From 4ab19f5c8f868b0ece6826679a478e3b326ec39b Mon Sep 17 00:00:00 2001 From: Johannes Mey <johannes.mey@tu-dresden.de> Date: Fri, 13 Jul 2018 18:20:02 +0200 Subject: [PATCH] removed unused modules --- .gitmodules | 9 - pracr-python | 1 - pracr-scheme | 1 - racr-cpp | 1 - .../build.gradle | 12 - .../trainbenchmark/neo4j/Neo4jConstants.java | 49 -- .../mit/trainbenchmark/neo4j/Neo4jHelper.java | 19 - .../trainbenchmark/neo4j/apoc/ApocHelper.java | 19 - .../neo4j/config/Neo4jGraphFormat.java | 20 - trainbenchmark-format-rdf/README.md | 16 - trainbenchmark-format-rdf/build.gradle | 3 - .../mit/trainbenchmark/rdf/RdfConstants.java | 28 - .../bme/mit/trainbenchmark/rdf/RdfFormat.java | 16 - .../bme/mit/trainbenchmark/rdf/RdfHelper.java | 47 -- .../resources/metamodel/railway-inferred.nt | 0 .../resources/metamodel/railway-inferred.ttl | 3 - .../resources/metamodel/railway-metamodel.ttl | 353 ---------- trainbenchmark-format-sql/build.gradle | 3 - trainbenchmark-format-sql/scripts/README.md | 1 - .../scripts/clean-mysql.sh | 4 - .../scripts/mysql2sqlite.sh | 185 ----- .../scripts/start-mysql.sh | 5 - .../scripts/stop-mysql.sh | 4 - .../sql/constants/SqlConstants.java | 26 - .../sql/process/MySqlProcess.java | 75 -- .../resources/metamodel/railway-footer.sql | 8 - .../resources/metamodel/railway-header.sql | 92 --- .../build.gradle | 15 - .../generator/cypher/CypherGeneratorMain.java | 29 - .../generator/cypher/CypherSerializer.java | 124 ---- .../generator/cypher/config/CypherFormat.java | 19 - .../cypher/config/CypherGeneratorConfig.java | 36 - .../config/CypherGeneratorConfigBuilder.java | 38 -- .../src/main/resources/.gitignore | 0 .../generator/cypher/CypherGeneratorTest.java | 31 - .../.gitignore | 1 - .../build.gradle | 13 - .../graph/neo4j/Neo4jGraphGeneratorMain.java | 29 - .../graph/neo4j/Neo4jGraphSerializer.java | 226 ------- .../config/Neo4jGraphGeneratorConfig.java | 37 - .../Neo4jGraphGeneratorConfigBuilder.java | 40 -- .../neo4j/test/Neo4jGraphGeneratorTest.java | 45 -- trainbenchmark-generator-rdf/.gitignore | 1 - trainbenchmark-generator-rdf/build.gradle | 19 - .../generator/rdf/RdfGeneratorMain.java | 28 - .../generator/rdf/RdfSerializer.java | 181 ----- .../rdf/config/RdfGeneratorConfig.java | 52 -- .../rdf/config/RdfGeneratorConfigBuilder.java | 36 - .../src/main/resources/.gitignore | 0 .../generator/rdf/test/RdfGeneratorTest.java | 32 - trainbenchmark-generator-sql/build.gradle | 15 - .../generator/sql/SqlGeneratorMain.java | 29 - .../generator/sql/SqlSerializer.java | 218 ------ .../sql/config/SqlGeneratorConfig.java | 29 - .../sql/config/SqlGeneratorConfigBuilder.java | 25 - .../src/main/resources/.gitignore | 0 .../generator/sql/SqlGeneratorTest.java | 20 - trainbenchmark-tool-blazegraph/.gitignore | 1 - trainbenchmark-tool-blazegraph/build.gradle | 12 - .../blazegraph/BlazegraphBenchmarkMain.java | 26 - .../BlazegraphBenchmarkScenario.java | 17 - .../config/BlazegraphBenchmarkConfig.java | 34 - .../BlazegraphBenchmarkConfigBuilder.java | 14 - .../blazegraph/driver/BlazegraphDriver.java | 70 -- .../driver/BlazegraphDriverFactory.java | 32 - .../src/main/resources/blazegraph.properties | 4 - .../src/main/resources/log4j.properties | 5 - .../blazegraph/test/BlazegraphTest.java | 36 - trainbenchmark-tool-drools/build.gradle | 15 - .../benchmark/drools/DroolsBenchmarkMain.java | 26 - .../drools/DroolsBenchmarkScenario.java | 18 - .../drools/config/DroolsBenchmarkConfig.java | 34 - .../config/DroolsBenchmarkConfigBuilder.java | 14 - .../benchmark/drools/driver/DroolsDriver.java | 104 --- .../drools/driver/DroolsDriverFactory.java | 12 - .../matches/DroolsConnectedSegmentsMatch.java | 30 - .../drools/matches/DroolsPosLengthMatch.java | 27 - .../matches/DroolsRouteSensorMatch.java | 33 - .../matches/DroolsSemaphoreNeighborMatch.java | 37 - .../matches/DroolsSwitchMonitoredMatch.java | 27 - .../drools/matches/DroolsSwitchSetMatch.java | 34 - .../DroolsModelOperationFactory.java | 172 ----- .../benchmark/drools/queries/DroolsQuery.java | 68 -- .../drools/queries/DroolsResultListener.java | 77 --- .../src/main/resources/META-INF/kmodule.xml | 9 - .../drools/queries/ConnectedSegments.drl | 18 - .../benchmark/drools/queries/PosLength.drl | 5 - .../benchmark/drools/queries/RouteSensor.drl | 9 - .../drools/queries/SemaphoreNeighbor.drl | 12 - .../drools/queries/SwitchMonitored.drl | 5 - .../benchmark/drools/queries/SwitchSet.drl | 8 - .../benchmark/drools/test/DroolsTest.java | 32 - trainbenchmark-tool-eclipseocl/.gitignore | 2 - trainbenchmark-tool-eclipseocl/build.gradle | 14 - .../eclipseocl/EclipseOclBenchmarkMain.java | 24 - .../EclipseOclBenchmarkScenario.java | 17 - .../config/EclipseOclBenchmarkConfig.java | 34 - .../EclipseOclBenchmarkConfigBuilder.java | 14 - .../EclipseOclModelOperationFactory.java | 175 ----- .../eclipseocl/queries/EclipseOclQuery.java | 52 -- .../EclipseOclQueryConnectedSegments.java | 54 -- .../queries/EclipseOclQueryPosLength.java | 45 -- .../queries/EclipseOclQueryRouteSensor.java | 51 -- .../EclipseOclQuerySemaphoreNeighbor.java | 54 -- .../EclipseOclQuerySwitchMonitored.java | 45 -- .../queries/EclipseOclQuerySwitchSet.java | 51 -- .../resources/queries/ConnectedSegments.ocl | 20 - .../src/main/resources/queries/PosLength.ocl | 5 - .../main/resources/queries/RouteSensor.ocl | 11 - .../resources/queries/SemaphoreNeighbor.ocl | 16 - .../resources/queries/SwitchMonitored.ocl | 5 - .../src/main/resources/queries/SwitchSet.ocl | 9 - .../eclipseocl/test/EclipseOclTest.java | 32 - .../src/test/resources/.gitignore | 0 trainbenchmark-tool-emfapi/build.gradle | 8 - .../benchmark/emfapi/EmfApiBenchmarkMain.java | 24 - .../emfapi/EmfApiBenchmarkScenario.java | 18 - .../emfapi/config/EmfApiBenchmarkConfig.java | 34 - .../config/EmfApiBenchmarkConfigBuilder.java | 14 - .../EmfApiModelOperationFactory.java | 174 ----- .../queries/EmfApiQueryConnectedSegments.java | 124 ---- .../emfapi/queries/EmfApiQueryPosLength.java | 59 -- .../queries/EmfApiQueryRouteSensor.java | 68 -- .../queries/EmfApiQuerySemaphoreNeighbor.java | 81 --- .../queries/EmfApiQuerySwitchMonitored.java | 59 -- .../emfapi/queries/EmfApiQuerySwitchSet.java | 68 -- .../src/main/resources/.gitignore | 0 .../benchmark/emfapi/test/EmfApiTest.java | 32 - trainbenchmark-tool-epsilon/build.gradle | 11 - .../epsilon/EpsilonBenchmarkMain.java | 24 - .../epsilon/EpsilonBenchmarkScenario.java | 18 - .../config/EpsilonBenchmarkConfig.java | 37 - .../EpsilonModelOperationFactory.java | 160 ----- .../epsilon/queries/EpsilonQuery.java | 21 - .../queries/EpsilonQueryPosLength.java | 59 -- .../src/main/resources/.gitignore | 0 .../benchmark/epsilon/test/EpsilonTest.java | 31 - .../build.gradle | 25 - .../trainbenchmark/QueryPlanFactory.xtend | 14 - .../RouteSensorQueryPlanFactory.xtend | 178 ----- .../SemaphoreNeighborQueryPlanFactory.xtend | 638 ------------------ .../trainbenchmark/TrainBenchmarkUtil.xtend | 466 ------------- .../QueryPlanVisualizationTest.xtend | 56 -- .../trainbenchmark/RelalgBuilderTest.xtend | 51 -- .../trainbenchmark/cost/CostTest.xtend | 28 - trainbenchmark-tool-ingraph/.gitignore | 3 - trainbenchmark-tool-ingraph/build.gradle | 18 - .../ingraph/IngraphBenchmarkMain.java | 27 - .../ingraph/IngraphBenchmarkScenario.java | 30 - .../benchmark/ingraph/IngraphUtils.java | 25 - .../config/IngraphBenchmarkConfig.java | 51 -- .../config/IngraphBenchmarkConfigBuilder.java | 35 - .../ingraph/driver/IngraphDriver.java | 93 --- .../ingraph/driver/IngraphDriverFactory.java | 22 - .../IngraphConnectedSegmentsInjectMatch.java | 40 -- .../match/IngraphConnectedSegmentsMatch.java | 58 -- .../benchmark/ingraph/match/IngraphMatch.java | 65 -- .../ingraph/match/IngraphMatchComparator.java | 23 - .../match/IngraphPosLengthInjectMatch.java | 32 - .../ingraph/match/IngraphPosLengthMatch.java | 32 - .../match/IngraphRouteSensorInjectMatch.java | 33 - .../match/IngraphRouteSensorMatch.java | 43 -- .../IngraphSemaphoreNeighborInjectMatch.java | 33 - .../match/IngraphSemaphoreNeighborMatch.java | 58 -- .../IngraphSwitchMonitoredInjectMatch.java | 28 - .../match/IngraphSwitchMonitoredMatch.java | 28 - .../match/IngraphSwitchSetInjectMatch.java | 28 - .../ingraph/match/IngraphSwitchSetMatch.java | 51 -- .../IngraphModelOperationFactory.java | 167 ----- .../queries/IngraphChangeListener.java | 39 -- .../ingraph/queries/IngraphQuery.java | 48 -- .../IngraphTransformation.java | 25 - ...TransformationInjectConnectedSegments.java | 35 - .../IngraphTransformationInjectPosLength.java | 39 -- ...ngraphTransformationInjectRouteSensor.java | 38 -- ...TransformationInjectSemaphoreNeighbor.java | 38 -- ...phTransformationInjectSwitchMonitored.java | 35 - .../IngraphTransformationInjectSwitchSet.java | 37 - ...TransformationRepairConnectedSegments.java | 39 -- .../IngraphTransformationRepairPosLength.java | 40 -- ...ngraphTransformationRepairRouteSensor.java | 40 -- ...TransformationRepairSemaphoreNeighbor.java | 41 -- ...phTransformationRepairSwitchMonitored.java | 37 - .../IngraphTransformationRepairSwitchSet.java | 39 -- .../src/main/resources/log4j.properties | 1 - .../benchmark/ingraph/test/IngraphTest.java | 37 - .../queryspecific/IngraphRouteSensorTest.java | 50 -- .../IngraphSemaphoreNeighborTest.java | 50 -- trainbenchmark-tool-jena/.gitignore | 2 - trainbenchmark-tool-jena/build.gradle | 12 - .../benchmark/jena/JenaBenchmarkMain.java | 26 - .../benchmark/jena/JenaBenchmarkScenario.java | 17 - .../jena/comparators/JenaMatchComparator.java | 25 - .../jena/comparators/ResourceComparator.java | 30 - .../jena/config/JenaBenchmarkConfig.java | 34 - .../config/JenaBenchmarkConfigBuilder.java | 14 - .../benchmark/jena/driver/JenaDriver.java | 121 ---- .../jena/driver/JenaDriverFactory.java | 16 - .../jena/driver/StatementComparator.java | 32 - .../JenaConnectedSegmentsInjectMatch.java | 44 -- .../matches/JenaConnectedSegmentsMatch.java | 68 -- .../benchmark/jena/matches/JenaMatch.java | 65 -- .../matches/JenaPosLengthInjectMatch.java | 32 - .../jena/matches/JenaPosLengthMatch.java | 38 -- .../matches/JenaRouteSensorInjectMatch.java | 38 -- .../jena/matches/JenaRouteSensorMatch.java | 50 -- .../JenaSemaphoreNeighborInjectMatch.java | 38 -- .../matches/JenaSemaphoreNeighborMatch.java | 68 -- .../JenaSwitchMonitoredInjectMatch.java | 32 - .../matches/JenaSwitchMonitoredMatch.java | 32 - .../matches/JenaSwitchSetInjectMatch.java | 42 -- .../jena/matches/JenaSwitchSetMatch.java | 60 -- .../operations/JenaModelOperationFactory.java | 164 ----- .../benchmark/jena/queries/JenaQuery.java | 64 -- .../transformations/JenaTransformation.java | 23 - ...TransformationInjectConnectedSegments.java | 64 -- .../JenaTransformationInjectPosLength.java | 59 -- .../JenaTransformationInjectRouteSensor.java | 44 -- ...TransformationInjectSemaphoreNeighbor.java | 41 -- ...naTransformationInjectSwitchMonitored.java | 39 -- .../JenaTransformationInjectSwitchSet.java | 75 -- ...TransformationRepairConnectedSegments.java | 70 -- .../JenaTransformationRepairPosLength.java | 61 -- .../JenaTransformationRepairRouteSensor.java | 47 -- ...TransformationRepairSemaphoreNeighbor.java | 47 -- ...naTransformationRepairSwitchMonitored.java | 52 -- .../JenaTransformationRepairSwitchSet.java | 47 -- .../src/main/resources/log4j.properties | 13 - .../benchmark/jena/test/JenaTest.java | 36 - trainbenchmark-tool-kiama/build.gradle | 32 - .../kiamatrain-src/build.sbt | 30 - .../kiamatrain-src/project/build.properties | 1 - .../inf/st/train/kiama/enums/Position.java | 5 - .../inf/st/train/kiama/enums/Signal.java | 5 - ...aInternalConnectedSegmentsInjectMatch.java | 31 - .../KiamaInternalConnectedSegmentsMatch.java | 56 -- .../KiamaInternalPosLengthInjectMatch.java | 17 - .../matches/KiamaInternalPosLengthMatch.java | 24 - .../KiamaInternalRouteSensorInjectMatch.java | 25 - .../KiamaInternalRouteSensorMatch.java | 39 -- ...aInternalSemaphoreNeighborInjectMatch.java | 25 - .../KiamaInternalSemaphoreNeighborMatch.java | 58 -- .../KiamaInternalSwitchSetInjectMatch.java | 18 - .../matches/KiamaInternalSwitchSetMatch.java | 53 -- .../tudresden/inf/st/train/kiama/ast/Id.scala | 12 - .../train/kiama/ast/KiamaTrainTreeNode.scala | 3 - .../st/train/kiama/ast/RailwayContainer.scala | 6 - .../st/train/kiama/ast/RailwayElement.scala | 12 - .../inf/st/train/kiama/ast/Ref.scala | 12 - .../inf/st/train/kiama/ast/Region.scala | 6 - .../inf/st/train/kiama/ast/Route.scala | 9 - .../inf/st/train/kiama/ast/Segment.scala | 6 - .../inf/st/train/kiama/ast/Semaphore.scala | 7 - .../inf/st/train/kiama/ast/Sensor.scala | 5 - .../inf/st/train/kiama/ast/Switch.scala | 7 - .../st/train/kiama/ast/SwitchPosition.scala | 8 - .../inf/st/train/kiama/ast/TrackElement.scala | 7 - .../kiama/queries/KiamaTrainQueries.scala | 602 ----------------- trainbenchmark-tool-kiama/libs/kiamatrain.jar | Bin 73227 -> 0 bytes .../kiama/KiamaAbstractBenchmarkScenario.java | 29 - .../st/train/kiama/KiamaBenchmarkMain.java | 12 - .../train/kiama/KiamaBenchmarkScenario.java | 12 - .../comparators/KiamaMatchComparator.java | 13 - .../comparators/RailwayElementComparator.java | 13 - .../config/KiamaAbstractBenchmarkConfig.java | 12 - .../kiama/config/KiamaBenchmarkConfig.java | 21 - .../config/KiamaBenchmarkConfigBuilder.java | 13 - .../st/train/kiama/driver/KiamaDriver.java | 56 -- .../kiama/driver/KiamaDriverFactory.java | 19 - .../deserializer/ASTNodeDeserializer.java | 216 ------ .../DeserializationException.java | 22 - .../driver/deserializer/JsonDeserializer.java | 37 - .../KiamaConnectedSegmentsInjectMatch.java | 36 - .../matches/KiamaConnectedSegmentsMatch.java | 64 -- .../st/train/kiama/matches/KiamaMatch.java | 14 - .../matches/KiamaPosLengthInjectMatch.java | 20 - .../kiama/matches/KiamaPosLengthMatch.java | 26 - .../matches/KiamaRouteSensorInjectMatch.java | 28 - .../kiama/matches/KiamaRouteSensorMatch.java | 50 -- .../KiamaSemaphoreNeighborInjectMatch.java | 28 - .../matches/KiamaSemaphoreNeighborMatch.java | 66 -- .../KiamaSwitchMonitoredInjectMatch.java | 20 - .../matches/KiamaSwitchMonitoredMatch.java | 20 - .../matches/KiamaSwitchSetInjectMatch.java | 20 - .../kiama/matches/KiamaSwitchSetMatch.java | 55 -- .../KiamaModelOperationFactory.java | 150 ---- .../st/train/kiama/queries/KiamaQuery.java | 24 - .../queries/KiamaQueryConnectedSegments.java | 30 - .../KiamaQueryConnectedSegmentsInject.java | 30 - .../kiama/queries/KiamaQueryPosLength.java | 27 - .../queries/KiamaQueryPosLengthInject.java | 27 - .../kiama/queries/KiamaQueryRouteSensor.java | 28 - .../queries/KiamaQueryRouteSensorInject.java | 28 - .../queries/KiamaQuerySemaphoreNeighbor.java | 27 - .../KiamaQuerySemaphoreNeighborInject.java | 28 - .../queries/KiamaQuerySwitchMonitored.java | 28 - .../KiamaQuerySwitchMonitoredInject.java | 28 - .../kiama/queries/KiamaQuerySwitchSet.java | 29 - .../queries/KiamaQuerySwitchSetInject.java | 29 - .../transformations/KiamaTransformation.java | 14 - ...TransformationInjectConnectedSegments.java | 52 -- .../KiamaTransformationInjectPosLength.java | 24 - .../KiamaTransformationInjectRouteSensor.java | 28 - ...TransformationInjectSemaphoreNeighbor.java | 24 - ...maTransformationInjectSwitchMonitored.java | 43 -- .../KiamaTransformationInjectSwitchSet.java | 28 - ...TransformationRepairConnectedSegments.java | 45 -- .../KiamaTransformationRepairPosLength.java | 26 - .../KiamaTransformationRepairRouteSensor.java | 31 - ...TransformationRepairSemaphoreNeighbor.java | 27 - ...maTransformationRepairSwitchMonitored.java | 52 -- .../KiamaTransformationRepairSwitchSet.java | 25 - .../inf/st/train/kiama/test/KiamaTest.java | 24 - trainbenchmark-tool-mysql/.gitignore | 1 - trainbenchmark-tool-mysql/README.md | 28 - trainbenchmark-tool-mysql/build.gradle | 12 - .../benchmark/mysql/MySqlBenchmarkMain.java | 26 - .../mysql/MySqlBenchmarkScenario.java | 17 - .../mysql/config/MySqlBenchmarkConfig.java | 34 - .../config/MySqlBenchmarkConfigBuilder.java | 13 - .../benchmark/mysql/driver/MySqlDriver.java | 79 --- .../mysql/driver/MySqlDriverFactory.java | 12 - .../MySqlModelOperationFactory.java | 167 ----- .../src/main/resources/.gitignore | 0 .../benchmark/mysql/test/MySqlTest.java | 32 - trainbenchmark-tool-neo4j/README.md | 5 - trainbenchmark-tool-neo4j/build.gradle | 12 - .../benchmark/neo4j/Neo4jBenchmarkMain.java | 26 - .../neo4j/Neo4jBenchmarkScenario.java | 17 - .../comparators/Neo4jMatchComparator.java | 25 - .../neo4j/comparators/NodeComparator.java | 29 - .../neo4j/config/Neo4jBenchmarkConfig.java | 48 -- .../config/Neo4jBenchmarkConfigBuilder.java | 36 - .../benchmark/neo4j/config/Neo4jEngine.java | 17 - .../benchmark/neo4j/driver/Neo4jDriver.java | 228 ------- .../neo4j/driver/Neo4jDriverFactory.java | 22 - .../Neo4jConnectedSegmentsInjectMatch.java | 45 -- .../matches/Neo4jConnectedSegmentsMatch.java | 69 -- .../benchmark/neo4j/matches/Neo4jMatch.java | 64 -- .../matches/Neo4jPosLengthInjectMatch.java | 33 - .../neo4j/matches/Neo4jPosLengthMatch.java | 33 - .../matches/Neo4jRouteSensorInjectMatch.java | 37 - .../neo4j/matches/Neo4jRouteSensorMatch.java | 47 -- .../Neo4jSemaphoreNeighborInjectMatch.java | 39 -- .../matches/Neo4jSemaphoreNeighborMatch.java | 69 -- .../Neo4jSwitchMonitoredInjectMatch.java | 33 - .../matches/Neo4jSwitchMonitoredMatch.java | 33 - .../matches/Neo4jSwitchSetInjectMatch.java | 33 - .../neo4j/matches/Neo4jSwitchSetMatch.java | 60 -- .../Neo4jModelOperationFactory.java | 331 --------- .../benchmark/neo4j/queries/Neo4jQuery.java | 14 - .../neo4j/queries/core/Neo4jCoreQuery.java | 25 - .../core/Neo4jCoreQueryConnectedSegments.java | 123 ---- ...Neo4jCoreQueryConnectedSegmentsInject.java | 77 --- .../queries/core/Neo4jCoreQueryPosLength.java | 62 -- .../core/Neo4jCoreQueryPosLengthInject.java | 54 -- .../core/Neo4jCoreQueryRouteSensor.java | 76 --- .../core/Neo4jCoreQueryRouteSensorInject.java | 62 -- .../core/Neo4jCoreQuerySemaphoreNeighbor.java | 102 --- ...Neo4jCoreQuerySemaphoreNeighborInject.java | 61 -- .../core/Neo4jCoreQuerySwitchMonitored.java | 70 -- .../Neo4jCoreQuerySwitchMonitoredInject.java | 53 -- .../queries/core/Neo4jCoreQuerySwitchSet.java | 97 --- .../core/Neo4jCoreQuerySwitchSetInject.java | 53 -- .../queries/cypher/Neo4jCypherQuery.java | 46 -- .../Neo4jCoreTransformation.java | 23 - .../Neo4jCypherTransformation.java | 25 - .../transformations/Neo4jTransformation.java | 13 - ...TransformationInjectConnectedSegments.java | 60 -- ...eo4jCoreTransformationInjectPosLength.java | 34 - ...4jCoreTransformationInjectRouteSensor.java | 41 -- ...TransformationInjectSemaphoreNeighbor.java | 41 -- ...reTransformationInjectSwitchMonitored.java | 41 -- ...eo4jCoreTransformationInjectSwitchSet.java | 41 -- ...TransformationRepairConnectedSegments.java | 44 -- ...eo4jCoreTransformationRepairPosLength.java | 43 -- ...4jCoreTransformationRepairRouteSensor.java | 38 -- ...TransformationRepairSemaphoreNeighbor.java | 38 -- ...reTransformationRepairSwitchMonitored.java | 38 -- ...eo4jCoreTransformationRepairSwitchSet.java | 39 -- ...TransformationInjectConnectedSegments.java | 46 -- ...4jCypherTransformationInjectPosLength.java | 42 -- ...CypherTransformationInjectRouteSensor.java | 43 -- ...TransformationInjectSemaphoreNeighbor.java | 46 -- ...erTransformationInjectSwitchMonitored.java | 44 -- ...4jCypherTransformationInjectSwitchSet.java | 49 -- ...TransformationRepairConnectedSegments.java | 42 -- ...4jCypherTransformationRepairPosLength.java | 47 -- ...CypherTransformationRepairRouteSensor.java | 43 -- ...TransformationRepairSemaphoreNeighbor.java | 43 -- ...erTransformationRepairSwitchMonitored.java | 42 -- ...4jCypherTransformationRepairSwitchSet.java | 43 -- .../benchmark/neo4j/util/Neo4jUtil.java | 68 -- .../queries/ConnectedSegments.cypher | 13 - .../queries/ConnectedSegmentsInject.cypher | 5 - .../main/resources/queries/PosLength.cypher | 3 - .../resources/queries/PosLengthInject.cypher | 2 - .../main/resources/queries/RouteSensor.cypher | 3 - .../queries/RouteSensorInject.cypher | 2 - .../queries/SemaphoreNeighbor.cypher | 6 - .../queries/SemaphoreNeighborInject.cypher | 2 - .../resources/queries/SwitchMonitored.cypher | 3 - .../queries/SwitchMonitoredInject.cypher | 2 - .../main/resources/queries/SwitchSet.cypher | 5 - .../resources/queries/SwitchSetInject.cypher | 2 - .../ConnectedSegmentsInjectRhs.cypher | 8 - .../ConnectedSegmentsRepairRhs.cypher | 2 - .../transformations/PosLengthInjectRhs.cypher | 2 - .../transformations/PosLengthRepairRhs.cypher | 2 - .../RouteSensorInjectRhs.cypher | 2 - .../RouteSensorRepairRhs.cypher | 2 - .../SemaphoreNeighborInjectRhs.cypher | 2 - .../SemaphoreNeighborRepairRhs.cypher | 2 - .../SwitchMonitoredInjectRhs.cypher | 2 - .../SwitchMonitoredRepairRhs.cypher | 2 - .../transformations/SwitchSetInjectRhs.cypher | 2 - .../transformations/SwitchSetRepairRhs.cypher | 2 - .../benchmark/neo4j/test/Neo4jTest.java | 60 -- .../src/test/resources/.gitignore | 0 trainbenchmark-tool-racr-cpp/build.gradle | 31 - .../train/racr/cpp/RacrCppBenchmarkMain.java | 13 - .../racr/cpp/RacrCppBenchmarkScenario.java | 18 - .../train/racr/cpp/driver/RacrCppDriver.java | 80 --- .../racr/cpp/driver/RacrCppDriverFactory.java | 20 - .../RacrCppModelOperationFactory.java | 63 -- .../inf/st/train/racr/test/RacrCppTest.java | 87 --- trainbenchmark-tool-racr-python/build.gradle | 19 - .../racr/python/RacrPythonBenchmarkMain.java | 15 - .../racr/python/test/RacrPythonTest.java | 42 -- trainbenchmark-tool-racr-scheme/build.gradle | 19 - .../racr/scheme/RacrSchemeBenchmarkMain.java | 15 - .../st/train/racr/test/RacrSchemeTest.java | 43 -- trainbenchmark-tool-racr/build.gradle | 17 - .../inf/st/train/racr/RacrBenchmarkMain.java | 119 ---- .../st/train/racr/RacrBenchmarkScenario.java | 18 - .../inf/st/train/racr/SocketTestMain.java | 53 -- .../racr/comparators/RacrMatchComparator.java | 12 - .../racr/config/RacrBenchmarkConfig.java | 26 - .../config/RacrBenchmarkConfigBuilder.java | 71 -- .../inf/st/train/racr/driver/RacrDriver.java | 35 - .../train/racr/driver/RacrDriverFactory.java | 20 - .../RacrConnectedSegmentsInjectMatch.java | 48 -- .../matches/RacrConnectedSegmentsMatch.java | 77 --- .../inf/st/train/racr/matches/RacrMatch.java | 12 - .../matches/RacrPosLengthInjectMatch.java | 19 - .../racr/matches/RacrPosLengthMatch.java | 19 - .../matches/RacrRouteSensorInjectMatch.java | 41 -- .../racr/matches/RacrRouteSensorMatch.java | 55 -- .../RacrSemaphoreNeighborInjectMatch.java | 41 -- .../matches/RacrSemaphoreNeighborMatch.java | 77 --- .../RacrSwitchMonitoredInjectMatch.java | 34 - .../matches/RacrSwitchMonitoredMatch.java | 34 - .../matches/RacrSwitchSetInjectMatch.java | 34 - .../racr/matches/RacrSwitchSetMatch.java | 55 -- .../operations/RacrModelOperationFactory.java | 127 ---- .../train/racr/queries/ConstructMatches.java | 10 - .../train/racr/queries/GetResponseQuery.java | 12 - .../inf/st/train/racr/queries/RacrQuery.java | 67 -- .../queries/RacrQueryConnectedSegments.java | 32 - .../RacrQueryConnectedSegmentsInject.java | 32 - .../racr/queries/RacrQueryPosLength.java | 32 - .../queries/RacrQueryPosLengthInject.java | 32 - .../racr/queries/RacrQueryRouteSensor.java | 32 - .../queries/RacrQueryRouteSensorInject.java | 32 - .../queries/RacrQuerySemaphoreNeighbor.java | 35 - .../RacrQuerySemaphoreNeighborInject.java | 35 - .../queries/RacrQuerySwitchMonitored.java | 32 - .../RacrQuerySwitchMonitoredInject.java | 32 - .../racr/queries/RacrQuerySwitchSet.java | 32 - .../queries/RacrQuerySwitchSetInject.java | 32 - .../GetResponseTransformation.java | 13 - .../transformations/HandleEmptyResponse.java | 8 - .../racr/transformations/HandleResponse.java | 8 - .../transformations/RacrTransformation.java | 60 -- ...TransformationInjectConnectedSegments.java | 23 - .../RacrTransformationInjectPosLength.java | 23 - .../RacrTransformationInjectRouteSensor.java | 23 - ...TransformationInjectSemaphoreNeighbor.java | 23 - ...crTransformationInjectSwitchMonitored.java | 23 - .../RacrTransformationInjectSwitchSet.java | 23 - ...TransformationRepairConnectedSegments.java | 23 - .../RacrTransformationRepairPosLength.java | 23 - .../RacrTransformationRepairRouteSensor.java | 23 - ...TransformationRepairSemaphoreNeighbor.java | 23 - ...crTransformationRepairSwitchMonitored.java | 23 - .../RacrTransformationRepairSwitchSet.java | 23 - .../st/train/racr/util/AbstractClient.java | 238 ------- .../st/train/racr/util/AsyncSocketClient.java | 25 - .../inf/st/train/racr/util/Event.java | 71 -- .../inf/st/train/racr/util/RacrConfig.java | 52 -- .../st/train/racr/util/RacrHttpClient.java | 74 -- .../inf/st/train/racr/util/RacrUtils.java | 119 ---- .../inf/st/train/racr/util/SocketClient.java | 118 ---- .../inf/st/train/racr/util/TestUtils.java | 44 -- trainbenchmark-tool-rdf/build.gradle | 4 - .../rdf/config/RdfBenchmarkConfig.java | 35 - .../rdf/config/RdfBenchmarkConfigBuilder.java | 24 - .../benchmark/rdf/driver/RdfDriver.java | 68 -- .../rdf/driver/RdfDriverFactory.java | 13 - .../benchmark/rdf/queries/RdfModelQuery.java | 27 - .../benchmark/rdf/tests/RdfTest.java | 23 - .../queries/ConnectedSegments.sparql | 30 - .../queries/ConnectedSegmentsInject.sparql | 13 - .../main/resources/queries/PosLength.sparql | 11 - .../resources/queries/PosLengthInject.sparql | 7 - .../main/resources/queries/RouteSensor.sparql | 20 - .../queries/RouteSensorInject.sparql | 9 - .../queries/SemaphoreNeighbor.sparql | 30 - .../queries/SemaphoreNeighborInject.sparql | 9 - .../resources/queries/SwitchMonitored.sparql | 13 - .../queries/SwitchMonitoredInject.sparql | 7 - .../main/resources/queries/SwitchSet.sparql | 25 - .../resources/queries/SwitchSetInject.sparql | 7 - trainbenchmark-tool-rdf4j/.gitignore | 1 - trainbenchmark-tool-rdf4j/build.gradle | 22 - .../benchmark/rdf4j/Rdf4jBenchmarkMain.java | 26 - .../rdf4j/Rdf4jBenchmarkScenario.java | 17 - .../rdf4j/comparators/IriComparator.java | 27 - .../comparators/Rdf4jMatchComparator.java | 25 - .../rdf4j/config/Rdf4jBenchmarkConfig.java | 34 - .../config/Rdf4jBenchmarkConfigBuilder.java | 14 - .../benchmark/rdf4j/driver/Rdf4jDriver.java | 173 ----- .../rdf4j/driver/Rdf4jDriverFactory.java | 16 - .../Rdf4jConnectedSegmentsInjectMatch.java | 44 -- .../matches/Rdf4jConnectedSegmentsMatch.java | 68 -- .../benchmark/rdf4j/matches/Rdf4jMatch.java | 58 -- .../matches/Rdf4jPosLengthInjectMatch.java | 38 -- .../rdf4j/matches/Rdf4jPosLengthMatch.java | 38 -- .../matches/Rdf4jRouteSensorInjectMatch.java | 38 -- .../rdf4j/matches/Rdf4jRouteSensorMatch.java | 50 -- .../Rdf4jSemaphoreNeighborInjectMatch.java | 38 -- .../matches/Rdf4jSemaphoreNeighborMatch.java | 68 -- .../Rdf4jSwitchMonitoredInjectMatch.java | 32 - .../matches/Rdf4jSwitchMonitoredMatch.java | 32 - .../matches/Rdf4jSwitchSetInjectMatch.java | 43 -- .../rdf4j/matches/Rdf4jSwitchSetMatch.java | 61 -- .../Rdf4jModelOperationFactory.java | 206 ------ .../benchmark/rdf4j/queries/Rdf4jQuery.java | 45 -- .../transformations/Rdf4jTransformation.java | 24 - ...TransformationInjectConnectedSegments.java | 70 -- .../Rdf4jTransformationInjectPosLength.java | 54 -- .../Rdf4jTransformationInjectRouteSensor.java | 50 -- ...TransformationInjectSemaphoreNeighbor.java | 40 -- ...4jTransformationInjectSwitchMonitored.java | 37 - .../Rdf4jTransformationInjectSwitchSet.java | 70 -- ...TransformationRepairConnectedSegments.java | 56 -- .../Rdf4jTransformationRepairPosLength.java | 62 -- .../Rdf4jTransformationRepairRouteSensor.java | 49 -- ...TransformationRepairSemaphoreNeighbor.java | 48 -- ...4jTransformationRepairSwitchMonitored.java | 65 -- .../Rdf4jTransformationRepairSwitchSet.java | 58 -- .../src/main/resources/.gitignore | 0 .../benchmark/rdf4j/test/Rdf4jTest.java | 25 - trainbenchmark-tool-sesame/.gitignore | 1 - trainbenchmark-tool-sesame/build.gradle | 19 - .../benchmark/sesame/SesameBenchmarkMain.java | 26 - .../sesame/SesameBenchmarkScenario.java | 18 - .../comparators/SesameMatchComparator.java | 25 - .../sesame/comparators/UriComparator.java | 27 - .../sesame/config/SesameBenchmarkConfig.java | 34 - .../config/SesameBenchmarkConfigBuilder.java | 14 - .../benchmark/sesame/driver/SesameDriver.java | 179 ----- .../sesame/driver/SesameDriverFactory.java | 16 - .../SesameConnectedSegmentsInjectMatch.java | 44 -- .../matches/SesameConnectedSegmentsMatch.java | 68 -- .../benchmark/sesame/matches/SesameMatch.java | 58 -- .../matches/SesamePosLengthInjectMatch.java | 38 -- .../sesame/matches/SesamePosLengthMatch.java | 38 -- .../matches/SesameRouteSensorInjectMatch.java | 38 -- .../matches/SesameRouteSensorMatch.java | 50 -- .../SesameSemaphoreNeighborInjectMatch.java | 38 -- .../matches/SesameSemaphoreNeighborMatch.java | 68 -- .../SesameSwitchMonitoredInjectMatch.java | 32 - .../matches/SesameSwitchMonitoredMatch.java | 32 - .../matches/SesameSwitchSetInjectMatch.java | 43 -- .../sesame/matches/SesameSwitchSetMatch.java | 61 -- .../SesameModelOperationFactory.java | 205 ------ .../benchmark/sesame/queries/SesameQuery.java | 50 -- .../transformations/SesameTransformation.java | 25 - ...TransformationInjectConnectedSegments.java | 71 -- .../SesameTransformationInjectPosLength.java | 55 -- ...SesameTransformationInjectRouteSensor.java | 51 -- ...TransformationInjectSemaphoreNeighbor.java | 40 -- ...meTransformationInjectSwitchMonitored.java | 38 -- .../SesameTransformationInjectSwitchSet.java | 71 -- ...TransformationRepairConnectedSegments.java | 57 -- .../SesameTransformationRepairPosLength.java | 63 -- ...SesameTransformationRepairRouteSensor.java | 50 -- ...TransformationRepairSemaphoreNeighbor.java | 49 -- ...meTransformationRepairSwitchMonitored.java | 65 -- .../SesameTransformationRepairSwitchSet.java | 59 -- .../src/main/resources/.gitignore | 0 .../benchmark/sesame/test/SesameTest.java | 25 - .../src/test/resources/.gitignore | 0 trainbenchmark-tool-sql/build.gradle | 4 - .../benchmark/sql/driver/SqlDriver.java | 58 -- .../SqlConnectedSegmentsInjectMatch.java | 41 -- .../matches/SqlConnectedSegmentsMatch.java | 63 -- .../benchmark/sql/matches/SqlMatch.java | 60 -- .../sql/matches/SqlPosLengthInjectMatch.java | 32 - .../sql/matches/SqlPosLengthMatch.java | 37 - .../matches/SqlRouteSensorInjectMatch.java | 38 -- .../sql/matches/SqlRouteSensorMatch.java | 50 -- .../SqlSemaphoreNeighborInjectMatch.java | 38 -- .../matches/SqlSemaphoreNeighborMatch.java | 61 -- .../SqlSwitchMonitoredInjectMatch.java | 32 - .../sql/matches/SqlSwitchMonitoredMatch.java | 32 - .../sql/matches/SqlSwitchSetInjectMatch.java | 32 - .../sql/matches/SqlSwitchSetMatch.java | 61 -- .../benchmark/sql/queries/SqlQuery.java | 48 -- .../transformations/SqlTransformation.java | 37 - ...TransformationInjectConnectedSegments.java | 45 -- .../SqlTransformationInjectPosLength.java | 41 -- .../SqlTransformationInjectRouteSensor.java | 43 -- ...TransformationInjectSemaphoreNeighbor.java | 42 -- ...qlTransformationInjectSwitchMonitored.java | 41 -- .../SqlTransformationInjectSwitchSet.java | 41 -- ...TransformationRepairConnectedSegments.java | 44 -- .../SqlTransformationRepairPosLength.java | 41 -- .../SqlTransformationRepairRouteSensor.java | 43 -- ...TransformationRepairSemaphoreNeighbor.java | 43 -- ...qlTransformationRepairSwitchMonitored.java | 42 -- .../SqlTransformationRepairSwitchSet.java | 43 -- .../resources/queries/ConnectedSegments.sql | 25 - .../queries/ConnectedSegmentsInject.sql | 9 - .../src/main/resources/queries/PosLength.sql | 5 - .../resources/queries/PosLengthInject.sql | 2 - .../main/resources/queries/RouteSensor.sql | 13 - .../resources/queries/RouteSensorInject.sql | 4 - .../resources/queries/SemaphoreNeighbor.sql | 39 -- .../queries/SemaphoreNeighborInject.sql | 3 - .../resources/queries/SwitchMonitored.sql | 4 - .../queries/SwitchMonitoredInject.sql | 2 - .../src/main/resources/queries/SwitchSet.sql | 26 - .../resources/queries/SwitchSetInject.sql | 2 - .../ConnectedSegmentsInjectRhs.sql | 35 - .../ConnectedSegmentsRepairRhs.sql | 19 - .../transformations/PosLengthInjectRhs.sql | 3 - .../transformations/PosLengthRepairRhs.sql | 3 - .../transformations/RouteSensorInjectRhs.sql | 6 - .../transformations/RouteSensorRepairRhs.sql | 2 - .../SemaphoreNeighborInjectRhs.sql | 5 - .../SemaphoreNeighborRepairRhs.sql | 3 - .../SwitchMonitoredInjectRhs.sql | 2 - .../SwitchMonitoredRepairRhs.sql | 11 - .../transformations/SwitchSetInjectRhs.sql | 3 - .../transformations/SwitchSetRepairRhs.sql | 3 - trainbenchmark-tool-sqlite/.gitignore | 1 - trainbenchmark-tool-sqlite/README.md | 1 - trainbenchmark-tool-sqlite/build.gradle | 12 - .../benchmark/sqlite/SQLiteBenchmarkMain.java | 26 - .../sqlite/SQLiteBenchmarkScenario.java | 17 - .../sqlite/config/SQLiteBenchmarkConfig.java | 34 - .../config/SQLiteBenchmarkConfigBuilder.java | 14 - .../benchmark/sqlite/driver/SQLiteDriver.java | 56 -- .../sqlite/driver/SQLiteDriverFactory.java | 12 - .../SQLiteModelOperationFactory.java | 167 ----- .../transformation/SQLiteTransformation.java | 27 - ...TransformationInjectConnectedSegments.java | 50 -- ...SQLiteTransformationInjectRouteSensor.java | 47 -- ...TransformationRepairConnectedSegments.java | 46 -- ...teTransformationRepairSwitchMonitored.java | 45 -- .../ConnectedSegmentsInjectRhs.sql | 49 -- .../ConnectedSegmentsRepairRhs.sql | 24 - .../transformations/RouteSensorInjectRhs.sql | 3 - .../SwitchMonitoredRepairRhs.sql | 16 - .../benchmark/sqlite/test/SQLiteTest.java | 32 - 667 files changed, 26922 deletions(-) delete mode 160000 pracr-python delete mode 160000 pracr-scheme delete mode 160000 racr-cpp delete mode 100644 trainbenchmark-format-graph-neo4j/build.gradle delete mode 100644 trainbenchmark-format-graph-neo4j/src/main/java/hu/bme/mit/trainbenchmark/neo4j/Neo4jConstants.java delete mode 100644 trainbenchmark-format-graph-neo4j/src/main/java/hu/bme/mit/trainbenchmark/neo4j/Neo4jHelper.java delete mode 100644 trainbenchmark-format-graph-neo4j/src/main/java/hu/bme/mit/trainbenchmark/neo4j/apoc/ApocHelper.java delete mode 100644 trainbenchmark-format-graph-neo4j/src/main/java/hu/bme/mit/trainbenchmark/neo4j/config/Neo4jGraphFormat.java delete mode 100644 trainbenchmark-format-rdf/README.md delete mode 100644 trainbenchmark-format-rdf/build.gradle delete mode 100644 trainbenchmark-format-rdf/src/main/java/hu/bme/mit/trainbenchmark/rdf/RdfConstants.java delete mode 100644 trainbenchmark-format-rdf/src/main/java/hu/bme/mit/trainbenchmark/rdf/RdfFormat.java delete mode 100644 trainbenchmark-format-rdf/src/main/java/hu/bme/mit/trainbenchmark/rdf/RdfHelper.java delete mode 100644 trainbenchmark-format-rdf/src/main/resources/metamodel/railway-inferred.nt delete mode 100644 trainbenchmark-format-rdf/src/main/resources/metamodel/railway-inferred.ttl delete mode 100644 trainbenchmark-format-rdf/src/main/resources/metamodel/railway-metamodel.ttl delete mode 100644 trainbenchmark-format-sql/build.gradle delete mode 100644 trainbenchmark-format-sql/scripts/README.md delete mode 100755 trainbenchmark-format-sql/scripts/clean-mysql.sh delete mode 100755 trainbenchmark-format-sql/scripts/mysql2sqlite.sh delete mode 100755 trainbenchmark-format-sql/scripts/start-mysql.sh delete mode 100755 trainbenchmark-format-sql/scripts/stop-mysql.sh delete mode 100644 trainbenchmark-format-sql/src/main/java/hu/bme/mit/trainbenchmark/sql/constants/SqlConstants.java delete mode 100644 trainbenchmark-format-sql/src/main/java/hu/bme/mit/trainbenchmark/sql/process/MySqlProcess.java delete mode 100644 trainbenchmark-format-sql/src/main/resources/metamodel/railway-footer.sql delete mode 100644 trainbenchmark-format-sql/src/main/resources/metamodel/railway-header.sql delete mode 100644 trainbenchmark-generator-graph-cypher/build.gradle delete mode 100644 trainbenchmark-generator-graph-cypher/src/main/java/hu/bme/mit/trainbenchmark/generator/cypher/CypherGeneratorMain.java delete mode 100644 trainbenchmark-generator-graph-cypher/src/main/java/hu/bme/mit/trainbenchmark/generator/cypher/CypherSerializer.java delete mode 100644 trainbenchmark-generator-graph-cypher/src/main/java/hu/bme/mit/trainbenchmark/generator/cypher/config/CypherFormat.java delete mode 100644 trainbenchmark-generator-graph-cypher/src/main/java/hu/bme/mit/trainbenchmark/generator/cypher/config/CypherGeneratorConfig.java delete mode 100644 trainbenchmark-generator-graph-cypher/src/main/java/hu/bme/mit/trainbenchmark/generator/cypher/config/CypherGeneratorConfigBuilder.java delete mode 100644 trainbenchmark-generator-graph-cypher/src/main/resources/.gitignore delete mode 100644 trainbenchmark-generator-graph-cypher/src/test/java/hu/bme/mit/trainbenchmark/generator/cypher/CypherGeneratorTest.java delete mode 100644 trainbenchmark-generator-graph-neo4j/.gitignore delete mode 100644 trainbenchmark-generator-graph-neo4j/build.gradle delete mode 100644 trainbenchmark-generator-graph-neo4j/src/main/java/hu/bme/mit/trainbenchmark/generator/graph/neo4j/Neo4jGraphGeneratorMain.java delete mode 100644 trainbenchmark-generator-graph-neo4j/src/main/java/hu/bme/mit/trainbenchmark/generator/graph/neo4j/Neo4jGraphSerializer.java delete mode 100644 trainbenchmark-generator-graph-neo4j/src/main/java/hu/bme/mit/trainbenchmark/generator/graph/neo4j/config/Neo4jGraphGeneratorConfig.java delete mode 100644 trainbenchmark-generator-graph-neo4j/src/main/java/hu/bme/mit/trainbenchmark/generator/graph/neo4j/config/Neo4jGraphGeneratorConfigBuilder.java delete mode 100644 trainbenchmark-generator-graph-neo4j/src/test/java/hu/bme/mit/trainbenchmark/generator/graph/neo4j/test/Neo4jGraphGeneratorTest.java delete mode 100644 trainbenchmark-generator-rdf/.gitignore delete mode 100644 trainbenchmark-generator-rdf/build.gradle delete mode 100644 trainbenchmark-generator-rdf/src/main/java/hu/bme/mit/trainbenchmark/generator/rdf/RdfGeneratorMain.java delete mode 100644 trainbenchmark-generator-rdf/src/main/java/hu/bme/mit/trainbenchmark/generator/rdf/RdfSerializer.java delete mode 100644 trainbenchmark-generator-rdf/src/main/java/hu/bme/mit/trainbenchmark/generator/rdf/config/RdfGeneratorConfig.java delete mode 100644 trainbenchmark-generator-rdf/src/main/java/hu/bme/mit/trainbenchmark/generator/rdf/config/RdfGeneratorConfigBuilder.java delete mode 100644 trainbenchmark-generator-rdf/src/main/resources/.gitignore delete mode 100644 trainbenchmark-generator-rdf/src/test/java/hu/bme/mit/trainbenchmark/generator/rdf/test/RdfGeneratorTest.java delete mode 100644 trainbenchmark-generator-sql/build.gradle delete mode 100644 trainbenchmark-generator-sql/src/main/java/hu/bme/mit/trainbenchmark/generator/sql/SqlGeneratorMain.java delete mode 100644 trainbenchmark-generator-sql/src/main/java/hu/bme/mit/trainbenchmark/generator/sql/SqlSerializer.java delete mode 100644 trainbenchmark-generator-sql/src/main/java/hu/bme/mit/trainbenchmark/generator/sql/config/SqlGeneratorConfig.java delete mode 100644 trainbenchmark-generator-sql/src/main/java/hu/bme/mit/trainbenchmark/generator/sql/config/SqlGeneratorConfigBuilder.java delete mode 100644 trainbenchmark-generator-sql/src/main/resources/.gitignore delete mode 100644 trainbenchmark-generator-sql/src/test/java/hu/bme/mit/trainbenchmark/generator/sql/SqlGeneratorTest.java delete mode 100644 trainbenchmark-tool-blazegraph/.gitignore delete mode 100644 trainbenchmark-tool-blazegraph/build.gradle delete mode 100644 trainbenchmark-tool-blazegraph/src/main/java/hu/bme/mit/trainbenchmark/benchmark/blazegraph/BlazegraphBenchmarkMain.java delete mode 100644 trainbenchmark-tool-blazegraph/src/main/java/hu/bme/mit/trainbenchmark/benchmark/blazegraph/BlazegraphBenchmarkScenario.java delete mode 100644 trainbenchmark-tool-blazegraph/src/main/java/hu/bme/mit/trainbenchmark/benchmark/blazegraph/config/BlazegraphBenchmarkConfig.java delete mode 100644 trainbenchmark-tool-blazegraph/src/main/java/hu/bme/mit/trainbenchmark/benchmark/blazegraph/config/BlazegraphBenchmarkConfigBuilder.java delete mode 100644 trainbenchmark-tool-blazegraph/src/main/java/hu/bme/mit/trainbenchmark/benchmark/blazegraph/driver/BlazegraphDriver.java delete mode 100644 trainbenchmark-tool-blazegraph/src/main/java/hu/bme/mit/trainbenchmark/benchmark/blazegraph/driver/BlazegraphDriverFactory.java delete mode 100644 trainbenchmark-tool-blazegraph/src/main/resources/blazegraph.properties delete mode 100644 trainbenchmark-tool-blazegraph/src/main/resources/log4j.properties delete mode 100644 trainbenchmark-tool-blazegraph/src/test/java/hu/bme/mit/trainbenchmark/benchmark/blazegraph/test/BlazegraphTest.java delete mode 100644 trainbenchmark-tool-drools/build.gradle delete mode 100644 trainbenchmark-tool-drools/src/main/java/hu/bme/mit/trainbenchmark/benchmark/drools/DroolsBenchmarkMain.java delete mode 100644 trainbenchmark-tool-drools/src/main/java/hu/bme/mit/trainbenchmark/benchmark/drools/DroolsBenchmarkScenario.java delete mode 100644 trainbenchmark-tool-drools/src/main/java/hu/bme/mit/trainbenchmark/benchmark/drools/config/DroolsBenchmarkConfig.java delete mode 100644 trainbenchmark-tool-drools/src/main/java/hu/bme/mit/trainbenchmark/benchmark/drools/config/DroolsBenchmarkConfigBuilder.java delete mode 100644 trainbenchmark-tool-drools/src/main/java/hu/bme/mit/trainbenchmark/benchmark/drools/driver/DroolsDriver.java delete mode 100644 trainbenchmark-tool-drools/src/main/java/hu/bme/mit/trainbenchmark/benchmark/drools/driver/DroolsDriverFactory.java delete mode 100644 trainbenchmark-tool-drools/src/main/java/hu/bme/mit/trainbenchmark/benchmark/drools/matches/DroolsConnectedSegmentsMatch.java delete mode 100644 trainbenchmark-tool-drools/src/main/java/hu/bme/mit/trainbenchmark/benchmark/drools/matches/DroolsPosLengthMatch.java delete mode 100644 trainbenchmark-tool-drools/src/main/java/hu/bme/mit/trainbenchmark/benchmark/drools/matches/DroolsRouteSensorMatch.java delete mode 100644 trainbenchmark-tool-drools/src/main/java/hu/bme/mit/trainbenchmark/benchmark/drools/matches/DroolsSemaphoreNeighborMatch.java delete mode 100644 trainbenchmark-tool-drools/src/main/java/hu/bme/mit/trainbenchmark/benchmark/drools/matches/DroolsSwitchMonitoredMatch.java delete mode 100644 trainbenchmark-tool-drools/src/main/java/hu/bme/mit/trainbenchmark/benchmark/drools/matches/DroolsSwitchSetMatch.java delete mode 100644 trainbenchmark-tool-drools/src/main/java/hu/bme/mit/trainbenchmark/benchmark/drools/operations/DroolsModelOperationFactory.java delete mode 100644 trainbenchmark-tool-drools/src/main/java/hu/bme/mit/trainbenchmark/benchmark/drools/queries/DroolsQuery.java delete mode 100644 trainbenchmark-tool-drools/src/main/java/hu/bme/mit/trainbenchmark/benchmark/drools/queries/DroolsResultListener.java delete mode 100644 trainbenchmark-tool-drools/src/main/resources/META-INF/kmodule.xml delete mode 100644 trainbenchmark-tool-drools/src/main/resources/hu/bme/mit/trainbenchmark/benchmark/drools/queries/ConnectedSegments.drl delete mode 100644 trainbenchmark-tool-drools/src/main/resources/hu/bme/mit/trainbenchmark/benchmark/drools/queries/PosLength.drl delete mode 100644 trainbenchmark-tool-drools/src/main/resources/hu/bme/mit/trainbenchmark/benchmark/drools/queries/RouteSensor.drl delete mode 100644 trainbenchmark-tool-drools/src/main/resources/hu/bme/mit/trainbenchmark/benchmark/drools/queries/SemaphoreNeighbor.drl delete mode 100644 trainbenchmark-tool-drools/src/main/resources/hu/bme/mit/trainbenchmark/benchmark/drools/queries/SwitchMonitored.drl delete mode 100644 trainbenchmark-tool-drools/src/main/resources/hu/bme/mit/trainbenchmark/benchmark/drools/queries/SwitchSet.drl delete mode 100644 trainbenchmark-tool-drools/src/test/java/hu/bme/mit/trainbenchmark/benchmark/drools/test/DroolsTest.java delete mode 100644 trainbenchmark-tool-eclipseocl/.gitignore delete mode 100644 trainbenchmark-tool-eclipseocl/build.gradle delete mode 100644 trainbenchmark-tool-eclipseocl/src/main/java/hu/bme/mit/trainbenchmark/benchmark/eclipseocl/EclipseOclBenchmarkMain.java delete mode 100644 trainbenchmark-tool-eclipseocl/src/main/java/hu/bme/mit/trainbenchmark/benchmark/eclipseocl/EclipseOclBenchmarkScenario.java delete mode 100644 trainbenchmark-tool-eclipseocl/src/main/java/hu/bme/mit/trainbenchmark/benchmark/eclipseocl/config/EclipseOclBenchmarkConfig.java delete mode 100644 trainbenchmark-tool-eclipseocl/src/main/java/hu/bme/mit/trainbenchmark/benchmark/eclipseocl/config/EclipseOclBenchmarkConfigBuilder.java delete mode 100644 trainbenchmark-tool-eclipseocl/src/main/java/hu/bme/mit/trainbenchmark/benchmark/eclipseocl/operations/EclipseOclModelOperationFactory.java delete mode 100644 trainbenchmark-tool-eclipseocl/src/main/java/hu/bme/mit/trainbenchmark/benchmark/eclipseocl/queries/EclipseOclQuery.java delete mode 100644 trainbenchmark-tool-eclipseocl/src/main/java/hu/bme/mit/trainbenchmark/benchmark/eclipseocl/queries/EclipseOclQueryConnectedSegments.java delete mode 100644 trainbenchmark-tool-eclipseocl/src/main/java/hu/bme/mit/trainbenchmark/benchmark/eclipseocl/queries/EclipseOclQueryPosLength.java delete mode 100644 trainbenchmark-tool-eclipseocl/src/main/java/hu/bme/mit/trainbenchmark/benchmark/eclipseocl/queries/EclipseOclQueryRouteSensor.java delete mode 100644 trainbenchmark-tool-eclipseocl/src/main/java/hu/bme/mit/trainbenchmark/benchmark/eclipseocl/queries/EclipseOclQuerySemaphoreNeighbor.java delete mode 100644 trainbenchmark-tool-eclipseocl/src/main/java/hu/bme/mit/trainbenchmark/benchmark/eclipseocl/queries/EclipseOclQuerySwitchMonitored.java delete mode 100644 trainbenchmark-tool-eclipseocl/src/main/java/hu/bme/mit/trainbenchmark/benchmark/eclipseocl/queries/EclipseOclQuerySwitchSet.java delete mode 100644 trainbenchmark-tool-eclipseocl/src/main/resources/queries/ConnectedSegments.ocl delete mode 100644 trainbenchmark-tool-eclipseocl/src/main/resources/queries/PosLength.ocl delete mode 100644 trainbenchmark-tool-eclipseocl/src/main/resources/queries/RouteSensor.ocl delete mode 100644 trainbenchmark-tool-eclipseocl/src/main/resources/queries/SemaphoreNeighbor.ocl delete mode 100644 trainbenchmark-tool-eclipseocl/src/main/resources/queries/SwitchMonitored.ocl delete mode 100644 trainbenchmark-tool-eclipseocl/src/main/resources/queries/SwitchSet.ocl delete mode 100644 trainbenchmark-tool-eclipseocl/src/test/java/hu/bme/mit/trainbenchmark/benchmark/eclipseocl/test/EclipseOclTest.java delete mode 100644 trainbenchmark-tool-eclipseocl/src/test/resources/.gitignore delete mode 100644 trainbenchmark-tool-emfapi/build.gradle delete mode 100644 trainbenchmark-tool-emfapi/src/main/java/hu/bme/mit/trainbenchmark/benchmark/emfapi/EmfApiBenchmarkMain.java delete mode 100644 trainbenchmark-tool-emfapi/src/main/java/hu/bme/mit/trainbenchmark/benchmark/emfapi/EmfApiBenchmarkScenario.java delete mode 100644 trainbenchmark-tool-emfapi/src/main/java/hu/bme/mit/trainbenchmark/benchmark/emfapi/config/EmfApiBenchmarkConfig.java delete mode 100644 trainbenchmark-tool-emfapi/src/main/java/hu/bme/mit/trainbenchmark/benchmark/emfapi/config/EmfApiBenchmarkConfigBuilder.java delete mode 100644 trainbenchmark-tool-emfapi/src/main/java/hu/bme/mit/trainbenchmark/benchmark/emfapi/operations/EmfApiModelOperationFactory.java delete mode 100644 trainbenchmark-tool-emfapi/src/main/java/hu/bme/mit/trainbenchmark/benchmark/emfapi/queries/EmfApiQueryConnectedSegments.java delete mode 100644 trainbenchmark-tool-emfapi/src/main/java/hu/bme/mit/trainbenchmark/benchmark/emfapi/queries/EmfApiQueryPosLength.java delete mode 100644 trainbenchmark-tool-emfapi/src/main/java/hu/bme/mit/trainbenchmark/benchmark/emfapi/queries/EmfApiQueryRouteSensor.java delete mode 100644 trainbenchmark-tool-emfapi/src/main/java/hu/bme/mit/trainbenchmark/benchmark/emfapi/queries/EmfApiQuerySemaphoreNeighbor.java delete mode 100644 trainbenchmark-tool-emfapi/src/main/java/hu/bme/mit/trainbenchmark/benchmark/emfapi/queries/EmfApiQuerySwitchMonitored.java delete mode 100644 trainbenchmark-tool-emfapi/src/main/java/hu/bme/mit/trainbenchmark/benchmark/emfapi/queries/EmfApiQuerySwitchSet.java delete mode 100644 trainbenchmark-tool-emfapi/src/main/resources/.gitignore delete mode 100644 trainbenchmark-tool-emfapi/src/test/java/hu/bme/mit/trainbenchmark/benchmark/emfapi/test/EmfApiTest.java delete mode 100644 trainbenchmark-tool-epsilon/build.gradle delete mode 100644 trainbenchmark-tool-epsilon/src/main/java/hu/bme/mit/trainbenchmark/benchmark/epsilon/EpsilonBenchmarkMain.java delete mode 100644 trainbenchmark-tool-epsilon/src/main/java/hu/bme/mit/trainbenchmark/benchmark/epsilon/EpsilonBenchmarkScenario.java delete mode 100644 trainbenchmark-tool-epsilon/src/main/java/hu/bme/mit/trainbenchmark/benchmark/epsilon/config/EpsilonBenchmarkConfig.java delete mode 100644 trainbenchmark-tool-epsilon/src/main/java/hu/bme/mit/trainbenchmark/benchmark/epsilon/operations/EpsilonModelOperationFactory.java delete mode 100644 trainbenchmark-tool-epsilon/src/main/java/hu/bme/mit/trainbenchmark/benchmark/epsilon/queries/EpsilonQuery.java delete mode 100644 trainbenchmark-tool-epsilon/src/main/java/hu/bme/mit/trainbenchmark/benchmark/epsilon/queries/EpsilonQueryPosLength.java delete mode 100644 trainbenchmark-tool-epsilon/src/main/resources/.gitignore delete mode 100644 trainbenchmark-tool-epsilon/src/test/java/hu/bme/mit/trainbenchmark/benchmark/epsilon/test/EpsilonTest.java delete mode 100644 trainbenchmark-tool-ingraph-query-plans/build.gradle delete mode 100644 trainbenchmark-tool-ingraph-query-plans/src/main/java/ingraph/trainbenchmark/QueryPlanFactory.xtend delete mode 100644 trainbenchmark-tool-ingraph-query-plans/src/main/java/ingraph/trainbenchmark/RouteSensorQueryPlanFactory.xtend delete mode 100644 trainbenchmark-tool-ingraph-query-plans/src/main/java/ingraph/trainbenchmark/SemaphoreNeighborQueryPlanFactory.xtend delete mode 100644 trainbenchmark-tool-ingraph-query-plans/src/main/java/ingraph/trainbenchmark/TrainBenchmarkUtil.xtend delete mode 100644 trainbenchmark-tool-ingraph-query-plans/src/test/java/ingraph/trainbenchmark/QueryPlanVisualizationTest.xtend delete mode 100644 trainbenchmark-tool-ingraph-query-plans/src/test/java/ingraph/trainbenchmark/RelalgBuilderTest.xtend delete mode 100644 trainbenchmark-tool-ingraph-query-plans/src/test/java/ingraph/trainbenchmark/cost/CostTest.xtend delete mode 100644 trainbenchmark-tool-ingraph/.gitignore delete mode 100644 trainbenchmark-tool-ingraph/build.gradle delete mode 100644 trainbenchmark-tool-ingraph/src/main/java/hu/bme/mit/trainbenchmark/benchmark/ingraph/IngraphBenchmarkMain.java delete mode 100644 trainbenchmark-tool-ingraph/src/main/java/hu/bme/mit/trainbenchmark/benchmark/ingraph/IngraphBenchmarkScenario.java delete mode 100644 trainbenchmark-tool-ingraph/src/main/java/hu/bme/mit/trainbenchmark/benchmark/ingraph/IngraphUtils.java delete mode 100644 trainbenchmark-tool-ingraph/src/main/java/hu/bme/mit/trainbenchmark/benchmark/ingraph/config/IngraphBenchmarkConfig.java delete mode 100644 trainbenchmark-tool-ingraph/src/main/java/hu/bme/mit/trainbenchmark/benchmark/ingraph/config/IngraphBenchmarkConfigBuilder.java delete mode 100644 trainbenchmark-tool-ingraph/src/main/java/hu/bme/mit/trainbenchmark/benchmark/ingraph/driver/IngraphDriver.java delete mode 100644 trainbenchmark-tool-ingraph/src/main/java/hu/bme/mit/trainbenchmark/benchmark/ingraph/driver/IngraphDriverFactory.java delete mode 100644 trainbenchmark-tool-ingraph/src/main/java/hu/bme/mit/trainbenchmark/benchmark/ingraph/match/IngraphConnectedSegmentsInjectMatch.java delete mode 100644 trainbenchmark-tool-ingraph/src/main/java/hu/bme/mit/trainbenchmark/benchmark/ingraph/match/IngraphConnectedSegmentsMatch.java delete mode 100644 trainbenchmark-tool-ingraph/src/main/java/hu/bme/mit/trainbenchmark/benchmark/ingraph/match/IngraphMatch.java delete mode 100644 trainbenchmark-tool-ingraph/src/main/java/hu/bme/mit/trainbenchmark/benchmark/ingraph/match/IngraphMatchComparator.java delete mode 100644 trainbenchmark-tool-ingraph/src/main/java/hu/bme/mit/trainbenchmark/benchmark/ingraph/match/IngraphPosLengthInjectMatch.java delete mode 100644 trainbenchmark-tool-ingraph/src/main/java/hu/bme/mit/trainbenchmark/benchmark/ingraph/match/IngraphPosLengthMatch.java delete mode 100644 trainbenchmark-tool-ingraph/src/main/java/hu/bme/mit/trainbenchmark/benchmark/ingraph/match/IngraphRouteSensorInjectMatch.java delete mode 100644 trainbenchmark-tool-ingraph/src/main/java/hu/bme/mit/trainbenchmark/benchmark/ingraph/match/IngraphRouteSensorMatch.java delete mode 100644 trainbenchmark-tool-ingraph/src/main/java/hu/bme/mit/trainbenchmark/benchmark/ingraph/match/IngraphSemaphoreNeighborInjectMatch.java delete mode 100644 trainbenchmark-tool-ingraph/src/main/java/hu/bme/mit/trainbenchmark/benchmark/ingraph/match/IngraphSemaphoreNeighborMatch.java delete mode 100644 trainbenchmark-tool-ingraph/src/main/java/hu/bme/mit/trainbenchmark/benchmark/ingraph/match/IngraphSwitchMonitoredInjectMatch.java delete mode 100644 trainbenchmark-tool-ingraph/src/main/java/hu/bme/mit/trainbenchmark/benchmark/ingraph/match/IngraphSwitchMonitoredMatch.java delete mode 100644 trainbenchmark-tool-ingraph/src/main/java/hu/bme/mit/trainbenchmark/benchmark/ingraph/match/IngraphSwitchSetInjectMatch.java delete mode 100644 trainbenchmark-tool-ingraph/src/main/java/hu/bme/mit/trainbenchmark/benchmark/ingraph/match/IngraphSwitchSetMatch.java delete mode 100644 trainbenchmark-tool-ingraph/src/main/java/hu/bme/mit/trainbenchmark/benchmark/ingraph/operations/IngraphModelOperationFactory.java delete mode 100644 trainbenchmark-tool-ingraph/src/main/java/hu/bme/mit/trainbenchmark/benchmark/ingraph/queries/IngraphChangeListener.java delete mode 100644 trainbenchmark-tool-ingraph/src/main/java/hu/bme/mit/trainbenchmark/benchmark/ingraph/queries/IngraphQuery.java delete mode 100644 trainbenchmark-tool-ingraph/src/main/java/hu/bme/mit/trainbenchmark/benchmark/ingraph/transformations/IngraphTransformation.java delete mode 100644 trainbenchmark-tool-ingraph/src/main/java/hu/bme/mit/trainbenchmark/benchmark/ingraph/transformations/inject/IngraphTransformationInjectConnectedSegments.java delete mode 100644 trainbenchmark-tool-ingraph/src/main/java/hu/bme/mit/trainbenchmark/benchmark/ingraph/transformations/inject/IngraphTransformationInjectPosLength.java delete mode 100644 trainbenchmark-tool-ingraph/src/main/java/hu/bme/mit/trainbenchmark/benchmark/ingraph/transformations/inject/IngraphTransformationInjectRouteSensor.java delete mode 100644 trainbenchmark-tool-ingraph/src/main/java/hu/bme/mit/trainbenchmark/benchmark/ingraph/transformations/inject/IngraphTransformationInjectSemaphoreNeighbor.java delete mode 100644 trainbenchmark-tool-ingraph/src/main/java/hu/bme/mit/trainbenchmark/benchmark/ingraph/transformations/inject/IngraphTransformationInjectSwitchMonitored.java delete mode 100644 trainbenchmark-tool-ingraph/src/main/java/hu/bme/mit/trainbenchmark/benchmark/ingraph/transformations/inject/IngraphTransformationInjectSwitchSet.java delete mode 100644 trainbenchmark-tool-ingraph/src/main/java/hu/bme/mit/trainbenchmark/benchmark/ingraph/transformations/repair/IngraphTransformationRepairConnectedSegments.java delete mode 100644 trainbenchmark-tool-ingraph/src/main/java/hu/bme/mit/trainbenchmark/benchmark/ingraph/transformations/repair/IngraphTransformationRepairPosLength.java delete mode 100644 trainbenchmark-tool-ingraph/src/main/java/hu/bme/mit/trainbenchmark/benchmark/ingraph/transformations/repair/IngraphTransformationRepairRouteSensor.java delete mode 100644 trainbenchmark-tool-ingraph/src/main/java/hu/bme/mit/trainbenchmark/benchmark/ingraph/transformations/repair/IngraphTransformationRepairSemaphoreNeighbor.java delete mode 100644 trainbenchmark-tool-ingraph/src/main/java/hu/bme/mit/trainbenchmark/benchmark/ingraph/transformations/repair/IngraphTransformationRepairSwitchMonitored.java delete mode 100644 trainbenchmark-tool-ingraph/src/main/java/hu/bme/mit/trainbenchmark/benchmark/ingraph/transformations/repair/IngraphTransformationRepairSwitchSet.java delete mode 100644 trainbenchmark-tool-ingraph/src/main/resources/log4j.properties delete mode 100644 trainbenchmark-tool-ingraph/src/test/java/hu/bme/mit/trainbenchmark/benchmark/ingraph/test/IngraphTest.java delete mode 100644 trainbenchmark-tool-ingraph/src/test/java/hu/bme/mit/trainbenchmark/benchmark/ingraph/test/queryspecific/IngraphRouteSensorTest.java delete mode 100644 trainbenchmark-tool-ingraph/src/test/java/hu/bme/mit/trainbenchmark/benchmark/ingraph/test/queryspecific/IngraphSemaphoreNeighborTest.java delete mode 100644 trainbenchmark-tool-jena/.gitignore delete mode 100644 trainbenchmark-tool-jena/build.gradle delete mode 100644 trainbenchmark-tool-jena/src/main/java/hu/bme/mit/trainbenchmark/benchmark/jena/JenaBenchmarkMain.java delete mode 100644 trainbenchmark-tool-jena/src/main/java/hu/bme/mit/trainbenchmark/benchmark/jena/JenaBenchmarkScenario.java delete mode 100644 trainbenchmark-tool-jena/src/main/java/hu/bme/mit/trainbenchmark/benchmark/jena/comparators/JenaMatchComparator.java delete mode 100644 trainbenchmark-tool-jena/src/main/java/hu/bme/mit/trainbenchmark/benchmark/jena/comparators/ResourceComparator.java delete mode 100644 trainbenchmark-tool-jena/src/main/java/hu/bme/mit/trainbenchmark/benchmark/jena/config/JenaBenchmarkConfig.java delete mode 100644 trainbenchmark-tool-jena/src/main/java/hu/bme/mit/trainbenchmark/benchmark/jena/config/JenaBenchmarkConfigBuilder.java delete mode 100644 trainbenchmark-tool-jena/src/main/java/hu/bme/mit/trainbenchmark/benchmark/jena/driver/JenaDriver.java delete mode 100644 trainbenchmark-tool-jena/src/main/java/hu/bme/mit/trainbenchmark/benchmark/jena/driver/JenaDriverFactory.java delete mode 100644 trainbenchmark-tool-jena/src/main/java/hu/bme/mit/trainbenchmark/benchmark/jena/driver/StatementComparator.java delete mode 100644 trainbenchmark-tool-jena/src/main/java/hu/bme/mit/trainbenchmark/benchmark/jena/matches/JenaConnectedSegmentsInjectMatch.java delete mode 100644 trainbenchmark-tool-jena/src/main/java/hu/bme/mit/trainbenchmark/benchmark/jena/matches/JenaConnectedSegmentsMatch.java delete mode 100644 trainbenchmark-tool-jena/src/main/java/hu/bme/mit/trainbenchmark/benchmark/jena/matches/JenaMatch.java delete mode 100644 trainbenchmark-tool-jena/src/main/java/hu/bme/mit/trainbenchmark/benchmark/jena/matches/JenaPosLengthInjectMatch.java delete mode 100644 trainbenchmark-tool-jena/src/main/java/hu/bme/mit/trainbenchmark/benchmark/jena/matches/JenaPosLengthMatch.java delete mode 100644 trainbenchmark-tool-jena/src/main/java/hu/bme/mit/trainbenchmark/benchmark/jena/matches/JenaRouteSensorInjectMatch.java delete mode 100644 trainbenchmark-tool-jena/src/main/java/hu/bme/mit/trainbenchmark/benchmark/jena/matches/JenaRouteSensorMatch.java delete mode 100644 trainbenchmark-tool-jena/src/main/java/hu/bme/mit/trainbenchmark/benchmark/jena/matches/JenaSemaphoreNeighborInjectMatch.java delete mode 100644 trainbenchmark-tool-jena/src/main/java/hu/bme/mit/trainbenchmark/benchmark/jena/matches/JenaSemaphoreNeighborMatch.java delete mode 100644 trainbenchmark-tool-jena/src/main/java/hu/bme/mit/trainbenchmark/benchmark/jena/matches/JenaSwitchMonitoredInjectMatch.java delete mode 100644 trainbenchmark-tool-jena/src/main/java/hu/bme/mit/trainbenchmark/benchmark/jena/matches/JenaSwitchMonitoredMatch.java delete mode 100644 trainbenchmark-tool-jena/src/main/java/hu/bme/mit/trainbenchmark/benchmark/jena/matches/JenaSwitchSetInjectMatch.java delete mode 100644 trainbenchmark-tool-jena/src/main/java/hu/bme/mit/trainbenchmark/benchmark/jena/matches/JenaSwitchSetMatch.java delete mode 100644 trainbenchmark-tool-jena/src/main/java/hu/bme/mit/trainbenchmark/benchmark/jena/operations/JenaModelOperationFactory.java delete mode 100644 trainbenchmark-tool-jena/src/main/java/hu/bme/mit/trainbenchmark/benchmark/jena/queries/JenaQuery.java delete mode 100644 trainbenchmark-tool-jena/src/main/java/hu/bme/mit/trainbenchmark/benchmark/jena/transformations/JenaTransformation.java delete mode 100644 trainbenchmark-tool-jena/src/main/java/hu/bme/mit/trainbenchmark/benchmark/jena/transformations/inject/JenaTransformationInjectConnectedSegments.java delete mode 100644 trainbenchmark-tool-jena/src/main/java/hu/bme/mit/trainbenchmark/benchmark/jena/transformations/inject/JenaTransformationInjectPosLength.java delete mode 100644 trainbenchmark-tool-jena/src/main/java/hu/bme/mit/trainbenchmark/benchmark/jena/transformations/inject/JenaTransformationInjectRouteSensor.java delete mode 100644 trainbenchmark-tool-jena/src/main/java/hu/bme/mit/trainbenchmark/benchmark/jena/transformations/inject/JenaTransformationInjectSemaphoreNeighbor.java delete mode 100644 trainbenchmark-tool-jena/src/main/java/hu/bme/mit/trainbenchmark/benchmark/jena/transformations/inject/JenaTransformationInjectSwitchMonitored.java delete mode 100644 trainbenchmark-tool-jena/src/main/java/hu/bme/mit/trainbenchmark/benchmark/jena/transformations/inject/JenaTransformationInjectSwitchSet.java delete mode 100644 trainbenchmark-tool-jena/src/main/java/hu/bme/mit/trainbenchmark/benchmark/jena/transformations/repair/JenaTransformationRepairConnectedSegments.java delete mode 100644 trainbenchmark-tool-jena/src/main/java/hu/bme/mit/trainbenchmark/benchmark/jena/transformations/repair/JenaTransformationRepairPosLength.java delete mode 100644 trainbenchmark-tool-jena/src/main/java/hu/bme/mit/trainbenchmark/benchmark/jena/transformations/repair/JenaTransformationRepairRouteSensor.java delete mode 100644 trainbenchmark-tool-jena/src/main/java/hu/bme/mit/trainbenchmark/benchmark/jena/transformations/repair/JenaTransformationRepairSemaphoreNeighbor.java delete mode 100644 trainbenchmark-tool-jena/src/main/java/hu/bme/mit/trainbenchmark/benchmark/jena/transformations/repair/JenaTransformationRepairSwitchMonitored.java delete mode 100644 trainbenchmark-tool-jena/src/main/java/hu/bme/mit/trainbenchmark/benchmark/jena/transformations/repair/JenaTransformationRepairSwitchSet.java delete mode 100644 trainbenchmark-tool-jena/src/main/resources/log4j.properties delete mode 100644 trainbenchmark-tool-jena/src/test/java/hu/bme/mit/trainbenchmark/benchmark/jena/test/JenaTest.java delete mode 100644 trainbenchmark-tool-kiama/build.gradle delete mode 100644 trainbenchmark-tool-kiama/kiamatrain-src/build.sbt delete mode 100644 trainbenchmark-tool-kiama/kiamatrain-src/project/build.properties delete mode 100644 trainbenchmark-tool-kiama/kiamatrain-src/src/main/java/de/tudresden/inf/st/train/kiama/enums/Position.java delete mode 100644 trainbenchmark-tool-kiama/kiamatrain-src/src/main/java/de/tudresden/inf/st/train/kiama/enums/Signal.java delete mode 100644 trainbenchmark-tool-kiama/kiamatrain-src/src/main/java/de/tudresden/inf/st/train/kiama/matches/KiamaInternalConnectedSegmentsInjectMatch.java delete mode 100644 trainbenchmark-tool-kiama/kiamatrain-src/src/main/java/de/tudresden/inf/st/train/kiama/matches/KiamaInternalConnectedSegmentsMatch.java delete mode 100644 trainbenchmark-tool-kiama/kiamatrain-src/src/main/java/de/tudresden/inf/st/train/kiama/matches/KiamaInternalPosLengthInjectMatch.java delete mode 100644 trainbenchmark-tool-kiama/kiamatrain-src/src/main/java/de/tudresden/inf/st/train/kiama/matches/KiamaInternalPosLengthMatch.java delete mode 100644 trainbenchmark-tool-kiama/kiamatrain-src/src/main/java/de/tudresden/inf/st/train/kiama/matches/KiamaInternalRouteSensorInjectMatch.java delete mode 100644 trainbenchmark-tool-kiama/kiamatrain-src/src/main/java/de/tudresden/inf/st/train/kiama/matches/KiamaInternalRouteSensorMatch.java delete mode 100644 trainbenchmark-tool-kiama/kiamatrain-src/src/main/java/de/tudresden/inf/st/train/kiama/matches/KiamaInternalSemaphoreNeighborInjectMatch.java delete mode 100644 trainbenchmark-tool-kiama/kiamatrain-src/src/main/java/de/tudresden/inf/st/train/kiama/matches/KiamaInternalSemaphoreNeighborMatch.java delete mode 100644 trainbenchmark-tool-kiama/kiamatrain-src/src/main/java/de/tudresden/inf/st/train/kiama/matches/KiamaInternalSwitchSetInjectMatch.java delete mode 100644 trainbenchmark-tool-kiama/kiamatrain-src/src/main/java/de/tudresden/inf/st/train/kiama/matches/KiamaInternalSwitchSetMatch.java delete mode 100644 trainbenchmark-tool-kiama/kiamatrain-src/src/main/scala/de/tudresden/inf/st/train/kiama/ast/Id.scala delete mode 100644 trainbenchmark-tool-kiama/kiamatrain-src/src/main/scala/de/tudresden/inf/st/train/kiama/ast/KiamaTrainTreeNode.scala delete mode 100644 trainbenchmark-tool-kiama/kiamatrain-src/src/main/scala/de/tudresden/inf/st/train/kiama/ast/RailwayContainer.scala delete mode 100644 trainbenchmark-tool-kiama/kiamatrain-src/src/main/scala/de/tudresden/inf/st/train/kiama/ast/RailwayElement.scala delete mode 100644 trainbenchmark-tool-kiama/kiamatrain-src/src/main/scala/de/tudresden/inf/st/train/kiama/ast/Ref.scala delete mode 100644 trainbenchmark-tool-kiama/kiamatrain-src/src/main/scala/de/tudresden/inf/st/train/kiama/ast/Region.scala delete mode 100644 trainbenchmark-tool-kiama/kiamatrain-src/src/main/scala/de/tudresden/inf/st/train/kiama/ast/Route.scala delete mode 100644 trainbenchmark-tool-kiama/kiamatrain-src/src/main/scala/de/tudresden/inf/st/train/kiama/ast/Segment.scala delete mode 100644 trainbenchmark-tool-kiama/kiamatrain-src/src/main/scala/de/tudresden/inf/st/train/kiama/ast/Semaphore.scala delete mode 100644 trainbenchmark-tool-kiama/kiamatrain-src/src/main/scala/de/tudresden/inf/st/train/kiama/ast/Sensor.scala delete mode 100644 trainbenchmark-tool-kiama/kiamatrain-src/src/main/scala/de/tudresden/inf/st/train/kiama/ast/Switch.scala delete mode 100644 trainbenchmark-tool-kiama/kiamatrain-src/src/main/scala/de/tudresden/inf/st/train/kiama/ast/SwitchPosition.scala delete mode 100644 trainbenchmark-tool-kiama/kiamatrain-src/src/main/scala/de/tudresden/inf/st/train/kiama/ast/TrackElement.scala delete mode 100644 trainbenchmark-tool-kiama/kiamatrain-src/src/main/scala/de/tudresden/inf/st/train/kiama/queries/KiamaTrainQueries.scala delete mode 100644 trainbenchmark-tool-kiama/libs/kiamatrain.jar delete mode 100644 trainbenchmark-tool-kiama/src/main/java/de/tudresden/inf/st/train/kiama/KiamaAbstractBenchmarkScenario.java delete mode 100644 trainbenchmark-tool-kiama/src/main/java/de/tudresden/inf/st/train/kiama/KiamaBenchmarkMain.java delete mode 100644 trainbenchmark-tool-kiama/src/main/java/de/tudresden/inf/st/train/kiama/KiamaBenchmarkScenario.java delete mode 100644 trainbenchmark-tool-kiama/src/main/java/de/tudresden/inf/st/train/kiama/comparators/KiamaMatchComparator.java delete mode 100644 trainbenchmark-tool-kiama/src/main/java/de/tudresden/inf/st/train/kiama/comparators/RailwayElementComparator.java delete mode 100644 trainbenchmark-tool-kiama/src/main/java/de/tudresden/inf/st/train/kiama/config/KiamaAbstractBenchmarkConfig.java delete mode 100644 trainbenchmark-tool-kiama/src/main/java/de/tudresden/inf/st/train/kiama/config/KiamaBenchmarkConfig.java delete mode 100644 trainbenchmark-tool-kiama/src/main/java/de/tudresden/inf/st/train/kiama/config/KiamaBenchmarkConfigBuilder.java delete mode 100644 trainbenchmark-tool-kiama/src/main/java/de/tudresden/inf/st/train/kiama/driver/KiamaDriver.java delete mode 100644 trainbenchmark-tool-kiama/src/main/java/de/tudresden/inf/st/train/kiama/driver/KiamaDriverFactory.java delete mode 100644 trainbenchmark-tool-kiama/src/main/java/de/tudresden/inf/st/train/kiama/driver/deserializer/ASTNodeDeserializer.java delete mode 100644 trainbenchmark-tool-kiama/src/main/java/de/tudresden/inf/st/train/kiama/driver/deserializer/DeserializationException.java delete mode 100644 trainbenchmark-tool-kiama/src/main/java/de/tudresden/inf/st/train/kiama/driver/deserializer/JsonDeserializer.java delete mode 100644 trainbenchmark-tool-kiama/src/main/java/de/tudresden/inf/st/train/kiama/matches/KiamaConnectedSegmentsInjectMatch.java delete mode 100644 trainbenchmark-tool-kiama/src/main/java/de/tudresden/inf/st/train/kiama/matches/KiamaConnectedSegmentsMatch.java delete mode 100644 trainbenchmark-tool-kiama/src/main/java/de/tudresden/inf/st/train/kiama/matches/KiamaMatch.java delete mode 100644 trainbenchmark-tool-kiama/src/main/java/de/tudresden/inf/st/train/kiama/matches/KiamaPosLengthInjectMatch.java delete mode 100644 trainbenchmark-tool-kiama/src/main/java/de/tudresden/inf/st/train/kiama/matches/KiamaPosLengthMatch.java delete mode 100644 trainbenchmark-tool-kiama/src/main/java/de/tudresden/inf/st/train/kiama/matches/KiamaRouteSensorInjectMatch.java delete mode 100644 trainbenchmark-tool-kiama/src/main/java/de/tudresden/inf/st/train/kiama/matches/KiamaRouteSensorMatch.java delete mode 100644 trainbenchmark-tool-kiama/src/main/java/de/tudresden/inf/st/train/kiama/matches/KiamaSemaphoreNeighborInjectMatch.java delete mode 100644 trainbenchmark-tool-kiama/src/main/java/de/tudresden/inf/st/train/kiama/matches/KiamaSemaphoreNeighborMatch.java delete mode 100644 trainbenchmark-tool-kiama/src/main/java/de/tudresden/inf/st/train/kiama/matches/KiamaSwitchMonitoredInjectMatch.java delete mode 100644 trainbenchmark-tool-kiama/src/main/java/de/tudresden/inf/st/train/kiama/matches/KiamaSwitchMonitoredMatch.java delete mode 100644 trainbenchmark-tool-kiama/src/main/java/de/tudresden/inf/st/train/kiama/matches/KiamaSwitchSetInjectMatch.java delete mode 100644 trainbenchmark-tool-kiama/src/main/java/de/tudresden/inf/st/train/kiama/matches/KiamaSwitchSetMatch.java delete mode 100644 trainbenchmark-tool-kiama/src/main/java/de/tudresden/inf/st/train/kiama/operations/KiamaModelOperationFactory.java delete mode 100644 trainbenchmark-tool-kiama/src/main/java/de/tudresden/inf/st/train/kiama/queries/KiamaQuery.java delete mode 100644 trainbenchmark-tool-kiama/src/main/java/de/tudresden/inf/st/train/kiama/queries/KiamaQueryConnectedSegments.java delete mode 100644 trainbenchmark-tool-kiama/src/main/java/de/tudresden/inf/st/train/kiama/queries/KiamaQueryConnectedSegmentsInject.java delete mode 100644 trainbenchmark-tool-kiama/src/main/java/de/tudresden/inf/st/train/kiama/queries/KiamaQueryPosLength.java delete mode 100644 trainbenchmark-tool-kiama/src/main/java/de/tudresden/inf/st/train/kiama/queries/KiamaQueryPosLengthInject.java delete mode 100644 trainbenchmark-tool-kiama/src/main/java/de/tudresden/inf/st/train/kiama/queries/KiamaQueryRouteSensor.java delete mode 100644 trainbenchmark-tool-kiama/src/main/java/de/tudresden/inf/st/train/kiama/queries/KiamaQueryRouteSensorInject.java delete mode 100644 trainbenchmark-tool-kiama/src/main/java/de/tudresden/inf/st/train/kiama/queries/KiamaQuerySemaphoreNeighbor.java delete mode 100644 trainbenchmark-tool-kiama/src/main/java/de/tudresden/inf/st/train/kiama/queries/KiamaQuerySemaphoreNeighborInject.java delete mode 100644 trainbenchmark-tool-kiama/src/main/java/de/tudresden/inf/st/train/kiama/queries/KiamaQuerySwitchMonitored.java delete mode 100644 trainbenchmark-tool-kiama/src/main/java/de/tudresden/inf/st/train/kiama/queries/KiamaQuerySwitchMonitoredInject.java delete mode 100644 trainbenchmark-tool-kiama/src/main/java/de/tudresden/inf/st/train/kiama/queries/KiamaQuerySwitchSet.java delete mode 100644 trainbenchmark-tool-kiama/src/main/java/de/tudresden/inf/st/train/kiama/queries/KiamaQuerySwitchSetInject.java delete mode 100644 trainbenchmark-tool-kiama/src/main/java/de/tudresden/inf/st/train/kiama/transformations/KiamaTransformation.java delete mode 100644 trainbenchmark-tool-kiama/src/main/java/de/tudresden/inf/st/train/kiama/transformations/inject/KiamaTransformationInjectConnectedSegments.java delete mode 100644 trainbenchmark-tool-kiama/src/main/java/de/tudresden/inf/st/train/kiama/transformations/inject/KiamaTransformationInjectPosLength.java delete mode 100644 trainbenchmark-tool-kiama/src/main/java/de/tudresden/inf/st/train/kiama/transformations/inject/KiamaTransformationInjectRouteSensor.java delete mode 100644 trainbenchmark-tool-kiama/src/main/java/de/tudresden/inf/st/train/kiama/transformations/inject/KiamaTransformationInjectSemaphoreNeighbor.java delete mode 100644 trainbenchmark-tool-kiama/src/main/java/de/tudresden/inf/st/train/kiama/transformations/inject/KiamaTransformationInjectSwitchMonitored.java delete mode 100644 trainbenchmark-tool-kiama/src/main/java/de/tudresden/inf/st/train/kiama/transformations/inject/KiamaTransformationInjectSwitchSet.java delete mode 100644 trainbenchmark-tool-kiama/src/main/java/de/tudresden/inf/st/train/kiama/transformations/repair/KiamaTransformationRepairConnectedSegments.java delete mode 100644 trainbenchmark-tool-kiama/src/main/java/de/tudresden/inf/st/train/kiama/transformations/repair/KiamaTransformationRepairPosLength.java delete mode 100644 trainbenchmark-tool-kiama/src/main/java/de/tudresden/inf/st/train/kiama/transformations/repair/KiamaTransformationRepairRouteSensor.java delete mode 100644 trainbenchmark-tool-kiama/src/main/java/de/tudresden/inf/st/train/kiama/transformations/repair/KiamaTransformationRepairSemaphoreNeighbor.java delete mode 100644 trainbenchmark-tool-kiama/src/main/java/de/tudresden/inf/st/train/kiama/transformations/repair/KiamaTransformationRepairSwitchMonitored.java delete mode 100644 trainbenchmark-tool-kiama/src/main/java/de/tudresden/inf/st/train/kiama/transformations/repair/KiamaTransformationRepairSwitchSet.java delete mode 100644 trainbenchmark-tool-kiama/src/test/java/de/tudresden/inf/st/train/kiama/test/KiamaTest.java delete mode 100644 trainbenchmark-tool-mysql/.gitignore delete mode 100644 trainbenchmark-tool-mysql/README.md delete mode 100644 trainbenchmark-tool-mysql/build.gradle delete mode 100644 trainbenchmark-tool-mysql/src/main/java/hu/bme/mit/trainbenchmark/benchmark/mysql/MySqlBenchmarkMain.java delete mode 100644 trainbenchmark-tool-mysql/src/main/java/hu/bme/mit/trainbenchmark/benchmark/mysql/MySqlBenchmarkScenario.java delete mode 100644 trainbenchmark-tool-mysql/src/main/java/hu/bme/mit/trainbenchmark/benchmark/mysql/config/MySqlBenchmarkConfig.java delete mode 100644 trainbenchmark-tool-mysql/src/main/java/hu/bme/mit/trainbenchmark/benchmark/mysql/config/MySqlBenchmarkConfigBuilder.java delete mode 100644 trainbenchmark-tool-mysql/src/main/java/hu/bme/mit/trainbenchmark/benchmark/mysql/driver/MySqlDriver.java delete mode 100644 trainbenchmark-tool-mysql/src/main/java/hu/bme/mit/trainbenchmark/benchmark/mysql/driver/MySqlDriverFactory.java delete mode 100644 trainbenchmark-tool-mysql/src/main/java/hu/bme/mit/trainbenchmark/benchmark/mysql/operations/MySqlModelOperationFactory.java delete mode 100644 trainbenchmark-tool-mysql/src/main/resources/.gitignore delete mode 100644 trainbenchmark-tool-mysql/src/test/java/hu/bme/mit/trainbenchmark/benchmark/mysql/test/MySqlTest.java delete mode 100644 trainbenchmark-tool-neo4j/README.md delete mode 100644 trainbenchmark-tool-neo4j/build.gradle delete mode 100644 trainbenchmark-tool-neo4j/src/main/java/hu/bme/mit/trainbenchmark/benchmark/neo4j/Neo4jBenchmarkMain.java delete mode 100644 trainbenchmark-tool-neo4j/src/main/java/hu/bme/mit/trainbenchmark/benchmark/neo4j/Neo4jBenchmarkScenario.java delete mode 100644 trainbenchmark-tool-neo4j/src/main/java/hu/bme/mit/trainbenchmark/benchmark/neo4j/comparators/Neo4jMatchComparator.java delete mode 100644 trainbenchmark-tool-neo4j/src/main/java/hu/bme/mit/trainbenchmark/benchmark/neo4j/comparators/NodeComparator.java delete mode 100644 trainbenchmark-tool-neo4j/src/main/java/hu/bme/mit/trainbenchmark/benchmark/neo4j/config/Neo4jBenchmarkConfig.java delete mode 100644 trainbenchmark-tool-neo4j/src/main/java/hu/bme/mit/trainbenchmark/benchmark/neo4j/config/Neo4jBenchmarkConfigBuilder.java delete mode 100644 trainbenchmark-tool-neo4j/src/main/java/hu/bme/mit/trainbenchmark/benchmark/neo4j/config/Neo4jEngine.java delete mode 100644 trainbenchmark-tool-neo4j/src/main/java/hu/bme/mit/trainbenchmark/benchmark/neo4j/driver/Neo4jDriver.java delete mode 100644 trainbenchmark-tool-neo4j/src/main/java/hu/bme/mit/trainbenchmark/benchmark/neo4j/driver/Neo4jDriverFactory.java delete mode 100644 trainbenchmark-tool-neo4j/src/main/java/hu/bme/mit/trainbenchmark/benchmark/neo4j/matches/Neo4jConnectedSegmentsInjectMatch.java delete mode 100644 trainbenchmark-tool-neo4j/src/main/java/hu/bme/mit/trainbenchmark/benchmark/neo4j/matches/Neo4jConnectedSegmentsMatch.java delete mode 100644 trainbenchmark-tool-neo4j/src/main/java/hu/bme/mit/trainbenchmark/benchmark/neo4j/matches/Neo4jMatch.java delete mode 100644 trainbenchmark-tool-neo4j/src/main/java/hu/bme/mit/trainbenchmark/benchmark/neo4j/matches/Neo4jPosLengthInjectMatch.java delete mode 100644 trainbenchmark-tool-neo4j/src/main/java/hu/bme/mit/trainbenchmark/benchmark/neo4j/matches/Neo4jPosLengthMatch.java delete mode 100644 trainbenchmark-tool-neo4j/src/main/java/hu/bme/mit/trainbenchmark/benchmark/neo4j/matches/Neo4jRouteSensorInjectMatch.java delete mode 100644 trainbenchmark-tool-neo4j/src/main/java/hu/bme/mit/trainbenchmark/benchmark/neo4j/matches/Neo4jRouteSensorMatch.java delete mode 100644 trainbenchmark-tool-neo4j/src/main/java/hu/bme/mit/trainbenchmark/benchmark/neo4j/matches/Neo4jSemaphoreNeighborInjectMatch.java delete mode 100644 trainbenchmark-tool-neo4j/src/main/java/hu/bme/mit/trainbenchmark/benchmark/neo4j/matches/Neo4jSemaphoreNeighborMatch.java delete mode 100644 trainbenchmark-tool-neo4j/src/main/java/hu/bme/mit/trainbenchmark/benchmark/neo4j/matches/Neo4jSwitchMonitoredInjectMatch.java delete mode 100644 trainbenchmark-tool-neo4j/src/main/java/hu/bme/mit/trainbenchmark/benchmark/neo4j/matches/Neo4jSwitchMonitoredMatch.java delete mode 100644 trainbenchmark-tool-neo4j/src/main/java/hu/bme/mit/trainbenchmark/benchmark/neo4j/matches/Neo4jSwitchSetInjectMatch.java delete mode 100644 trainbenchmark-tool-neo4j/src/main/java/hu/bme/mit/trainbenchmark/benchmark/neo4j/matches/Neo4jSwitchSetMatch.java delete mode 100644 trainbenchmark-tool-neo4j/src/main/java/hu/bme/mit/trainbenchmark/benchmark/neo4j/operations/Neo4jModelOperationFactory.java delete mode 100644 trainbenchmark-tool-neo4j/src/main/java/hu/bme/mit/trainbenchmark/benchmark/neo4j/queries/Neo4jQuery.java delete mode 100644 trainbenchmark-tool-neo4j/src/main/java/hu/bme/mit/trainbenchmark/benchmark/neo4j/queries/core/Neo4jCoreQuery.java delete mode 100644 trainbenchmark-tool-neo4j/src/main/java/hu/bme/mit/trainbenchmark/benchmark/neo4j/queries/core/Neo4jCoreQueryConnectedSegments.java delete mode 100644 trainbenchmark-tool-neo4j/src/main/java/hu/bme/mit/trainbenchmark/benchmark/neo4j/queries/core/Neo4jCoreQueryConnectedSegmentsInject.java delete mode 100644 trainbenchmark-tool-neo4j/src/main/java/hu/bme/mit/trainbenchmark/benchmark/neo4j/queries/core/Neo4jCoreQueryPosLength.java delete mode 100644 trainbenchmark-tool-neo4j/src/main/java/hu/bme/mit/trainbenchmark/benchmark/neo4j/queries/core/Neo4jCoreQueryPosLengthInject.java delete mode 100644 trainbenchmark-tool-neo4j/src/main/java/hu/bme/mit/trainbenchmark/benchmark/neo4j/queries/core/Neo4jCoreQueryRouteSensor.java delete mode 100644 trainbenchmark-tool-neo4j/src/main/java/hu/bme/mit/trainbenchmark/benchmark/neo4j/queries/core/Neo4jCoreQueryRouteSensorInject.java delete mode 100644 trainbenchmark-tool-neo4j/src/main/java/hu/bme/mit/trainbenchmark/benchmark/neo4j/queries/core/Neo4jCoreQuerySemaphoreNeighbor.java delete mode 100644 trainbenchmark-tool-neo4j/src/main/java/hu/bme/mit/trainbenchmark/benchmark/neo4j/queries/core/Neo4jCoreQuerySemaphoreNeighborInject.java delete mode 100644 trainbenchmark-tool-neo4j/src/main/java/hu/bme/mit/trainbenchmark/benchmark/neo4j/queries/core/Neo4jCoreQuerySwitchMonitored.java delete mode 100644 trainbenchmark-tool-neo4j/src/main/java/hu/bme/mit/trainbenchmark/benchmark/neo4j/queries/core/Neo4jCoreQuerySwitchMonitoredInject.java delete mode 100644 trainbenchmark-tool-neo4j/src/main/java/hu/bme/mit/trainbenchmark/benchmark/neo4j/queries/core/Neo4jCoreQuerySwitchSet.java delete mode 100644 trainbenchmark-tool-neo4j/src/main/java/hu/bme/mit/trainbenchmark/benchmark/neo4j/queries/core/Neo4jCoreQuerySwitchSetInject.java delete mode 100644 trainbenchmark-tool-neo4j/src/main/java/hu/bme/mit/trainbenchmark/benchmark/neo4j/queries/cypher/Neo4jCypherQuery.java delete mode 100644 trainbenchmark-tool-neo4j/src/main/java/hu/bme/mit/trainbenchmark/benchmark/neo4j/transformations/Neo4jCoreTransformation.java delete mode 100644 trainbenchmark-tool-neo4j/src/main/java/hu/bme/mit/trainbenchmark/benchmark/neo4j/transformations/Neo4jCypherTransformation.java delete mode 100644 trainbenchmark-tool-neo4j/src/main/java/hu/bme/mit/trainbenchmark/benchmark/neo4j/transformations/Neo4jTransformation.java delete mode 100644 trainbenchmark-tool-neo4j/src/main/java/hu/bme/mit/trainbenchmark/benchmark/neo4j/transformations/core/inject/Neo4jCoreTransformationInjectConnectedSegments.java delete mode 100644 trainbenchmark-tool-neo4j/src/main/java/hu/bme/mit/trainbenchmark/benchmark/neo4j/transformations/core/inject/Neo4jCoreTransformationInjectPosLength.java delete mode 100644 trainbenchmark-tool-neo4j/src/main/java/hu/bme/mit/trainbenchmark/benchmark/neo4j/transformations/core/inject/Neo4jCoreTransformationInjectRouteSensor.java delete mode 100644 trainbenchmark-tool-neo4j/src/main/java/hu/bme/mit/trainbenchmark/benchmark/neo4j/transformations/core/inject/Neo4jCoreTransformationInjectSemaphoreNeighbor.java delete mode 100644 trainbenchmark-tool-neo4j/src/main/java/hu/bme/mit/trainbenchmark/benchmark/neo4j/transformations/core/inject/Neo4jCoreTransformationInjectSwitchMonitored.java delete mode 100644 trainbenchmark-tool-neo4j/src/main/java/hu/bme/mit/trainbenchmark/benchmark/neo4j/transformations/core/inject/Neo4jCoreTransformationInjectSwitchSet.java delete mode 100644 trainbenchmark-tool-neo4j/src/main/java/hu/bme/mit/trainbenchmark/benchmark/neo4j/transformations/core/repair/Neo4jCoreTransformationRepairConnectedSegments.java delete mode 100644 trainbenchmark-tool-neo4j/src/main/java/hu/bme/mit/trainbenchmark/benchmark/neo4j/transformations/core/repair/Neo4jCoreTransformationRepairPosLength.java delete mode 100644 trainbenchmark-tool-neo4j/src/main/java/hu/bme/mit/trainbenchmark/benchmark/neo4j/transformations/core/repair/Neo4jCoreTransformationRepairRouteSensor.java delete mode 100644 trainbenchmark-tool-neo4j/src/main/java/hu/bme/mit/trainbenchmark/benchmark/neo4j/transformations/core/repair/Neo4jCoreTransformationRepairSemaphoreNeighbor.java delete mode 100644 trainbenchmark-tool-neo4j/src/main/java/hu/bme/mit/trainbenchmark/benchmark/neo4j/transformations/core/repair/Neo4jCoreTransformationRepairSwitchMonitored.java delete mode 100644 trainbenchmark-tool-neo4j/src/main/java/hu/bme/mit/trainbenchmark/benchmark/neo4j/transformations/core/repair/Neo4jCoreTransformationRepairSwitchSet.java delete mode 100644 trainbenchmark-tool-neo4j/src/main/java/hu/bme/mit/trainbenchmark/benchmark/neo4j/transformations/cypher/inject/Neo4jCypherTransformationInjectConnectedSegments.java delete mode 100644 trainbenchmark-tool-neo4j/src/main/java/hu/bme/mit/trainbenchmark/benchmark/neo4j/transformations/cypher/inject/Neo4jCypherTransformationInjectPosLength.java delete mode 100644 trainbenchmark-tool-neo4j/src/main/java/hu/bme/mit/trainbenchmark/benchmark/neo4j/transformations/cypher/inject/Neo4jCypherTransformationInjectRouteSensor.java delete mode 100644 trainbenchmark-tool-neo4j/src/main/java/hu/bme/mit/trainbenchmark/benchmark/neo4j/transformations/cypher/inject/Neo4jCypherTransformationInjectSemaphoreNeighbor.java delete mode 100644 trainbenchmark-tool-neo4j/src/main/java/hu/bme/mit/trainbenchmark/benchmark/neo4j/transformations/cypher/inject/Neo4jCypherTransformationInjectSwitchMonitored.java delete mode 100644 trainbenchmark-tool-neo4j/src/main/java/hu/bme/mit/trainbenchmark/benchmark/neo4j/transformations/cypher/inject/Neo4jCypherTransformationInjectSwitchSet.java delete mode 100644 trainbenchmark-tool-neo4j/src/main/java/hu/bme/mit/trainbenchmark/benchmark/neo4j/transformations/cypher/repair/Neo4jCypherTransformationRepairConnectedSegments.java delete mode 100644 trainbenchmark-tool-neo4j/src/main/java/hu/bme/mit/trainbenchmark/benchmark/neo4j/transformations/cypher/repair/Neo4jCypherTransformationRepairPosLength.java delete mode 100644 trainbenchmark-tool-neo4j/src/main/java/hu/bme/mit/trainbenchmark/benchmark/neo4j/transformations/cypher/repair/Neo4jCypherTransformationRepairRouteSensor.java delete mode 100644 trainbenchmark-tool-neo4j/src/main/java/hu/bme/mit/trainbenchmark/benchmark/neo4j/transformations/cypher/repair/Neo4jCypherTransformationRepairSemaphoreNeighbor.java delete mode 100644 trainbenchmark-tool-neo4j/src/main/java/hu/bme/mit/trainbenchmark/benchmark/neo4j/transformations/cypher/repair/Neo4jCypherTransformationRepairSwitchMonitored.java delete mode 100644 trainbenchmark-tool-neo4j/src/main/java/hu/bme/mit/trainbenchmark/benchmark/neo4j/transformations/cypher/repair/Neo4jCypherTransformationRepairSwitchSet.java delete mode 100644 trainbenchmark-tool-neo4j/src/main/java/hu/bme/mit/trainbenchmark/benchmark/neo4j/util/Neo4jUtil.java delete mode 100644 trainbenchmark-tool-neo4j/src/main/resources/queries/ConnectedSegments.cypher delete mode 100644 trainbenchmark-tool-neo4j/src/main/resources/queries/ConnectedSegmentsInject.cypher delete mode 100644 trainbenchmark-tool-neo4j/src/main/resources/queries/PosLength.cypher delete mode 100644 trainbenchmark-tool-neo4j/src/main/resources/queries/PosLengthInject.cypher delete mode 100644 trainbenchmark-tool-neo4j/src/main/resources/queries/RouteSensor.cypher delete mode 100644 trainbenchmark-tool-neo4j/src/main/resources/queries/RouteSensorInject.cypher delete mode 100644 trainbenchmark-tool-neo4j/src/main/resources/queries/SemaphoreNeighbor.cypher delete mode 100644 trainbenchmark-tool-neo4j/src/main/resources/queries/SemaphoreNeighborInject.cypher delete mode 100644 trainbenchmark-tool-neo4j/src/main/resources/queries/SwitchMonitored.cypher delete mode 100644 trainbenchmark-tool-neo4j/src/main/resources/queries/SwitchMonitoredInject.cypher delete mode 100644 trainbenchmark-tool-neo4j/src/main/resources/queries/SwitchSet.cypher delete mode 100644 trainbenchmark-tool-neo4j/src/main/resources/queries/SwitchSetInject.cypher delete mode 100644 trainbenchmark-tool-neo4j/src/main/resources/transformations/ConnectedSegmentsInjectRhs.cypher delete mode 100644 trainbenchmark-tool-neo4j/src/main/resources/transformations/ConnectedSegmentsRepairRhs.cypher delete mode 100644 trainbenchmark-tool-neo4j/src/main/resources/transformations/PosLengthInjectRhs.cypher delete mode 100644 trainbenchmark-tool-neo4j/src/main/resources/transformations/PosLengthRepairRhs.cypher delete mode 100644 trainbenchmark-tool-neo4j/src/main/resources/transformations/RouteSensorInjectRhs.cypher delete mode 100644 trainbenchmark-tool-neo4j/src/main/resources/transformations/RouteSensorRepairRhs.cypher delete mode 100644 trainbenchmark-tool-neo4j/src/main/resources/transformations/SemaphoreNeighborInjectRhs.cypher delete mode 100644 trainbenchmark-tool-neo4j/src/main/resources/transformations/SemaphoreNeighborRepairRhs.cypher delete mode 100644 trainbenchmark-tool-neo4j/src/main/resources/transformations/SwitchMonitoredInjectRhs.cypher delete mode 100644 trainbenchmark-tool-neo4j/src/main/resources/transformations/SwitchMonitoredRepairRhs.cypher delete mode 100644 trainbenchmark-tool-neo4j/src/main/resources/transformations/SwitchSetInjectRhs.cypher delete mode 100644 trainbenchmark-tool-neo4j/src/main/resources/transformations/SwitchSetRepairRhs.cypher delete mode 100644 trainbenchmark-tool-neo4j/src/test/java/hu/bme/mit/trainbenchmark/benchmark/neo4j/test/Neo4jTest.java delete mode 100644 trainbenchmark-tool-neo4j/src/test/resources/.gitignore delete mode 100644 trainbenchmark-tool-racr-cpp/build.gradle delete mode 100644 trainbenchmark-tool-racr-cpp/src/main/java/de/tudresden/inf/st/train/racr/cpp/RacrCppBenchmarkMain.java delete mode 100644 trainbenchmark-tool-racr-cpp/src/main/java/de/tudresden/inf/st/train/racr/cpp/RacrCppBenchmarkScenario.java delete mode 100644 trainbenchmark-tool-racr-cpp/src/main/java/de/tudresden/inf/st/train/racr/cpp/driver/RacrCppDriver.java delete mode 100644 trainbenchmark-tool-racr-cpp/src/main/java/de/tudresden/inf/st/train/racr/cpp/driver/RacrCppDriverFactory.java delete mode 100644 trainbenchmark-tool-racr-cpp/src/main/java/de/tudresden/inf/st/train/racr/cpp/operations/RacrCppModelOperationFactory.java delete mode 100644 trainbenchmark-tool-racr-cpp/src/test/java/de/tudresden/inf/st/train/racr/test/RacrCppTest.java delete mode 100644 trainbenchmark-tool-racr-python/build.gradle delete mode 100644 trainbenchmark-tool-racr-python/src/main/java/de/tudresden/inf/st/train/racr/python/RacrPythonBenchmarkMain.java delete mode 100644 trainbenchmark-tool-racr-python/src/test/java/de/tudresden/inf/st/train/racr/python/test/RacrPythonTest.java delete mode 100644 trainbenchmark-tool-racr-scheme/build.gradle delete mode 100644 trainbenchmark-tool-racr-scheme/src/main/java/de/tudresden/inf/st/train/racr/scheme/RacrSchemeBenchmarkMain.java delete mode 100644 trainbenchmark-tool-racr-scheme/src/test/java/de/tudresden/inf/st/train/racr/test/RacrSchemeTest.java delete mode 100644 trainbenchmark-tool-racr/build.gradle delete mode 100644 trainbenchmark-tool-racr/src/main/java/de/tudresden/inf/st/train/racr/RacrBenchmarkMain.java delete mode 100644 trainbenchmark-tool-racr/src/main/java/de/tudresden/inf/st/train/racr/RacrBenchmarkScenario.java delete mode 100644 trainbenchmark-tool-racr/src/main/java/de/tudresden/inf/st/train/racr/SocketTestMain.java delete mode 100644 trainbenchmark-tool-racr/src/main/java/de/tudresden/inf/st/train/racr/comparators/RacrMatchComparator.java delete mode 100644 trainbenchmark-tool-racr/src/main/java/de/tudresden/inf/st/train/racr/config/RacrBenchmarkConfig.java delete mode 100644 trainbenchmark-tool-racr/src/main/java/de/tudresden/inf/st/train/racr/config/RacrBenchmarkConfigBuilder.java delete mode 100644 trainbenchmark-tool-racr/src/main/java/de/tudresden/inf/st/train/racr/driver/RacrDriver.java delete mode 100644 trainbenchmark-tool-racr/src/main/java/de/tudresden/inf/st/train/racr/driver/RacrDriverFactory.java delete mode 100644 trainbenchmark-tool-racr/src/main/java/de/tudresden/inf/st/train/racr/matches/RacrConnectedSegmentsInjectMatch.java delete mode 100644 trainbenchmark-tool-racr/src/main/java/de/tudresden/inf/st/train/racr/matches/RacrConnectedSegmentsMatch.java delete mode 100644 trainbenchmark-tool-racr/src/main/java/de/tudresden/inf/st/train/racr/matches/RacrMatch.java delete mode 100644 trainbenchmark-tool-racr/src/main/java/de/tudresden/inf/st/train/racr/matches/RacrPosLengthInjectMatch.java delete mode 100644 trainbenchmark-tool-racr/src/main/java/de/tudresden/inf/st/train/racr/matches/RacrPosLengthMatch.java delete mode 100644 trainbenchmark-tool-racr/src/main/java/de/tudresden/inf/st/train/racr/matches/RacrRouteSensorInjectMatch.java delete mode 100644 trainbenchmark-tool-racr/src/main/java/de/tudresden/inf/st/train/racr/matches/RacrRouteSensorMatch.java delete mode 100644 trainbenchmark-tool-racr/src/main/java/de/tudresden/inf/st/train/racr/matches/RacrSemaphoreNeighborInjectMatch.java delete mode 100644 trainbenchmark-tool-racr/src/main/java/de/tudresden/inf/st/train/racr/matches/RacrSemaphoreNeighborMatch.java delete mode 100644 trainbenchmark-tool-racr/src/main/java/de/tudresden/inf/st/train/racr/matches/RacrSwitchMonitoredInjectMatch.java delete mode 100644 trainbenchmark-tool-racr/src/main/java/de/tudresden/inf/st/train/racr/matches/RacrSwitchMonitoredMatch.java delete mode 100644 trainbenchmark-tool-racr/src/main/java/de/tudresden/inf/st/train/racr/matches/RacrSwitchSetInjectMatch.java delete mode 100644 trainbenchmark-tool-racr/src/main/java/de/tudresden/inf/st/train/racr/matches/RacrSwitchSetMatch.java delete mode 100644 trainbenchmark-tool-racr/src/main/java/de/tudresden/inf/st/train/racr/operations/RacrModelOperationFactory.java delete mode 100644 trainbenchmark-tool-racr/src/main/java/de/tudresden/inf/st/train/racr/queries/ConstructMatches.java delete mode 100644 trainbenchmark-tool-racr/src/main/java/de/tudresden/inf/st/train/racr/queries/GetResponseQuery.java delete mode 100644 trainbenchmark-tool-racr/src/main/java/de/tudresden/inf/st/train/racr/queries/RacrQuery.java delete mode 100644 trainbenchmark-tool-racr/src/main/java/de/tudresden/inf/st/train/racr/queries/RacrQueryConnectedSegments.java delete mode 100644 trainbenchmark-tool-racr/src/main/java/de/tudresden/inf/st/train/racr/queries/RacrQueryConnectedSegmentsInject.java delete mode 100644 trainbenchmark-tool-racr/src/main/java/de/tudresden/inf/st/train/racr/queries/RacrQueryPosLength.java delete mode 100644 trainbenchmark-tool-racr/src/main/java/de/tudresden/inf/st/train/racr/queries/RacrQueryPosLengthInject.java delete mode 100644 trainbenchmark-tool-racr/src/main/java/de/tudresden/inf/st/train/racr/queries/RacrQueryRouteSensor.java delete mode 100644 trainbenchmark-tool-racr/src/main/java/de/tudresden/inf/st/train/racr/queries/RacrQueryRouteSensorInject.java delete mode 100644 trainbenchmark-tool-racr/src/main/java/de/tudresden/inf/st/train/racr/queries/RacrQuerySemaphoreNeighbor.java delete mode 100644 trainbenchmark-tool-racr/src/main/java/de/tudresden/inf/st/train/racr/queries/RacrQuerySemaphoreNeighborInject.java delete mode 100644 trainbenchmark-tool-racr/src/main/java/de/tudresden/inf/st/train/racr/queries/RacrQuerySwitchMonitored.java delete mode 100644 trainbenchmark-tool-racr/src/main/java/de/tudresden/inf/st/train/racr/queries/RacrQuerySwitchMonitoredInject.java delete mode 100644 trainbenchmark-tool-racr/src/main/java/de/tudresden/inf/st/train/racr/queries/RacrQuerySwitchSet.java delete mode 100644 trainbenchmark-tool-racr/src/main/java/de/tudresden/inf/st/train/racr/queries/RacrQuerySwitchSetInject.java delete mode 100644 trainbenchmark-tool-racr/src/main/java/de/tudresden/inf/st/train/racr/transformations/GetResponseTransformation.java delete mode 100644 trainbenchmark-tool-racr/src/main/java/de/tudresden/inf/st/train/racr/transformations/HandleEmptyResponse.java delete mode 100644 trainbenchmark-tool-racr/src/main/java/de/tudresden/inf/st/train/racr/transformations/HandleResponse.java delete mode 100644 trainbenchmark-tool-racr/src/main/java/de/tudresden/inf/st/train/racr/transformations/RacrTransformation.java delete mode 100644 trainbenchmark-tool-racr/src/main/java/de/tudresden/inf/st/train/racr/transformations/inject/RacrTransformationInjectConnectedSegments.java delete mode 100644 trainbenchmark-tool-racr/src/main/java/de/tudresden/inf/st/train/racr/transformations/inject/RacrTransformationInjectPosLength.java delete mode 100644 trainbenchmark-tool-racr/src/main/java/de/tudresden/inf/st/train/racr/transformations/inject/RacrTransformationInjectRouteSensor.java delete mode 100644 trainbenchmark-tool-racr/src/main/java/de/tudresden/inf/st/train/racr/transformations/inject/RacrTransformationInjectSemaphoreNeighbor.java delete mode 100644 trainbenchmark-tool-racr/src/main/java/de/tudresden/inf/st/train/racr/transformations/inject/RacrTransformationInjectSwitchMonitored.java delete mode 100644 trainbenchmark-tool-racr/src/main/java/de/tudresden/inf/st/train/racr/transformations/inject/RacrTransformationInjectSwitchSet.java delete mode 100644 trainbenchmark-tool-racr/src/main/java/de/tudresden/inf/st/train/racr/transformations/repair/RacrTransformationRepairConnectedSegments.java delete mode 100644 trainbenchmark-tool-racr/src/main/java/de/tudresden/inf/st/train/racr/transformations/repair/RacrTransformationRepairPosLength.java delete mode 100644 trainbenchmark-tool-racr/src/main/java/de/tudresden/inf/st/train/racr/transformations/repair/RacrTransformationRepairRouteSensor.java delete mode 100644 trainbenchmark-tool-racr/src/main/java/de/tudresden/inf/st/train/racr/transformations/repair/RacrTransformationRepairSemaphoreNeighbor.java delete mode 100644 trainbenchmark-tool-racr/src/main/java/de/tudresden/inf/st/train/racr/transformations/repair/RacrTransformationRepairSwitchMonitored.java delete mode 100644 trainbenchmark-tool-racr/src/main/java/de/tudresden/inf/st/train/racr/transformations/repair/RacrTransformationRepairSwitchSet.java delete mode 100644 trainbenchmark-tool-racr/src/main/java/de/tudresden/inf/st/train/racr/util/AbstractClient.java delete mode 100644 trainbenchmark-tool-racr/src/main/java/de/tudresden/inf/st/train/racr/util/AsyncSocketClient.java delete mode 100644 trainbenchmark-tool-racr/src/main/java/de/tudresden/inf/st/train/racr/util/Event.java delete mode 100644 trainbenchmark-tool-racr/src/main/java/de/tudresden/inf/st/train/racr/util/RacrConfig.java delete mode 100644 trainbenchmark-tool-racr/src/main/java/de/tudresden/inf/st/train/racr/util/RacrHttpClient.java delete mode 100644 trainbenchmark-tool-racr/src/main/java/de/tudresden/inf/st/train/racr/util/RacrUtils.java delete mode 100644 trainbenchmark-tool-racr/src/main/java/de/tudresden/inf/st/train/racr/util/SocketClient.java delete mode 100644 trainbenchmark-tool-racr/src/main/java/de/tudresden/inf/st/train/racr/util/TestUtils.java delete mode 100644 trainbenchmark-tool-rdf/build.gradle delete mode 100644 trainbenchmark-tool-rdf/src/main/java/hu/bme/mit/trainbenchmark/benchmark/rdf/config/RdfBenchmarkConfig.java delete mode 100644 trainbenchmark-tool-rdf/src/main/java/hu/bme/mit/trainbenchmark/benchmark/rdf/config/RdfBenchmarkConfigBuilder.java delete mode 100644 trainbenchmark-tool-rdf/src/main/java/hu/bme/mit/trainbenchmark/benchmark/rdf/driver/RdfDriver.java delete mode 100644 trainbenchmark-tool-rdf/src/main/java/hu/bme/mit/trainbenchmark/benchmark/rdf/driver/RdfDriverFactory.java delete mode 100644 trainbenchmark-tool-rdf/src/main/java/hu/bme/mit/trainbenchmark/benchmark/rdf/queries/RdfModelQuery.java delete mode 100644 trainbenchmark-tool-rdf/src/main/java/hu/bme/mit/trainbenchmark/benchmark/rdf/tests/RdfTest.java delete mode 100644 trainbenchmark-tool-rdf/src/main/resources/queries/ConnectedSegments.sparql delete mode 100644 trainbenchmark-tool-rdf/src/main/resources/queries/ConnectedSegmentsInject.sparql delete mode 100644 trainbenchmark-tool-rdf/src/main/resources/queries/PosLength.sparql delete mode 100644 trainbenchmark-tool-rdf/src/main/resources/queries/PosLengthInject.sparql delete mode 100644 trainbenchmark-tool-rdf/src/main/resources/queries/RouteSensor.sparql delete mode 100644 trainbenchmark-tool-rdf/src/main/resources/queries/RouteSensorInject.sparql delete mode 100644 trainbenchmark-tool-rdf/src/main/resources/queries/SemaphoreNeighbor.sparql delete mode 100644 trainbenchmark-tool-rdf/src/main/resources/queries/SemaphoreNeighborInject.sparql delete mode 100644 trainbenchmark-tool-rdf/src/main/resources/queries/SwitchMonitored.sparql delete mode 100644 trainbenchmark-tool-rdf/src/main/resources/queries/SwitchMonitoredInject.sparql delete mode 100644 trainbenchmark-tool-rdf/src/main/resources/queries/SwitchSet.sparql delete mode 100644 trainbenchmark-tool-rdf/src/main/resources/queries/SwitchSetInject.sparql delete mode 100644 trainbenchmark-tool-rdf4j/.gitignore delete mode 100644 trainbenchmark-tool-rdf4j/build.gradle delete mode 100644 trainbenchmark-tool-rdf4j/src/main/java/hu/bme/mit/trainbenchmark/benchmark/rdf4j/Rdf4jBenchmarkMain.java delete mode 100644 trainbenchmark-tool-rdf4j/src/main/java/hu/bme/mit/trainbenchmark/benchmark/rdf4j/Rdf4jBenchmarkScenario.java delete mode 100644 trainbenchmark-tool-rdf4j/src/main/java/hu/bme/mit/trainbenchmark/benchmark/rdf4j/comparators/IriComparator.java delete mode 100644 trainbenchmark-tool-rdf4j/src/main/java/hu/bme/mit/trainbenchmark/benchmark/rdf4j/comparators/Rdf4jMatchComparator.java delete mode 100644 trainbenchmark-tool-rdf4j/src/main/java/hu/bme/mit/trainbenchmark/benchmark/rdf4j/config/Rdf4jBenchmarkConfig.java delete mode 100644 trainbenchmark-tool-rdf4j/src/main/java/hu/bme/mit/trainbenchmark/benchmark/rdf4j/config/Rdf4jBenchmarkConfigBuilder.java delete mode 100644 trainbenchmark-tool-rdf4j/src/main/java/hu/bme/mit/trainbenchmark/benchmark/rdf4j/driver/Rdf4jDriver.java delete mode 100644 trainbenchmark-tool-rdf4j/src/main/java/hu/bme/mit/trainbenchmark/benchmark/rdf4j/driver/Rdf4jDriverFactory.java delete mode 100644 trainbenchmark-tool-rdf4j/src/main/java/hu/bme/mit/trainbenchmark/benchmark/rdf4j/matches/Rdf4jConnectedSegmentsInjectMatch.java delete mode 100644 trainbenchmark-tool-rdf4j/src/main/java/hu/bme/mit/trainbenchmark/benchmark/rdf4j/matches/Rdf4jConnectedSegmentsMatch.java delete mode 100644 trainbenchmark-tool-rdf4j/src/main/java/hu/bme/mit/trainbenchmark/benchmark/rdf4j/matches/Rdf4jMatch.java delete mode 100644 trainbenchmark-tool-rdf4j/src/main/java/hu/bme/mit/trainbenchmark/benchmark/rdf4j/matches/Rdf4jPosLengthInjectMatch.java delete mode 100644 trainbenchmark-tool-rdf4j/src/main/java/hu/bme/mit/trainbenchmark/benchmark/rdf4j/matches/Rdf4jPosLengthMatch.java delete mode 100644 trainbenchmark-tool-rdf4j/src/main/java/hu/bme/mit/trainbenchmark/benchmark/rdf4j/matches/Rdf4jRouteSensorInjectMatch.java delete mode 100644 trainbenchmark-tool-rdf4j/src/main/java/hu/bme/mit/trainbenchmark/benchmark/rdf4j/matches/Rdf4jRouteSensorMatch.java delete mode 100644 trainbenchmark-tool-rdf4j/src/main/java/hu/bme/mit/trainbenchmark/benchmark/rdf4j/matches/Rdf4jSemaphoreNeighborInjectMatch.java delete mode 100644 trainbenchmark-tool-rdf4j/src/main/java/hu/bme/mit/trainbenchmark/benchmark/rdf4j/matches/Rdf4jSemaphoreNeighborMatch.java delete mode 100644 trainbenchmark-tool-rdf4j/src/main/java/hu/bme/mit/trainbenchmark/benchmark/rdf4j/matches/Rdf4jSwitchMonitoredInjectMatch.java delete mode 100644 trainbenchmark-tool-rdf4j/src/main/java/hu/bme/mit/trainbenchmark/benchmark/rdf4j/matches/Rdf4jSwitchMonitoredMatch.java delete mode 100644 trainbenchmark-tool-rdf4j/src/main/java/hu/bme/mit/trainbenchmark/benchmark/rdf4j/matches/Rdf4jSwitchSetInjectMatch.java delete mode 100644 trainbenchmark-tool-rdf4j/src/main/java/hu/bme/mit/trainbenchmark/benchmark/rdf4j/matches/Rdf4jSwitchSetMatch.java delete mode 100644 trainbenchmark-tool-rdf4j/src/main/java/hu/bme/mit/trainbenchmark/benchmark/rdf4j/operations/Rdf4jModelOperationFactory.java delete mode 100644 trainbenchmark-tool-rdf4j/src/main/java/hu/bme/mit/trainbenchmark/benchmark/rdf4j/queries/Rdf4jQuery.java delete mode 100644 trainbenchmark-tool-rdf4j/src/main/java/hu/bme/mit/trainbenchmark/benchmark/rdf4j/transformations/Rdf4jTransformation.java delete mode 100644 trainbenchmark-tool-rdf4j/src/main/java/hu/bme/mit/trainbenchmark/benchmark/rdf4j/transformations/inject/Rdf4jTransformationInjectConnectedSegments.java delete mode 100644 trainbenchmark-tool-rdf4j/src/main/java/hu/bme/mit/trainbenchmark/benchmark/rdf4j/transformations/inject/Rdf4jTransformationInjectPosLength.java delete mode 100644 trainbenchmark-tool-rdf4j/src/main/java/hu/bme/mit/trainbenchmark/benchmark/rdf4j/transformations/inject/Rdf4jTransformationInjectRouteSensor.java delete mode 100644 trainbenchmark-tool-rdf4j/src/main/java/hu/bme/mit/trainbenchmark/benchmark/rdf4j/transformations/inject/Rdf4jTransformationInjectSemaphoreNeighbor.java delete mode 100644 trainbenchmark-tool-rdf4j/src/main/java/hu/bme/mit/trainbenchmark/benchmark/rdf4j/transformations/inject/Rdf4jTransformationInjectSwitchMonitored.java delete mode 100644 trainbenchmark-tool-rdf4j/src/main/java/hu/bme/mit/trainbenchmark/benchmark/rdf4j/transformations/inject/Rdf4jTransformationInjectSwitchSet.java delete mode 100644 trainbenchmark-tool-rdf4j/src/main/java/hu/bme/mit/trainbenchmark/benchmark/rdf4j/transformations/repair/Rdf4jTransformationRepairConnectedSegments.java delete mode 100644 trainbenchmark-tool-rdf4j/src/main/java/hu/bme/mit/trainbenchmark/benchmark/rdf4j/transformations/repair/Rdf4jTransformationRepairPosLength.java delete mode 100644 trainbenchmark-tool-rdf4j/src/main/java/hu/bme/mit/trainbenchmark/benchmark/rdf4j/transformations/repair/Rdf4jTransformationRepairRouteSensor.java delete mode 100644 trainbenchmark-tool-rdf4j/src/main/java/hu/bme/mit/trainbenchmark/benchmark/rdf4j/transformations/repair/Rdf4jTransformationRepairSemaphoreNeighbor.java delete mode 100644 trainbenchmark-tool-rdf4j/src/main/java/hu/bme/mit/trainbenchmark/benchmark/rdf4j/transformations/repair/Rdf4jTransformationRepairSwitchMonitored.java delete mode 100644 trainbenchmark-tool-rdf4j/src/main/java/hu/bme/mit/trainbenchmark/benchmark/rdf4j/transformations/repair/Rdf4jTransformationRepairSwitchSet.java delete mode 100644 trainbenchmark-tool-rdf4j/src/main/resources/.gitignore delete mode 100644 trainbenchmark-tool-rdf4j/src/test/java/hu/bme/mit/trainbenchmark/benchmark/rdf4j/test/Rdf4jTest.java delete mode 100644 trainbenchmark-tool-sesame/.gitignore delete mode 100644 trainbenchmark-tool-sesame/build.gradle delete mode 100644 trainbenchmark-tool-sesame/src/main/java/hu/bme/mit/trainbenchmark/benchmark/sesame/SesameBenchmarkMain.java delete mode 100644 trainbenchmark-tool-sesame/src/main/java/hu/bme/mit/trainbenchmark/benchmark/sesame/SesameBenchmarkScenario.java delete mode 100644 trainbenchmark-tool-sesame/src/main/java/hu/bme/mit/trainbenchmark/benchmark/sesame/comparators/SesameMatchComparator.java delete mode 100644 trainbenchmark-tool-sesame/src/main/java/hu/bme/mit/trainbenchmark/benchmark/sesame/comparators/UriComparator.java delete mode 100644 trainbenchmark-tool-sesame/src/main/java/hu/bme/mit/trainbenchmark/benchmark/sesame/config/SesameBenchmarkConfig.java delete mode 100644 trainbenchmark-tool-sesame/src/main/java/hu/bme/mit/trainbenchmark/benchmark/sesame/config/SesameBenchmarkConfigBuilder.java delete mode 100644 trainbenchmark-tool-sesame/src/main/java/hu/bme/mit/trainbenchmark/benchmark/sesame/driver/SesameDriver.java delete mode 100644 trainbenchmark-tool-sesame/src/main/java/hu/bme/mit/trainbenchmark/benchmark/sesame/driver/SesameDriverFactory.java delete mode 100644 trainbenchmark-tool-sesame/src/main/java/hu/bme/mit/trainbenchmark/benchmark/sesame/matches/SesameConnectedSegmentsInjectMatch.java delete mode 100644 trainbenchmark-tool-sesame/src/main/java/hu/bme/mit/trainbenchmark/benchmark/sesame/matches/SesameConnectedSegmentsMatch.java delete mode 100644 trainbenchmark-tool-sesame/src/main/java/hu/bme/mit/trainbenchmark/benchmark/sesame/matches/SesameMatch.java delete mode 100644 trainbenchmark-tool-sesame/src/main/java/hu/bme/mit/trainbenchmark/benchmark/sesame/matches/SesamePosLengthInjectMatch.java delete mode 100644 trainbenchmark-tool-sesame/src/main/java/hu/bme/mit/trainbenchmark/benchmark/sesame/matches/SesamePosLengthMatch.java delete mode 100644 trainbenchmark-tool-sesame/src/main/java/hu/bme/mit/trainbenchmark/benchmark/sesame/matches/SesameRouteSensorInjectMatch.java delete mode 100644 trainbenchmark-tool-sesame/src/main/java/hu/bme/mit/trainbenchmark/benchmark/sesame/matches/SesameRouteSensorMatch.java delete mode 100644 trainbenchmark-tool-sesame/src/main/java/hu/bme/mit/trainbenchmark/benchmark/sesame/matches/SesameSemaphoreNeighborInjectMatch.java delete mode 100644 trainbenchmark-tool-sesame/src/main/java/hu/bme/mit/trainbenchmark/benchmark/sesame/matches/SesameSemaphoreNeighborMatch.java delete mode 100644 trainbenchmark-tool-sesame/src/main/java/hu/bme/mit/trainbenchmark/benchmark/sesame/matches/SesameSwitchMonitoredInjectMatch.java delete mode 100644 trainbenchmark-tool-sesame/src/main/java/hu/bme/mit/trainbenchmark/benchmark/sesame/matches/SesameSwitchMonitoredMatch.java delete mode 100644 trainbenchmark-tool-sesame/src/main/java/hu/bme/mit/trainbenchmark/benchmark/sesame/matches/SesameSwitchSetInjectMatch.java delete mode 100644 trainbenchmark-tool-sesame/src/main/java/hu/bme/mit/trainbenchmark/benchmark/sesame/matches/SesameSwitchSetMatch.java delete mode 100644 trainbenchmark-tool-sesame/src/main/java/hu/bme/mit/trainbenchmark/benchmark/sesame/operations/SesameModelOperationFactory.java delete mode 100644 trainbenchmark-tool-sesame/src/main/java/hu/bme/mit/trainbenchmark/benchmark/sesame/queries/SesameQuery.java delete mode 100644 trainbenchmark-tool-sesame/src/main/java/hu/bme/mit/trainbenchmark/benchmark/sesame/transformations/SesameTransformation.java delete mode 100644 trainbenchmark-tool-sesame/src/main/java/hu/bme/mit/trainbenchmark/benchmark/sesame/transformations/inject/SesameTransformationInjectConnectedSegments.java delete mode 100644 trainbenchmark-tool-sesame/src/main/java/hu/bme/mit/trainbenchmark/benchmark/sesame/transformations/inject/SesameTransformationInjectPosLength.java delete mode 100644 trainbenchmark-tool-sesame/src/main/java/hu/bme/mit/trainbenchmark/benchmark/sesame/transformations/inject/SesameTransformationInjectRouteSensor.java delete mode 100644 trainbenchmark-tool-sesame/src/main/java/hu/bme/mit/trainbenchmark/benchmark/sesame/transformations/inject/SesameTransformationInjectSemaphoreNeighbor.java delete mode 100644 trainbenchmark-tool-sesame/src/main/java/hu/bme/mit/trainbenchmark/benchmark/sesame/transformations/inject/SesameTransformationInjectSwitchMonitored.java delete mode 100644 trainbenchmark-tool-sesame/src/main/java/hu/bme/mit/trainbenchmark/benchmark/sesame/transformations/inject/SesameTransformationInjectSwitchSet.java delete mode 100644 trainbenchmark-tool-sesame/src/main/java/hu/bme/mit/trainbenchmark/benchmark/sesame/transformations/repair/SesameTransformationRepairConnectedSegments.java delete mode 100644 trainbenchmark-tool-sesame/src/main/java/hu/bme/mit/trainbenchmark/benchmark/sesame/transformations/repair/SesameTransformationRepairPosLength.java delete mode 100644 trainbenchmark-tool-sesame/src/main/java/hu/bme/mit/trainbenchmark/benchmark/sesame/transformations/repair/SesameTransformationRepairRouteSensor.java delete mode 100644 trainbenchmark-tool-sesame/src/main/java/hu/bme/mit/trainbenchmark/benchmark/sesame/transformations/repair/SesameTransformationRepairSemaphoreNeighbor.java delete mode 100644 trainbenchmark-tool-sesame/src/main/java/hu/bme/mit/trainbenchmark/benchmark/sesame/transformations/repair/SesameTransformationRepairSwitchMonitored.java delete mode 100644 trainbenchmark-tool-sesame/src/main/java/hu/bme/mit/trainbenchmark/benchmark/sesame/transformations/repair/SesameTransformationRepairSwitchSet.java delete mode 100644 trainbenchmark-tool-sesame/src/main/resources/.gitignore delete mode 100644 trainbenchmark-tool-sesame/src/test/java/hu/bme/mit/trainbenchmark/benchmark/sesame/test/SesameTest.java delete mode 100644 trainbenchmark-tool-sesame/src/test/resources/.gitignore delete mode 100644 trainbenchmark-tool-sql/build.gradle delete mode 100644 trainbenchmark-tool-sql/src/main/java/hu/bme/mit/trainbenchmark/benchmark/sql/driver/SqlDriver.java delete mode 100644 trainbenchmark-tool-sql/src/main/java/hu/bme/mit/trainbenchmark/benchmark/sql/matches/SqlConnectedSegmentsInjectMatch.java delete mode 100644 trainbenchmark-tool-sql/src/main/java/hu/bme/mit/trainbenchmark/benchmark/sql/matches/SqlConnectedSegmentsMatch.java delete mode 100644 trainbenchmark-tool-sql/src/main/java/hu/bme/mit/trainbenchmark/benchmark/sql/matches/SqlMatch.java delete mode 100644 trainbenchmark-tool-sql/src/main/java/hu/bme/mit/trainbenchmark/benchmark/sql/matches/SqlPosLengthInjectMatch.java delete mode 100644 trainbenchmark-tool-sql/src/main/java/hu/bme/mit/trainbenchmark/benchmark/sql/matches/SqlPosLengthMatch.java delete mode 100644 trainbenchmark-tool-sql/src/main/java/hu/bme/mit/trainbenchmark/benchmark/sql/matches/SqlRouteSensorInjectMatch.java delete mode 100644 trainbenchmark-tool-sql/src/main/java/hu/bme/mit/trainbenchmark/benchmark/sql/matches/SqlRouteSensorMatch.java delete mode 100644 trainbenchmark-tool-sql/src/main/java/hu/bme/mit/trainbenchmark/benchmark/sql/matches/SqlSemaphoreNeighborInjectMatch.java delete mode 100644 trainbenchmark-tool-sql/src/main/java/hu/bme/mit/trainbenchmark/benchmark/sql/matches/SqlSemaphoreNeighborMatch.java delete mode 100644 trainbenchmark-tool-sql/src/main/java/hu/bme/mit/trainbenchmark/benchmark/sql/matches/SqlSwitchMonitoredInjectMatch.java delete mode 100644 trainbenchmark-tool-sql/src/main/java/hu/bme/mit/trainbenchmark/benchmark/sql/matches/SqlSwitchMonitoredMatch.java delete mode 100644 trainbenchmark-tool-sql/src/main/java/hu/bme/mit/trainbenchmark/benchmark/sql/matches/SqlSwitchSetInjectMatch.java delete mode 100644 trainbenchmark-tool-sql/src/main/java/hu/bme/mit/trainbenchmark/benchmark/sql/matches/SqlSwitchSetMatch.java delete mode 100644 trainbenchmark-tool-sql/src/main/java/hu/bme/mit/trainbenchmark/benchmark/sql/queries/SqlQuery.java delete mode 100644 trainbenchmark-tool-sql/src/main/java/hu/bme/mit/trainbenchmark/benchmark/sql/transformations/SqlTransformation.java delete mode 100644 trainbenchmark-tool-sql/src/main/java/hu/bme/mit/trainbenchmark/benchmark/sql/transformations/inject/SqlTransformationInjectConnectedSegments.java delete mode 100644 trainbenchmark-tool-sql/src/main/java/hu/bme/mit/trainbenchmark/benchmark/sql/transformations/inject/SqlTransformationInjectPosLength.java delete mode 100644 trainbenchmark-tool-sql/src/main/java/hu/bme/mit/trainbenchmark/benchmark/sql/transformations/inject/SqlTransformationInjectRouteSensor.java delete mode 100644 trainbenchmark-tool-sql/src/main/java/hu/bme/mit/trainbenchmark/benchmark/sql/transformations/inject/SqlTransformationInjectSemaphoreNeighbor.java delete mode 100644 trainbenchmark-tool-sql/src/main/java/hu/bme/mit/trainbenchmark/benchmark/sql/transformations/inject/SqlTransformationInjectSwitchMonitored.java delete mode 100644 trainbenchmark-tool-sql/src/main/java/hu/bme/mit/trainbenchmark/benchmark/sql/transformations/inject/SqlTransformationInjectSwitchSet.java delete mode 100644 trainbenchmark-tool-sql/src/main/java/hu/bme/mit/trainbenchmark/benchmark/sql/transformations/repair/SqlTransformationRepairConnectedSegments.java delete mode 100644 trainbenchmark-tool-sql/src/main/java/hu/bme/mit/trainbenchmark/benchmark/sql/transformations/repair/SqlTransformationRepairPosLength.java delete mode 100644 trainbenchmark-tool-sql/src/main/java/hu/bme/mit/trainbenchmark/benchmark/sql/transformations/repair/SqlTransformationRepairRouteSensor.java delete mode 100644 trainbenchmark-tool-sql/src/main/java/hu/bme/mit/trainbenchmark/benchmark/sql/transformations/repair/SqlTransformationRepairSemaphoreNeighbor.java delete mode 100644 trainbenchmark-tool-sql/src/main/java/hu/bme/mit/trainbenchmark/benchmark/sql/transformations/repair/SqlTransformationRepairSwitchMonitored.java delete mode 100644 trainbenchmark-tool-sql/src/main/java/hu/bme/mit/trainbenchmark/benchmark/sql/transformations/repair/SqlTransformationRepairSwitchSet.java delete mode 100644 trainbenchmark-tool-sql/src/main/resources/queries/ConnectedSegments.sql delete mode 100644 trainbenchmark-tool-sql/src/main/resources/queries/ConnectedSegmentsInject.sql delete mode 100644 trainbenchmark-tool-sql/src/main/resources/queries/PosLength.sql delete mode 100644 trainbenchmark-tool-sql/src/main/resources/queries/PosLengthInject.sql delete mode 100644 trainbenchmark-tool-sql/src/main/resources/queries/RouteSensor.sql delete mode 100644 trainbenchmark-tool-sql/src/main/resources/queries/RouteSensorInject.sql delete mode 100644 trainbenchmark-tool-sql/src/main/resources/queries/SemaphoreNeighbor.sql delete mode 100644 trainbenchmark-tool-sql/src/main/resources/queries/SemaphoreNeighborInject.sql delete mode 100644 trainbenchmark-tool-sql/src/main/resources/queries/SwitchMonitored.sql delete mode 100644 trainbenchmark-tool-sql/src/main/resources/queries/SwitchMonitoredInject.sql delete mode 100644 trainbenchmark-tool-sql/src/main/resources/queries/SwitchSet.sql delete mode 100644 trainbenchmark-tool-sql/src/main/resources/queries/SwitchSetInject.sql delete mode 100644 trainbenchmark-tool-sql/src/main/resources/transformations/ConnectedSegmentsInjectRhs.sql delete mode 100644 trainbenchmark-tool-sql/src/main/resources/transformations/ConnectedSegmentsRepairRhs.sql delete mode 100644 trainbenchmark-tool-sql/src/main/resources/transformations/PosLengthInjectRhs.sql delete mode 100644 trainbenchmark-tool-sql/src/main/resources/transformations/PosLengthRepairRhs.sql delete mode 100644 trainbenchmark-tool-sql/src/main/resources/transformations/RouteSensorInjectRhs.sql delete mode 100644 trainbenchmark-tool-sql/src/main/resources/transformations/RouteSensorRepairRhs.sql delete mode 100644 trainbenchmark-tool-sql/src/main/resources/transformations/SemaphoreNeighborInjectRhs.sql delete mode 100644 trainbenchmark-tool-sql/src/main/resources/transformations/SemaphoreNeighborRepairRhs.sql delete mode 100644 trainbenchmark-tool-sql/src/main/resources/transformations/SwitchMonitoredInjectRhs.sql delete mode 100644 trainbenchmark-tool-sql/src/main/resources/transformations/SwitchMonitoredRepairRhs.sql delete mode 100644 trainbenchmark-tool-sql/src/main/resources/transformations/SwitchSetInjectRhs.sql delete mode 100644 trainbenchmark-tool-sql/src/main/resources/transformations/SwitchSetRepairRhs.sql delete mode 100644 trainbenchmark-tool-sqlite/.gitignore delete mode 100644 trainbenchmark-tool-sqlite/README.md delete mode 100644 trainbenchmark-tool-sqlite/build.gradle delete mode 100644 trainbenchmark-tool-sqlite/src/main/java/hu/bme/mit/trainbenchmark/benchmark/sqlite/SQLiteBenchmarkMain.java delete mode 100644 trainbenchmark-tool-sqlite/src/main/java/hu/bme/mit/trainbenchmark/benchmark/sqlite/SQLiteBenchmarkScenario.java delete mode 100644 trainbenchmark-tool-sqlite/src/main/java/hu/bme/mit/trainbenchmark/benchmark/sqlite/config/SQLiteBenchmarkConfig.java delete mode 100644 trainbenchmark-tool-sqlite/src/main/java/hu/bme/mit/trainbenchmark/benchmark/sqlite/config/SQLiteBenchmarkConfigBuilder.java delete mode 100644 trainbenchmark-tool-sqlite/src/main/java/hu/bme/mit/trainbenchmark/benchmark/sqlite/driver/SQLiteDriver.java delete mode 100644 trainbenchmark-tool-sqlite/src/main/java/hu/bme/mit/trainbenchmark/benchmark/sqlite/driver/SQLiteDriverFactory.java delete mode 100644 trainbenchmark-tool-sqlite/src/main/java/hu/bme/mit/trainbenchmark/benchmark/sqlite/operations/SQLiteModelOperationFactory.java delete mode 100644 trainbenchmark-tool-sqlite/src/main/java/hu/bme/mit/trainbenchmark/benchmark/sqlite/transformation/SQLiteTransformation.java delete mode 100644 trainbenchmark-tool-sqlite/src/main/java/hu/bme/mit/trainbenchmark/benchmark/sqlite/transformations/inject/SQLiteTransformationInjectConnectedSegments.java delete mode 100644 trainbenchmark-tool-sqlite/src/main/java/hu/bme/mit/trainbenchmark/benchmark/sqlite/transformations/inject/SQLiteTransformationInjectRouteSensor.java delete mode 100644 trainbenchmark-tool-sqlite/src/main/java/hu/bme/mit/trainbenchmark/benchmark/sqlite/transformations/repair/SQLiteTransformationRepairConnectedSegments.java delete mode 100644 trainbenchmark-tool-sqlite/src/main/java/hu/bme/mit/trainbenchmark/benchmark/sqlite/transformations/repair/SQLiteTransformationRepairSwitchMonitored.java delete mode 100644 trainbenchmark-tool-sqlite/src/main/resources/transformations/ConnectedSegmentsInjectRhs.sql delete mode 100644 trainbenchmark-tool-sqlite/src/main/resources/transformations/ConnectedSegmentsRepairRhs.sql delete mode 100644 trainbenchmark-tool-sqlite/src/main/resources/transformations/RouteSensorInjectRhs.sql delete mode 100644 trainbenchmark-tool-sqlite/src/main/resources/transformations/SwitchMonitoredRepairRhs.sql delete mode 100644 trainbenchmark-tool-sqlite/src/test/java/hu/bme/mit/trainbenchmark/benchmark/sqlite/test/SQLiteTest.java diff --git a/.gitmodules b/.gitmodules index 19e1e1120..e69de29bb 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,9 +0,0 @@ -[submodule "pracr-scheme"] - path = pracr-scheme - url = git@git-st.inf.tu-dresden.de:rschoene/pracr -[submodule "pracr-python"] - path = pracr-python - url = git@git-st.inf.tu-dresden.de:rschoene/pracr -[submodule "racr-cpp"] - path = racr-cpp - url = git@git-st.inf.tu-dresden.de:rschoene/trainbenchmark-racr-plus-plus diff --git a/pracr-python b/pracr-python deleted file mode 160000 index f15c5bb0f..000000000 --- a/pracr-python +++ /dev/null @@ -1 +0,0 @@ -Subproject commit f15c5bb0f14043c6c0bf06c3c54fbe41f680dcb4 diff --git a/pracr-scheme b/pracr-scheme deleted file mode 160000 index f15c5bb0f..000000000 --- a/pracr-scheme +++ /dev/null @@ -1 +0,0 @@ -Subproject commit f15c5bb0f14043c6c0bf06c3c54fbe41f680dcb4 diff --git a/racr-cpp b/racr-cpp deleted file mode 160000 index 2f4ee264b..000000000 --- a/racr-cpp +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 2f4ee264b5212cafaa9648f5685aa8b36cec0ce6 diff --git a/trainbenchmark-format-graph-neo4j/build.gradle b/trainbenchmark-format-graph-neo4j/build.gradle deleted file mode 100644 index b55740316..000000000 --- a/trainbenchmark-format-graph-neo4j/build.gradle +++ /dev/null @@ -1,12 +0,0 @@ -ext { - apocVersion = '3.2.0.4' - neo4jVersion = '3.2.4' -} - -dependencies { - compile project(':trainbenchmark-config') - compile group: 'org.neo4j', name: 'neo4j-cypher', version: neo4jVersion - compile group: 'org.neo4j', name: 'neo4j-io', version: neo4jVersion - compile group: 'org.neo4j', name: 'neo4j-kernel', version: neo4jVersion - compile group: 'org.neo4j.procedure', name: 'apoc', version: apocVersion -} diff --git a/trainbenchmark-format-graph-neo4j/src/main/java/hu/bme/mit/trainbenchmark/neo4j/Neo4jConstants.java b/trainbenchmark-format-graph-neo4j/src/main/java/hu/bme/mit/trainbenchmark/neo4j/Neo4jConstants.java deleted file mode 100644 index 8ab9aef8f..000000000 --- a/trainbenchmark-format-graph-neo4j/src/main/java/hu/bme/mit/trainbenchmark/neo4j/Neo4jConstants.java +++ /dev/null @@ -1,49 +0,0 @@ - -package hu.bme.mit.trainbenchmark.neo4j; - -import org.neo4j.graphdb.Label; -import org.neo4j.graphdb.RelationshipType; - -import static hu.bme.mit.trainbenchmark.constants.ModelConstants.CONNECTS_TO; -import static hu.bme.mit.trainbenchmark.constants.ModelConstants.ENTRY; -import static hu.bme.mit.trainbenchmark.constants.ModelConstants.EXIT; -import static hu.bme.mit.trainbenchmark.constants.ModelConstants.FOLLOWS; -import static hu.bme.mit.trainbenchmark.constants.ModelConstants.MONITORED_BY; -import static hu.bme.mit.trainbenchmark.constants.ModelConstants.REQUIRES; -import static hu.bme.mit.trainbenchmark.constants.ModelConstants.ROUTE; -import static hu.bme.mit.trainbenchmark.constants.ModelConstants.SEGMENT; -import static hu.bme.mit.trainbenchmark.constants.ModelConstants.SEMAPHORE; -import static hu.bme.mit.trainbenchmark.constants.ModelConstants.SENSOR; -import static hu.bme.mit.trainbenchmark.constants.ModelConstants.SWITCH; -import static hu.bme.mit.trainbenchmark.constants.ModelConstants.SWITCHPOSITION; -import static hu.bme.mit.trainbenchmark.constants.ModelConstants.TARGET; -import static hu.bme.mit.trainbenchmark.constants.ModelConstants.TRACKELEMENT; - -public class Neo4jConstants { - - public static final String QUERY_EXTENSION = "cypher"; - - public static final String CSV_EXTENSION = "csv"; - public static final String GRAPHML_EXTENSION = "graphml"; - - public static final String ID = "id"; - - public static final Label labelRoute = Label.label(ROUTE); - public static final Label labelSegment = Label.label(SEGMENT); - public static final Label labelSemaphore = Label.label(SEMAPHORE); - public static final Label labelSensor = Label.label(SENSOR); - public static final Label labelSwitch = Label.label(SWITCH); - public static final Label labelSwitchPosition = Label.label(SWITCHPOSITION); - public static final Label labelTrackElement = Label.label(TRACKELEMENT); - - public static final RelationshipType relationshipTypeConnectsTo = RelationshipType.withName(CONNECTS_TO); - public static final RelationshipType relationshipTypeEntry = RelationshipType.withName(ENTRY); - public static final RelationshipType relationshipTypeExit = RelationshipType.withName(EXIT); - public static final RelationshipType relationshipTypeFollows = RelationshipType.withName(FOLLOWS); - public static final RelationshipType relationshipTypeRequires = RelationshipType.withName(REQUIRES); - public static final RelationshipType relationshipTypeMonitoredBy = RelationshipType.withName(MONITORED_BY); - public static final RelationshipType relationshipTypeTarget = RelationshipType.withName(TARGET); - - public static final String CYPHER_DIR = "/trainbenchmark-tool-neo4j/src/main/resources/"; - -} diff --git a/trainbenchmark-format-graph-neo4j/src/main/java/hu/bme/mit/trainbenchmark/neo4j/Neo4jHelper.java b/trainbenchmark-format-graph-neo4j/src/main/java/hu/bme/mit/trainbenchmark/neo4j/Neo4jHelper.java deleted file mode 100644 index 96b58a4a0..000000000 --- a/trainbenchmark-format-graph-neo4j/src/main/java/hu/bme/mit/trainbenchmark/neo4j/Neo4jHelper.java +++ /dev/null @@ -1,19 +0,0 @@ -package hu.bme.mit.trainbenchmark.neo4j; - -import org.neo4j.graphdb.GraphDatabaseService; -import org.neo4j.graphdb.factory.GraphDatabaseFactory; - -import java.io.File; - -public class Neo4jHelper { - - public static GraphDatabaseService startGraphDatabase(final File graphDatabaseDirectory) { - final GraphDatabaseService graphDb = new GraphDatabaseFactory() - .newEmbeddedDatabaseBuilder(graphDatabaseDirectory) - .setConfig("apoc.export.file.enabled", "true") - .setConfig("apoc.import.file.enabled", "true") - .newGraphDatabase(); - return graphDb; - } - -} diff --git a/trainbenchmark-format-graph-neo4j/src/main/java/hu/bme/mit/trainbenchmark/neo4j/apoc/ApocHelper.java b/trainbenchmark-format-graph-neo4j/src/main/java/hu/bme/mit/trainbenchmark/neo4j/apoc/ApocHelper.java deleted file mode 100644 index 7a9d37e4c..000000000 --- a/trainbenchmark-format-graph-neo4j/src/main/java/hu/bme/mit/trainbenchmark/neo4j/apoc/ApocHelper.java +++ /dev/null @@ -1,19 +0,0 @@ -package hu.bme.mit.trainbenchmark.neo4j.apoc; - -import org.neo4j.graphdb.GraphDatabaseService; -import org.neo4j.kernel.api.exceptions.KernelException; -import org.neo4j.kernel.impl.proc.Procedures; -import org.neo4j.kernel.internal.GraphDatabaseAPI; - -public class ApocHelper { - - // https://github.com/neo4j-contrib/neo4j-apoc-procedures/blob/a4423863ce77ef51c5d94cdbdc65d8a09172821b/src/test/java/apoc/util/TestUtil.java - public static void registerProcedure(GraphDatabaseService db, Class<?>...procedures) throws KernelException { - Procedures proceduresService = ((GraphDatabaseAPI) db).getDependencyResolver().resolveDependency(Procedures.class); - for (Class<?> procedure : procedures) { - proceduresService.registerProcedure(procedure); - proceduresService.registerFunction(procedure); - } - } - -} diff --git a/trainbenchmark-format-graph-neo4j/src/main/java/hu/bme/mit/trainbenchmark/neo4j/config/Neo4jGraphFormat.java b/trainbenchmark-format-graph-neo4j/src/main/java/hu/bme/mit/trainbenchmark/neo4j/config/Neo4jGraphFormat.java deleted file mode 100644 index f5e008496..000000000 --- a/trainbenchmark-format-graph-neo4j/src/main/java/hu/bme/mit/trainbenchmark/neo4j/config/Neo4jGraphFormat.java +++ /dev/null @@ -1,20 +0,0 @@ -package hu.bme.mit.trainbenchmark.neo4j.config; - -public enum Neo4jGraphFormat { - CSV("CSV"), // - GRAPHML("GraphML"), // - CYPHER("Cypher"), - ; - - private String name; - - Neo4jGraphFormat(final String name) { - this.name = name; - } - - @Override - public String toString() { - return name; - } - -} diff --git a/trainbenchmark-format-rdf/README.md b/trainbenchmark-format-rdf/README.md deleted file mode 100644 index 169a87cb0..000000000 --- a/trainbenchmark-format-rdf/README.md +++ /dev/null @@ -1,16 +0,0 @@ -#### Visualization script - -For visualizing RDF models, you can use the `graphviz` and `rapper` tools: - -```bash -sudo apt-get install -y rapper graphviz -``` - -Usage: - -```bash -MODEL=railway-repair-1 -rapper -i turtle $MODEL.ttl -o dot | dot -Tpdf > $MODEL.pdf -``` - -You may use `fdp`, `neato`, `twopi` or `circo` instead of `dot`. diff --git a/trainbenchmark-format-rdf/build.gradle b/trainbenchmark-format-rdf/build.gradle deleted file mode 100644 index 81b6e75d2..000000000 --- a/trainbenchmark-format-rdf/build.gradle +++ /dev/null @@ -1,3 +0,0 @@ -dependencies { - compile project(':trainbenchmark-tool') -} diff --git a/trainbenchmark-format-rdf/src/main/java/hu/bme/mit/trainbenchmark/rdf/RdfConstants.java b/trainbenchmark-format-rdf/src/main/java/hu/bme/mit/trainbenchmark/rdf/RdfConstants.java deleted file mode 100644 index cc463197d..000000000 --- a/trainbenchmark-format-rdf/src/main/java/hu/bme/mit/trainbenchmark/rdf/RdfConstants.java +++ /dev/null @@ -1,28 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2010-2015, Benedek Izso, Gabor Szarnyas, Istvan Rath and Daniel Varro - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Benedek Izso - initial API and implementation - * Gabor Szarnyas - initial API and implementation - *******************************************************************************/ - -package hu.bme.mit.trainbenchmark.rdf; - -public interface RdfConstants { - - static final String ONTOLOGYIRI = "http://www.semanticweb.org/ontologies/2015/trainbenchmark"; - static final String BASE_PREFIX = ONTOLOGYIRI + "#"; - static final String ID_PREFIX = "_"; - - static final String XSD_PREFIX = "http://www.w3.org/2001/XMLSchema#"; - static final String RDF_PREFIX = "http://www.w3.org/1999/02/22-rdf-syntax-ns#"; - static final String RDF_TYPE = RDF_PREFIX + "type"; - - static final String SPARQL_BASE_PREFIX = "PREFIX base: <" + BASE_PREFIX + "> "; - static final String SPARQL_RDF_PREFIX = "PREFIX rdf: <" + RDF_PREFIX + "> "; - -} \ No newline at end of file diff --git a/trainbenchmark-format-rdf/src/main/java/hu/bme/mit/trainbenchmark/rdf/RdfFormat.java b/trainbenchmark-format-rdf/src/main/java/hu/bme/mit/trainbenchmark/rdf/RdfFormat.java deleted file mode 100644 index 78320bbf6..000000000 --- a/trainbenchmark-format-rdf/src/main/java/hu/bme/mit/trainbenchmark/rdf/RdfFormat.java +++ /dev/null @@ -1,16 +0,0 @@ -package hu.bme.mit.trainbenchmark.rdf; - -public enum RdfFormat { - TURTLE("ttl"), NTRIPLES("nt"); - - private String extension; - - RdfFormat(final String extension) { - this.extension = extension; - } - - public String getExtension() { - return extension; - } - -} diff --git a/trainbenchmark-format-rdf/src/main/java/hu/bme/mit/trainbenchmark/rdf/RdfHelper.java b/trainbenchmark-format-rdf/src/main/java/hu/bme/mit/trainbenchmark/rdf/RdfHelper.java deleted file mode 100644 index 06640a090..000000000 --- a/trainbenchmark-format-rdf/src/main/java/hu/bme/mit/trainbenchmark/rdf/RdfHelper.java +++ /dev/null @@ -1,47 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2010-2015, Benedek Izso, Gabor Szarnyas, Istvan Rath and Daniel Varro - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Benedek Izso - initial API and implementation - * Gabor Szarnyas - initial API and implementation - *******************************************************************************/ - -package hu.bme.mit.trainbenchmark.rdf; - -public class RdfHelper { - - public static String brackets(final String uri) { - return "<" + uri + ">"; - } - - public static long extractId(final String uri) { - final int hashPosition = uri.lastIndexOf("#"); - try { - final String localName = uri.substring(hashPosition + RdfConstants.ID_PREFIX.length() + 1); - return Long.parseLong(localName); - } catch (final NumberFormatException e) { - throw new RuntimeException("Could not extract id from URI: " + uri, e); - } - } - - public static String addEnumPrefix(final Enum<?> e) { - return e.getClass().getSimpleName().toUpperCase() + "_" + e.toString(); - } - - public static String removePrefix(final Class<?> enumClass, final String name) { - return name.replace(enumClass.getSimpleName().toUpperCase() + "_", ""); - } - - public static String getPostfix(final boolean metamodel) { - if (metamodel) { - return "-metamodel.ttl"; - } else { - return "-inferred.ttl"; - } - } - -} diff --git a/trainbenchmark-format-rdf/src/main/resources/metamodel/railway-inferred.nt b/trainbenchmark-format-rdf/src/main/resources/metamodel/railway-inferred.nt deleted file mode 100644 index e69de29bb..000000000 diff --git a/trainbenchmark-format-rdf/src/main/resources/metamodel/railway-inferred.ttl b/trainbenchmark-format-rdf/src/main/resources/metamodel/railway-inferred.ttl deleted file mode 100644 index e32a1532c..000000000 --- a/trainbenchmark-format-rdf/src/main/resources/metamodel/railway-inferred.ttl +++ /dev/null @@ -1,3 +0,0 @@ -@prefix : <http://www.semanticweb.org/ontologies/2015/trainbenchmark#> . -@prefix xsd: <http://www.w3.org/2001/XMLSchema#> . - diff --git a/trainbenchmark-format-rdf/src/main/resources/metamodel/railway-metamodel.ttl b/trainbenchmark-format-rdf/src/main/resources/metamodel/railway-metamodel.ttl deleted file mode 100644 index 85f771f97..000000000 --- a/trainbenchmark-format-rdf/src/main/resources/metamodel/railway-metamodel.ttl +++ /dev/null @@ -1,353 +0,0 @@ -@prefix : <http://www.semanticweb.org/ontologies/2015/trainbenchmark#> . -@prefix owl: <http://www.w3.org/2002/07/owl#> . -@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> . -@prefix xml: <http://www.w3.org/XML/1998/namespace> . -@prefix xsd: <http://www.w3.org/2001/XMLSchema#> . -@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> . -@prefix swrl: <http://www.w3.org/2003/11/swrl#> . -@prefix swrlb: <http://www.w3.org/2003/11/swrlb#> . -@base <http://www.semanticweb.org/ontologies/2015/trainbenchmark#> . - -<http://www.semanticweb.org/ontologies/2015/trainbenchmark#> rdf:type owl:Ontology . - - -################################################################# -# -# Object Properties -# -################################################################# - - -### http://www.semanticweb.org/ontologies/2015/trainbenchmark##connectsTo - -:connectsTo rdf:type owl:ObjectProperty ; - - rdfs:domain :TrackElement ; - - rdfs:range :TrackElement . - - - -### http://www.semanticweb.org/ontologies/2015/trainbenchmark##currentPosition - -:currentPosition rdf:type owl:ObjectProperty ; - - rdfs:range :Position ; - - rdfs:domain :Switch . - - - -### http://www.semanticweb.org/ontologies/2015/trainbenchmark##definedBy - -:definedBy rdf:type owl:ObjectProperty ; - - rdfs:domain :Route ; - - rdfs:range :Sensor . - - - -### http://www.semanticweb.org/ontologies/2015/trainbenchmark##elements - -:elements rdf:type owl:ObjectProperty ; - - rdfs:domain :Sensor ; - - rdfs:range :TrackElement . - - - -### http://www.semanticweb.org/ontologies/2015/trainbenchmark##entry - -:entry rdf:type owl:ObjectProperty ; - - rdfs:domain :Route ; - - rdfs:range :Semaphore . - - - -### http://www.semanticweb.org/ontologies/2015/trainbenchmark##exit - -:exit rdf:type owl:ObjectProperty ; - - rdfs:domain :Route ; - - rdfs:range :Semaphore . - - - -### http://www.semanticweb.org/ontologies/2015/trainbenchmark##follows - -:follows rdf:type owl:ObjectProperty ; - - rdfs:domain :Route ; - - rdfs:range :SwitchPosition ; - - owl:inverseOf :route . - - - -### http://www.semanticweb.org/ontologies/2015/trainbenchmark##position - -:position rdf:type owl:ObjectProperty ; - - rdfs:range :Position ; - - rdfs:domain :SwitchPosition . - - - -### http://www.semanticweb.org/ontologies/2015/trainbenchmark##positions - -:positions rdf:type owl:ObjectProperty ; - - rdfs:domain :Switch ; - - rdfs:range :SwitchPosition . - - - -### http://www.semanticweb.org/ontologies/2015/trainbenchmark##route - -:route rdf:type owl:ObjectProperty ; - - rdfs:range :Route ; - - rdfs:domain :SwitchPosition . - - - -### http://www.semanticweb.org/ontologies/2015/trainbenchmark##sensor - -:sensor rdf:type owl:ObjectProperty ; - - rdfs:range :Sensor ; - - rdfs:domain :TrackElement ; - - owl:inverseOf :elements . - - - -### http://www.semanticweb.org/ontologies/2015/trainbenchmark##signal - -:signal rdf:type owl:ObjectProperty ; - - rdfs:domain :Semaphore ; - - rdfs:range :SignalState . - - - -### http://www.semanticweb.org/ontologies/2015/trainbenchmark##switch - -:switch rdf:type owl:ObjectProperty ; - - rdfs:range :Switch ; - - rdfs:domain :SwitchPosition ; - - owl:inverseOf :positions . - - - - - -################################################################# -# -# Data properties -# -################################################################# - - -### http://www.semanticweb.org/ontologies/2015/trainbenchmark##length - -:length rdf:type owl:DatatypeProperty ; - - rdfs:domain :Segment ; - - rdfs:range xsd:int . - - - - - -################################################################# -# -# Classes -# -################################################################# - - -### http://www.semanticweb.org/ontologies/2015/trainbenchmark##Position - -:Position rdf:type owl:Class ; - - owl:equivalentClass [ rdf:type owl:Class ; - owl:oneOf ( :POSITION_STRAIGHT - :POSITION_LEFT - :POSITION_FAILURE - :POSITION_RIGHT - ) - ] . - - - -### http://www.semanticweb.org/ontologies/2015/trainbenchmark##Route - -:Route rdf:type owl:Class ; - - rdfs:subClassOf [ rdf:type owl:Restriction ; - owl:onProperty :entry ; - owl:cardinality "1"^^xsd:nonNegativeInteger - ] , - [ rdf:type owl:Restriction ; - owl:onProperty :exit ; - owl:cardinality "1"^^xsd:nonNegativeInteger - ] , - [ rdf:type owl:Restriction ; - owl:onProperty :definedBy ; - owl:minCardinality "2"^^xsd:nonNegativeInteger - ] . - - - -### http://www.semanticweb.org/ontologies/2015/trainbenchmark##Segment - -:Segment rdf:type owl:Class ; - - rdfs:subClassOf :TrackElement , - [ rdf:type owl:Restriction ; - owl:onProperty :length ; - owl:cardinality "1"^^xsd:nonNegativeInteger - ] . - - - -### http://www.semanticweb.org/ontologies/2015/trainbenchmark##Semaphore - -:Semaphore rdf:type owl:Class ; - - rdfs:subClassOf [ rdf:type owl:Restriction ; - owl:onProperty :signal ; - owl:cardinality "1"^^xsd:nonNegativeInteger - ] . - - - -### http://www.semanticweb.org/ontologies/2015/trainbenchmark##Sensor - -:Sensor rdf:type owl:Class . - - - -### http://www.semanticweb.org/ontologies/2015/trainbenchmark##SignalState - -:SignalState rdf:type owl:Class ; - - owl:equivalentClass [ rdf:type owl:Class ; - owl:oneOf ( :SIGNAL_FAILURE - :SIGNAL_GO - :SIGNAL_STOP - ) - ] . - - - -### http://www.semanticweb.org/ontologies/2015/trainbenchmark##Switch - -:Switch rdf:type owl:Class ; - - rdfs:subClassOf :TrackElement , - [ rdf:type owl:Restriction ; - owl:onProperty :currentPosition ; - owl:cardinality "1"^^xsd:nonNegativeInteger - ] . - - - -### http://www.semanticweb.org/ontologies/2015/trainbenchmark##SwitchPosition - -:SwitchPosition rdf:type owl:Class ; - - rdfs:subClassOf [ rdf:type owl:Restriction ; - owl:onProperty :position ; - owl:cardinality "1"^^xsd:nonNegativeInteger - ] , - [ rdf:type owl:Restriction ; - owl:onProperty :switch ; - owl:cardinality "1"^^xsd:nonNegativeInteger - ] . - - - -### http://www.semanticweb.org/ontologies/2015/trainbenchmark##TrackElement - -:TrackElement rdf:type owl:Class . - - - - - -################################################################# -# -# Individuals -# -################################################################# - - -### http://www.semanticweb.org/ontologies/2015/trainbenchmark##POSITION_FAILURE - -:POSITION_FAILURE rdf:type :Position , - owl:NamedIndividual . - - - -### http://www.semanticweb.org/ontologies/2015/trainbenchmark##POSITION_LEFT - -:POSITION_LEFT rdf:type :Position , - owl:NamedIndividual . - - - -### http://www.semanticweb.org/ontologies/2015/trainbenchmark##POSITION_RIGHT - -:POSITION_RIGHT rdf:type :Position , - owl:NamedIndividual . - - - -### http://www.semanticweb.org/ontologies/2015/trainbenchmark##POSITION_STRAIGHT - -:POSITION_STRAIGHT rdf:type :Position , - owl:NamedIndividual . - - - -### http://www.semanticweb.org/ontologies/2015/trainbenchmark##SIGNAL_FAILURE - -:SIGNAL_FAILURE rdf:type :SignalState , - owl:NamedIndividual . - - - -### http://www.semanticweb.org/ontologies/2015/trainbenchmark##SIGNAL_GO - -:SIGNAL_GO rdf:type :SignalState , - owl:NamedIndividual . - - - -### http://www.semanticweb.org/ontologies/2015/trainbenchmark##SIGNAL_STOP - -:SIGNAL_STOP rdf:type :SignalState , - owl:NamedIndividual . - - - - -### Generated by the OWL API (version 3.5.1) http://owlapi.sourceforge.net - diff --git a/trainbenchmark-format-sql/build.gradle b/trainbenchmark-format-sql/build.gradle deleted file mode 100644 index 81b6e75d2..000000000 --- a/trainbenchmark-format-sql/build.gradle +++ /dev/null @@ -1,3 +0,0 @@ -dependencies { - compile project(':trainbenchmark-tool') -} diff --git a/trainbenchmark-format-sql/scripts/README.md b/trainbenchmark-format-sql/scripts/README.md deleted file mode 100644 index d57070447..000000000 --- a/trainbenchmark-format-sql/scripts/README.md +++ /dev/null @@ -1 +0,0 @@ -The `mysql2sqlite.sh` script is distributed under the MIT license. Source: https://github.com/dumblob/mysql2sqlite diff --git a/trainbenchmark-format-sql/scripts/clean-mysql.sh b/trainbenchmark-format-sql/scripts/clean-mysql.sh deleted file mode 100755 index 5a7f4c7cf..000000000 --- a/trainbenchmark-format-sql/scripts/clean-mysql.sh +++ /dev/null @@ -1,4 +0,0 @@ -#!/bin/bash - -sudo rm -rf /var/lib/mysql/trainbenchmark -#echo "MySQL cleaned" diff --git a/trainbenchmark-format-sql/scripts/mysql2sqlite.sh b/trainbenchmark-format-sql/scripts/mysql2sqlite.sh deleted file mode 100755 index f2cb717a4..000000000 --- a/trainbenchmark-format-sql/scripts/mysql2sqlite.sh +++ /dev/null @@ -1,185 +0,0 @@ -#!/bin/sh - -# Authors: @esperlu, @artemyk, @gkuenning, @dumblob - -[ $# -eq 1 ] || { - printf '%s\n%s\n' \ - 'USAGE: mysql2sqlite.sh dump_mysql.sql > dump_sqlite3.sql' \ - " file name - (dash) is not supported, because - means stdin" >&2 - exit -} - -awk ' -BEGIN { - FS=",$" - print "PRAGMA synchronous = OFF;" - print "PRAGMA journal_mode = MEMORY;" - print "BEGIN TRANSACTION;" -} - -# CREATE TRIGGER statements have funny commenting. Remember we are in trigger. -/^\/\*.*(CREATE.*TRIGGER|create.*trigger)/ { - gsub( /^.*(TRIGGER|trigger)/, "CREATE TRIGGER" ) - print - inTrigger = 1 - next -} -# The end of CREATE TRIGGER has a stray comment terminator -/(END|end) \*\/;;/ { gsub( /\*\//, "" ); print; inTrigger = 0; next } -# The rest of triggers just get passed through -inTrigger != 0 { print; next } - -# CREATE VIEW looks like a TABLE in comments -/^\/\*.*(CREATE.*TABLE|create.*table)/ { - inView = 1 - next -} -# The end of CREATE VIEW -/^(\).*(ENGINE|engine).*\*\/;)/ { - inView = 0; - next -} -# The rest of view just get passed through -inView != 0 { next } - -# Skip other comments -/^\/\*/ { next } - -# Print all `INSERT` lines. The single quotes are protected by another single quote. -( /^ *\(/ && /\) *[,;] *$/ ) || /^(INSERT|insert)/ { - prev = ""; - gsub( /\\\047/, "\047\047" ) # single quote - gsub( /\\\047\047,/, "\\\047," ) - gsub( /\\n/, "\n" ) - gsub( /\\r/, "\r" ) - gsub( /\\"/, "\"" ) - gsub( /\\\\/, "\\" ) - gsub( /\\\032/, "\032" ) # substitute - # sqlite3 is limited to 16 significant digits of precision - while ( match( $0, /0x[0-9a-fA-F]{17}/ ) ) { - hexIssue = 1 - sub( /0x[0-9a-fA-F]+/, substr( $0, RSTART, RLENGTH-1 ), $0 ) - } - print - next -} - -# CREATE DATABASE is not supported -/^(CREATE.*DATABASE|create.*database)/ { next } - -# Print the `CREATE` line as is and capture the table name. -/^(CREATE|create)/ { - if ( $0 ~ /IF NOT EXISTS|if not exists/ || $0 ~ /TEMPORARY|temporary/ ){ - caseIssue = 1 - } - if ( match( $0, /`[^`]+/ ) ) { - tableName = substr( $0, RSTART+1, RLENGTH-1 ) - } - aInc = 0 - prev = "" - firstInTable = 1 - print - next -} - -# Replace `FULLTEXT KEY` (probably other `XXXXX KEY`) -/^ (FULLTEXT KEY|fulltext key)/ { gsub( /.+(KEY|key)/, " KEY" ) } - -# Get rid of field lengths in KEY lines -/ (PRIMARY |primary )?(KEY|key)/ { gsub( /\([0-9]+\)/, "" ) } - -aInc == 1 && /PRIMARY KEY|primary key/ { next } - -# Replace COLLATE xxx_xxxx_xx statements with COLLATE BINARY -/ (COLLATE|collate) [a-z0-9_]*/ { gsub( /(COLLATE|collate) [a-z0-9_]*/, "COLLATE BINARY" ) } - -# Print all fields definition lines except the `KEY` lines. -/^ / && !/^( (KEY|key)|\);)/ { - if ( match( $0, /[^"`]AUTO_INCREMENT|auto_increment[^"`]/)) { - aInc = 1; - gsub( /AUTO_INCREMENT|auto_increment/, "PRIMARY KEY AUTOINCREMENT" ) - } - gsub( /(UNIQUE KEY|unique key) `.*` /, "UNIQUE " ) - gsub( /(CHARACTER SET|character set) [^ ]+ /, "" ) - gsub( /DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP|default current_timestamp on update current_timestamp/, "" ) - gsub( /(COLLATE|collate) [^ ]+ /, "" ) - gsub( /(ENUM|enum)[^)]+\)/, "text " ) - gsub( /(SET|set)\([^)]+\)/, "text " ) - gsub( /UNSIGNED|unsigned/, "" ) - gsub( /` [^ ]*(INT|int)[^ ]*/, "` integer" ) - # field comments are not supported - gsub( / (COMMENT|comment).+$/, "" ) - # Get commas off end of line - gsub( /,.?$/, "") - if ( prev ){ - if ( firstInTable ){ - print prev - firstInTable = 0 - } - else print "," prev - } - else { - # FIXME check if this is correct in all cases - if ( match( $1, - /(CONSTRAINT|constraint) \".*\" (FOREIGN KEY|foreign key)/ ) ) - print "," - } - prev = $1 -} - -/ ENGINE| engine/ { - if (prev) { - if (firstInTable) { - print prev - firstInTable = 0 - } - else print "," prev - # else print prev - } - prev="" - print ");" - next -} -# `KEY` lines are extracted from the `CREATE` block and stored in array for later print -# in a separate `CREATE KEY` command. The index name is prefixed by the table name to -# avoid a sqlite error for duplicate index name. -/^( (KEY|key)|\);)/ { - if (prev) { - if (firstInTable) { - print prev - firstInTable = 0 - } - else print "," prev - # else print prev - } - prev = "" - if ($0 == ");"){ - print - } else { - if ( match( $0, /`[^`]+/ ) ) { - indexName = substr( $0, RSTART+1, RLENGTH-1 ) - } - if ( match( $0, /\([^()]+/ ) ) { - indexKey = substr( $0, RSTART+1, RLENGTH-1 ) - } - # idx_ prefix to avoid name clashes (they really happen!) - key[tableName]=key[tableName] "CREATE INDEX \"idx_" tableName "_" indexName "\" ON \"" tableName "\" (" indexKey ");\n" - } -} - -END { - # print all `KEY` creation lines. - for (table in key) printf key[table] - - print "END TRANSACTION;" - - if ( hexIssue ){ - print "WARN Hexadecimal numbers longer than 16 characters has been trimmed." | "cat >&2" - } - if ( caseIssue ){ - print "WARN Pure sqlite identifiers are case insensitive (even if quoted\n" \ - " or if ASCII) and doesnt cross-check TABLE and TEMPORARY TABLE\n" \ - " identifiers. Thus expect errors like \"table T has no column named F\"." | "cat >&2" - } -} -' "$1" diff --git a/trainbenchmark-format-sql/scripts/start-mysql.sh b/trainbenchmark-format-sql/scripts/start-mysql.sh deleted file mode 100755 index b4e672bb9..000000000 --- a/trainbenchmark-format-sql/scripts/start-mysql.sh +++ /dev/null @@ -1,5 +0,0 @@ -#!/bin/bash - -sudo service mysql start -echo "SET GLOBAL max_heap_table_size=1073741824;" | mysql -u root -#echo "MySQL started" diff --git a/trainbenchmark-format-sql/scripts/stop-mysql.sh b/trainbenchmark-format-sql/scripts/stop-mysql.sh deleted file mode 100755 index 0091c3226..000000000 --- a/trainbenchmark-format-sql/scripts/stop-mysql.sh +++ /dev/null @@ -1,4 +0,0 @@ -#!/bin/bash - -sudo service mysql stop -#echo "MySQL stopped" diff --git a/trainbenchmark-format-sql/src/main/java/hu/bme/mit/trainbenchmark/sql/constants/SqlConstants.java b/trainbenchmark-format-sql/src/main/java/hu/bme/mit/trainbenchmark/sql/constants/SqlConstants.java deleted file mode 100644 index d18d6178a..000000000 --- a/trainbenchmark-format-sql/src/main/java/hu/bme/mit/trainbenchmark/sql/constants/SqlConstants.java +++ /dev/null @@ -1,26 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2010-2015, Benedek Izso, Gabor Szarnyas, Istvan Rath and Daniel Varro - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Benedek Izso - initial API and implementation - * Gabor Szarnyas - initial API and implementation - *******************************************************************************/ -package hu.bme.mit.trainbenchmark.sql.constants; - -public class SqlConstants { - - public static final String ID_POSTFIX = "_id"; - public static final String USER = "root"; - public static final String PASSWORD = ""; - - public static final String CONNECTSTO_TRACKELEMENT1 = "TrackElement1"; - public static final String CONNECTSTO_TRACKELEMENT2 = "TrackElement2"; - - public static final String ROUTE_ID = "Route_id"; - public static final String SENSOR_ID = "Sensor_id"; - -} diff --git a/trainbenchmark-format-sql/src/main/java/hu/bme/mit/trainbenchmark/sql/process/MySqlProcess.java b/trainbenchmark-format-sql/src/main/java/hu/bme/mit/trainbenchmark/sql/process/MySqlProcess.java deleted file mode 100644 index 6930d3df6..000000000 --- a/trainbenchmark-format-sql/src/main/java/hu/bme/mit/trainbenchmark/sql/process/MySqlProcess.java +++ /dev/null @@ -1,75 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2010-2015, Benedek Izso, Gabor Szarnyas, Istvan Rath and Daniel Varro - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Benedek Izso - initial API and implementation - * Gabor Szarnyas - initial API and implementation - *******************************************************************************/ - -package hu.bme.mit.trainbenchmark.sql.process; - -import java.io.IOException; -import java.io.InputStream; - -import org.apache.commons.exec.CommandLine; -import org.apache.commons.exec.DefaultExecutor; -import org.apache.commons.exec.ExecuteException; -import org.apache.commons.exec.Executor; - -public class MySqlProcess { - - // It is generally considered good practice to use Apache Commmons Exec. - // However, it does not work with MySQL start/stop properly, with frequent - // hangs. Therefore, we recommend using the simple ProcessBuilder instead. - - private static final String SCRIPT_DIRECTORY = "../trainbenchmark-format-sql/scripts/"; - - private static String getInputAsString(final InputStream is) { - try (java.util.Scanner s = new java.util.Scanner(is)) { - return s.useDelimiter("\\A").hasNext() ? s.next() : ""; - } - } - - public static void stopServer() throws ExecuteException, IOException, InterruptedException { - run(new String[] { SCRIPT_DIRECTORY + "stop-mysql.sh" }); - } - - public static void cleanServer() throws ExecuteException, IOException, InterruptedException { - runScript(SCRIPT_DIRECTORY + "clean-mysql.sh"); - } - - public static void startServer() throws ExecuteException, IOException, InterruptedException { - run(new String[] { SCRIPT_DIRECTORY + "start-mysql.sh" }); - } - - public static void run(final String command[]) throws IOException, InterruptedException { - final ProcessBuilder pb = new ProcessBuilder(command); - final Process p = pb.start(); - p.waitFor(); - - final String stdOut = getInputAsString(p.getInputStream()); - final String stdErr = getInputAsString(p.getErrorStream()); - // System.out.println(stdOut); - // System.out.println(stdErr); - } - - public static void runShell(final String shellCommand) throws ExecuteException, IOException { - final Executor executor = new DefaultExecutor(); - final CommandLine commandLine = new CommandLine("/bin/bash"); - commandLine.addArgument("-c"); - commandLine.addArgument(shellCommand, false); - executor.execute(commandLine); - } - - public static void runScript(final String scriptFile) throws ExecuteException, IOException { - final Executor executor = new DefaultExecutor(); - final CommandLine commandLine = new CommandLine("/bin/bash"); - commandLine.addArgument(scriptFile, false); - executor.execute(commandLine); - } - -} diff --git a/trainbenchmark-format-sql/src/main/resources/metamodel/railway-footer.sql b/trainbenchmark-format-sql/src/main/resources/metamodel/railway-footer.sql deleted file mode 100644 index 6926c26a3..000000000 --- a/trainbenchmark-format-sql/src/main/resources/metamodel/railway-footer.sql +++ /dev/null @@ -1,8 +0,0 @@ - -COMMIT; -CREATE INDEX segment_length_idx ON "Segment" ("length"); -CREATE INDEX route_active_idx ON "Route" ("active"); -CREATE INDEX semaphore_signal_idx ON "Semaphore" ("signal"); -CREATE INDEX monitoredBy_idx ON "monitoredBy" ("Sensor_id", "TrackElement_id"); -CREATE INDEX connectsTo_idx1 ON "connectsTo" ("TrackElement1_id"); -CREATE INDEX connectsTo_idx2 ON "connectsTo" ("TrackElement2_id"); diff --git a/trainbenchmark-format-sql/src/main/resources/metamodel/railway-header.sql b/trainbenchmark-format-sql/src/main/resources/metamodel/railway-header.sql deleted file mode 100644 index 635185af4..000000000 --- a/trainbenchmark-format-sql/src/main/resources/metamodel/railway-header.sql +++ /dev/null @@ -1,92 +0,0 @@ -SET SESSION sql_mode = 'ANSI_QUOTES'; --- --- Database: "trainbenchmark" --- - --- 512 Mb -SET max_heap_table_size=536870912; - -DROP DATABASE IF EXISTS "trainbenchmark"; -CREATE DATABASE "trainbenchmark"; -USE "trainbenchmark"; - -START TRANSACTION; --- -------------------------------------------------------- - --- --- Nodes --- - -CREATE TABLE IF NOT EXISTS "Route" ( - "id" int NOT NULL AUTO_INCREMENT, - "active" int, - "entry" int, - "exit" int, - PRIMARY KEY ("id") -) DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ENGINE=MEMORY; - -CREATE TABLE IF NOT EXISTS "Region" ( - "id" int NOT NULL AUTO_INCREMENT, - PRIMARY KEY ("id") -) DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ENGINE=MEMORY; - -CREATE TABLE IF NOT EXISTS "Segment" ( - "id" int NOT NULL AUTO_INCREMENT, - "length" int NOT NULL DEFAULT 1, - PRIMARY KEY ("id") -) DEFAULT CHARSET=utf8 ENGINE=MEMORY; - -CREATE TABLE IF NOT EXISTS "Sensor" ( - "id" int NOT NULL AUTO_INCREMENT, - "region" int NOT NULL, -- inverse of the "sensors" edge - PRIMARY KEY ("id") -) DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ENGINE=MEMORY; - -CREATE TABLE IF NOT EXISTS "Semaphore" ( - "id" int NOT NULL AUTO_INCREMENT, - "segment" int NOT NULL, -- inverse of the "semaphores" edge - "signal" int NOT NULL, - PRIMARY KEY ("id") -) DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ENGINE=MEMORY; - -CREATE TABLE IF NOT EXISTS "Switch" ( - "id" int NOT NULL AUTO_INCREMENT, - "currentPosition" int NOT NULL, - PRIMARY KEY ("id") -) DEFAULT CHARSET=utf8 ENGINE=MEMORY; - -CREATE TABLE IF NOT EXISTS "SwitchPosition" ( - "id" int NOT NULL AUTO_INCREMENT, - "route" int, -- inverse of the "follows" edge - "target" int, - "position" int NOT NULL, - PRIMARY KEY ("id") -) DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ENGINE=MEMORY; - -CREATE TABLE IF NOT EXISTS "TrackElement" ( - "id" int NOT NULL AUTO_INCREMENT, - "region" int NOT NULL, -- inverse of the "elements" edge - PRIMARY KEY ("id") -) DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ENGINE=MEMORY; - --- --- Edges --- - -CREATE TABLE IF NOT EXISTS "connectsTo" ( - "TrackElement1_id" int NOT NULL, - "TrackElement2_id" int NOT NULL, - PRIMARY KEY ("TrackElement1_id", "TrackElement2_id") -) DEFAULT CHARSET=utf8 ENGINE=MEMORY; - -CREATE TABLE IF NOT EXISTS "monitoredBy" ( - "TrackElement_id" int NOT NULL, - "Sensor_id" int NOT NULL, - PRIMARY KEY ("TrackElement_id", "Sensor_id") -) DEFAULT CHARSET=utf8 ENGINE=MEMORY; - -CREATE TABLE IF NOT EXISTS "requires" ( - "Route_id" int NOT NULL, - "Sensor_id" int NOT NULL, - PRIMARY KEY ("Route_id", "Sensor_id") -) DEFAULT CHARSET=utf8 ENGINE=MEMORY; diff --git a/trainbenchmark-generator-graph-cypher/build.gradle b/trainbenchmark-generator-graph-cypher/build.gradle deleted file mode 100644 index bbeac31d8..000000000 --- a/trainbenchmark-generator-graph-cypher/build.gradle +++ /dev/null @@ -1,15 +0,0 @@ -plugins { - id "com.github.johnrengelman.shadow" version "1.2.3" -} - -shadowJar { - classifier = 'fat' - manifest { - attributes 'Main-Class': 'hu.bme.mit.trainbenchmark.generator.cypher.CypherGeneratorMain' - } -} - -dependencies { - compile project(':trainbenchmark-generator') - //compile project(':trainbenchmark-format-graph-neo4j') -} diff --git a/trainbenchmark-generator-graph-cypher/src/main/java/hu/bme/mit/trainbenchmark/generator/cypher/CypherGeneratorMain.java b/trainbenchmark-generator-graph-cypher/src/main/java/hu/bme/mit/trainbenchmark/generator/cypher/CypherGeneratorMain.java deleted file mode 100644 index f8dc985cb..000000000 --- a/trainbenchmark-generator-graph-cypher/src/main/java/hu/bme/mit/trainbenchmark/generator/cypher/CypherGeneratorMain.java +++ /dev/null @@ -1,29 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2010-2015, Benedek Izso, Gabor Szarnyas, Istvan Rath and Daniel Varro - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Benedek Izso - initial API and implementation - * Gabor Szarnyas - initial API and implementation - *******************************************************************************/ - -package hu.bme.mit.trainbenchmark.generator.cypher; - -import hu.bme.mit.trainbenchmark.generator.ModelGenerator; -import hu.bme.mit.trainbenchmark.generator.ScalableGeneratorFactory; -import hu.bme.mit.trainbenchmark.generator.config.GeneratorConfig; -import hu.bme.mit.trainbenchmark.generator.cypher.config.CypherGeneratorConfig; - -public class CypherGeneratorMain { - - public static void main(final String[] args) throws Exception { - final CypherGeneratorConfig gc = GeneratorConfig.fromFile(args[0], CypherGeneratorConfig.class); - final CypherSerializer cypherSerializer = new CypherSerializer(gc); - final ModelGenerator generator = ScalableGeneratorFactory.createGenerator(cypherSerializer, gc); - generator.generateModel(); - } - -} diff --git a/trainbenchmark-generator-graph-cypher/src/main/java/hu/bme/mit/trainbenchmark/generator/cypher/CypherSerializer.java b/trainbenchmark-generator-graph-cypher/src/main/java/hu/bme/mit/trainbenchmark/generator/cypher/CypherSerializer.java deleted file mode 100644 index af49b6cc7..000000000 --- a/trainbenchmark-generator-graph-cypher/src/main/java/hu/bme/mit/trainbenchmark/generator/cypher/CypherSerializer.java +++ /dev/null @@ -1,124 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2010-2015, Benedek Izso, Gabor Szarnyas, Istvan Rath and Daniel Varro - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Benedek Izso - initial API and implementation - * Gabor Szarnyas - initial API and implementation - *******************************************************************************/ - -package hu.bme.mit.trainbenchmark.generator.cypher; - -import hu.bme.mit.trainbenchmark.generator.ModelSerializer; -import hu.bme.mit.trainbenchmark.generator.cypher.config.CypherGeneratorConfig; - -import java.io.BufferedWriter; -import java.io.File; -import java.io.FileWriter; -import java.io.IOException; -import java.util.Map; -import java.util.Map.Entry; -import java.util.stream.Collectors; - -import static hu.bme.mit.trainbenchmark.constants.ModelConstants.SUPERTYPES; - -public class CypherSerializer extends ModelSerializer<CypherGeneratorConfig> { - - protected BufferedWriter writer; - - public CypherSerializer(final CypherGeneratorConfig gc) { - super(gc); - } - - @Override - public String syntax() { - return "Cypher"; - } - - public void write(final String s) throws IOException { - writer.write(s + "\n"); - } - - @Override - public void initModel() throws IOException { - final String cypherPath = gc.getConfigBase().getModelPathWithoutExtension() + ".cypher"; - final File cypherFile = new File(cypherPath); - writer = new BufferedWriter(new FileWriter(cypherFile)); - } - - @Override - public void persistModel() throws IOException, InterruptedException { - writer.close(); - } - - @Override - public Object createVertex(final int id, final String type, final Map<String, ? extends Object> attributes, final Map<String, Object> outgoingEdges, - final Map<String, Object> incomingEdges) throws IOException { - - StringBuilder query = new StringBuilder("CREATE (node"); - - //If we have supertypes, we add them first - if (SUPERTYPES.containsKey(type)){ - final String ancestorType = SUPERTYPES.get(type); - query.append(":" + ancestorType); - } - - //Then we add the type - query.append(":" + type); - - //Setting the attributes - query.append(" {id: " + id); - if (!attributes.isEmpty()){ - query.append(", "); - query.append( - attributes.entrySet().stream().map( - e -> (e.getKey() + ": " + valueToString(e.getValue())) - ).collect(Collectors.joining(", ")) - ); - } - query.append("});"); - - write(query.toString()); - - //Adding relationships - for(Entry<String, Object> entry : outgoingEdges.entrySet()) { - write("MATCH (from {id: " + id + "}), (to {id: " + entry.getValue() + "}) CREATE (from)-[:" + entry.getKey() + "]->(to);"); - } - - for (Entry<String, Object> entry : incomingEdges.entrySet()) { - write("MATCH (from {id: " + entry.getValue() + "}), (to {id: " + id + "}) CREATE (from)-[:" + entry.getKey() + "]->(to);"); - } - - return id; - } - - @Override - public void createEdge(final String label, final Object from, final Object to) throws IOException { - if (from == null || to == null) { - return; - } - - write("MATCH (from {id: " + from + "}), (to {id: " + to + "}) CREATE (from)-[:" + label + "]->(to);"); - } - - @Override - public void setAttribute(final String type, final Object node, final String key, final Object value) throws IOException { - final String stringValue = valueToString(value); - - write("MATCH (node:" + type + " {id: " + node + "}) SET node." + key + "=" + stringValue + ";"); - } - - private String valueToString(final Object value) { - if (value.toString().equals("true") || value.toString().equals("false")) return value.toString(); - try { - Integer.parseInt(value.toString()); - return value.toString(); - } catch (NumberFormatException e){ - return "'" + value + "'"; - } - } - -} diff --git a/trainbenchmark-generator-graph-cypher/src/main/java/hu/bme/mit/trainbenchmark/generator/cypher/config/CypherFormat.java b/trainbenchmark-generator-graph-cypher/src/main/java/hu/bme/mit/trainbenchmark/generator/cypher/config/CypherFormat.java deleted file mode 100644 index e3155ce39..000000000 --- a/trainbenchmark-generator-graph-cypher/src/main/java/hu/bme/mit/trainbenchmark/generator/cypher/config/CypherFormat.java +++ /dev/null @@ -1,19 +0,0 @@ -package hu.bme.mit.trainbenchmark.generator.cypher.config; - -public enum CypherFormat { - BASIC("Basic"), // - GRAPHFLOW("Graphflow"), // - ; - - private String name; - - CypherFormat(final String name) { - this.name = name; - } - - @Override - public String toString() { - return name; - } - -} diff --git a/trainbenchmark-generator-graph-cypher/src/main/java/hu/bme/mit/trainbenchmark/generator/cypher/config/CypherGeneratorConfig.java b/trainbenchmark-generator-graph-cypher/src/main/java/hu/bme/mit/trainbenchmark/generator/cypher/config/CypherGeneratorConfig.java deleted file mode 100644 index d8b9604c6..000000000 --- a/trainbenchmark-generator-graph-cypher/src/main/java/hu/bme/mit/trainbenchmark/generator/cypher/config/CypherGeneratorConfig.java +++ /dev/null @@ -1,36 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2010-2015, Benedek Izso, Gabor Szarnyas, Istvan Rath and Daniel Varro - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Benedek Izso - initial API and implementation - * Gabor Szarnyas - initial API and implementation - *******************************************************************************/ - -package hu.bme.mit.trainbenchmark.generator.cypher.config; - -import hu.bme.mit.trainbenchmark.generator.config.GeneratorConfig; -import hu.bme.mit.trainbenchmark.generator.config.GeneratorConfigBase; - -public class CypherGeneratorConfig extends GeneratorConfig { - - protected CypherFormat cypherFormat; - - protected CypherGeneratorConfig(final GeneratorConfigBase configBase, final CypherFormat cypherFormat) { - super(configBase); - this.cypherFormat = cypherFormat; - } - - public CypherFormat getCypherFormat() { - return cypherFormat; - } - - @Override - public String getProjectName() { - return "graph-cypher"; - } - -} diff --git a/trainbenchmark-generator-graph-cypher/src/main/java/hu/bme/mit/trainbenchmark/generator/cypher/config/CypherGeneratorConfigBuilder.java b/trainbenchmark-generator-graph-cypher/src/main/java/hu/bme/mit/trainbenchmark/generator/cypher/config/CypherGeneratorConfigBuilder.java deleted file mode 100644 index c33b80f3e..000000000 --- a/trainbenchmark-generator-graph-cypher/src/main/java/hu/bme/mit/trainbenchmark/generator/cypher/config/CypherGeneratorConfigBuilder.java +++ /dev/null @@ -1,38 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2010-2015, Benedek Izso, Gabor Szarnyas, Istvan Rath and Daniel Varro - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Benedek Izso - initial API and implementation - * Gabor Szarnyas - initial API and implementation - *******************************************************************************/ - -package hu.bme.mit.trainbenchmark.generator.cypher.config; - -import com.google.common.base.Preconditions; -import hu.bme.mit.trainbenchmark.generator.config.GeneratorConfigBuilder; - -public class CypherGeneratorConfigBuilder extends GeneratorConfigBuilder<CypherGeneratorConfig, CypherGeneratorConfigBuilder> { - - protected CypherFormat cypherFormat; - - public CypherGeneratorConfigBuilder setGraphFormat(CypherFormat cypherFormat) { - this.cypherFormat = cypherFormat; - return this; - } - - @Override - public CypherGeneratorConfig createConfig() { - return new CypherGeneratorConfig(configBase, cypherFormat); - } - - @Override - public void checkNotNulls() { - super.checkNotNulls(); - Preconditions.checkNotNull(cypherFormat); - } - -} diff --git a/trainbenchmark-generator-graph-cypher/src/main/resources/.gitignore b/trainbenchmark-generator-graph-cypher/src/main/resources/.gitignore deleted file mode 100644 index e69de29bb..000000000 diff --git a/trainbenchmark-generator-graph-cypher/src/test/java/hu/bme/mit/trainbenchmark/generator/cypher/CypherGeneratorTest.java b/trainbenchmark-generator-graph-cypher/src/test/java/hu/bme/mit/trainbenchmark/generator/cypher/CypherGeneratorTest.java deleted file mode 100644 index 54b0a5036..000000000 --- a/trainbenchmark-generator-graph-cypher/src/test/java/hu/bme/mit/trainbenchmark/generator/cypher/CypherGeneratorTest.java +++ /dev/null @@ -1,31 +0,0 @@ -package hu.bme.mit.trainbenchmark.generator.cypher; - -import com.google.common.collect.ImmutableList; -import hu.bme.mit.trainbenchmark.generator.ModelGenerator; -import hu.bme.mit.trainbenchmark.generator.ScalableGeneratorFactory; -import hu.bme.mit.trainbenchmark.generator.cypher.config.CypherFormat; -import hu.bme.mit.trainbenchmark.generator.config.GeneratorConfigBase; -import hu.bme.mit.trainbenchmark.generator.cypher.config.CypherGeneratorConfig; -import hu.bme.mit.trainbenchmark.generator.cypher.config.CypherGeneratorConfigBuilder; -import hu.bme.mit.trainbenchmark.generator.tests.GeneratorTest; - -import java.util.List; - -public class CypherGeneratorTest extends GeneratorTest { - - protected final List<CypherFormat> formats = ImmutableList.of( - CypherFormat.BASIC, // - CypherFormat.GRAPHFLOW // - ); - - @Override - public void generate(final GeneratorConfigBase gcb) throws Exception { - for (CypherFormat format : formats) { - final CypherGeneratorConfig gc = new CypherGeneratorConfigBuilder().setConfigBase(gcb).setGraphFormat(format).createConfig(); - final CypherSerializer serializer = new CypherSerializer(gc); - final ModelGenerator generator = ScalableGeneratorFactory.createGenerator(serializer, gc); - generator.generateModel(); - } - } - -} diff --git a/trainbenchmark-generator-graph-neo4j/.gitignore b/trainbenchmark-generator-graph-neo4j/.gitignore deleted file mode 100644 index ea8c4bf7f..000000000 --- a/trainbenchmark-generator-graph-neo4j/.gitignore +++ /dev/null @@ -1 +0,0 @@ -/target diff --git a/trainbenchmark-generator-graph-neo4j/build.gradle b/trainbenchmark-generator-graph-neo4j/build.gradle deleted file mode 100644 index 8b430ed59..000000000 --- a/trainbenchmark-generator-graph-neo4j/build.gradle +++ /dev/null @@ -1,13 +0,0 @@ -plugins { id "com.github.johnrengelman.shadow" version "1.2.3" } - -shadowJar { - classifier = 'fat' - mergeServiceFiles() - manifest { attributes 'Main-Class': 'hu.bme.mit.trainbenchmark.generator.graph.neo4j.Neo4jGraphGeneratorMain' } -} - -dependencies { - compile group: 'commons-io', name: 'commons-io', version: commonsIoVersion - compile project(':trainbenchmark-generator') - compile project(':trainbenchmark-format-graph-neo4j') -} diff --git a/trainbenchmark-generator-graph-neo4j/src/main/java/hu/bme/mit/trainbenchmark/generator/graph/neo4j/Neo4jGraphGeneratorMain.java b/trainbenchmark-generator-graph-neo4j/src/main/java/hu/bme/mit/trainbenchmark/generator/graph/neo4j/Neo4jGraphGeneratorMain.java deleted file mode 100644 index 91bc28d37..000000000 --- a/trainbenchmark-generator-graph-neo4j/src/main/java/hu/bme/mit/trainbenchmark/generator/graph/neo4j/Neo4jGraphGeneratorMain.java +++ /dev/null @@ -1,29 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2010-2015, Benedek Izso, Gabor Szarnyas, Istvan Rath and Daniel Varro - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Benedek Izso - initial API and implementation - * Gabor Szarnyas - initial API and implementation - *******************************************************************************/ - -package hu.bme.mit.trainbenchmark.generator.graph.neo4j; - -import hu.bme.mit.trainbenchmark.generator.ModelGenerator; -import hu.bme.mit.trainbenchmark.generator.ScalableGeneratorFactory; -import hu.bme.mit.trainbenchmark.generator.config.GeneratorConfig; -import hu.bme.mit.trainbenchmark.generator.graph.neo4j.config.Neo4jGraphGeneratorConfig; - -public class Neo4jGraphGeneratorMain { - - public static void main(final String[] args) throws Exception { - final Neo4jGraphGeneratorConfig gc = GeneratorConfig.fromFile(args[0], Neo4jGraphGeneratorConfig.class); - final Neo4jGraphSerializer graphSerializer = new Neo4jGraphSerializer(gc); - final ModelGenerator generator = ScalableGeneratorFactory.createGenerator(graphSerializer, gc); - generator.generateModel(); - } - -} diff --git a/trainbenchmark-generator-graph-neo4j/src/main/java/hu/bme/mit/trainbenchmark/generator/graph/neo4j/Neo4jGraphSerializer.java b/trainbenchmark-generator-graph-neo4j/src/main/java/hu/bme/mit/trainbenchmark/generator/graph/neo4j/Neo4jGraphSerializer.java deleted file mode 100644 index 9ec79e773..000000000 --- a/trainbenchmark-generator-graph-neo4j/src/main/java/hu/bme/mit/trainbenchmark/generator/graph/neo4j/Neo4jGraphSerializer.java +++ /dev/null @@ -1,226 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2010-2015, Benedek Izso, Gabor Szarnyas, Istvan Rath and Daniel Varro - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Benedek Izso - initial API and implementation - * Gabor Szarnyas - initial API and implementation - *******************************************************************************/ -package hu.bme.mit.trainbenchmark.generator.graph.neo4j; - -import apoc.export.csv.ExportCSV; -import apoc.export.graphml.ExportGraphML; -import apoc.graph.Graphs; -import com.google.common.collect.ImmutableMap; -import hu.bme.mit.trainbenchmark.constants.ModelConstants; -import hu.bme.mit.trainbenchmark.generator.ModelSerializer; -import hu.bme.mit.trainbenchmark.generator.graph.neo4j.config.Neo4jGraphGeneratorConfig; -import hu.bme.mit.trainbenchmark.neo4j.Neo4jConstants; -import hu.bme.mit.trainbenchmark.neo4j.apoc.ApocHelper; -import hu.bme.mit.trainbenchmark.neo4j.Neo4jHelper; -import org.apache.commons.io.FileUtils; -import org.neo4j.graphdb.GraphDatabaseService; -import org.neo4j.graphdb.Label; -import org.neo4j.graphdb.Node; -import org.neo4j.graphdb.RelationshipType; -import org.neo4j.graphdb.Transaction; -import org.neo4j.kernel.api.exceptions.KernelException; - -import javax.xml.stream.XMLStreamException; -import java.io.File; -import java.io.IOException; -import java.rmi.RemoteException; -import java.util.Map; -import java.util.Map.Entry; - -public class Neo4jGraphSerializer extends ModelSerializer<Neo4jGraphGeneratorConfig> { - - protected GraphDatabaseService graphDb; - protected Transaction tx; - protected final File databaseDirectory; - - public Neo4jGraphSerializer(final Neo4jGraphGeneratorConfig generatorConfig) { - super(generatorConfig); - databaseDirectory = new File(generatorConfig.getConfigBase().getModelDir() + "neo4j-gen/" - + generatorConfig.getConfigBase().getModelFileNameWithoutExtension() + ".neo4j"); - } - - @Override - public String syntax() { - return "graph-" + gc.getGraphFormat(); - } - - @Override - public void initModel() throws IOException { - cleanupDatabaseDirectory(); - graphDb = Neo4jHelper.startGraphDatabase(databaseDirectory); - } - - @Override - public Object createVertex(final int id, final String type, final Map<String, ? extends Object> attributes, - final Map<String, Object> outgoingEdges, final Map<String, Object> incomingEdges) { - final Node node = graphDb.createNode(Label.label(type)); - - // this only works for inheritance hierarchies - if (ModelConstants.SUPERTYPES.containsKey(type)) { - final String ancestor = ModelConstants.SUPERTYPES.get(type); - node.addLabel(Label.label(ancestor)); - } - - node.setProperty(Neo4jConstants.ID, id); - for (final Entry<String, ? extends Object> attribute : attributes.entrySet()) { - final String key = attribute.getKey(); - Object value = attribute.getValue(); - - // convert the value to string if it's an enum - value = enumsToString(value); - node.setProperty(key, value); - } - - for (final Entry<String, Object> outgoingEdge : outgoingEdges.entrySet()) { - final String label = outgoingEdge.getKey(); - if (outgoingEdge.getValue() instanceof Node) { - final Node targetNode = (Node) outgoingEdge.getValue(); - node.createRelationshipTo(targetNode, relationship(label)); - } - } - - for (final Entry<String, Object> incomingEdge : incomingEdges.entrySet()) { - final String label = incomingEdge.getKey(); - if (incomingEdge.getValue() instanceof Node) { - final Node sourceNode = (Node) incomingEdge.getValue(); - sourceNode.createRelationshipTo(node, relationship(label)); - } - } - - return node; - } - - private Object enumsToString(Object value) { - if (value instanceof Enum) { - final Enum<?> e = (Enum<?>) value; - value = e.toString(); - } - return value; - } - - @Override - public void createEdge(final String label, final Object from, final Object to) { - if (from == null || to == null) { - return; - } - - final Node source = (Node) from; - final Node target = (Node) to; - - final RelationshipType relationshipType = relationship(label); - source.createRelationshipTo(target, relationshipType); - } - - @Override - public void setAttribute(final String type, final Object node, final String key, final Object value) { - final Node n = (Node) node; - - final Object attributeValue = enumsToString(value); - n.setProperty(key, attributeValue); - } - - public RelationshipType relationship(final String label) { - return RelationshipType.withName(label); - } - - @Override - public void persistModel() throws IOException, XMLStreamException, KernelException { - try { - switch (gc.getGraphFormat()) { - case CSV: - saveToCsv(); - break; - case GRAPHML: - saveToGraphMl(); - break; - default: - throw new UnsupportedOperationException("Graph format " + gc.getGraphFormat() + " not supported."); - } - } finally { - graphDb.shutdown(); - - // cleanup: delete the database directory - cleanupDatabaseDirectory(); - } - } - - private void saveToCsv() throws RemoteException, KernelException { - ApocHelper.registerProcedure(graphDb, ExportCSV.class, Graphs.class); - - final Map<String, String> exportCommands = ImmutableMap.<String, String>builder() - // nodes - .put(ModelConstants.REGION, "MATCH (n:Region) RETURN n.id AS `id:ID`") // - .put(ModelConstants.ROUTE, "MATCH (n:Route) RETURN n.id AS `id:ID`, n.active AS `active:BOOLEAN`") // - .put(ModelConstants.SEGMENT, "MATCH (n:Segment) RETURN n.id AS `id:ID`, n.length AS `length:INT`") // - .put(ModelConstants.SEMAPHORE, "MATCH (n:Semaphore) RETURN n.id AS `id:ID`, n.signal AS signal") // - .put(ModelConstants.SENSOR, "MATCH (n:Sensor) RETURN n.id AS `id:ID`") // - .put(ModelConstants.SWITCH, "MATCH (n:Switch) RETURN n.id AS `id:ID`, n.currentPosition AS currentPosition") // - .put(ModelConstants.SWITCHPOSITION, "MATCH (n:SwitchPosition) RETURN n.id AS `id:ID`, n.position AS position") // - // relationships - .put(ModelConstants.CONNECTS_TO, "MATCH (n)-[:connectsTo]->(m) RETURN n.id AS `id:START_ID`, m.id AS `id:END_ID`") // - .put(ModelConstants.ENTRY, "MATCH (n)-[:entry]->(m) RETURN n.id AS `id:START_ID`, m.id AS `id:END_ID`") // - .put(ModelConstants.EXIT, "MATCH (n)-[:exit]->(m) RETURN n.id AS `id:START_ID`, m.id AS `id:END_ID`") // - .put(ModelConstants.FOLLOWS, "MATCH (n)-[:follows]->(m) RETURN n.id AS `id:START_ID`, m.id AS `id:END_ID`") // - .put(ModelConstants.MONITORED_BY, "MATCH (n)-[:monitoredBy]->(m) RETURN n.id AS `id:START_ID`, m.id AS `id:END_ID`") // - .put(ModelConstants.REQUIRES, "MATCH (n)-[:requires]->(m) RETURN n.id AS `id:START_ID`, m.id AS `id:END_ID`") // - .put(ModelConstants.TARGET, "MATCH (n)-[:target]->(m) RETURN n.id AS `id:START_ID`, m.id AS `id:END_ID`") // - .build(); - - for (Entry<String, String> entry : exportCommands.entrySet()) { - final String type = entry.getKey(); - final String query = entry.getValue(); - - final String fileName = gc.getConfigBase().getModelPathWithoutExtension() + "-" + type + "." - + Neo4jConstants.CSV_EXTENSION; - - try (final Transaction tx = graphDb.beginTx()) { - graphDb.execute(String.format( // - "CALL apoc.export.csv.query('%s', '%s', null)", // - query, - fileName // - )); - } - } - } - - private void saveToGraphMl() throws KernelException { - ApocHelper.registerProcedure(graphDb, ExportGraphML.class, Graphs.class); - - final String fileName = gc.getConfigBase().getModelPathWithoutExtension() + "." - + Neo4jConstants.GRAPHML_EXTENSION; - - try (final Transaction tx = graphDb.beginTx()) { - graphDb.execute(String.format( // - "CALL apoc.export.graphml.all('%s', {useTypes: true})", // - fileName // - )); - } - } - - private void cleanupDatabaseDirectory() throws IOException { - if (databaseDirectory.exists()) { - FileUtils.deleteDirectory(databaseDirectory); - } - } - - @Override - public void beginTransaction() throws IOException { - tx = graphDb.beginTx(); - } - - @Override - public void endTransaction() { - tx.success(); - tx.close(); - } - -} diff --git a/trainbenchmark-generator-graph-neo4j/src/main/java/hu/bme/mit/trainbenchmark/generator/graph/neo4j/config/Neo4jGraphGeneratorConfig.java b/trainbenchmark-generator-graph-neo4j/src/main/java/hu/bme/mit/trainbenchmark/generator/graph/neo4j/config/Neo4jGraphGeneratorConfig.java deleted file mode 100644 index 61cb31829..000000000 --- a/trainbenchmark-generator-graph-neo4j/src/main/java/hu/bme/mit/trainbenchmark/generator/graph/neo4j/config/Neo4jGraphGeneratorConfig.java +++ /dev/null @@ -1,37 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2010-2015, Benedek Izso, Gabor Szarnyas, Istvan Rath and Daniel Varro - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Benedek Izso - initial API and implementation - * Gabor Szarnyas - initial API and implementation - *******************************************************************************/ - -package hu.bme.mit.trainbenchmark.generator.graph.neo4j.config; - -import hu.bme.mit.trainbenchmark.generator.config.GeneratorConfig; -import hu.bme.mit.trainbenchmark.generator.config.GeneratorConfigBase; -import hu.bme.mit.trainbenchmark.neo4j.config.Neo4jGraphFormat; - -public class Neo4jGraphGeneratorConfig extends GeneratorConfig { - - protected Neo4jGraphFormat graphFormat; - - protected Neo4jGraphGeneratorConfig(final GeneratorConfigBase configBase, final Neo4jGraphFormat graphFormat) { - super(configBase); - this.graphFormat = graphFormat; - } - - public Neo4jGraphFormat getGraphFormat() { - return graphFormat; - } - - @Override - public String getProjectName() { - return "graph-neo4j"; - } - -} diff --git a/trainbenchmark-generator-graph-neo4j/src/main/java/hu/bme/mit/trainbenchmark/generator/graph/neo4j/config/Neo4jGraphGeneratorConfigBuilder.java b/trainbenchmark-generator-graph-neo4j/src/main/java/hu/bme/mit/trainbenchmark/generator/graph/neo4j/config/Neo4jGraphGeneratorConfigBuilder.java deleted file mode 100644 index 4a07aded9..000000000 --- a/trainbenchmark-generator-graph-neo4j/src/main/java/hu/bme/mit/trainbenchmark/generator/graph/neo4j/config/Neo4jGraphGeneratorConfigBuilder.java +++ /dev/null @@ -1,40 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2010-2015, Benedek Izso, Gabor Szarnyas, Istvan Rath and Daniel Varro - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Benedek Izso - initial API and implementation - * Gabor Szarnyas - initial API and implementation - *******************************************************************************/ - -package hu.bme.mit.trainbenchmark.generator.graph.neo4j.config; - -import com.google.common.base.Preconditions; - -import hu.bme.mit.trainbenchmark.generator.config.GeneratorConfigBuilder; -import hu.bme.mit.trainbenchmark.neo4j.config.Neo4jGraphFormat; - -public class Neo4jGraphGeneratorConfigBuilder extends GeneratorConfigBuilder<Neo4jGraphGeneratorConfig, Neo4jGraphGeneratorConfigBuilder> { - - protected Neo4jGraphFormat graphFormat; - - public Neo4jGraphGeneratorConfigBuilder setGraphFormat(Neo4jGraphFormat graphFormat) { - this.graphFormat = graphFormat; - return this; - } - - @Override - public Neo4jGraphGeneratorConfig createConfig() { - return new Neo4jGraphGeneratorConfig(configBase, graphFormat); - } - - @Override - public void checkNotNulls() { - super.checkNotNulls(); - Preconditions.checkNotNull(graphFormat); - } - -} diff --git a/trainbenchmark-generator-graph-neo4j/src/test/java/hu/bme/mit/trainbenchmark/generator/graph/neo4j/test/Neo4jGraphGeneratorTest.java b/trainbenchmark-generator-graph-neo4j/src/test/java/hu/bme/mit/trainbenchmark/generator/graph/neo4j/test/Neo4jGraphGeneratorTest.java deleted file mode 100644 index 369b50652..000000000 --- a/trainbenchmark-generator-graph-neo4j/src/test/java/hu/bme/mit/trainbenchmark/generator/graph/neo4j/test/Neo4jGraphGeneratorTest.java +++ /dev/null @@ -1,45 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2010-2015, Benedek Izso, Gabor Szarnyas, Istvan Rath and Daniel Varro - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Benedek Izso - initial API and implementation - * Gabor Szarnyas - initial API and implementation - *******************************************************************************/ - -package hu.bme.mit.trainbenchmark.generator.graph.neo4j.test; - -import com.google.common.collect.ImmutableList; -import hu.bme.mit.trainbenchmark.generator.ModelGenerator; -import hu.bme.mit.trainbenchmark.generator.ScalableGeneratorFactory; -import hu.bme.mit.trainbenchmark.generator.config.GeneratorConfigBase; -import hu.bme.mit.trainbenchmark.generator.graph.neo4j.Neo4jGraphSerializer; -import hu.bme.mit.trainbenchmark.generator.graph.neo4j.config.Neo4jGraphGeneratorConfig; -import hu.bme.mit.trainbenchmark.generator.graph.neo4j.config.Neo4jGraphGeneratorConfigBuilder; -import hu.bme.mit.trainbenchmark.generator.tests.GeneratorTest; -import hu.bme.mit.trainbenchmark.neo4j.config.Neo4jGraphFormat; - -import java.util.List; - -public class Neo4jGraphGeneratorTest extends GeneratorTest { - - protected final List<Neo4jGraphFormat> graphFormats = ImmutableList.of( - Neo4jGraphFormat.CSV, // - Neo4jGraphFormat.GRAPHML // - ); - - @Override - public void generate(final GeneratorConfigBase gcb) throws Exception { - for (Neo4jGraphFormat graphFormat : graphFormats) { - final Neo4jGraphGeneratorConfig gc = new Neo4jGraphGeneratorConfigBuilder().setConfigBase(gcb) - .setGraphFormat(graphFormat).createConfig(); - final Neo4jGraphSerializer serializer = new Neo4jGraphSerializer(gc); - final ModelGenerator generator = ScalableGeneratorFactory.createGenerator(serializer, gc); - generator.generateModel(); - } - } - -} diff --git a/trainbenchmark-generator-rdf/.gitignore b/trainbenchmark-generator-rdf/.gitignore deleted file mode 100644 index ea8c4bf7f..000000000 --- a/trainbenchmark-generator-rdf/.gitignore +++ /dev/null @@ -1 +0,0 @@ -/target diff --git a/trainbenchmark-generator-rdf/build.gradle b/trainbenchmark-generator-rdf/build.gradle deleted file mode 100644 index 18b91cda8..000000000 --- a/trainbenchmark-generator-rdf/build.gradle +++ /dev/null @@ -1,19 +0,0 @@ -plugins { id "com.github.johnrengelman.shadow" version "1.2.3" } - -shadowJar { - classifier = 'fat' - manifest { attributes 'Main-Class': 'hu.bme.mit.trainbenchmark.generator.rdf.RdfGeneratorMain' } -} - -dependencies { - def sesameVersion = '2.7.10' - compile project(':trainbenchmark-generator') - compile project(':trainbenchmark-format-rdf') - compile group: 'org.slf4j', name: 'slf4j-nop', version: slf4jVersion - compile group: 'org.openrdf.sesame', name: 'sesame-model', version: sesameVersion - compile group: 'org.openrdf.sesame', name: 'sesame-repository-sail', version: sesameVersion - compile group: 'org.openrdf.sesame', name: 'sesame-sail-memory', version: sesameVersion - compile group: 'org.openrdf.sesame', name: 'sesame-repository-contextaware', version: sesameVersion - compile group: 'org.openrdf.sesame', name: 'sesame-rio-rdfxml', version: sesameVersion - compile group: 'org.openrdf.sesame', name: 'sesame-rio-turtle', version: sesameVersion -} diff --git a/trainbenchmark-generator-rdf/src/main/java/hu/bme/mit/trainbenchmark/generator/rdf/RdfGeneratorMain.java b/trainbenchmark-generator-rdf/src/main/java/hu/bme/mit/trainbenchmark/generator/rdf/RdfGeneratorMain.java deleted file mode 100644 index dcf50f34f..000000000 --- a/trainbenchmark-generator-rdf/src/main/java/hu/bme/mit/trainbenchmark/generator/rdf/RdfGeneratorMain.java +++ /dev/null @@ -1,28 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2010-2015, Benedek Izso, Gabor Szarnyas, Istvan Rath and Daniel Varro - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Benedek Izso - initial API and implementation - * Gabor Szarnyas - initial API and implementation - *******************************************************************************/ - -package hu.bme.mit.trainbenchmark.generator.rdf; - -import hu.bme.mit.trainbenchmark.generator.ModelGenerator; -import hu.bme.mit.trainbenchmark.generator.ScalableGeneratorFactory; -import hu.bme.mit.trainbenchmark.generator.rdf.config.RdfGeneratorConfig; - -public class RdfGeneratorMain { - - public static void main(final String[] args) throws Exception { - final RdfGeneratorConfig gc = RdfGeneratorConfig.fromFile(args[0], RdfGeneratorConfig.class); - final RdfSerializer rdfSerializer = new RdfSerializer(gc); - final ModelGenerator generator = ScalableGeneratorFactory.createGenerator(rdfSerializer, gc); - generator.generateModel(); - } - -} diff --git a/trainbenchmark-generator-rdf/src/main/java/hu/bme/mit/trainbenchmark/generator/rdf/RdfSerializer.java b/trainbenchmark-generator-rdf/src/main/java/hu/bme/mit/trainbenchmark/generator/rdf/RdfSerializer.java deleted file mode 100644 index 9c38c396e..000000000 --- a/trainbenchmark-generator-rdf/src/main/java/hu/bme/mit/trainbenchmark/generator/rdf/RdfSerializer.java +++ /dev/null @@ -1,181 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2010-2015, Benedek Izso, Gabor Szarnyas, Istvan Rath and Daniel Varro - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Benedek Izso - initial API and implementation - * Gabor Szarnyas - initial API and implementation - *******************************************************************************/ - -package hu.bme.mit.trainbenchmark.generator.rdf; - -import static hu.bme.mit.trainbenchmark.rdf.RdfConstants.ID_PREFIX; - -import java.io.BufferedWriter; -import java.io.File; -import java.io.FileWriter; -import java.io.IOException; -import java.util.Map; -import java.util.Map.Entry; - -import org.apache.commons.io.FileUtils; - -import hu.bme.mit.trainbenchmark.constants.ModelConstants; -import hu.bme.mit.trainbenchmark.generator.ModelSerializer; -import hu.bme.mit.trainbenchmark.generator.rdf.config.RdfGeneratorConfig; -import hu.bme.mit.trainbenchmark.rdf.RdfHelper; - -public class RdfSerializer extends ModelSerializer<RdfGeneratorConfig> { - - protected BufferedWriter file; - protected String RDF_METAMODEL_DIR = "/trainbenchmark-format-rdf/src/main/resources/metamodel/"; - - public RdfSerializer(final RdfGeneratorConfig generatorConfig) { - super(generatorConfig); - } - - @Override - public String syntax() { - return "RDF" + gc.getModelFlavor(); - } - - @Override - public void initModel() throws IOException { - // source file - final String modelFlavor = gc.getModelFlavor(); - final String extension = gc.getExtension(); - - final String postfix = modelFlavor + "." + extension; - - final String srcFilePath = gc.getConfigBase().getWorkspaceDir() + RDF_METAMODEL_DIR - + "railway" + postfix; - - final File srcFile = new File(srcFilePath); - - // destination file - final String destFilePath = gc.getConfigBase().getModelPathWithoutExtension() - + postfix; - final File destFile = new File(destFilePath); - - // this overwrites the destination file if it exists - FileUtils.copyFile(srcFile, destFile); - - file = new BufferedWriter(new FileWriter(destFile, true)); - } - - @Override - public void persistModel() throws IOException { - file.close(); - } - - @Override - public Object createVertex(final int id, final String type, final Map<String, ? extends Object> attributes, - final Map<String, Object> outgoingEdges, final Map<String, Object> incomingEdges) throws IOException { - - // vertex id and type - final String triple = String.format(":%s%d a :%s", ID_PREFIX, id, type); - final StringBuilder vertex = new StringBuilder(triple); - - final String linePrefix; - - switch (gc.getFormat()) { - case NTRIPLES: - linePrefix = String.format(" .\n:%s%d ", ID_PREFIX, id); - break; - case TURTLE: - linePrefix = " ;\n\t"; - break; - default: - throw new UnsupportedOperationException( - "RDF format " + gc.getFormat() + " not supported"); - } - - // if the metamodel is not included, we manually insert the inferenced triples - if (gc.isInferred()) { - if (ModelConstants.SUPERTYPES.containsKey(type)) { - final String superType = ModelConstants.SUPERTYPES.get(type); - - final String superTypeTriple = String.format("%sa :%s", linePrefix, superType); - vertex.append(superTypeTriple); - } - } - - // (id)-[]->() attributes - for (final Entry<String, ? extends Object> attribute : attributes.entrySet()) { - final String attributeTriple = String.format("%s:%s %s", linePrefix, attribute.getKey(), - stringValue(attribute.getValue())); - vertex.append(attributeTriple); - } - - // (id)-[]->() edges - for (final Entry<String, Object> outgoingEdge : outgoingEdges.entrySet()) { - if (outgoingEdge.getValue() == null) { - continue; - } - - final String edgeTriple = String.format("%s:%s :%s%s", linePrefix, outgoingEdge.getKey(), ID_PREFIX, - outgoingEdge.getValue()); - vertex.append(edgeTriple); - } - - vertex.append(" ."); - write(vertex.toString()); - - // ()-[]->(id) edges - for (final Entry<String, Object> incomingEdge : incomingEdges.entrySet()) { - createEdge(incomingEdge.getKey(), incomingEdge.getValue(), id); - } - - return id; - } - - @Override - public void createEdge(final String label, final Object from, final Object to) throws IOException { - if (from == null || to == null) { - return; - } - final String triple = String.format(":%s%s :%s :%s%s .", ID_PREFIX, from, label, ID_PREFIX, to); - write(triple); - } - - @Override - public void setAttribute(final String type, final Object node, final String key, final Object value) - throws IOException { - final String triple = String.format(":%s%s :%s %s", ID_PREFIX, node, key, stringValue(value)); - write(triple + " ."); - - } - - protected void write(final String s) throws IOException { - switch (gc.getFormat()) { - case NTRIPLES: - file.write(s + "\n"); - break; - case TURTLE: - file.write(s + "\n\n"); - break; - default: - throw new UnsupportedOperationException( - "RDF format " + gc.getFormat() + " not supported"); - } - } - - protected String stringValue(final Object value) { - if (value instanceof Boolean) { - return Boolean.toString((Boolean) value); - } - if (value instanceof Integer) { - return String.format("\"%d\"^^xsd:int", value); - } - if (value instanceof Enum<?>) { - final Enum<?> e = (Enum<?>) value; - return String.format(":%s", RdfHelper.addEnumPrefix(e)); - } else { - return value.toString(); - } - } - -} diff --git a/trainbenchmark-generator-rdf/src/main/java/hu/bme/mit/trainbenchmark/generator/rdf/config/RdfGeneratorConfig.java b/trainbenchmark-generator-rdf/src/main/java/hu/bme/mit/trainbenchmark/generator/rdf/config/RdfGeneratorConfig.java deleted file mode 100644 index 84c73b2e0..000000000 --- a/trainbenchmark-generator-rdf/src/main/java/hu/bme/mit/trainbenchmark/generator/rdf/config/RdfGeneratorConfig.java +++ /dev/null @@ -1,52 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2010-2015, Benedek Izso, Gabor Szarnyas, Istvan Rath and Daniel Varro - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Benedek Izso - initial API and implementation - * Gabor Szarnyas - initial API and implementation - *******************************************************************************/ - -package hu.bme.mit.trainbenchmark.generator.rdf.config; - -import hu.bme.mit.trainbenchmark.generator.config.GeneratorConfig; -import hu.bme.mit.trainbenchmark.generator.config.GeneratorConfigBase; -import hu.bme.mit.trainbenchmark.rdf.RdfFormat; - -public class RdfGeneratorConfig extends GeneratorConfig { - - protected boolean inferred; - protected RdfFormat format; - - protected RdfGeneratorConfig(final GeneratorConfigBase configBase, - final boolean inferred, final RdfFormat format) { - super(configBase); - this.inferred = inferred; - this.format = format; - } - - public boolean isInferred() { - return inferred; - } - - public RdfFormat getFormat() { - return format; - } - - public String getModelFlavor() { - return isInferred() ? "-inferred" : "-metamodel"; - } - - public String getExtension() { - return format.getExtension(); - } - - @Override - public String getProjectName() { - return "rdf"; - } - -} diff --git a/trainbenchmark-generator-rdf/src/main/java/hu/bme/mit/trainbenchmark/generator/rdf/config/RdfGeneratorConfigBuilder.java b/trainbenchmark-generator-rdf/src/main/java/hu/bme/mit/trainbenchmark/generator/rdf/config/RdfGeneratorConfigBuilder.java deleted file mode 100644 index 68b370ff3..000000000 --- a/trainbenchmark-generator-rdf/src/main/java/hu/bme/mit/trainbenchmark/generator/rdf/config/RdfGeneratorConfigBuilder.java +++ /dev/null @@ -1,36 +0,0 @@ -package hu.bme.mit.trainbenchmark.generator.rdf.config; - -import com.google.common.base.Preconditions; - -import hu.bme.mit.trainbenchmark.generator.config.GeneratorConfigBuilder; -import hu.bme.mit.trainbenchmark.rdf.RdfFormat; - -public class RdfGeneratorConfigBuilder extends GeneratorConfigBuilder<RdfGeneratorConfig, RdfGeneratorConfigBuilder> { - - protected Boolean inferred; - protected RdfFormat format; - - public RdfGeneratorConfigBuilder setInferred(Boolean inferred) { - this.inferred = inferred; - return this; - } - - public RdfGeneratorConfigBuilder setFormat(RdfFormat format) { - this.format = format; - return this; - } - - @Override - public void checkNotNulls() { - super.checkNotNulls(); - Preconditions.checkNotNull(inferred); - Preconditions.checkNotNull(format); - } - - @Override - public RdfGeneratorConfig createConfig() { - checkNotNulls(); - return new RdfGeneratorConfig(configBase, inferred, format); - } - -} diff --git a/trainbenchmark-generator-rdf/src/main/resources/.gitignore b/trainbenchmark-generator-rdf/src/main/resources/.gitignore deleted file mode 100644 index e69de29bb..000000000 diff --git a/trainbenchmark-generator-rdf/src/test/java/hu/bme/mit/trainbenchmark/generator/rdf/test/RdfGeneratorTest.java b/trainbenchmark-generator-rdf/src/test/java/hu/bme/mit/trainbenchmark/generator/rdf/test/RdfGeneratorTest.java deleted file mode 100644 index 13d74f665..000000000 --- a/trainbenchmark-generator-rdf/src/test/java/hu/bme/mit/trainbenchmark/generator/rdf/test/RdfGeneratorTest.java +++ /dev/null @@ -1,32 +0,0 @@ -package hu.bme.mit.trainbenchmark.generator.rdf.test; - -import java.util.List; - -import com.google.common.collect.ImmutableList; - -import hu.bme.mit.trainbenchmark.generator.ModelGenerator; -import hu.bme.mit.trainbenchmark.generator.ScalableGeneratorFactory; -import hu.bme.mit.trainbenchmark.generator.config.GeneratorConfigBase; -import hu.bme.mit.trainbenchmark.generator.rdf.RdfSerializer; -import hu.bme.mit.trainbenchmark.generator.rdf.config.RdfGeneratorConfig; -import hu.bme.mit.trainbenchmark.generator.rdf.config.RdfGeneratorConfigBuilder; -import hu.bme.mit.trainbenchmark.generator.tests.GeneratorTest; -import hu.bme.mit.trainbenchmark.rdf.RdfFormat; - -public class RdfGeneratorTest extends GeneratorTest { - - @Override - public void generate(final GeneratorConfigBase gcb) throws Exception { - final RdfGeneratorConfigBuilder builder = new RdfGeneratorConfigBuilder().setConfigBase(gcb) - .setFormat(RdfFormat.TURTLE); - - final List<Boolean> inferredConfigs = ImmutableList.of(true, false); - for (Boolean inferredConfig : inferredConfigs) { - final RdfGeneratorConfig gc = builder.setInferred(inferredConfig).createConfig(); - final RdfSerializer serializer = new RdfSerializer(gc); - final ModelGenerator generator = ScalableGeneratorFactory.createGenerator(serializer, gc); - generator.generateModel(); - } - } - -} diff --git a/trainbenchmark-generator-sql/build.gradle b/trainbenchmark-generator-sql/build.gradle deleted file mode 100644 index 1588e5d76..000000000 --- a/trainbenchmark-generator-sql/build.gradle +++ /dev/null @@ -1,15 +0,0 @@ -plugins { - id "com.github.johnrengelman.shadow" version "1.2.3" -} - -shadowJar { - classifier = 'fat' - manifest { - attributes 'Main-Class': 'hu.bme.mit.trainbenchmark.generator.sql.SqlGeneratorMain' - } -} - -dependencies { - compile project(':trainbenchmark-generator') - compile project(':trainbenchmark-format-sql') -} diff --git a/trainbenchmark-generator-sql/src/main/java/hu/bme/mit/trainbenchmark/generator/sql/SqlGeneratorMain.java b/trainbenchmark-generator-sql/src/main/java/hu/bme/mit/trainbenchmark/generator/sql/SqlGeneratorMain.java deleted file mode 100644 index 227348ca0..000000000 --- a/trainbenchmark-generator-sql/src/main/java/hu/bme/mit/trainbenchmark/generator/sql/SqlGeneratorMain.java +++ /dev/null @@ -1,29 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2010-2015, Benedek Izso, Gabor Szarnyas, Istvan Rath and Daniel Varro - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Benedek Izso - initial API and implementation - * Gabor Szarnyas - initial API and implementation - *******************************************************************************/ - -package hu.bme.mit.trainbenchmark.generator.sql; - -import hu.bme.mit.trainbenchmark.generator.ModelGenerator; -import hu.bme.mit.trainbenchmark.generator.ScalableGeneratorFactory; -import hu.bme.mit.trainbenchmark.generator.config.GeneratorConfig; -import hu.bme.mit.trainbenchmark.generator.sql.config.SqlGeneratorConfig; - -public class SqlGeneratorMain { - - public static void main(final String[] args) throws Exception { - final SqlGeneratorConfig gc = GeneratorConfig.fromFile(args[0], SqlGeneratorConfig.class); - final SqlSerializer sqlSerializer = new SqlSerializer(gc); - final ModelGenerator generator = ScalableGeneratorFactory.createGenerator(sqlSerializer, gc); - generator.generateModel(); - } - -} diff --git a/trainbenchmark-generator-sql/src/main/java/hu/bme/mit/trainbenchmark/generator/sql/SqlSerializer.java b/trainbenchmark-generator-sql/src/main/java/hu/bme/mit/trainbenchmark/generator/sql/SqlSerializer.java deleted file mode 100644 index 03dc70483..000000000 --- a/trainbenchmark-generator-sql/src/main/java/hu/bme/mit/trainbenchmark/generator/sql/SqlSerializer.java +++ /dev/null @@ -1,218 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2010-2015, Benedek Izso, Gabor Szarnyas, Istvan Rath and Daniel Varro - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Benedek Izso - initial API and implementation - * Gabor Szarnyas - initial API and implementation - *******************************************************************************/ - -package hu.bme.mit.trainbenchmark.generator.sql; - -import static hu.bme.mit.trainbenchmark.constants.ModelConstants.CONNECTS_TO; -import static hu.bme.mit.trainbenchmark.constants.ModelConstants.ELEMENTS; -import static hu.bme.mit.trainbenchmark.constants.ModelConstants.FOLLOWS; -import static hu.bme.mit.trainbenchmark.constants.ModelConstants.ID; -import static hu.bme.mit.trainbenchmark.constants.ModelConstants.MONITORED_BY; -import static hu.bme.mit.trainbenchmark.constants.ModelConstants.REQUIRES; -import static hu.bme.mit.trainbenchmark.constants.ModelConstants.SEMAPHORE; -import static hu.bme.mit.trainbenchmark.constants.ModelConstants.SEMAPHORES; -import static hu.bme.mit.trainbenchmark.constants.ModelConstants.SENSOR; -import static hu.bme.mit.trainbenchmark.constants.ModelConstants.SENSORS; -import static hu.bme.mit.trainbenchmark.constants.ModelConstants.SUPERTYPES; -import static hu.bme.mit.trainbenchmark.constants.ModelConstants.SWITCHPOSITION; -import static hu.bme.mit.trainbenchmark.constants.ModelConstants.TRACKELEMENT; - -import java.io.BufferedWriter; -import java.io.File; -import java.io.FileWriter; -import java.io.IOException; -import java.util.List; -import java.util.Map; -import java.util.Map.Entry; - -import org.apache.commons.io.FileUtils; - -import hu.bme.mit.trainbenchmark.generator.ModelSerializer; -import hu.bme.mit.trainbenchmark.generator.sql.config.SqlGeneratorConfig; -import hu.bme.mit.trainbenchmark.sql.constants.SqlConstants; -import hu.bme.mit.trainbenchmark.sql.process.MySqlProcess; - -public class SqlSerializer extends ModelSerializer<SqlGeneratorConfig> { - - protected String sqlRawPath; - protected BufferedWriter writer; - protected String SQL_FORMAT_DIR = "trainbenchmark-format-sql/"; - protected String SQL_METAMODEL_DIR = SQL_FORMAT_DIR + "src/main/resources/metamodel/"; - protected String SQL_SCRIPT_DIR = SQL_FORMAT_DIR + "scripts/"; - - public SqlSerializer(final SqlGeneratorConfig gc) { - super(gc); - } - - @Override - public String syntax() { - return "SQL"; - } - - public void write(final String s) throws IOException { - writer.write(s + "\n"); - } - - @Override - public void initModel() throws IOException { - // header file (DDL operations) - final String headerFilePath = gc.getConfigBase().getWorkspaceDir() + SQL_METAMODEL_DIR + "railway-header.sql"; - final File headerFile = new File(headerFilePath); - - // destination file - sqlRawPath = gc.getConfigBase().getModelPathWithoutExtension() + "-raw.sql"; - final File sqlRawFile = new File(sqlRawPath); - - // this overwrites the destination file if it exists - FileUtils.copyFile(headerFile, sqlRawFile); - - writer = new BufferedWriter(new FileWriter(sqlRawFile, true)); - } - - @Override - public void persistModel() throws IOException, InterruptedException { - final String footerFilePath = gc.getConfigBase().getWorkspaceDir() + SQL_METAMODEL_DIR + "railway-footer.sql"; - final File footerFile = new File(footerFilePath); - - final List<String> lines = FileUtils.readLines(footerFile); - for (final String line : lines) { - write(line); - } - - writer.close(); - - compact(); - } - - public void compact() throws IOException, InterruptedException { - log("Stopping server"); - MySqlProcess.stopServer(); - - log("Cleaning data"); - MySqlProcess.cleanServer(); - - log("Starting server"); - MySqlProcess.startServer(); - - log("Loading the raw model"); - MySqlProcess.runShell(String.format("mysql -u %s < %s", SqlConstants.USER, sqlRawPath)); - - final String mysqlDumpPath = gc.getConfigBase().getModelPathWithoutExtension() + "-mysql.sql"; - final String commandDump = "mysqldump -u " + SqlConstants.USER + " --databases trainbenchmark --skip-dump-date --skip-comments > " + mysqlDumpPath; - MySqlProcess.runShell(commandDump); - - final String sqliteDumpPath = gc.getConfigBase().getModelPathWithoutExtension() + "-sqlite.sql"; - final String sqliteDump = gc.getConfigBase().getWorkspaceDir() + SQL_SCRIPT_DIR + "mysql2sqlite.sh " + mysqlDumpPath + " > " + sqliteDumpPath; - MySqlProcess.runShell(sqliteDump); - } - - protected void log(final String message) { - //System.out.println(message); - } - - @Override - public Object createVertex(final int id, final String type, final Map<String, ? extends Object> attributes, final Map<String, Object> outgoingEdges, - final Map<String, Object> incomingEdges) throws IOException { - final StringBuilder columns = new StringBuilder(); - final StringBuilder values = new StringBuilder(); - - columns.append("\"" + ID + "\""); - values.append(id); - - structuralFeaturesToSQL(attributes, columns, values); - structuralFeaturesToSQL(outgoingEdges, columns, values); - structuralFeaturesToSQL(incomingEdges, columns, values); - - if (SUPERTYPES.containsKey(type)) { - final String ancestorType = SUPERTYPES.get(type); - write(String.format("INSERT INTO \"%s\" (\"%s\") VALUES (%s);", ancestorType, ID, id)); - write(String.format("INSERT INTO \"%s\" (%s) VALUES (%s);", type, columns.toString(), values.toString())); - } else { - final String insertQuery = String.format("INSERT INTO \"%s\" (%s) VALUES (%s);", type, columns.toString(), values.toString()); - write(insertQuery.toString()); - } - - return id; - } - - @Override - public void createEdge(final String label, final Object from, final Object to) throws IOException { - if (from == null || to == null) { - return; - } - - String insertQuery; - switch (label) { - // n:m edges - case MONITORED_BY: - case CONNECTS_TO: - case REQUIRES: - insertQuery = String.format("INSERT INTO \"%s\" VALUES (%s, %s);", label, from, to); - break; - // n:1 edges - case FOLLOWS: - insertQuery = String.format("UPDATE \"%s\" SET \"%s\" = %s WHERE \"%s\" = %s;", SWITCHPOSITION, "route", from, ID, to); - break; - case SENSORS: - insertQuery = String.format("UPDATE \"%s\" SET \"%s\" = %s WHERE \"%s\" = %s;", SENSOR, "region", from, ID, to); - break; - case ELEMENTS: - insertQuery = String.format("UPDATE \"%s\" SET \"%s\" = %s WHERE \"%s\" = %s;", TRACKELEMENT, "region", from, ID, to); - break; - case SEMAPHORES: - insertQuery = String.format("UPDATE \"%s\" SET \"%s\" = %s WHERE \"%s\" = %s;", SEMAPHORE, "segment", from, ID, to); - break; - default: - throw new UnsupportedOperationException("Label '" + label + "' not supported."); - } - - write(insertQuery); - } - - @Override - public void setAttribute(final String type, final Object node, final String key, final Object value) throws IOException { - final String stringValue = valueToString(value); - final String updateQuery = String.format("UPDATE \"%s\" SET \"%s\" = %s WHERE \"%s\" = %s;", type, key, stringValue, ID, node); - write(updateQuery); - } - - protected void structuralFeaturesToSQL(final Map<String, ? extends Object> attributes, final StringBuilder columns, final StringBuilder values) { - for (final Entry<String, ? extends Object> entry : attributes.entrySet()) { - final String key = entry.getKey(); - final Object value = entry.getValue(); - - columns.append(", \"" + key + "\""); - values.append(", "); - - final String stringValue = (value == null ? "NULL" : valueToString(value)); - values.append(stringValue); - } - } - - private String valueToString(final Object value) { - String stringValue; - if (value instanceof Boolean) { - stringValue = (Boolean) value ? "1" : "0"; - } else if (value instanceof String) { - // escape string - stringValue = "\"" + value + "\""; - } else if (value instanceof Enum) { - // change enum to ordinal value - final Enum<?> enumeration = (Enum<?>) value; - stringValue = Integer.toString(enumeration.ordinal()); - } else { - stringValue = value.toString(); - } - return stringValue; - } - -} diff --git a/trainbenchmark-generator-sql/src/main/java/hu/bme/mit/trainbenchmark/generator/sql/config/SqlGeneratorConfig.java b/trainbenchmark-generator-sql/src/main/java/hu/bme/mit/trainbenchmark/generator/sql/config/SqlGeneratorConfig.java deleted file mode 100644 index 57f37c1e6..000000000 --- a/trainbenchmark-generator-sql/src/main/java/hu/bme/mit/trainbenchmark/generator/sql/config/SqlGeneratorConfig.java +++ /dev/null @@ -1,29 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2010-2015, Benedek Izso, Gabor Szarnyas, Istvan Rath and Daniel Varro - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Benedek Izso - initial API and implementation - * Gabor Szarnyas - initial API and implementation - *******************************************************************************/ - -package hu.bme.mit.trainbenchmark.generator.sql.config; - -import hu.bme.mit.trainbenchmark.generator.config.GeneratorConfig; -import hu.bme.mit.trainbenchmark.generator.config.GeneratorConfigBase; - -public class SqlGeneratorConfig extends GeneratorConfig { - - protected SqlGeneratorConfig(final GeneratorConfigBase configBase) { - super(configBase); - } - - @Override - public String getProjectName() { - return "sql"; - } - -} diff --git a/trainbenchmark-generator-sql/src/main/java/hu/bme/mit/trainbenchmark/generator/sql/config/SqlGeneratorConfigBuilder.java b/trainbenchmark-generator-sql/src/main/java/hu/bme/mit/trainbenchmark/generator/sql/config/SqlGeneratorConfigBuilder.java deleted file mode 100644 index d5d4f8182..000000000 --- a/trainbenchmark-generator-sql/src/main/java/hu/bme/mit/trainbenchmark/generator/sql/config/SqlGeneratorConfigBuilder.java +++ /dev/null @@ -1,25 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2010-2015, Benedek Izso, Gabor Szarnyas, Istvan Rath and Daniel Varro - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Benedek Izso - initial API and implementation - * Gabor Szarnyas - initial API and implementation - *******************************************************************************/ - -package hu.bme.mit.trainbenchmark.generator.sql.config; - -import hu.bme.mit.trainbenchmark.generator.config.GeneratorConfigBuilder; - -public class SqlGeneratorConfigBuilder extends GeneratorConfigBuilder<SqlGeneratorConfig, SqlGeneratorConfigBuilder> { - - @Override - public SqlGeneratorConfig createConfig() { - checkNotNulls(); - return new SqlGeneratorConfig(configBase); - } - -} diff --git a/trainbenchmark-generator-sql/src/main/resources/.gitignore b/trainbenchmark-generator-sql/src/main/resources/.gitignore deleted file mode 100644 index e69de29bb..000000000 diff --git a/trainbenchmark-generator-sql/src/test/java/hu/bme/mit/trainbenchmark/generator/sql/SqlGeneratorTest.java b/trainbenchmark-generator-sql/src/test/java/hu/bme/mit/trainbenchmark/generator/sql/SqlGeneratorTest.java deleted file mode 100644 index 4bd224eb0..000000000 --- a/trainbenchmark-generator-sql/src/test/java/hu/bme/mit/trainbenchmark/generator/sql/SqlGeneratorTest.java +++ /dev/null @@ -1,20 +0,0 @@ -package hu.bme.mit.trainbenchmark.generator.sql; - -import hu.bme.mit.trainbenchmark.generator.ModelGenerator; -import hu.bme.mit.trainbenchmark.generator.ScalableGeneratorFactory; -import hu.bme.mit.trainbenchmark.generator.config.GeneratorConfigBase; -import hu.bme.mit.trainbenchmark.generator.sql.config.SqlGeneratorConfig; -import hu.bme.mit.trainbenchmark.generator.sql.config.SqlGeneratorConfigBuilder; -import hu.bme.mit.trainbenchmark.generator.tests.GeneratorTest; - -public class SqlGeneratorTest extends GeneratorTest { - - @Override - public void generate(final GeneratorConfigBase gcb) throws Exception { - final SqlGeneratorConfig gc = new SqlGeneratorConfigBuilder().setConfigBase(gcb).createConfig(); - final SqlSerializer serializer = new SqlSerializer(gc); - final ModelGenerator generator = ScalableGeneratorFactory.createGenerator(serializer, gc); - generator.generateModel(); - } - -} diff --git a/trainbenchmark-tool-blazegraph/.gitignore b/trainbenchmark-tool-blazegraph/.gitignore deleted file mode 100644 index ea8c4bf7f..000000000 --- a/trainbenchmark-tool-blazegraph/.gitignore +++ /dev/null @@ -1 +0,0 @@ -/target diff --git a/trainbenchmark-tool-blazegraph/build.gradle b/trainbenchmark-tool-blazegraph/build.gradle deleted file mode 100644 index d68fc50a8..000000000 --- a/trainbenchmark-tool-blazegraph/build.gradle +++ /dev/null @@ -1,12 +0,0 @@ -plugins { id "com.github.johnrengelman.shadow" version "1.2.3" } - -shadowJar { - classifier = 'fat' - mergeServiceFiles() - manifest { attributes 'Main-Class': 'hu.bme.mit.trainbenchmark.benchmark.blazegraph.BlazegraphBenchmarkMain' } -} - -dependencies { - compile project(':trainbenchmark-tool-sesame') - compile group: 'com.blazegraph', name: 'bigdata-core', version: '2.1.2' -} diff --git a/trainbenchmark-tool-blazegraph/src/main/java/hu/bme/mit/trainbenchmark/benchmark/blazegraph/BlazegraphBenchmarkMain.java b/trainbenchmark-tool-blazegraph/src/main/java/hu/bme/mit/trainbenchmark/benchmark/blazegraph/BlazegraphBenchmarkMain.java deleted file mode 100644 index 071e8c727..000000000 --- a/trainbenchmark-tool-blazegraph/src/main/java/hu/bme/mit/trainbenchmark/benchmark/blazegraph/BlazegraphBenchmarkMain.java +++ /dev/null @@ -1,26 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2010-2015, Benedek Izso, Gabor Szarnyas, Istvan Rath and Daniel Varro - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Benedek Izso - initial API and implementation - * Gabor Szarnyas - initial API and implementation - *******************************************************************************/ - -package hu.bme.mit.trainbenchmark.benchmark.blazegraph; - -import hu.bme.mit.trainbenchmark.benchmark.blazegraph.config.BlazegraphBenchmarkConfig; -import hu.bme.mit.trainbenchmark.benchmark.config.BenchmarkConfig; - -public class BlazegraphBenchmarkMain { - - public static void main(final String[] args) throws Exception { - final BlazegraphBenchmarkConfig bc = BenchmarkConfig.fromFile(args[0], BlazegraphBenchmarkConfig.class); - final BlazegraphBenchmarkScenario scenario = new BlazegraphBenchmarkScenario(bc); - scenario.performBenchmark(); - } - -} diff --git a/trainbenchmark-tool-blazegraph/src/main/java/hu/bme/mit/trainbenchmark/benchmark/blazegraph/BlazegraphBenchmarkScenario.java b/trainbenchmark-tool-blazegraph/src/main/java/hu/bme/mit/trainbenchmark/benchmark/blazegraph/BlazegraphBenchmarkScenario.java deleted file mode 100644 index e70a9fe35..000000000 --- a/trainbenchmark-tool-blazegraph/src/main/java/hu/bme/mit/trainbenchmark/benchmark/blazegraph/BlazegraphBenchmarkScenario.java +++ /dev/null @@ -1,17 +0,0 @@ -package hu.bme.mit.trainbenchmark.benchmark.blazegraph; - -import hu.bme.mit.trainbenchmark.benchmark.blazegraph.config.BlazegraphBenchmarkConfig; -import hu.bme.mit.trainbenchmark.benchmark.blazegraph.driver.BlazegraphDriver; -import hu.bme.mit.trainbenchmark.benchmark.blazegraph.driver.BlazegraphDriverFactory; -import hu.bme.mit.trainbenchmark.benchmark.phases.BenchmarkScenario; -import hu.bme.mit.trainbenchmark.benchmark.sesame.comparators.SesameMatchComparator; -import hu.bme.mit.trainbenchmark.benchmark.sesame.matches.SesameMatch; -import hu.bme.mit.trainbenchmark.benchmark.sesame.operations.SesameModelOperationFactory; - -public class BlazegraphBenchmarkScenario extends BenchmarkScenario<SesameMatch, BlazegraphDriver, BlazegraphBenchmarkConfig> { - - public BlazegraphBenchmarkScenario(final BlazegraphBenchmarkConfig bc) throws Exception { - super(new BlazegraphDriverFactory(bc.isInferencing()), new SesameModelOperationFactory<BlazegraphDriver>(), new SesameMatchComparator(), bc); - } - -} diff --git a/trainbenchmark-tool-blazegraph/src/main/java/hu/bme/mit/trainbenchmark/benchmark/blazegraph/config/BlazegraphBenchmarkConfig.java b/trainbenchmark-tool-blazegraph/src/main/java/hu/bme/mit/trainbenchmark/benchmark/blazegraph/config/BlazegraphBenchmarkConfig.java deleted file mode 100644 index 9aeb52ee2..000000000 --- a/trainbenchmark-tool-blazegraph/src/main/java/hu/bme/mit/trainbenchmark/benchmark/blazegraph/config/BlazegraphBenchmarkConfig.java +++ /dev/null @@ -1,34 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2010-2015, Benedek Izso, Gabor Szarnyas, Istvan Rath and Daniel Varro - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Benedek Izso - initial API and implementation - * Gabor Szarnyas - initial API and implementation - *******************************************************************************/ - -package hu.bme.mit.trainbenchmark.benchmark.blazegraph.config; - -import hu.bme.mit.trainbenchmark.benchmark.config.BenchmarkConfigBase; -import hu.bme.mit.trainbenchmark.benchmark.rdf.config.RdfBenchmarkConfig; - -public class BlazegraphBenchmarkConfig extends RdfBenchmarkConfig { - - protected BlazegraphBenchmarkConfig(final BenchmarkConfigBase configBase, final boolean inferencing) { - super(configBase, inferencing); - } - - @Override - public String getToolName() { - return "Blazegraph" + getToolNamePostfix(); - } - - @Override - public String getProjectName() { - return "blazegraph"; - } - -} diff --git a/trainbenchmark-tool-blazegraph/src/main/java/hu/bme/mit/trainbenchmark/benchmark/blazegraph/config/BlazegraphBenchmarkConfigBuilder.java b/trainbenchmark-tool-blazegraph/src/main/java/hu/bme/mit/trainbenchmark/benchmark/blazegraph/config/BlazegraphBenchmarkConfigBuilder.java deleted file mode 100644 index fcbbfb0b1..000000000 --- a/trainbenchmark-tool-blazegraph/src/main/java/hu/bme/mit/trainbenchmark/benchmark/blazegraph/config/BlazegraphBenchmarkConfigBuilder.java +++ /dev/null @@ -1,14 +0,0 @@ -package hu.bme.mit.trainbenchmark.benchmark.blazegraph.config; - -import hu.bme.mit.trainbenchmark.benchmark.rdf.config.RdfBenchmarkConfigBuilder; - -public class BlazegraphBenchmarkConfigBuilder - extends RdfBenchmarkConfigBuilder<BlazegraphBenchmarkConfig, BlazegraphBenchmarkConfigBuilder> { - - @Override - public BlazegraphBenchmarkConfig createConfig() { - checkNotNulls(); - return new BlazegraphBenchmarkConfig(configBase, inferencing); - } - -} diff --git a/trainbenchmark-tool-blazegraph/src/main/java/hu/bme/mit/trainbenchmark/benchmark/blazegraph/driver/BlazegraphDriver.java b/trainbenchmark-tool-blazegraph/src/main/java/hu/bme/mit/trainbenchmark/benchmark/blazegraph/driver/BlazegraphDriver.java deleted file mode 100644 index fd0eafe0a..000000000 --- a/trainbenchmark-tool-blazegraph/src/main/java/hu/bme/mit/trainbenchmark/benchmark/blazegraph/driver/BlazegraphDriver.java +++ /dev/null @@ -1,70 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2010-2015, Benedek Izso, Gabor Szarnyas, Istvan Rath and Daniel Varro - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Benedek Izso - initial API and implementation - * Gabor Szarnyas - initial API and implementation - *******************************************************************************/ - -package hu.bme.mit.trainbenchmark.benchmark.blazegraph.driver; - -import java.io.BufferedInputStream; -import java.io.File; -import java.io.IOException; -import java.io.InputStream; -import java.io.InputStreamReader; -import java.util.Properties; - -import org.apache.commons.io.FileUtils; -import org.openrdf.repository.RepositoryException; - -import com.bigdata.rdf.sail.BigdataSail; -import com.bigdata.rdf.sail.BigdataSailRepository; - -import hu.bme.mit.trainbenchmark.benchmark.sesame.driver.SesameDriver; - -public class BlazegraphDriver extends SesameDriver { - - protected final BigdataSail sail; - - public BlazegraphDriver(final boolean inferencing) throws IOException, RepositoryException { - super(inferencing); - - // remove Blazegraph banner text - System.getProperties().setProperty("com.bigdata.Banner.quiet", "true"); - System.getProperties().setProperty("com.bigdata.util.config.LogUtil.quiet", "true"); - - // load journal properties from resources - final Properties props = loadProperties("/blazegraph.properties"); - // instantiate a sail - final String journalFile = (String) props.get("com.bigdata.journal.AbstractJournal.file"); - FileUtils.deleteQuietly(new File(journalFile)); - - sail = new BigdataSail(props); - repository = new BigdataSailRepository(sail); - repository.initialize(); - } - - @Override - public void beginTransaction() { - vf = sail.getValueFactory(); - } - - @Override - public void destroy() throws Exception { - super.destroy(); - repository.shutDown(); - } - - public Properties loadProperties(final String resource) throws IOException { - final Properties p = new Properties(); - final InputStream is = this.getClass().getResourceAsStream(resource); - p.load(new InputStreamReader(new BufferedInputStream(is))); - return p; - } - -} diff --git a/trainbenchmark-tool-blazegraph/src/main/java/hu/bme/mit/trainbenchmark/benchmark/blazegraph/driver/BlazegraphDriverFactory.java b/trainbenchmark-tool-blazegraph/src/main/java/hu/bme/mit/trainbenchmark/benchmark/blazegraph/driver/BlazegraphDriverFactory.java deleted file mode 100644 index 03229ae7b..000000000 --- a/trainbenchmark-tool-blazegraph/src/main/java/hu/bme/mit/trainbenchmark/benchmark/blazegraph/driver/BlazegraphDriverFactory.java +++ /dev/null @@ -1,32 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2010-2015, Benedek Izso, Gabor Szarnyas, Istvan Rath and Daniel Varro - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Benedek Izso - initial API and implementation - * Gabor Szarnyas - initial API and implementation - *******************************************************************************/ - -package hu.bme.mit.trainbenchmark.benchmark.blazegraph.driver; - -import java.io.IOException; - -import org.openrdf.repository.RepositoryException; - -import hu.bme.mit.trainbenchmark.benchmark.rdf.driver.RdfDriverFactory; - -public class BlazegraphDriverFactory extends RdfDriverFactory<BlazegraphDriver> { - - public BlazegraphDriverFactory(final boolean inferencing) { - super(inferencing); - } - - @Override - public BlazegraphDriver createInstance() throws RepositoryException, IOException { - return new BlazegraphDriver(inferencing); - } - -} diff --git a/trainbenchmark-tool-blazegraph/src/main/resources/blazegraph.properties b/trainbenchmark-tool-blazegraph/src/main/resources/blazegraph.properties deleted file mode 100644 index fa411156e..000000000 --- a/trainbenchmark-tool-blazegraph/src/main/resources/blazegraph.properties +++ /dev/null @@ -1,4 +0,0 @@ -# For more configuration parameters see -# http://www.blazegraph.com/docs/api/index.html?com/bigdata/journal/BufferMode.html -com.bigdata.journal.AbstractJournal.bufferMode=DiskRW -com.bigdata.journal.AbstractJournal.file=/tmp/blazegraph/test.jnl diff --git a/trainbenchmark-tool-blazegraph/src/main/resources/log4j.properties b/trainbenchmark-tool-blazegraph/src/main/resources/log4j.properties deleted file mode 100644 index 2546b7774..000000000 --- a/trainbenchmark-tool-blazegraph/src/main/resources/log4j.properties +++ /dev/null @@ -1,5 +0,0 @@ -log4j.rootCategory=OFF,dest1 - -log4j.appender.dest1=org.apache.log4j.ConsoleAppender -log4j.appender.dest1.layout=org.apache.log4j.PatternLayout -log4j.appender.dest1.Threshold=OFF diff --git a/trainbenchmark-tool-blazegraph/src/test/java/hu/bme/mit/trainbenchmark/benchmark/blazegraph/test/BlazegraphTest.java b/trainbenchmark-tool-blazegraph/src/test/java/hu/bme/mit/trainbenchmark/benchmark/blazegraph/test/BlazegraphTest.java deleted file mode 100644 index 58d078fc8..000000000 --- a/trainbenchmark-tool-blazegraph/src/test/java/hu/bme/mit/trainbenchmark/benchmark/blazegraph/test/BlazegraphTest.java +++ /dev/null @@ -1,36 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2010-2015, Benedek Izso, Gabor Szarnyas, Istvan Rath and Daniel Varro - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Benedek Izso - initial API and implementation - * Gabor Szarnyas - initial API and implementation - *******************************************************************************/ - -package hu.bme.mit.trainbenchmark.benchmark.blazegraph.test; - -import org.junit.runner.RunWith; -import org.junit.runners.Parameterized; - -import hu.bme.mit.trainbenchmark.benchmark.blazegraph.BlazegraphBenchmarkScenario; -import hu.bme.mit.trainbenchmark.benchmark.blazegraph.config.BlazegraphBenchmarkConfig; -import hu.bme.mit.trainbenchmark.benchmark.blazegraph.config.BlazegraphBenchmarkConfigBuilder; -import hu.bme.mit.trainbenchmark.benchmark.config.BenchmarkConfigBase; -import hu.bme.mit.trainbenchmark.benchmark.rdf.tests.RdfTest; -import hu.bme.mit.trainbenchmark.benchmark.runcomponents.BenchmarkResult; - -@RunWith(Parameterized.class) -public class BlazegraphTest extends RdfTest { - - @Override - protected BenchmarkResult runTest(final BenchmarkConfigBase bcb) throws Exception { - final BlazegraphBenchmarkConfig bc = new BlazegraphBenchmarkConfigBuilder().setConfigBase(bcb).setInferencing(inferencing).createConfig(); - final BlazegraphBenchmarkScenario scenario = new BlazegraphBenchmarkScenario(bc); - final BenchmarkResult result = scenario.performBenchmark(); - return result; - } - -} diff --git a/trainbenchmark-tool-drools/build.gradle b/trainbenchmark-tool-drools/build.gradle deleted file mode 100644 index f62f2bde2..000000000 --- a/trainbenchmark-tool-drools/build.gradle +++ /dev/null @@ -1,15 +0,0 @@ -plugins { id "com.github.johnrengelman.shadow" version "1.2.3" } - -shadowJar { - classifier = 'fat' - manifest { attributes 'Main-Class': 'hu.bme.mit.trainbenchmark.benchmark.drools.DroolsBenchmarkMain' } -} - -ext { droolsVersion = '6.5.0.Final' } - -dependencies { - compile project(':trainbenchmark-tool-emf') - compile group: 'org.drools', name: 'drools-core', version: droolsVersion - compile group: 'org.drools', name: 'drools-compiler', version: droolsVersion - compile group: 'org.slf4j', name: 'slf4j-nop', version: slf4jVersion -} diff --git a/trainbenchmark-tool-drools/src/main/java/hu/bme/mit/trainbenchmark/benchmark/drools/DroolsBenchmarkMain.java b/trainbenchmark-tool-drools/src/main/java/hu/bme/mit/trainbenchmark/benchmark/drools/DroolsBenchmarkMain.java deleted file mode 100644 index d58341eb1..000000000 --- a/trainbenchmark-tool-drools/src/main/java/hu/bme/mit/trainbenchmark/benchmark/drools/DroolsBenchmarkMain.java +++ /dev/null @@ -1,26 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2010-2015, Benedek Izso, Gabor Szarnyas, Istvan Rath and Daniel Varro - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Benedek Izso - initial API and implementation - * Gabor Szarnyas - initial API and implementation - *******************************************************************************/ - -package hu.bme.mit.trainbenchmark.benchmark.drools; - -import hu.bme.mit.trainbenchmark.benchmark.config.BenchmarkConfig; -import hu.bme.mit.trainbenchmark.benchmark.drools.config.DroolsBenchmarkConfig; - -public class DroolsBenchmarkMain { - - public static void main(final String[] args) throws Exception { - final DroolsBenchmarkConfig bc = BenchmarkConfig.fromFile(args[0], DroolsBenchmarkConfig.class); - final DroolsBenchmarkScenario scenario = new DroolsBenchmarkScenario(bc); - scenario.performBenchmark(); - } - -} diff --git a/trainbenchmark-tool-drools/src/main/java/hu/bme/mit/trainbenchmark/benchmark/drools/DroolsBenchmarkScenario.java b/trainbenchmark-tool-drools/src/main/java/hu/bme/mit/trainbenchmark/benchmark/drools/DroolsBenchmarkScenario.java deleted file mode 100644 index 531a827b8..000000000 --- a/trainbenchmark-tool-drools/src/main/java/hu/bme/mit/trainbenchmark/benchmark/drools/DroolsBenchmarkScenario.java +++ /dev/null @@ -1,18 +0,0 @@ -package hu.bme.mit.trainbenchmark.benchmark.drools; - -import hu.bme.mit.trainbenchmark.benchmark.drools.config.DroolsBenchmarkConfig; -import hu.bme.mit.trainbenchmark.benchmark.drools.driver.DroolsDriver; -import hu.bme.mit.trainbenchmark.benchmark.drools.driver.DroolsDriverFactory; -import hu.bme.mit.trainbenchmark.benchmark.drools.operations.DroolsModelOperationFactory; -import hu.bme.mit.trainbenchmark.benchmark.emf.comparators.EmfMatchComparator; -import hu.bme.mit.trainbenchmark.benchmark.emf.matches.EmfMatch; -import hu.bme.mit.trainbenchmark.benchmark.phases.BenchmarkScenario; - -public class DroolsBenchmarkScenario - extends BenchmarkScenario<EmfMatch, DroolsDriver, DroolsBenchmarkConfig> { - - public DroolsBenchmarkScenario(final DroolsBenchmarkConfig bc) throws Exception { - super(new DroolsDriverFactory(), new DroolsModelOperationFactory(), new EmfMatchComparator(), bc); - } - -} diff --git a/trainbenchmark-tool-drools/src/main/java/hu/bme/mit/trainbenchmark/benchmark/drools/config/DroolsBenchmarkConfig.java b/trainbenchmark-tool-drools/src/main/java/hu/bme/mit/trainbenchmark/benchmark/drools/config/DroolsBenchmarkConfig.java deleted file mode 100644 index f0d59b770..000000000 --- a/trainbenchmark-tool-drools/src/main/java/hu/bme/mit/trainbenchmark/benchmark/drools/config/DroolsBenchmarkConfig.java +++ /dev/null @@ -1,34 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2010-2015, Benedek Izso, Gabor Szarnyas, Istvan Rath and Daniel Varro - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Benedek Izso - initial API and implementation - * Gabor Szarnyas - initial API and implementation - *******************************************************************************/ - -package hu.bme.mit.trainbenchmark.benchmark.drools.config; - -import hu.bme.mit.trainbenchmark.benchmark.config.BenchmarkConfig; -import hu.bme.mit.trainbenchmark.benchmark.config.BenchmarkConfigBase; - -public class DroolsBenchmarkConfig extends BenchmarkConfig { - - protected DroolsBenchmarkConfig(final BenchmarkConfigBase configBase) { - super(configBase); - } - - @Override - public String getToolName() { - return "Drools"; - } - - @Override - public String getProjectName() { - return "drools"; - } - -} diff --git a/trainbenchmark-tool-drools/src/main/java/hu/bme/mit/trainbenchmark/benchmark/drools/config/DroolsBenchmarkConfigBuilder.java b/trainbenchmark-tool-drools/src/main/java/hu/bme/mit/trainbenchmark/benchmark/drools/config/DroolsBenchmarkConfigBuilder.java deleted file mode 100644 index 9b4ea8832..000000000 --- a/trainbenchmark-tool-drools/src/main/java/hu/bme/mit/trainbenchmark/benchmark/drools/config/DroolsBenchmarkConfigBuilder.java +++ /dev/null @@ -1,14 +0,0 @@ -package hu.bme.mit.trainbenchmark.benchmark.drools.config; - -import hu.bme.mit.trainbenchmark.benchmark.config.BenchmarkConfigBuilder; - -public class DroolsBenchmarkConfigBuilder - extends BenchmarkConfigBuilder<DroolsBenchmarkConfig, DroolsBenchmarkConfigBuilder> { - - @Override - public DroolsBenchmarkConfig createConfig() { - checkNotNulls(); - return new DroolsBenchmarkConfig(configBase); - } - -} diff --git a/trainbenchmark-tool-drools/src/main/java/hu/bme/mit/trainbenchmark/benchmark/drools/driver/DroolsDriver.java b/trainbenchmark-tool-drools/src/main/java/hu/bme/mit/trainbenchmark/benchmark/drools/driver/DroolsDriver.java deleted file mode 100644 index 0130337cb..000000000 --- a/trainbenchmark-tool-drools/src/main/java/hu/bme/mit/trainbenchmark/benchmark/drools/driver/DroolsDriver.java +++ /dev/null @@ -1,104 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2010-2015, Benedek Izso, Gabor Szarnyas, Istvan Rath and Daniel Varro - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Benedek Izso - initial API and implementation - * Gabor Szarnyas - initial API and implementation - *******************************************************************************/ -package hu.bme.mit.trainbenchmark.benchmark.drools.driver; - -import org.eclipse.emf.common.notify.Notification; -import org.eclipse.emf.common.notify.Notifier; -import org.eclipse.emf.common.util.TreeIterator; -import org.eclipse.emf.ecore.EObject; -import org.eclipse.emf.ecore.util.EContentAdapter; -import org.kie.api.KieServices; -import org.kie.api.builder.KieFileSystem; -import org.kie.api.runtime.KieContainer; -import org.kie.api.runtime.KieSession; -import org.kie.api.runtime.rule.FactHandle; - -import hu.bme.mit.trainbenchmark.benchmark.emf.driver.EmfDriver; - -public class DroolsDriver extends EmfDriver { - - protected final KieServices kServices = KieServices.Factory.get(); - protected final KieFileSystem kfs = kServices.newKieFileSystem(); - protected final KieContainer kContainer = kServices.getKieClasspathContainer(); - protected final String kSessionName = "TrainBenchmarkKieSession"; - protected final KieSession kSession = kContainer.newKieSession(kSessionName); - - @Override - public void initialize() throws Exception { - super.initialize(); - } - - @Override - public void read(final String modelPathWithoutExtension) throws Exception { - super.read(modelPathWithoutExtension); - - for (final TreeIterator<EObject> tIterator = resource.getAllContents(); tIterator.hasNext();) { - final EObject eObject = tIterator.next(); - kSession.insert(eObject); - } - - final EContentAdapter adapter = new EContentAdapter() { - @Override - public void notifyChanged(final Notification notification) { - super.notifyChanged(notification); - final EObject notifier = (EObject) notification.getNotifier(); - final FactHandle notifierFH = kSession.getFactHandle(notifier); - final int event = notification.getEventType(); - - switch (event) { - case Notification.REMOVING_ADAPTER: - break; - case Notification.MOVE: - break; // currently no support for ordering - case Notification.ADD: - case Notification.ADD_MANY: - case Notification.REMOVE: - case Notification.REMOVE_MANY: - case Notification.RESOLVE: - case Notification.UNSET: - case Notification.SET: - kSession.update(notifierFH, notifier); - break; - } - } - - @Override - protected void addAdapter(final Notifier notifier) { - super.addAdapter(notifier); - - kSession.insert(notifier); - } - - @Override - protected void removeAdapter(final Notifier notifier) { - super.removeAdapter(notifier); - - final FactHandle changedFactHandle = kSession.getFactHandle(notifier); - kSession.delete(changedFactHandle); - } - }; - resource.eAdapters().add(adapter); - } - - public KieSession getKsession() { - return kSession; - } - - public KieFileSystem getKfs() { - return kfs; - } - - public KieServices getKieServices() { - return kServices; - } - -} diff --git a/trainbenchmark-tool-drools/src/main/java/hu/bme/mit/trainbenchmark/benchmark/drools/driver/DroolsDriverFactory.java b/trainbenchmark-tool-drools/src/main/java/hu/bme/mit/trainbenchmark/benchmark/drools/driver/DroolsDriverFactory.java deleted file mode 100644 index a9f1a4830..000000000 --- a/trainbenchmark-tool-drools/src/main/java/hu/bme/mit/trainbenchmark/benchmark/drools/driver/DroolsDriverFactory.java +++ /dev/null @@ -1,12 +0,0 @@ -package hu.bme.mit.trainbenchmark.benchmark.drools.driver; - -import hu.bme.mit.trainbenchmark.benchmark.driver.DriverFactory; - -public class DroolsDriverFactory extends DriverFactory<DroolsDriver> { - - @Override - public DroolsDriver createInstance() throws Exception { - return new DroolsDriver(); - } - -} diff --git a/trainbenchmark-tool-drools/src/main/java/hu/bme/mit/trainbenchmark/benchmark/drools/matches/DroolsConnectedSegmentsMatch.java b/trainbenchmark-tool-drools/src/main/java/hu/bme/mit/trainbenchmark/benchmark/drools/matches/DroolsConnectedSegmentsMatch.java deleted file mode 100644 index ac4d8435a..000000000 --- a/trainbenchmark-tool-drools/src/main/java/hu/bme/mit/trainbenchmark/benchmark/drools/matches/DroolsConnectedSegmentsMatch.java +++ /dev/null @@ -1,30 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2010-2015, Benedek Izso, Gabor Szarnyas, Istvan Rath and Daniel Varro - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Benedek Izso - initial API and implementation - * Gabor Szarnyas - initial API and implementation - *******************************************************************************/ -package hu.bme.mit.trainbenchmark.benchmark.drools.matches; - -import org.kie.api.runtime.rule.Row; - -import hu.bme.mit.trainbenchmark.benchmark.emf.matches.EmfConnectedSegmentsMatch; -import hu.bme.mit.trainbenchmark.constants.QueryConstants; -import hu.bme.mit.trainbenchmark.railway.Segment; -import hu.bme.mit.trainbenchmark.railway.Sensor; - -public class DroolsConnectedSegmentsMatch extends EmfConnectedSegmentsMatch { - - public DroolsConnectedSegmentsMatch(final Row match) { - super((Sensor) match.get(QueryConstants.VAR_SENSOR), (Segment) match.get(QueryConstants.VAR_SEGMENT1), (Segment) match - .get(QueryConstants.VAR_SEGMENT2), (Segment) match.get(QueryConstants.VAR_SEGMENT3), (Segment) match - .get(QueryConstants.VAR_SEGMENT4), (Segment) match.get(QueryConstants.VAR_SEGMENT5), (Segment) match - .get(QueryConstants.VAR_SEGMENT6)); - } - -} diff --git a/trainbenchmark-tool-drools/src/main/java/hu/bme/mit/trainbenchmark/benchmark/drools/matches/DroolsPosLengthMatch.java b/trainbenchmark-tool-drools/src/main/java/hu/bme/mit/trainbenchmark/benchmark/drools/matches/DroolsPosLengthMatch.java deleted file mode 100644 index 601cfe845..000000000 --- a/trainbenchmark-tool-drools/src/main/java/hu/bme/mit/trainbenchmark/benchmark/drools/matches/DroolsPosLengthMatch.java +++ /dev/null @@ -1,27 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2010-2015, Benedek Izso, Gabor Szarnyas, Istvan Rath and Daniel Varro - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Benedek Izso - initial API and implementation - * Gabor Szarnyas - initial API and implementation - *******************************************************************************/ -package hu.bme.mit.trainbenchmark.benchmark.drools.matches; - -import static hu.bme.mit.trainbenchmark.constants.QueryConstants.VAR_SEGMENT; - -import org.kie.api.runtime.rule.Row; - -import hu.bme.mit.trainbenchmark.benchmark.emf.matches.EmfPosLengthMatch; -import hu.bme.mit.trainbenchmark.railway.Segment; - -public class DroolsPosLengthMatch extends EmfPosLengthMatch { - - public DroolsPosLengthMatch(final Row match) { - super((Segment) match.get(VAR_SEGMENT)); - } - -} diff --git a/trainbenchmark-tool-drools/src/main/java/hu/bme/mit/trainbenchmark/benchmark/drools/matches/DroolsRouteSensorMatch.java b/trainbenchmark-tool-drools/src/main/java/hu/bme/mit/trainbenchmark/benchmark/drools/matches/DroolsRouteSensorMatch.java deleted file mode 100644 index fe007e689..000000000 --- a/trainbenchmark-tool-drools/src/main/java/hu/bme/mit/trainbenchmark/benchmark/drools/matches/DroolsRouteSensorMatch.java +++ /dev/null @@ -1,33 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2010-2015, Benedek Izso, Gabor Szarnyas, Istvan Rath and Daniel Varro - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Benedek Izso - initial API and implementation - * Gabor Szarnyas - initial API and implementation - *******************************************************************************/ -package hu.bme.mit.trainbenchmark.benchmark.drools.matches; - -import static hu.bme.mit.trainbenchmark.constants.QueryConstants.VAR_ROUTE; -import static hu.bme.mit.trainbenchmark.constants.QueryConstants.VAR_SENSOR; -import static hu.bme.mit.trainbenchmark.constants.QueryConstants.VAR_SW; -import static hu.bme.mit.trainbenchmark.constants.QueryConstants.VAR_SWP; - -import org.kie.api.runtime.rule.Row; - -import hu.bme.mit.trainbenchmark.benchmark.emf.matches.EmfRouteSensorMatch; -import hu.bme.mit.trainbenchmark.railway.Route; -import hu.bme.mit.trainbenchmark.railway.Sensor; -import hu.bme.mit.trainbenchmark.railway.Switch; -import hu.bme.mit.trainbenchmark.railway.SwitchPosition; - -public class DroolsRouteSensorMatch extends EmfRouteSensorMatch { - - public DroolsRouteSensorMatch(final Row match) { - super((Route) match.get(VAR_ROUTE), (Sensor) match.get(VAR_SENSOR), (SwitchPosition) match.get(VAR_SWP), (Switch) match.get(VAR_SW)); - } - -} diff --git a/trainbenchmark-tool-drools/src/main/java/hu/bme/mit/trainbenchmark/benchmark/drools/matches/DroolsSemaphoreNeighborMatch.java b/trainbenchmark-tool-drools/src/main/java/hu/bme/mit/trainbenchmark/benchmark/drools/matches/DroolsSemaphoreNeighborMatch.java deleted file mode 100644 index 4f1644a40..000000000 --- a/trainbenchmark-tool-drools/src/main/java/hu/bme/mit/trainbenchmark/benchmark/drools/matches/DroolsSemaphoreNeighborMatch.java +++ /dev/null @@ -1,37 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2010-2015, Benedek Izso, Gabor Szarnyas, Istvan Rath and Daniel Varro - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Benedek Izso - initial API and implementation - * Gabor Szarnyas - initial API and implementation - *******************************************************************************/ -package hu.bme.mit.trainbenchmark.benchmark.drools.matches; - -import static hu.bme.mit.trainbenchmark.constants.QueryConstants.VAR_ROUTE1; -import static hu.bme.mit.trainbenchmark.constants.QueryConstants.VAR_ROUTE2; -import static hu.bme.mit.trainbenchmark.constants.QueryConstants.VAR_SEMAPHORE; -import static hu.bme.mit.trainbenchmark.constants.QueryConstants.VAR_SENSOR1; -import static hu.bme.mit.trainbenchmark.constants.QueryConstants.VAR_SENSOR2; -import static hu.bme.mit.trainbenchmark.constants.QueryConstants.VAR_TE1; -import static hu.bme.mit.trainbenchmark.constants.QueryConstants.VAR_TE2; - -import org.kie.api.runtime.rule.Row; - -import hu.bme.mit.trainbenchmark.benchmark.emf.matches.EmfSemaphoreNeighborMatch; -import hu.bme.mit.trainbenchmark.railway.Route; -import hu.bme.mit.trainbenchmark.railway.Semaphore; -import hu.bme.mit.trainbenchmark.railway.Sensor; -import hu.bme.mit.trainbenchmark.railway.TrackElement; - -public class DroolsSemaphoreNeighborMatch extends EmfSemaphoreNeighborMatch { - - public DroolsSemaphoreNeighborMatch(final Row match) { - super((Semaphore) match.get(VAR_SEMAPHORE), (Route) match.get(VAR_ROUTE1), (Route) match.get(VAR_ROUTE2), (Sensor) match - .get(VAR_SENSOR1), (Sensor) match.get(VAR_SENSOR2), (TrackElement) match.get(VAR_TE1), (TrackElement) match.get(VAR_TE2)); - } - -} diff --git a/trainbenchmark-tool-drools/src/main/java/hu/bme/mit/trainbenchmark/benchmark/drools/matches/DroolsSwitchMonitoredMatch.java b/trainbenchmark-tool-drools/src/main/java/hu/bme/mit/trainbenchmark/benchmark/drools/matches/DroolsSwitchMonitoredMatch.java deleted file mode 100644 index 02eb67cf1..000000000 --- a/trainbenchmark-tool-drools/src/main/java/hu/bme/mit/trainbenchmark/benchmark/drools/matches/DroolsSwitchMonitoredMatch.java +++ /dev/null @@ -1,27 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2010-2015, Benedek Izso, Gabor Szarnyas, Istvan Rath and Daniel Varro - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Benedek Izso - initial API and implementation - * Gabor Szarnyas - initial API and implementation - *******************************************************************************/ -package hu.bme.mit.trainbenchmark.benchmark.drools.matches; - -import static hu.bme.mit.trainbenchmark.constants.QueryConstants.VAR_SW; - -import org.kie.api.runtime.rule.Row; - -import hu.bme.mit.trainbenchmark.benchmark.emf.matches.EmfSwitchMonitoredMatch; -import hu.bme.mit.trainbenchmark.railway.Switch; - -public class DroolsSwitchMonitoredMatch extends EmfSwitchMonitoredMatch { - - public DroolsSwitchMonitoredMatch(final Row match) { - super((Switch) match.get(VAR_SW)); - } - -} diff --git a/trainbenchmark-tool-drools/src/main/java/hu/bme/mit/trainbenchmark/benchmark/drools/matches/DroolsSwitchSetMatch.java b/trainbenchmark-tool-drools/src/main/java/hu/bme/mit/trainbenchmark/benchmark/drools/matches/DroolsSwitchSetMatch.java deleted file mode 100644 index d0c6d9f54..000000000 --- a/trainbenchmark-tool-drools/src/main/java/hu/bme/mit/trainbenchmark/benchmark/drools/matches/DroolsSwitchSetMatch.java +++ /dev/null @@ -1,34 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2010-2015, Benedek Izso, Gabor Szarnyas, Istvan Rath and Daniel Varro - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Benedek Izso - initial API and implementation - * Gabor Szarnyas - initial API and implementation - *******************************************************************************/ -package hu.bme.mit.trainbenchmark.benchmark.drools.matches; - -import static hu.bme.mit.trainbenchmark.constants.QueryConstants.VAR_ROUTE; -import static hu.bme.mit.trainbenchmark.constants.QueryConstants.VAR_SEMAPHORE; -import static hu.bme.mit.trainbenchmark.constants.QueryConstants.VAR_SW; -import static hu.bme.mit.trainbenchmark.constants.QueryConstants.VAR_SWP; - -import org.kie.api.runtime.rule.Row; - -import hu.bme.mit.trainbenchmark.benchmark.emf.matches.EmfSwitchSetMatch; -import hu.bme.mit.trainbenchmark.railway.Route; -import hu.bme.mit.trainbenchmark.railway.Semaphore; -import hu.bme.mit.trainbenchmark.railway.Switch; -import hu.bme.mit.trainbenchmark.railway.SwitchPosition; - -public class DroolsSwitchSetMatch extends EmfSwitchSetMatch { - - public DroolsSwitchSetMatch(final Row match) { - super((Semaphore) match.get(VAR_SEMAPHORE), (Route) match.get(VAR_ROUTE), (SwitchPosition) match.get(VAR_SWP), (Switch) match - .get(VAR_SW)); - } - -} diff --git a/trainbenchmark-tool-drools/src/main/java/hu/bme/mit/trainbenchmark/benchmark/drools/operations/DroolsModelOperationFactory.java b/trainbenchmark-tool-drools/src/main/java/hu/bme/mit/trainbenchmark/benchmark/drools/operations/DroolsModelOperationFactory.java deleted file mode 100644 index c51dea5da..000000000 --- a/trainbenchmark-tool-drools/src/main/java/hu/bme/mit/trainbenchmark/benchmark/drools/operations/DroolsModelOperationFactory.java +++ /dev/null @@ -1,172 +0,0 @@ -package hu.bme.mit.trainbenchmark.benchmark.drools.operations; - -import hu.bme.mit.trainbenchmark.benchmark.drools.driver.DroolsDriver; -import hu.bme.mit.trainbenchmark.benchmark.drools.matches.DroolsConnectedSegmentsMatch; -import hu.bme.mit.trainbenchmark.benchmark.drools.matches.DroolsPosLengthMatch; -import hu.bme.mit.trainbenchmark.benchmark.drools.matches.DroolsRouteSensorMatch; -import hu.bme.mit.trainbenchmark.benchmark.drools.matches.DroolsSemaphoreNeighborMatch; -import hu.bme.mit.trainbenchmark.benchmark.drools.matches.DroolsSwitchMonitoredMatch; -import hu.bme.mit.trainbenchmark.benchmark.drools.matches.DroolsSwitchSetMatch; -import hu.bme.mit.trainbenchmark.benchmark.drools.queries.DroolsQuery; -import hu.bme.mit.trainbenchmark.benchmark.emf.matches.EmfConnectedSegmentsInjectMatch; -import hu.bme.mit.trainbenchmark.benchmark.emf.matches.EmfMatch; -import hu.bme.mit.trainbenchmark.benchmark.emf.matches.EmfPosLengthInjectMatch; -import hu.bme.mit.trainbenchmark.benchmark.emf.matches.EmfRouteSensorInjectMatch; -import hu.bme.mit.trainbenchmark.benchmark.emf.matches.EmfSemaphoreNeighborInjectMatch; -import hu.bme.mit.trainbenchmark.benchmark.emf.matches.EmfSwitchMonitoredInjectMatch; -import hu.bme.mit.trainbenchmark.benchmark.emf.matches.EmfSwitchSetInjectMatch; -import hu.bme.mit.trainbenchmark.benchmark.emf.transformation.EmfTransformation; -import hu.bme.mit.trainbenchmark.benchmark.emf.transformation.inject.EmfTransformationInjectConnectedSegments; -import hu.bme.mit.trainbenchmark.benchmark.emf.transformation.inject.EmfTransformationInjectPosLength; -import hu.bme.mit.trainbenchmark.benchmark.emf.transformation.inject.EmfTransformationInjectRouteSensor; -import hu.bme.mit.trainbenchmark.benchmark.emf.transformation.inject.EmfTransformationInjectSemaphoreNeighbor; -import hu.bme.mit.trainbenchmark.benchmark.emf.transformation.inject.EmfTransformationInjectSwitchMonitored; -import hu.bme.mit.trainbenchmark.benchmark.emf.transformation.inject.EmfTransformationInjectSwitchSet; -import hu.bme.mit.trainbenchmark.benchmark.emf.transformation.query.EmfApiQuery; -import hu.bme.mit.trainbenchmark.benchmark.emf.transformation.query.EmfApiQueryConnectedSegmentsInject; -import hu.bme.mit.trainbenchmark.benchmark.emf.transformation.query.EmfApiQueryPosLengthInject; -import hu.bme.mit.trainbenchmark.benchmark.emf.transformation.query.EmfApiQueryRouteSensorInject; -import hu.bme.mit.trainbenchmark.benchmark.emf.transformation.query.EmfApiQuerySemaphoreNeighborInject; -import hu.bme.mit.trainbenchmark.benchmark.emf.transformation.query.EmfApiQuerySwitchMonitoredInject; -import hu.bme.mit.trainbenchmark.benchmark.emf.transformation.query.EmfApiQuerySwitchSetInject; -import hu.bme.mit.trainbenchmark.benchmark.emf.transformation.repair.EmfTransformationRepairConnectedSegments; -import hu.bme.mit.trainbenchmark.benchmark.emf.transformation.repair.EmfTransformationRepairPosLength; -import hu.bme.mit.trainbenchmark.benchmark.emf.transformation.repair.EmfTransformationRepairRouteSensor; -import hu.bme.mit.trainbenchmark.benchmark.emf.transformation.repair.EmfTransformationRepairSemaphoreNeighbor; -import hu.bme.mit.trainbenchmark.benchmark.emf.transformation.repair.EmfTransformationRepairSwitchMonitored; -import hu.bme.mit.trainbenchmark.benchmark.emf.transformation.repair.EmfTransformationRepairSwitchSet; -import hu.bme.mit.trainbenchmark.benchmark.operations.ModelOperation; -import hu.bme.mit.trainbenchmark.benchmark.operations.ModelOperationFactory; -import hu.bme.mit.trainbenchmark.constants.RailwayOperation; -import hu.bme.mit.trainbenchmark.constants.RailwayQuery; - -public class DroolsModelOperationFactory extends ModelOperationFactory<EmfMatch, DroolsDriver> { - - @Override - public ModelOperation<? extends EmfMatch, DroolsDriver> createOperation(final RailwayOperation operationEnum, final String workspaceDir, - final DroolsDriver driver) throws Exception { - - switch (operationEnum) { - // ConnectedSegments - case CONNECTEDSEGMENTS: { - final DroolsQuery<DroolsConnectedSegmentsMatch> query = DroolsQuery.create(driver, workspaceDir, RailwayQuery.CONNECTEDSEGMENTS); - final ModelOperation<DroolsConnectedSegmentsMatch, DroolsDriver> operation = ModelOperation.of(query); - return operation; - } - case CONNECTEDSEGMENTS_INJECT: { - final EmfApiQuery<EmfConnectedSegmentsInjectMatch, DroolsDriver> query = new EmfApiQueryConnectedSegmentsInject<>(driver); - final EmfTransformation<EmfConnectedSegmentsInjectMatch, DroolsDriver> transformation = new EmfTransformationInjectConnectedSegments<>(driver); - final ModelOperation<EmfConnectedSegmentsInjectMatch, DroolsDriver> operation = ModelOperation.of(query, transformation); - return operation; - } - case CONNECTEDSEGMENTS_REPAIR: { - final DroolsQuery<DroolsConnectedSegmentsMatch> query = DroolsQuery.create(driver, workspaceDir, RailwayQuery.CONNECTEDSEGMENTS); - final EmfTransformationRepairConnectedSegments<DroolsDriver, DroolsConnectedSegmentsMatch> transformation = new EmfTransformationRepairConnectedSegments<>( - driver); - final ModelOperation<DroolsConnectedSegmentsMatch, DroolsDriver> operation = ModelOperation.of(query, transformation); - return operation; - } - - // PosLength - case POSLENGTH: { - final DroolsQuery<DroolsPosLengthMatch> query = DroolsQuery.create(driver, workspaceDir, RailwayQuery.POSLENGTH); - final ModelOperation<DroolsPosLengthMatch, DroolsDriver> operation = ModelOperation.of(query); - return operation; - } - case POSLENGTH_INJECT: { - final EmfApiQuery<EmfPosLengthInjectMatch, DroolsDriver> query = new EmfApiQueryPosLengthInject<>(driver); - final EmfTransformation<EmfPosLengthInjectMatch, DroolsDriver> transformation = new EmfTransformationInjectPosLength<>(driver); - final ModelOperation<EmfPosLengthInjectMatch, DroolsDriver> operation = ModelOperation.of(query, transformation); - return operation; - } - case POSLENGTH_REPAIR: { - final DroolsQuery<DroolsPosLengthMatch> query = DroolsQuery.create(driver, workspaceDir, RailwayQuery.POSLENGTH); - final EmfTransformation<DroolsPosLengthMatch, DroolsDriver> transformation = new EmfTransformationRepairPosLength<>(driver); - final ModelOperation<DroolsPosLengthMatch, DroolsDriver> operation = ModelOperation.of(query, transformation); - return operation; - } - - // RouteSensor - case ROUTESENSOR: { - final DroolsQuery<DroolsRouteSensorMatch> query = DroolsQuery.create(driver, workspaceDir, RailwayQuery.ROUTESENSOR); - final ModelOperation<DroolsRouteSensorMatch, DroolsDriver> operation = ModelOperation.of(query); - return operation; - } - case ROUTESENSOR_INJECT: { - final EmfApiQuery<EmfRouteSensorInjectMatch, DroolsDriver> query = new EmfApiQueryRouteSensorInject<>(driver); - final EmfTransformation<EmfRouteSensorInjectMatch, DroolsDriver> transformation = new EmfTransformationInjectRouteSensor<>(driver); - final ModelOperation<EmfRouteSensorInjectMatch, DroolsDriver> operation = ModelOperation.of(query, transformation); - return operation; - } - case ROUTESENSOR_REPAIR: { - final DroolsQuery<DroolsRouteSensorMatch> query = DroolsQuery.create(driver, workspaceDir, RailwayQuery.ROUTESENSOR); - final EmfTransformationRepairRouteSensor<DroolsDriver, DroolsRouteSensorMatch> transformation = new EmfTransformationRepairRouteSensor<>(driver); - final ModelOperation<DroolsRouteSensorMatch, DroolsDriver> operation = ModelOperation.of(query, transformation); - return operation; - } - - // SemaphoreNeighbor - case SEMAPHORENEIGHBOR: { - final DroolsQuery<DroolsSemaphoreNeighborMatch> query = DroolsQuery.create(driver, workspaceDir, RailwayQuery.SEMAPHORENEIGHBOR); - final ModelOperation<DroolsSemaphoreNeighborMatch, DroolsDriver> operation = ModelOperation.of(query); - return operation; - } - case SEMAPHORENEIGHBOR_INJECT: { - final EmfApiQuery<EmfSemaphoreNeighborInjectMatch, DroolsDriver> query = new EmfApiQuerySemaphoreNeighborInject<>(driver); - final EmfTransformation<EmfSemaphoreNeighborInjectMatch, DroolsDriver> transformation = new EmfTransformationInjectSemaphoreNeighbor<>(driver); - final ModelOperation<EmfSemaphoreNeighborInjectMatch, DroolsDriver> operation = ModelOperation.of(query, transformation); - return operation; - } - case SEMAPHORENEIGHBOR_REPAIR: { - final DroolsQuery<DroolsSemaphoreNeighborMatch> query = DroolsQuery.create(driver, workspaceDir, RailwayQuery.SEMAPHORENEIGHBOR); - final EmfTransformationRepairSemaphoreNeighbor<DroolsDriver, DroolsSemaphoreNeighborMatch> transformation = new EmfTransformationRepairSemaphoreNeighbor<>( - driver); - final ModelOperation<DroolsSemaphoreNeighborMatch, DroolsDriver> operation = ModelOperation.of(query, transformation); - return operation; - } - - // SwitchMonitored - case SWITCHMONITORED: { - final DroolsQuery<DroolsSwitchMonitoredMatch> query = DroolsQuery.create(driver, workspaceDir, RailwayQuery.SWITCHMONITORED); - final ModelOperation<DroolsSwitchMonitoredMatch, DroolsDriver> operation = ModelOperation.of(query); - return operation; - } - case SWITCHMONITORED_INJECT: { - final EmfApiQuery<EmfSwitchMonitoredInjectMatch, DroolsDriver> query = new EmfApiQuerySwitchMonitoredInject<>(driver); - final EmfTransformation<EmfSwitchMonitoredInjectMatch, DroolsDriver> transformation = new EmfTransformationInjectSwitchMonitored<>(driver); - final ModelOperation<EmfSwitchMonitoredInjectMatch, DroolsDriver> operation = ModelOperation.of(query, transformation); - return operation; - } - case SWITCHMONITORED_REPAIR: { - final DroolsQuery<DroolsSwitchMonitoredMatch> query = DroolsQuery.create(driver, workspaceDir, RailwayQuery.SWITCHMONITORED); - final EmfTransformationRepairSwitchMonitored<DroolsDriver, DroolsSwitchMonitoredMatch> transformation = new EmfTransformationRepairSwitchMonitored<>( - driver); - final ModelOperation<DroolsSwitchMonitoredMatch, DroolsDriver> operation = ModelOperation.of(query, transformation); - return operation; - } - - // SwitchSet - case SWITCHSET: { - final DroolsQuery<DroolsSwitchSetMatch> query = DroolsQuery.create(driver, workspaceDir, RailwayQuery.SWITCHSET); - final ModelOperation<DroolsSwitchSetMatch, DroolsDriver> operation = ModelOperation.of(query); - return operation; - } - case SWITCHSET_INJECT: { - final EmfApiQuery<EmfSwitchSetInjectMatch, DroolsDriver> query = new EmfApiQuerySwitchSetInject<>(driver); - final EmfTransformation<EmfSwitchSetInjectMatch, DroolsDriver> transformation = new EmfTransformationInjectSwitchSet<>(driver); - final ModelOperation<EmfSwitchSetInjectMatch, DroolsDriver> operation = ModelOperation.of(query, transformation); - return operation; - } - case SWITCHSET_REPAIR: { - final DroolsQuery<DroolsSwitchSetMatch> query = DroolsQuery.create(driver, workspaceDir, RailwayQuery.SWITCHSET); - final EmfTransformation<DroolsSwitchSetMatch, DroolsDriver> transformation = new EmfTransformationRepairSwitchSet<>(driver); - final ModelOperation<DroolsSwitchSetMatch, DroolsDriver> operation = ModelOperation.of(query, transformation); - return operation; - } - default: - break; - } - throw new UnsupportedOperationException("Operation " + operationEnum + " not supported."); - } - -} diff --git a/trainbenchmark-tool-drools/src/main/java/hu/bme/mit/trainbenchmark/benchmark/drools/queries/DroolsQuery.java b/trainbenchmark-tool-drools/src/main/java/hu/bme/mit/trainbenchmark/benchmark/drools/queries/DroolsQuery.java deleted file mode 100644 index 5c368490c..000000000 --- a/trainbenchmark-tool-drools/src/main/java/hu/bme/mit/trainbenchmark/benchmark/drools/queries/DroolsQuery.java +++ /dev/null @@ -1,68 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2010-2015, Benedek Izso, Gabor Szarnyas, Istvan Rath and Daniel Varro - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Benedek Izso - initial API and implementation - * Gabor Szarnyas - initial API and implementation - *******************************************************************************/ -package hu.bme.mit.trainbenchmark.benchmark.drools.queries; - -import java.io.IOException; -import java.util.Collection; - -import org.kie.api.io.ResourceType; -import org.kie.api.runtime.rule.LiveQuery; -import org.kie.internal.builder.KnowledgeBuilder; -import org.kie.internal.builder.KnowledgeBuilderFactory; -import org.kie.internal.io.ResourceFactory; - -import hu.bme.mit.trainbenchmark.benchmark.drools.driver.DroolsDriver; -import hu.bme.mit.trainbenchmark.benchmark.emf.matches.EmfMatch; -import hu.bme.mit.trainbenchmark.benchmark.operations.ModelQuery; -import hu.bme.mit.trainbenchmark.constants.RailwayQuery; - -public class DroolsQuery<TMatch extends EmfMatch> extends ModelQuery<TMatch, DroolsDriver> { - - protected Collection<TMatch> matches; - protected DroolsResultListener listener; - protected LiveQuery liveQuery; - - protected DroolsQuery(final DroolsDriver driver, final String workspaceDir, final RailwayQuery query) - throws IOException { - super(query, driver); - - final String queryFile = query + ".drl"; - final KnowledgeBuilder kbuilder = KnowledgeBuilderFactory.newKnowledgeBuilder(); - kbuilder.add(ResourceFactory.newClassPathResource(queryFile, DroolsQuery.class), ResourceType.DRL); - } - - public static <TMatch extends EmfMatch> DroolsQuery<TMatch> create(final DroolsDriver driver, - final String workspaceDir, final RailwayQuery query) throws IOException { - return new DroolsQuery<TMatch>(driver, workspaceDir, query); - } - - @SuppressWarnings("unchecked") - @Override - public Collection<TMatch> evaluate() throws IOException { - if (liveQuery == null) { - listener = new DroolsResultListener(query); - liveQuery = driver.getKsession().openLiveQuery(query.toString(), new Object[] {}, listener); - } else { - driver.getKsession().fireAllRules(); - } - matches = (Collection<TMatch>) listener.getMatches(); - return matches; - } - - @Override - public void close() { - if (liveQuery != null) { - liveQuery.close(); - } - } - -} diff --git a/trainbenchmark-tool-drools/src/main/java/hu/bme/mit/trainbenchmark/benchmark/drools/queries/DroolsResultListener.java b/trainbenchmark-tool-drools/src/main/java/hu/bme/mit/trainbenchmark/benchmark/drools/queries/DroolsResultListener.java deleted file mode 100644 index a7ad058f8..000000000 --- a/trainbenchmark-tool-drools/src/main/java/hu/bme/mit/trainbenchmark/benchmark/drools/queries/DroolsResultListener.java +++ /dev/null @@ -1,77 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2010-2015, Benedek Izso, Gabor Szarnyas, Istvan Rath and Daniel Varro - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Benedek Izso - initial API and implementation - * Gabor Szarnyas - initial API and implementation - *******************************************************************************/ - -package hu.bme.mit.trainbenchmark.benchmark.drools.queries; - -import java.util.HashSet; -import java.util.Set; - -import org.kie.api.runtime.rule.Row; -import org.kie.api.runtime.rule.ViewChangedEventListener; - -import hu.bme.mit.trainbenchmark.benchmark.drools.matches.DroolsConnectedSegmentsMatch; -import hu.bme.mit.trainbenchmark.benchmark.drools.matches.DroolsPosLengthMatch; -import hu.bme.mit.trainbenchmark.benchmark.drools.matches.DroolsRouteSensorMatch; -import hu.bme.mit.trainbenchmark.benchmark.drools.matches.DroolsSemaphoreNeighborMatch; -import hu.bme.mit.trainbenchmark.benchmark.drools.matches.DroolsSwitchMonitoredMatch; -import hu.bme.mit.trainbenchmark.benchmark.drools.matches.DroolsSwitchSetMatch; -import hu.bme.mit.trainbenchmark.benchmark.emf.matches.EmfMatch; -import hu.bme.mit.trainbenchmark.constants.RailwayQuery; - -public class DroolsResultListener implements ViewChangedEventListener { - - protected RailwayQuery query; - protected final Set<EmfMatch> matches = new HashSet<>(); - - public DroolsResultListener(final RailwayQuery query) { - this.query = query; - } - - @Override - public void rowInserted(final Row row) { - matches.add(createMatch(query, row)); - } - - @Override - public void rowDeleted(final Row row) { - matches.remove(createMatch(query, row)); - } - - @Override - public void rowUpdated(final Row row) { - matches.add(createMatch(query, row)); - } - - public Set<EmfMatch> getMatches() { - return matches; - } - - private EmfMatch createMatch(final RailwayQuery query, final Row row) { - switch (query) { - case CONNECTEDSEGMENTS: - return new DroolsConnectedSegmentsMatch(row); - case POSLENGTH: - return new DroolsPosLengthMatch(row); - case ROUTESENSOR: - return new DroolsRouteSensorMatch(row); - case SEMAPHORENEIGHBOR: - return new DroolsSemaphoreNeighborMatch(row); - case SWITCHMONITORED: - return new DroolsSwitchMonitoredMatch(row); - case SWITCHSET: - return new DroolsSwitchSetMatch(row); - default: - throw new UnsupportedOperationException("Query not supported: " + query); - } - } - -} diff --git a/trainbenchmark-tool-drools/src/main/resources/META-INF/kmodule.xml b/trainbenchmark-tool-drools/src/main/resources/META-INF/kmodule.xml deleted file mode 100644 index 59e76e487..000000000 --- a/trainbenchmark-tool-drools/src/main/resources/META-INF/kmodule.xml +++ /dev/null @@ -1,9 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<kmodule xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xmlns="http://jboss.org/kie/6.0.0/kmodule"> - - <kbase name="TrainBenchmarkKB" packages="hu.bme.mit.trainbenchmark.benchmark.drools.queries"> - <ksession name="TrainBenchmarkKieSession"/> - </kbase> - -</kmodule> \ No newline at end of file diff --git a/trainbenchmark-tool-drools/src/main/resources/hu/bme/mit/trainbenchmark/benchmark/drools/queries/ConnectedSegments.drl b/trainbenchmark-tool-drools/src/main/resources/hu/bme/mit/trainbenchmark/benchmark/drools/queries/ConnectedSegments.drl deleted file mode 100644 index 549f8c0c7..000000000 --- a/trainbenchmark-tool-drools/src/main/resources/hu/bme/mit/trainbenchmark/benchmark/drools/queries/ConnectedSegments.drl +++ /dev/null @@ -1,18 +0,0 @@ -package hu.bme.mit.trainbenchmark.railway - -query "ConnectedSegments" - segment1 : Segment( ) - segment2 : Segment( this memberOf segment1.connectsTo ) - segment3 : Segment( this memberOf segment2.connectsTo ) - segment4 : Segment( this memberOf segment3.connectsTo ) - segment5 : Segment( this memberOf segment4.connectsTo ) - segment6 : Segment( this memberOf segment5.connectsTo ) - sensor : Sensor( - this memberOf segment1.monitoredBy, - this memberOf segment2.monitoredBy, - this memberOf segment3.monitoredBy, - this memberOf segment4.monitoredBy, - this memberOf segment5.monitoredBy, - this memberOf segment6.monitoredBy - ) -end diff --git a/trainbenchmark-tool-drools/src/main/resources/hu/bme/mit/trainbenchmark/benchmark/drools/queries/PosLength.drl b/trainbenchmark-tool-drools/src/main/resources/hu/bme/mit/trainbenchmark/benchmark/drools/queries/PosLength.drl deleted file mode 100644 index c91a5677e..000000000 --- a/trainbenchmark-tool-drools/src/main/resources/hu/bme/mit/trainbenchmark/benchmark/drools/queries/PosLength.drl +++ /dev/null @@ -1,5 +0,0 @@ -package hu.bme.mit.trainbenchmark.railway - -query "PosLength" - segment : Segment( length <= 0 ) -end diff --git a/trainbenchmark-tool-drools/src/main/resources/hu/bme/mit/trainbenchmark/benchmark/drools/queries/RouteSensor.drl b/trainbenchmark-tool-drools/src/main/resources/hu/bme/mit/trainbenchmark/benchmark/drools/queries/RouteSensor.drl deleted file mode 100644 index ec31d2a08..000000000 --- a/trainbenchmark-tool-drools/src/main/resources/hu/bme/mit/trainbenchmark/benchmark/drools/queries/RouteSensor.drl +++ /dev/null @@ -1,9 +0,0 @@ -package hu.bme.mit.trainbenchmark.railway - -query "RouteSensor" - route : Route() - swP : SwitchPosition( ) from route.follows - sw : Switch( this == swP.target ) - sensor : Sensor( ) from sw.monitoredBy - not Sensor( this == sensor, this memberOf route.requires ) -end diff --git a/trainbenchmark-tool-drools/src/main/resources/hu/bme/mit/trainbenchmark/benchmark/drools/queries/SemaphoreNeighbor.drl b/trainbenchmark-tool-drools/src/main/resources/hu/bme/mit/trainbenchmark/benchmark/drools/queries/SemaphoreNeighbor.drl deleted file mode 100644 index 1ab54471a..000000000 --- a/trainbenchmark-tool-drools/src/main/resources/hu/bme/mit/trainbenchmark/benchmark/drools/queries/SemaphoreNeighbor.drl +++ /dev/null @@ -1,12 +0,0 @@ -package hu.bme.mit.trainbenchmark.railway - -query "SemaphoreNeighbor" - route1 : Route( ) - sensor1 : Sensor( ) from route1.requires - te1 : TrackElement( ) from sensor1.monitors - te2 : TrackElement( ) from te1.connectsTo - sensor2 : Sensor( ) from te2.monitoredBy - semaphore : Semaphore( this == route1.exit ) - route2 : Route( requires contains sensor2, this != route1 ) - not Route( entry == semaphore, requires contains sensor2 ) -end diff --git a/trainbenchmark-tool-drools/src/main/resources/hu/bme/mit/trainbenchmark/benchmark/drools/queries/SwitchMonitored.drl b/trainbenchmark-tool-drools/src/main/resources/hu/bme/mit/trainbenchmark/benchmark/drools/queries/SwitchMonitored.drl deleted file mode 100644 index ab3d7c6cc..000000000 --- a/trainbenchmark-tool-drools/src/main/resources/hu/bme/mit/trainbenchmark/benchmark/drools/queries/SwitchMonitored.drl +++ /dev/null @@ -1,5 +0,0 @@ -package hu.bme.mit.trainbenchmark.railway - -query "SwitchMonitored" - sw : Switch( monitoredBy.isEmpty() ) -end diff --git a/trainbenchmark-tool-drools/src/main/resources/hu/bme/mit/trainbenchmark/benchmark/drools/queries/SwitchSet.drl b/trainbenchmark-tool-drools/src/main/resources/hu/bme/mit/trainbenchmark/benchmark/drools/queries/SwitchSet.drl deleted file mode 100644 index 2eb396678..000000000 --- a/trainbenchmark-tool-drools/src/main/resources/hu/bme/mit/trainbenchmark/benchmark/drools/queries/SwitchSet.drl +++ /dev/null @@ -1,8 +0,0 @@ -package hu.bme.mit.trainbenchmark.railway - -query "SwitchSet" - route : Route( active, $follows : follows ) - semaphore : Semaphore( this == route.entry ) - swP : SwitchPosition( this memberOf $follows ) - sw: Switch( this == swP.target, currentPosition.value != swP.position.value ) -end diff --git a/trainbenchmark-tool-drools/src/test/java/hu/bme/mit/trainbenchmark/benchmark/drools/test/DroolsTest.java b/trainbenchmark-tool-drools/src/test/java/hu/bme/mit/trainbenchmark/benchmark/drools/test/DroolsTest.java deleted file mode 100644 index e13fa5b13..000000000 --- a/trainbenchmark-tool-drools/src/test/java/hu/bme/mit/trainbenchmark/benchmark/drools/test/DroolsTest.java +++ /dev/null @@ -1,32 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2010-2015, Benedek Izso, Gabor Szarnyas, Istvan Rath and Daniel Varro - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Benedek Izso - initial API and implementation - * Gabor Szarnyas - initial API and implementation - *******************************************************************************/ - -package hu.bme.mit.trainbenchmark.benchmark.drools.test; - -import hu.bme.mit.trainbenchmark.benchmark.config.BenchmarkConfigBase; -import hu.bme.mit.trainbenchmark.benchmark.drools.DroolsBenchmarkScenario; -import hu.bme.mit.trainbenchmark.benchmark.drools.config.DroolsBenchmarkConfig; -import hu.bme.mit.trainbenchmark.benchmark.drools.config.DroolsBenchmarkConfigBuilder; -import hu.bme.mit.trainbenchmark.benchmark.runcomponents.BenchmarkResult; -import hu.bme.mit.trainbenchmark.benchmark.test.TrainBenchmarkTest; - -public class DroolsTest extends TrainBenchmarkTest { - - @Override - protected BenchmarkResult runTest(final BenchmarkConfigBase bcb) throws Exception { - final DroolsBenchmarkConfig bc = new DroolsBenchmarkConfigBuilder().setConfigBase(bcb).createConfig(); - final DroolsBenchmarkScenario scenario = new DroolsBenchmarkScenario(bc); - final BenchmarkResult result = scenario.performBenchmark(); - return result; - } - -} diff --git a/trainbenchmark-tool-eclipseocl/.gitignore b/trainbenchmark-tool-eclipseocl/.gitignore deleted file mode 100644 index 19f2e002c..000000000 --- a/trainbenchmark-tool-eclipseocl/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -/target -/target diff --git a/trainbenchmark-tool-eclipseocl/build.gradle b/trainbenchmark-tool-eclipseocl/build.gradle deleted file mode 100644 index ce268cb13..000000000 --- a/trainbenchmark-tool-eclipseocl/build.gradle +++ /dev/null @@ -1,14 +0,0 @@ -plugins { id "com.github.johnrengelman.shadow" version "1.2.3" } - -shadowJar { - classifier = 'fat' - manifest { attributes 'Main-Class': 'hu.bme.mit.trainbenchmark.benchmark.eclipseocl.EclipseOclBenchmarkMain' } -} - -dependencies { - compile project(':trainbenchmark-tool-emf') - compile group: 'org.eclipse.ocl', name: 'org.eclipse.ocl', version:'3.3.0.v20140120-1508' - compile group: 'org.eclipse.ocl', name: 'org.eclipse.ocl.ecore', version:'3.3.0.v20130520-1222' - compile group: 'org.eclipse.ocl', name: 'org.eclipse.ocl.common', version:'1.2.0.v20140610-0641' - compile group: 'lpg.runtime', name: 'java', version:'2.0.17-v201004271640' -} diff --git a/trainbenchmark-tool-eclipseocl/src/main/java/hu/bme/mit/trainbenchmark/benchmark/eclipseocl/EclipseOclBenchmarkMain.java b/trainbenchmark-tool-eclipseocl/src/main/java/hu/bme/mit/trainbenchmark/benchmark/eclipseocl/EclipseOclBenchmarkMain.java deleted file mode 100644 index 556ae39f7..000000000 --- a/trainbenchmark-tool-eclipseocl/src/main/java/hu/bme/mit/trainbenchmark/benchmark/eclipseocl/EclipseOclBenchmarkMain.java +++ /dev/null @@ -1,24 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2010-2015, Benedek Izso, Gabor Szarnyas, Istvan Rath and Daniel Varro - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Benedek Izso - initial API and implementation - * Gabor Szarnyas - initial API and implementation - *******************************************************************************/ -package hu.bme.mit.trainbenchmark.benchmark.eclipseocl; - -import hu.bme.mit.trainbenchmark.benchmark.config.BenchmarkConfig; -import hu.bme.mit.trainbenchmark.benchmark.eclipseocl.config.EclipseOclBenchmarkConfig; - -public class EclipseOclBenchmarkMain { - - public static void main(final String[] args) throws Exception { - final EclipseOclBenchmarkConfig bc = BenchmarkConfig.fromFile(args[0], EclipseOclBenchmarkConfig.class); - final EclipseOclBenchmarkScenario scenario = new EclipseOclBenchmarkScenario(bc); - scenario.performBenchmark(); - } -} diff --git a/trainbenchmark-tool-eclipseocl/src/main/java/hu/bme/mit/trainbenchmark/benchmark/eclipseocl/EclipseOclBenchmarkScenario.java b/trainbenchmark-tool-eclipseocl/src/main/java/hu/bme/mit/trainbenchmark/benchmark/eclipseocl/EclipseOclBenchmarkScenario.java deleted file mode 100644 index a932d19c2..000000000 --- a/trainbenchmark-tool-eclipseocl/src/main/java/hu/bme/mit/trainbenchmark/benchmark/eclipseocl/EclipseOclBenchmarkScenario.java +++ /dev/null @@ -1,17 +0,0 @@ -package hu.bme.mit.trainbenchmark.benchmark.eclipseocl; - -import hu.bme.mit.trainbenchmark.benchmark.eclipseocl.config.EclipseOclBenchmarkConfig; -import hu.bme.mit.trainbenchmark.benchmark.eclipseocl.operations.EclipseOclModelOperationFactory; -import hu.bme.mit.trainbenchmark.benchmark.emf.comparators.EmfMatchComparator; -import hu.bme.mit.trainbenchmark.benchmark.emf.driver.EmfDriver; -import hu.bme.mit.trainbenchmark.benchmark.emf.driver.EmfDriverFactory; -import hu.bme.mit.trainbenchmark.benchmark.emf.matches.EmfMatch; -import hu.bme.mit.trainbenchmark.benchmark.phases.BenchmarkScenario; - -public class EclipseOclBenchmarkScenario extends BenchmarkScenario<EmfMatch, EmfDriver, EclipseOclBenchmarkConfig> { - - public EclipseOclBenchmarkScenario(final EclipseOclBenchmarkConfig bc) throws Exception { - super(new EmfDriverFactory(), new EclipseOclModelOperationFactory(), new EmfMatchComparator(), bc); - } - -} diff --git a/trainbenchmark-tool-eclipseocl/src/main/java/hu/bme/mit/trainbenchmark/benchmark/eclipseocl/config/EclipseOclBenchmarkConfig.java b/trainbenchmark-tool-eclipseocl/src/main/java/hu/bme/mit/trainbenchmark/benchmark/eclipseocl/config/EclipseOclBenchmarkConfig.java deleted file mode 100644 index 346b3f870..000000000 --- a/trainbenchmark-tool-eclipseocl/src/main/java/hu/bme/mit/trainbenchmark/benchmark/eclipseocl/config/EclipseOclBenchmarkConfig.java +++ /dev/null @@ -1,34 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2010-2015, Benedek Izso, Gabor Szarnyas, Istvan Rath and Daniel Varro - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Benedek Izso - initial API and implementation - * Gabor Szarnyas - initial API and implementation - *******************************************************************************/ - -package hu.bme.mit.trainbenchmark.benchmark.eclipseocl.config; - -import hu.bme.mit.trainbenchmark.benchmark.config.BenchmarkConfig; -import hu.bme.mit.trainbenchmark.benchmark.config.BenchmarkConfigBase; - -public class EclipseOclBenchmarkConfig extends BenchmarkConfig { - - protected EclipseOclBenchmarkConfig(final BenchmarkConfigBase configBase) { - super(configBase); - } - - @Override - public String getToolName() { - return "Eclipse OCL"; - } - - @Override - public String getProjectName() { - return "eclipseocl"; - } - -} diff --git a/trainbenchmark-tool-eclipseocl/src/main/java/hu/bme/mit/trainbenchmark/benchmark/eclipseocl/config/EclipseOclBenchmarkConfigBuilder.java b/trainbenchmark-tool-eclipseocl/src/main/java/hu/bme/mit/trainbenchmark/benchmark/eclipseocl/config/EclipseOclBenchmarkConfigBuilder.java deleted file mode 100644 index 135fcd277..000000000 --- a/trainbenchmark-tool-eclipseocl/src/main/java/hu/bme/mit/trainbenchmark/benchmark/eclipseocl/config/EclipseOclBenchmarkConfigBuilder.java +++ /dev/null @@ -1,14 +0,0 @@ -package hu.bme.mit.trainbenchmark.benchmark.eclipseocl.config; - -import hu.bme.mit.trainbenchmark.benchmark.config.BenchmarkConfigBuilder; - -public class EclipseOclBenchmarkConfigBuilder - extends BenchmarkConfigBuilder<EclipseOclBenchmarkConfig, EclipseOclBenchmarkConfigBuilder> { - - @Override - public EclipseOclBenchmarkConfig createConfig() { - checkNotNulls(); - return new EclipseOclBenchmarkConfig(configBase); - } - -} diff --git a/trainbenchmark-tool-eclipseocl/src/main/java/hu/bme/mit/trainbenchmark/benchmark/eclipseocl/operations/EclipseOclModelOperationFactory.java b/trainbenchmark-tool-eclipseocl/src/main/java/hu/bme/mit/trainbenchmark/benchmark/eclipseocl/operations/EclipseOclModelOperationFactory.java deleted file mode 100644 index f09229c18..000000000 --- a/trainbenchmark-tool-eclipseocl/src/main/java/hu/bme/mit/trainbenchmark/benchmark/eclipseocl/operations/EclipseOclModelOperationFactory.java +++ /dev/null @@ -1,175 +0,0 @@ -package hu.bme.mit.trainbenchmark.benchmark.eclipseocl.operations; - -import hu.bme.mit.trainbenchmark.benchmark.eclipseocl.queries.EclipseOclQuery; -import hu.bme.mit.trainbenchmark.benchmark.eclipseocl.queries.EclipseOclQueryConnectedSegments; -import hu.bme.mit.trainbenchmark.benchmark.eclipseocl.queries.EclipseOclQueryPosLength; -import hu.bme.mit.trainbenchmark.benchmark.eclipseocl.queries.EclipseOclQueryRouteSensor; -import hu.bme.mit.trainbenchmark.benchmark.eclipseocl.queries.EclipseOclQuerySemaphoreNeighbor; -import hu.bme.mit.trainbenchmark.benchmark.eclipseocl.queries.EclipseOclQuerySwitchMonitored; -import hu.bme.mit.trainbenchmark.benchmark.eclipseocl.queries.EclipseOclQuerySwitchSet; -import hu.bme.mit.trainbenchmark.benchmark.emf.driver.EmfDriver; -import hu.bme.mit.trainbenchmark.benchmark.emf.matches.EmfConnectedSegmentsInjectMatch; -import hu.bme.mit.trainbenchmark.benchmark.emf.matches.EmfConnectedSegmentsMatch; -import hu.bme.mit.trainbenchmark.benchmark.emf.matches.EmfMatch; -import hu.bme.mit.trainbenchmark.benchmark.emf.matches.EmfPosLengthInjectMatch; -import hu.bme.mit.trainbenchmark.benchmark.emf.matches.EmfPosLengthMatch; -import hu.bme.mit.trainbenchmark.benchmark.emf.matches.EmfRouteSensorInjectMatch; -import hu.bme.mit.trainbenchmark.benchmark.emf.matches.EmfRouteSensorMatch; -import hu.bme.mit.trainbenchmark.benchmark.emf.matches.EmfSemaphoreNeighborInjectMatch; -import hu.bme.mit.trainbenchmark.benchmark.emf.matches.EmfSemaphoreNeighborMatch; -import hu.bme.mit.trainbenchmark.benchmark.emf.matches.EmfSwitchMonitoredInjectMatch; -import hu.bme.mit.trainbenchmark.benchmark.emf.matches.EmfSwitchMonitoredMatch; -import hu.bme.mit.trainbenchmark.benchmark.emf.matches.EmfSwitchSetInjectMatch; -import hu.bme.mit.trainbenchmark.benchmark.emf.matches.EmfSwitchSetMatch; -import hu.bme.mit.trainbenchmark.benchmark.emf.transformation.EmfTransformation; -import hu.bme.mit.trainbenchmark.benchmark.emf.transformation.inject.EmfTransformationInjectConnectedSegments; -import hu.bme.mit.trainbenchmark.benchmark.emf.transformation.inject.EmfTransformationInjectPosLength; -import hu.bme.mit.trainbenchmark.benchmark.emf.transformation.inject.EmfTransformationInjectRouteSensor; -import hu.bme.mit.trainbenchmark.benchmark.emf.transformation.inject.EmfTransformationInjectSemaphoreNeighbor; -import hu.bme.mit.trainbenchmark.benchmark.emf.transformation.inject.EmfTransformationInjectSwitchMonitored; -import hu.bme.mit.trainbenchmark.benchmark.emf.transformation.inject.EmfTransformationInjectSwitchSet; -import hu.bme.mit.trainbenchmark.benchmark.emf.transformation.query.EmfApiQuery; -import hu.bme.mit.trainbenchmark.benchmark.emf.transformation.query.EmfApiQueryConnectedSegmentsInject; -import hu.bme.mit.trainbenchmark.benchmark.emf.transformation.query.EmfApiQueryPosLengthInject; -import hu.bme.mit.trainbenchmark.benchmark.emf.transformation.query.EmfApiQueryRouteSensorInject; -import hu.bme.mit.trainbenchmark.benchmark.emf.transformation.query.EmfApiQuerySemaphoreNeighborInject; -import hu.bme.mit.trainbenchmark.benchmark.emf.transformation.query.EmfApiQuerySwitchMonitoredInject; -import hu.bme.mit.trainbenchmark.benchmark.emf.transformation.query.EmfApiQuerySwitchSetInject; -import hu.bme.mit.trainbenchmark.benchmark.emf.transformation.repair.EmfTransformationRepairConnectedSegments; -import hu.bme.mit.trainbenchmark.benchmark.emf.transformation.repair.EmfTransformationRepairPosLength; -import hu.bme.mit.trainbenchmark.benchmark.emf.transformation.repair.EmfTransformationRepairRouteSensor; -import hu.bme.mit.trainbenchmark.benchmark.emf.transformation.repair.EmfTransformationRepairSemaphoreNeighbor; -import hu.bme.mit.trainbenchmark.benchmark.emf.transformation.repair.EmfTransformationRepairSwitchMonitored; -import hu.bme.mit.trainbenchmark.benchmark.emf.transformation.repair.EmfTransformationRepairSwitchSet; -import hu.bme.mit.trainbenchmark.benchmark.operations.ModelOperation; -import hu.bme.mit.trainbenchmark.benchmark.operations.ModelOperationFactory; -import hu.bme.mit.trainbenchmark.constants.RailwayOperation; - -public class EclipseOclModelOperationFactory extends ModelOperationFactory<EmfMatch, EmfDriver> { - - @Override - public ModelOperation<? extends EmfMatch, EmfDriver> createOperation(final RailwayOperation operationEnum, final String workspaceDir, - final EmfDriver driver) throws Exception { - - switch (operationEnum) { - // ConnectedSegments - case CONNECTEDSEGMENTS: { - final EclipseOclQueryConnectedSegments query = new EclipseOclQueryConnectedSegments(driver, workspaceDir); - final ModelOperation<EmfConnectedSegmentsMatch, EmfDriver> operation = ModelOperation.of(query); - return operation; - } - case CONNECTEDSEGMENTS_INJECT: { - final EmfApiQuery<EmfConnectedSegmentsInjectMatch, EmfDriver> query = new EmfApiQueryConnectedSegmentsInject<>(driver); - final EmfTransformation<EmfConnectedSegmentsInjectMatch, EmfDriver> transformation = new EmfTransformationInjectConnectedSegments<>(driver); - final ModelOperation<EmfConnectedSegmentsInjectMatch, EmfDriver> operation = ModelOperation.of(query, transformation); - return operation; - } - case CONNECTEDSEGMENTS_REPAIR: { - final EclipseOclQuery<EmfConnectedSegmentsMatch> query = new EclipseOclQueryConnectedSegments(driver, workspaceDir); - final EmfTransformation<EmfConnectedSegmentsMatch, EmfDriver> transformation = new EmfTransformationRepairConnectedSegments<>(driver); - final ModelOperation<EmfConnectedSegmentsMatch, EmfDriver> operation = ModelOperation.of(query, transformation); - return operation; - } - - // PosLength - case POSLENGTH: { - final EclipseOclQuery<EmfPosLengthMatch> query = new EclipseOclQueryPosLength(driver, workspaceDir); - final ModelOperation<EmfPosLengthMatch, EmfDriver> operation = ModelOperation.of(query); - return operation; - } - case POSLENGTH_INJECT: { - final EmfApiQuery<EmfPosLengthInjectMatch, EmfDriver> query = new EmfApiQueryPosLengthInject<>(driver); - final EmfTransformation<EmfPosLengthInjectMatch, EmfDriver> transformation = new EmfTransformationInjectPosLength<>(driver); - final ModelOperation<EmfPosLengthInjectMatch, EmfDriver> operation = ModelOperation.of(query, transformation); - return operation; - } - case POSLENGTH_REPAIR: { - final EclipseOclQuery<EmfPosLengthMatch> query = new EclipseOclQueryPosLength(driver, workspaceDir); - final EmfTransformation<EmfPosLengthMatch, EmfDriver> transformation = new EmfTransformationRepairPosLength<>(driver); - final ModelOperation<EmfPosLengthMatch, EmfDriver> operation = ModelOperation.of(query, transformation); - return operation; - } - - // RouteSensor - case ROUTESENSOR: { - final EclipseOclQuery<EmfRouteSensorMatch> query = new EclipseOclQueryRouteSensor(driver, workspaceDir); - final ModelOperation<EmfRouteSensorMatch, EmfDriver> operation = ModelOperation.of(query); - return operation; - } - case ROUTESENSOR_INJECT: { - final EmfApiQuery<EmfRouteSensorInjectMatch, EmfDriver> query = new EmfApiQueryRouteSensorInject<>(driver); - final EmfTransformation<EmfRouteSensorInjectMatch, EmfDriver> transformation = new EmfTransformationInjectRouteSensor<>(driver); - final ModelOperation<EmfRouteSensorInjectMatch, EmfDriver> operation = ModelOperation.of(query, transformation); - return operation; - } - case ROUTESENSOR_REPAIR: { - final EclipseOclQuery<EmfRouteSensorMatch> query = new EclipseOclQueryRouteSensor(driver, workspaceDir); - final EmfTransformation<EmfRouteSensorMatch, EmfDriver> transformation = new EmfTransformationRepairRouteSensor<>(driver); - final ModelOperation<EmfRouteSensorMatch, EmfDriver> operation = ModelOperation.of(query, transformation); - return operation; - } - - // SemaphoreNeighbor - case SEMAPHORENEIGHBOR: { - final EclipseOclQuery<EmfSemaphoreNeighborMatch> query = new EclipseOclQuerySemaphoreNeighbor(driver, workspaceDir); - final ModelOperation<EmfSemaphoreNeighborMatch, EmfDriver> operation = ModelOperation.of(query); - return operation; - } - case SEMAPHORENEIGHBOR_INJECT: { - final EmfApiQuery<EmfSemaphoreNeighborInjectMatch, EmfDriver> query = new EmfApiQuerySemaphoreNeighborInject<>(driver); - final EmfTransformation<EmfSemaphoreNeighborInjectMatch, EmfDriver> transformation = new EmfTransformationInjectSemaphoreNeighbor<>(driver); - final ModelOperation<EmfSemaphoreNeighborInjectMatch, EmfDriver> operation = ModelOperation.of(query, transformation); - return operation; - } - case SEMAPHORENEIGHBOR_REPAIR: { - final EclipseOclQuery<EmfSemaphoreNeighborMatch> query = new EclipseOclQuerySemaphoreNeighbor(driver, workspaceDir); - final EmfTransformation<EmfSemaphoreNeighborMatch, EmfDriver> transformation = new EmfTransformationRepairSemaphoreNeighbor<>(driver); - final ModelOperation<EmfSemaphoreNeighborMatch, EmfDriver> operation = ModelOperation.of(query, transformation); - return operation; - } - - // SwitchMonitored - case SWITCHMONITORED: { - final EclipseOclQuery<EmfSwitchMonitoredMatch> query = new EclipseOclQuerySwitchMonitored(driver, workspaceDir); - final ModelOperation<EmfSwitchMonitoredMatch, EmfDriver> operation = ModelOperation.of(query); - return operation; - } - case SWITCHMONITORED_INJECT: { - final EmfApiQuery<EmfSwitchMonitoredInjectMatch, EmfDriver> query = new EmfApiQuerySwitchMonitoredInject<>(driver); - final EmfTransformation<EmfSwitchMonitoredInjectMatch, EmfDriver> transformation = new EmfTransformationInjectSwitchMonitored<>(driver); - final ModelOperation<EmfSwitchMonitoredInjectMatch, EmfDriver> operation = ModelOperation.of(query, transformation); - return operation; - } - case SWITCHMONITORED_REPAIR: { - final EclipseOclQuery<EmfSwitchMonitoredMatch> query = new EclipseOclQuerySwitchMonitored(driver, workspaceDir); - final EmfTransformation<EmfSwitchMonitoredMatch, EmfDriver> transformation = new EmfTransformationRepairSwitchMonitored<>(driver); - final ModelOperation<EmfSwitchMonitoredMatch, EmfDriver> operation = ModelOperation.of(query, transformation); - return operation; - } - - // SwitchSet - case SWITCHSET: { - final EclipseOclQuery<EmfSwitchSetMatch> query = new EclipseOclQuerySwitchSet(driver, workspaceDir); - final ModelOperation<EmfSwitchSetMatch, EmfDriver> operation = ModelOperation.of(query); - return operation; - } - case SWITCHSET_INJECT: { - final EmfApiQuery<EmfSwitchSetInjectMatch, EmfDriver> query = new EmfApiQuerySwitchSetInject<>(driver); - final EmfTransformation<EmfSwitchSetInjectMatch, EmfDriver> transformation = new EmfTransformationInjectSwitchSet<>(driver); - final ModelOperation<EmfSwitchSetInjectMatch, EmfDriver> operation = ModelOperation.of(query, transformation); - return operation; - } - case SWITCHSET_REPAIR: { - final EclipseOclQuery<EmfSwitchSetMatch> query = new EclipseOclQuerySwitchSet(driver, workspaceDir); - final EmfTransformation<EmfSwitchSetMatch, EmfDriver> transformation = new EmfTransformationRepairSwitchSet<>(driver); - final ModelOperation<EmfSwitchSetMatch, EmfDriver> operation = ModelOperation.of(query, transformation); - return operation; - } - - default: - break; - } - throw new UnsupportedOperationException("Operation " + operationEnum + " not supported."); - } - -} diff --git a/trainbenchmark-tool-eclipseocl/src/main/java/hu/bme/mit/trainbenchmark/benchmark/eclipseocl/queries/EclipseOclQuery.java b/trainbenchmark-tool-eclipseocl/src/main/java/hu/bme/mit/trainbenchmark/benchmark/eclipseocl/queries/EclipseOclQuery.java deleted file mode 100644 index 1f4a74676..000000000 --- a/trainbenchmark-tool-eclipseocl/src/main/java/hu/bme/mit/trainbenchmark/benchmark/eclipseocl/queries/EclipseOclQuery.java +++ /dev/null @@ -1,52 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2010-2015, Benedek Izso, Gabor Szarnyas, Istvan Rath and Daniel Varro - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Benedek Izso - initial API and implementation - * Gabor Szarnyas - initial API and implementation - *******************************************************************************/ -package hu.bme.mit.trainbenchmark.benchmark.eclipseocl.queries; - -import java.io.File; -import java.io.IOException; -import java.util.Collection; - -import org.apache.commons.io.FileUtils; -import org.eclipse.ocl.ParserException; -import org.eclipse.ocl.ecore.OCL; -import org.eclipse.ocl.ecore.OCL.Helper; -import org.eclipse.ocl.ecore.OCL.Query; -import org.eclipse.ocl.ecore.OCLExpression; - -import hu.bme.mit.trainbenchmark.benchmark.emf.driver.EmfDriver; -import hu.bme.mit.trainbenchmark.benchmark.emf.matches.EmfMatch; -import hu.bme.mit.trainbenchmark.benchmark.operations.ModelQuery; -import hu.bme.mit.trainbenchmark.constants.RailwayQuery; -import hu.bme.mit.trainbenchmark.railway.RailwayContainer; -import hu.bme.mit.trainbenchmark.railway.RailwayPackage; - -public abstract class EclipseOclQuery<TMatch extends EmfMatch> extends ModelQuery<TMatch, EmfDriver> { - - protected Collection<TMatch> matches; - protected OCL ocl; - protected Query queryEvaluator; - protected RailwayContainer container; - - public EclipseOclQuery(final EmfDriver driver, final String workspaceDir, final RailwayQuery query) throws IOException, ParserException { - super(query, driver); - - final String oclQueryDefinition = FileUtils - .readFileToString(new File(workspaceDir + "/trainbenchmark-tool-eclipseocl/src/main/resources/queries/" + query + ".ocl")); - - ocl = OCL.newInstance(); - final Helper helper = ocl.createOCLHelper(); - helper.setContext(RailwayPackage.eINSTANCE.getRailwayContainer()); - final OCLExpression expression = helper.createQuery(oclQueryDefinition); - queryEvaluator = ocl.createQuery(expression); - } - -} diff --git a/trainbenchmark-tool-eclipseocl/src/main/java/hu/bme/mit/trainbenchmark/benchmark/eclipseocl/queries/EclipseOclQueryConnectedSegments.java b/trainbenchmark-tool-eclipseocl/src/main/java/hu/bme/mit/trainbenchmark/benchmark/eclipseocl/queries/EclipseOclQueryConnectedSegments.java deleted file mode 100644 index b3dc207af..000000000 --- a/trainbenchmark-tool-eclipseocl/src/main/java/hu/bme/mit/trainbenchmark/benchmark/eclipseocl/queries/EclipseOclQueryConnectedSegments.java +++ /dev/null @@ -1,54 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2010-2015, Benedek Izso, Gabor Szarnyas, Istvan Rath and Daniel Varro - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Benedek Izso - initial API and implementation - * Gabor Szarnyas - initial API and implementation - *******************************************************************************/ -package hu.bme.mit.trainbenchmark.benchmark.eclipseocl.queries; - -import java.util.ArrayList; -import java.util.Collection; - -import org.eclipse.ocl.util.Bag; -import org.eclipse.ocl.util.Tuple; - -import hu.bme.mit.trainbenchmark.benchmark.emf.driver.EmfDriver; -import hu.bme.mit.trainbenchmark.benchmark.emf.matches.EmfConnectedSegmentsMatch; -import hu.bme.mit.trainbenchmark.constants.RailwayQuery; -import hu.bme.mit.trainbenchmark.railway.Segment; -import hu.bme.mit.trainbenchmark.railway.Sensor; - -public class EclipseOclQueryConnectedSegments extends EclipseOclQuery<EmfConnectedSegmentsMatch> { - - public EclipseOclQueryConnectedSegments(final EmfDriver driver, final String workspaceDir) throws Exception { - super(driver, workspaceDir, RailwayQuery.CONNECTEDSEGMENTS); - } - - @Override - public Collection<EmfConnectedSegmentsMatch> evaluate() { - matches = new ArrayList<>(); - - @SuppressWarnings("unchecked") - final Bag<Tuple<?, ?>> bag = (Bag<Tuple<?, ?>>) queryEvaluator.evaluate(driver.getContainer()); - for (final Tuple<?, ?> tuple : bag) { - final Sensor sensor = (Sensor) tuple.getValue("sensor"); - final Segment segment1 = (Segment) tuple.getValue("segment1"); - final Segment segment2 = (Segment) tuple.getValue("segment2"); - final Segment segment3 = (Segment) tuple.getValue("segment3"); - final Segment segment4 = (Segment) tuple.getValue("segment4"); - final Segment segment5 = (Segment) tuple.getValue("segment5"); - final Segment segment6 = (Segment) tuple.getValue("segment6"); - final EmfConnectedSegmentsMatch match = new EmfConnectedSegmentsMatch(sensor, segment1, segment2, segment3, segment4, segment5, - segment6); - matches.add(match); - } - - return matches; - } - -} diff --git a/trainbenchmark-tool-eclipseocl/src/main/java/hu/bme/mit/trainbenchmark/benchmark/eclipseocl/queries/EclipseOclQueryPosLength.java b/trainbenchmark-tool-eclipseocl/src/main/java/hu/bme/mit/trainbenchmark/benchmark/eclipseocl/queries/EclipseOclQueryPosLength.java deleted file mode 100644 index 7bfd55cf9..000000000 --- a/trainbenchmark-tool-eclipseocl/src/main/java/hu/bme/mit/trainbenchmark/benchmark/eclipseocl/queries/EclipseOclQueryPosLength.java +++ /dev/null @@ -1,45 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2010-2015, Benedek Izso, Gabor Szarnyas, Istvan Rath and Daniel Varro - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Benedek Izso - initial API and implementation - * Gabor Szarnyas - initial API and implementation - *******************************************************************************/ -package hu.bme.mit.trainbenchmark.benchmark.eclipseocl.queries; - -import java.util.ArrayList; -import java.util.Collection; - -import org.eclipse.ocl.util.Bag; -import org.eclipse.ocl.util.Tuple; - -import hu.bme.mit.trainbenchmark.benchmark.emf.driver.EmfDriver; -import hu.bme.mit.trainbenchmark.benchmark.emf.matches.EmfPosLengthMatch; -import hu.bme.mit.trainbenchmark.constants.RailwayQuery; -import hu.bme.mit.trainbenchmark.railway.Segment; - -public class EclipseOclQueryPosLength extends EclipseOclQuery<EmfPosLengthMatch> { - - public EclipseOclQueryPosLength(final EmfDriver driver, final String workspaceDir) throws Exception { - super(driver, workspaceDir, RailwayQuery.POSLENGTH); - } - - @Override - public Collection<EmfPosLengthMatch> evaluate() { - matches = new ArrayList<>(); - - @SuppressWarnings("unchecked") - final Bag<Tuple<?, ?>> bag = (Bag<Tuple<?, ?>>) queryEvaluator.evaluate(driver.getContainer()); - for (final Tuple<?, ?> tuple : bag) { - final Segment segment = (Segment) tuple.getValue("segment"); - matches.add(new EmfPosLengthMatch(segment)); - } - - return matches; - } - -} diff --git a/trainbenchmark-tool-eclipseocl/src/main/java/hu/bme/mit/trainbenchmark/benchmark/eclipseocl/queries/EclipseOclQueryRouteSensor.java b/trainbenchmark-tool-eclipseocl/src/main/java/hu/bme/mit/trainbenchmark/benchmark/eclipseocl/queries/EclipseOclQueryRouteSensor.java deleted file mode 100644 index ab9c660e8..000000000 --- a/trainbenchmark-tool-eclipseocl/src/main/java/hu/bme/mit/trainbenchmark/benchmark/eclipseocl/queries/EclipseOclQueryRouteSensor.java +++ /dev/null @@ -1,51 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2010-2015, Benedek Izso, Gabor Szarnyas, Istvan Rath and Daniel Varro - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Benedek Izso - initial API and implementation - * Gabor Szarnyas - initial API and implementation - *******************************************************************************/ -package hu.bme.mit.trainbenchmark.benchmark.eclipseocl.queries; - -import java.util.ArrayList; -import java.util.Collection; - -import org.eclipse.ocl.util.Bag; -import org.eclipse.ocl.util.Tuple; - -import hu.bme.mit.trainbenchmark.benchmark.emf.driver.EmfDriver; -import hu.bme.mit.trainbenchmark.benchmark.emf.matches.EmfRouteSensorMatch; -import hu.bme.mit.trainbenchmark.constants.RailwayQuery; -import hu.bme.mit.trainbenchmark.railway.Route; -import hu.bme.mit.trainbenchmark.railway.Sensor; -import hu.bme.mit.trainbenchmark.railway.Switch; -import hu.bme.mit.trainbenchmark.railway.SwitchPosition; - -public class EclipseOclQueryRouteSensor extends EclipseOclQuery<EmfRouteSensorMatch> { - - public EclipseOclQueryRouteSensor(final EmfDriver driver, final String workspaceDir) throws Exception { - super(driver, workspaceDir, RailwayQuery.ROUTESENSOR); - } - - @Override - public Collection<EmfRouteSensorMatch> evaluate() { - matches = new ArrayList<>(); - - @SuppressWarnings("unchecked") - final Bag<Tuple<?, ?>> bag = (Bag<Tuple<?, ?>>) queryEvaluator.evaluate(driver.getContainer()); - for (final Tuple<?, ?> tuple : bag) { - final Route route = (Route) tuple.getValue("route"); - final Sensor sensor = (Sensor) tuple.getValue("sensor"); - final SwitchPosition swP = (SwitchPosition) tuple.getValue("swP"); - final Switch sw = (Switch) tuple.getValue("sw"); - matches.add(new EmfRouteSensorMatch(route, sensor, swP, sw)); - } - - return matches; - } - -} diff --git a/trainbenchmark-tool-eclipseocl/src/main/java/hu/bme/mit/trainbenchmark/benchmark/eclipseocl/queries/EclipseOclQuerySemaphoreNeighbor.java b/trainbenchmark-tool-eclipseocl/src/main/java/hu/bme/mit/trainbenchmark/benchmark/eclipseocl/queries/EclipseOclQuerySemaphoreNeighbor.java deleted file mode 100644 index 06cecfa8b..000000000 --- a/trainbenchmark-tool-eclipseocl/src/main/java/hu/bme/mit/trainbenchmark/benchmark/eclipseocl/queries/EclipseOclQuerySemaphoreNeighbor.java +++ /dev/null @@ -1,54 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2010-2015, Benedek Izso, Gabor Szarnyas, Istvan Rath and Daniel Varro - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Benedek Izso - initial API and implementation - * Gabor Szarnyas - initial API and implementation - *******************************************************************************/ -package hu.bme.mit.trainbenchmark.benchmark.eclipseocl.queries; - -import java.util.ArrayList; -import java.util.Collection; - -import org.eclipse.ocl.util.Bag; -import org.eclipse.ocl.util.Tuple; - -import hu.bme.mit.trainbenchmark.benchmark.emf.driver.EmfDriver; -import hu.bme.mit.trainbenchmark.benchmark.emf.matches.EmfSemaphoreNeighborMatch; -import hu.bme.mit.trainbenchmark.constants.RailwayQuery; -import hu.bme.mit.trainbenchmark.railway.Route; -import hu.bme.mit.trainbenchmark.railway.Semaphore; -import hu.bme.mit.trainbenchmark.railway.Sensor; -import hu.bme.mit.trainbenchmark.railway.TrackElement; - -public class EclipseOclQuerySemaphoreNeighbor extends EclipseOclQuery<EmfSemaphoreNeighborMatch> { - - public EclipseOclQuerySemaphoreNeighbor(final EmfDriver driver, final String workspaceDir) throws Exception { - super(driver, workspaceDir, RailwayQuery.SEMAPHORENEIGHBOR); - } - - @Override - public Collection<EmfSemaphoreNeighborMatch> evaluate() { - matches = new ArrayList<>(); - - @SuppressWarnings("unchecked") - final Bag<Tuple<?, ?>> bag = (Bag<Tuple<?, ?>>) queryEvaluator.evaluate(driver.getContainer()); - for (final Tuple<?, ?> tuple : bag) { - final Semaphore semaphore = (Semaphore) tuple.getValue("semaphore"); - final Route route1 = (Route) tuple.getValue("route1"); - final Route route2 = (Route) tuple.getValue("route2"); - final Sensor sensor1 = (Sensor) tuple.getValue("sensor1"); - final Sensor sensor2 = (Sensor) tuple.getValue("sensor2"); - final TrackElement te1 = (TrackElement) tuple.getValue("te1"); - final TrackElement te2 = (TrackElement) tuple.getValue("te2"); - matches.add(new EmfSemaphoreNeighborMatch(semaphore, route1, route2, sensor1, sensor2, te1, te2)); - } - - return matches; - } - -} diff --git a/trainbenchmark-tool-eclipseocl/src/main/java/hu/bme/mit/trainbenchmark/benchmark/eclipseocl/queries/EclipseOclQuerySwitchMonitored.java b/trainbenchmark-tool-eclipseocl/src/main/java/hu/bme/mit/trainbenchmark/benchmark/eclipseocl/queries/EclipseOclQuerySwitchMonitored.java deleted file mode 100644 index c6ae33799..000000000 --- a/trainbenchmark-tool-eclipseocl/src/main/java/hu/bme/mit/trainbenchmark/benchmark/eclipseocl/queries/EclipseOclQuerySwitchMonitored.java +++ /dev/null @@ -1,45 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2010-2015, Benedek Izso, Gabor Szarnyas, Istvan Rath and Daniel Varro - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Benedek Izso - initial API and implementation - * Gabor Szarnyas - initial API and implementation - *******************************************************************************/ -package hu.bme.mit.trainbenchmark.benchmark.eclipseocl.queries; - -import java.util.ArrayList; -import java.util.Collection; - -import org.eclipse.ocl.util.Bag; -import org.eclipse.ocl.util.Tuple; - -import hu.bme.mit.trainbenchmark.benchmark.emf.driver.EmfDriver; -import hu.bme.mit.trainbenchmark.benchmark.emf.matches.EmfSwitchMonitoredMatch; -import hu.bme.mit.trainbenchmark.constants.RailwayQuery; -import hu.bme.mit.trainbenchmark.railway.Switch; - -public class EclipseOclQuerySwitchMonitored extends EclipseOclQuery<EmfSwitchMonitoredMatch> { - - public EclipseOclQuerySwitchMonitored(final EmfDriver driver, final String workspaceDir) throws Exception { - super(driver, workspaceDir, RailwayQuery.SWITCHMONITORED); - } - - @SuppressWarnings("unchecked") - @Override - public Collection<EmfSwitchMonitoredMatch> evaluate() { - matches = new ArrayList<>(); - - final Bag<Tuple<?, ?>> bag = (Bag<Tuple<?, ?>>) queryEvaluator.evaluate(driver.getContainer()); - for (final Tuple<?, ?> tuple : bag) { - final Switch sw = (Switch) tuple.getValue("sw"); - matches.add(new EmfSwitchMonitoredMatch(sw)); - } - - return matches; - } - -} diff --git a/trainbenchmark-tool-eclipseocl/src/main/java/hu/bme/mit/trainbenchmark/benchmark/eclipseocl/queries/EclipseOclQuerySwitchSet.java b/trainbenchmark-tool-eclipseocl/src/main/java/hu/bme/mit/trainbenchmark/benchmark/eclipseocl/queries/EclipseOclQuerySwitchSet.java deleted file mode 100644 index 283a9ec6d..000000000 --- a/trainbenchmark-tool-eclipseocl/src/main/java/hu/bme/mit/trainbenchmark/benchmark/eclipseocl/queries/EclipseOclQuerySwitchSet.java +++ /dev/null @@ -1,51 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2010-2015, Benedek Izso, Gabor Szarnyas, Istvan Rath and Daniel Varro - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Benedek Izso - initial API and implementation - * Gabor Szarnyas - initial API and implementation - *******************************************************************************/ -package hu.bme.mit.trainbenchmark.benchmark.eclipseocl.queries; - -import java.util.ArrayList; -import java.util.Collection; - -import org.eclipse.ocl.util.Bag; -import org.eclipse.ocl.util.Tuple; - -import hu.bme.mit.trainbenchmark.benchmark.emf.driver.EmfDriver; -import hu.bme.mit.trainbenchmark.benchmark.emf.matches.EmfSwitchSetMatch; -import hu.bme.mit.trainbenchmark.constants.RailwayQuery; -import hu.bme.mit.trainbenchmark.railway.Route; -import hu.bme.mit.trainbenchmark.railway.Semaphore; -import hu.bme.mit.trainbenchmark.railway.Switch; -import hu.bme.mit.trainbenchmark.railway.SwitchPosition; - -public class EclipseOclQuerySwitchSet extends EclipseOclQuery<EmfSwitchSetMatch> { - - public EclipseOclQuerySwitchSet(final EmfDriver driver, final String workspaceDir) throws Exception { - super(driver, workspaceDir, RailwayQuery.SWITCHSET); - } - - @Override - public Collection<EmfSwitchSetMatch> evaluate() { - matches = new ArrayList<>(); - - @SuppressWarnings("unchecked") - final Bag<Tuple<?, ?>> bag = (Bag<Tuple<?, ?>>) queryEvaluator.evaluate(driver.getContainer()); - for (final Tuple<?, ?> tuple : bag) { - final Semaphore semaphore = (Semaphore) tuple.getValue("semaphore"); - final Route route = (Route) tuple.getValue("route"); - final SwitchPosition swP = (SwitchPosition) tuple.getValue("swP"); - final Switch sw = (Switch) tuple.getValue("sw"); - matches.add(new EmfSwitchSetMatch(semaphore, route, swP, sw)); - } - - return matches; - } - -} diff --git a/trainbenchmark-tool-eclipseocl/src/main/resources/queries/ConnectedSegments.ocl b/trainbenchmark-tool-eclipseocl/src/main/resources/queries/ConnectedSegments.ocl deleted file mode 100644 index 550532ef7..000000000 --- a/trainbenchmark-tool-eclipseocl/src/main/resources/queries/ConnectedSegments.ocl +++ /dev/null @@ -1,20 +0,0 @@ -Sensor.allInstances()->collect( - sensor | sensor.monitors->select(oclIsKindOf(Segment))-> - collect(segment1 | segment1.connectsTo->select(oclIsKindOf(Segment))-> - select(segment2 | segment2.monitoredBy->includes(sensor))-> - collect(segment2 | segment2.connectsTo->select(oclIsKindOf(Segment))-> - select(segment3 | segment3.monitoredBy->includes(sensor))-> - collect(segment3 | segment3.connectsTo->select(oclIsKindOf(Segment))-> - select(segment4 | segment4.monitoredBy->includes(sensor))-> - collect(segment4 | segment4.connectsTo->select(oclIsKindOf(Segment))-> - select(segment5 | segment5.monitoredBy->includes(sensor))-> - collect(segment5 | segment5.connectsTo->select(oclIsKindOf(Segment))-> - select(segment6 | segment6.monitoredBy->includes(sensor))->collect( - segment6 | Tuple{sensor = sensor, segment1 = segment1, segment2 = segment2, segment3 = segment3, segment4 = segment4, segment5 = segment5, segment6 = segment6} - ) - ) - ) - ) - ) - ) -) diff --git a/trainbenchmark-tool-eclipseocl/src/main/resources/queries/PosLength.ocl b/trainbenchmark-tool-eclipseocl/src/main/resources/queries/PosLength.ocl deleted file mode 100644 index a1ca14344..000000000 --- a/trainbenchmark-tool-eclipseocl/src/main/resources/queries/PosLength.ocl +++ /dev/null @@ -1,5 +0,0 @@ -Segment.allInstances()->select( - segment | segment.length <= 0 -)->collect( - segment | Tuple{segment = segment} -) diff --git a/trainbenchmark-tool-eclipseocl/src/main/resources/queries/RouteSensor.ocl b/trainbenchmark-tool-eclipseocl/src/main/resources/queries/RouteSensor.ocl deleted file mode 100644 index 3772cfa4e..000000000 --- a/trainbenchmark-tool-eclipseocl/src/main/resources/queries/RouteSensor.ocl +++ /dev/null @@ -1,11 +0,0 @@ -Route.allInstances()->collect( - route | route.follows->collect( - swP | swP.target->collect( - sw | sw.monitoredBy->select( - sensor | route.requires->excludes(sensor) - )->collect( - sensor | Tuple{route = route, sensor = sensor, swP = swP, sw = sw} - ) - ) - ) -) diff --git a/trainbenchmark-tool-eclipseocl/src/main/resources/queries/SemaphoreNeighbor.ocl b/trainbenchmark-tool-eclipseocl/src/main/resources/queries/SemaphoreNeighbor.ocl deleted file mode 100644 index 47d5d4182..000000000 --- a/trainbenchmark-tool-eclipseocl/src/main/resources/queries/SemaphoreNeighbor.ocl +++ /dev/null @@ -1,16 +0,0 @@ -Route.allInstances()->collect( - route1 | route1.exit->collect( - semaphore | route1.requires->collect( - sensor1 | sensor1.monitors->collect( - te1 | te1.connectsTo->collect( - te2 | te2.monitoredBy->collect( - sensor2 | Route.allInstances()->select(route2 | route2.requires->includes(sensor2) and route2.entry->excludes(semaphore) and route1 <> route2)->collect( - route2 | Tuple{semaphore = semaphore, route1 = route1, route2 = route2, sensor1 = sensor1, sensor2 = sensor2, te1 = te1, te2 = te2} - ) - ) - ) - ) - ) - ) -) - diff --git a/trainbenchmark-tool-eclipseocl/src/main/resources/queries/SwitchMonitored.ocl b/trainbenchmark-tool-eclipseocl/src/main/resources/queries/SwitchMonitored.ocl deleted file mode 100644 index 6b3d08b86..000000000 --- a/trainbenchmark-tool-eclipseocl/src/main/resources/queries/SwitchMonitored.ocl +++ /dev/null @@ -1,5 +0,0 @@ -Switch.allInstances()->select( - sw | sw.monitoredBy->isEmpty() -)->collect( - sw | Tuple{sw = sw} -) diff --git a/trainbenchmark-tool-eclipseocl/src/main/resources/queries/SwitchSet.ocl b/trainbenchmark-tool-eclipseocl/src/main/resources/queries/SwitchSet.ocl deleted file mode 100644 index 2992e7613..000000000 --- a/trainbenchmark-tool-eclipseocl/src/main/resources/queries/SwitchSet.ocl +++ /dev/null @@ -1,9 +0,0 @@ -Route.allInstances()->select(active = true)->collect( - route | route.entry->select(signal = Signal::GO)->collect( - semaphore | route.follows->collect( - swP | swP.target->select(currentPosition <> swP.position)->collect( - sw | Tuple{route = route, semaphore = semaphore, swP = swP, sw = sw} - ) - ) - ) -) diff --git a/trainbenchmark-tool-eclipseocl/src/test/java/hu/bme/mit/trainbenchmark/benchmark/eclipseocl/test/EclipseOclTest.java b/trainbenchmark-tool-eclipseocl/src/test/java/hu/bme/mit/trainbenchmark/benchmark/eclipseocl/test/EclipseOclTest.java deleted file mode 100644 index b94095bd8..000000000 --- a/trainbenchmark-tool-eclipseocl/src/test/java/hu/bme/mit/trainbenchmark/benchmark/eclipseocl/test/EclipseOclTest.java +++ /dev/null @@ -1,32 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2010-2015, Benedek Izso, Gabor Szarnyas, Istvan Rath and Daniel Varro - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Benedek Izso - initial API and implementation - * Gabor Szarnyas - initial API and implementation - *******************************************************************************/ - -package hu.bme.mit.trainbenchmark.benchmark.eclipseocl.test; - -import hu.bme.mit.trainbenchmark.benchmark.config.BenchmarkConfigBase; -import hu.bme.mit.trainbenchmark.benchmark.eclipseocl.EclipseOclBenchmarkScenario; -import hu.bme.mit.trainbenchmark.benchmark.eclipseocl.config.EclipseOclBenchmarkConfig; -import hu.bme.mit.trainbenchmark.benchmark.eclipseocl.config.EclipseOclBenchmarkConfigBuilder; -import hu.bme.mit.trainbenchmark.benchmark.runcomponents.BenchmarkResult; -import hu.bme.mit.trainbenchmark.benchmark.test.TrainBenchmarkTest; - -public class EclipseOclTest extends TrainBenchmarkTest { - - @Override - protected BenchmarkResult runTest(final BenchmarkConfigBase bcb) throws Exception { - final EclipseOclBenchmarkConfig bc = new EclipseOclBenchmarkConfigBuilder().setConfigBase(bcb).createConfig(); - final EclipseOclBenchmarkScenario scenario = new EclipseOclBenchmarkScenario(bc); - final BenchmarkResult result = scenario.performBenchmark(); - return result; - } - -} diff --git a/trainbenchmark-tool-eclipseocl/src/test/resources/.gitignore b/trainbenchmark-tool-eclipseocl/src/test/resources/.gitignore deleted file mode 100644 index e69de29bb..000000000 diff --git a/trainbenchmark-tool-emfapi/build.gradle b/trainbenchmark-tool-emfapi/build.gradle deleted file mode 100644 index 996b34a90..000000000 --- a/trainbenchmark-tool-emfapi/build.gradle +++ /dev/null @@ -1,8 +0,0 @@ -plugins { id "com.github.johnrengelman.shadow" version "1.2.3" } - -shadowJar { - classifier = 'fat' - manifest { attributes 'Main-Class': 'hu.bme.mit.trainbenchmark.benchmark.emfapi.EmfApiBenchmarkMain' } -} - -dependencies { compile project(':trainbenchmark-tool-emf') } diff --git a/trainbenchmark-tool-emfapi/src/main/java/hu/bme/mit/trainbenchmark/benchmark/emfapi/EmfApiBenchmarkMain.java b/trainbenchmark-tool-emfapi/src/main/java/hu/bme/mit/trainbenchmark/benchmark/emfapi/EmfApiBenchmarkMain.java deleted file mode 100644 index 1805c8986..000000000 --- a/trainbenchmark-tool-emfapi/src/main/java/hu/bme/mit/trainbenchmark/benchmark/emfapi/EmfApiBenchmarkMain.java +++ /dev/null @@ -1,24 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2010-2015, Benedek Izso, Gabor Szarnyas, Istvan Rath and Daniel Varro - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Benedek Izso - initial API and implementation - * Gabor Szarnyas - initial API and implementation - *******************************************************************************/ -package hu.bme.mit.trainbenchmark.benchmark.emfapi; - -import hu.bme.mit.trainbenchmark.benchmark.config.BenchmarkConfig; -import hu.bme.mit.trainbenchmark.benchmark.emfapi.config.EmfApiBenchmarkConfig; - -public class EmfApiBenchmarkMain { - - public static void main(final String[] args) throws Exception { - final EmfApiBenchmarkConfig bc = BenchmarkConfig.fromFile(args[0], EmfApiBenchmarkConfig.class); - final EmfApiBenchmarkScenario scenario = new EmfApiBenchmarkScenario(bc); - scenario.performBenchmark(); - } -} diff --git a/trainbenchmark-tool-emfapi/src/main/java/hu/bme/mit/trainbenchmark/benchmark/emfapi/EmfApiBenchmarkScenario.java b/trainbenchmark-tool-emfapi/src/main/java/hu/bme/mit/trainbenchmark/benchmark/emfapi/EmfApiBenchmarkScenario.java deleted file mode 100644 index 8cf79652c..000000000 --- a/trainbenchmark-tool-emfapi/src/main/java/hu/bme/mit/trainbenchmark/benchmark/emfapi/EmfApiBenchmarkScenario.java +++ /dev/null @@ -1,18 +0,0 @@ -package hu.bme.mit.trainbenchmark.benchmark.emfapi; - -import hu.bme.mit.trainbenchmark.benchmark.emf.comparators.EmfMatchComparator; -import hu.bme.mit.trainbenchmark.benchmark.emf.driver.EmfDriver; -import hu.bme.mit.trainbenchmark.benchmark.emf.driver.EmfDriverFactory; -import hu.bme.mit.trainbenchmark.benchmark.emf.matches.EmfMatch; -import hu.bme.mit.trainbenchmark.benchmark.emfapi.config.EmfApiBenchmarkConfig; -import hu.bme.mit.trainbenchmark.benchmark.emfapi.operations.EmfApiModelOperationFactory; -import hu.bme.mit.trainbenchmark.benchmark.phases.BenchmarkScenario; - -public class EmfApiBenchmarkScenario - extends BenchmarkScenario<EmfMatch, EmfDriver, EmfApiBenchmarkConfig> { - - public EmfApiBenchmarkScenario(final EmfApiBenchmarkConfig bc) throws Exception { - super(new EmfDriverFactory(), new EmfApiModelOperationFactory<EmfDriver>(), new EmfMatchComparator(), bc); - } - -} diff --git a/trainbenchmark-tool-emfapi/src/main/java/hu/bme/mit/trainbenchmark/benchmark/emfapi/config/EmfApiBenchmarkConfig.java b/trainbenchmark-tool-emfapi/src/main/java/hu/bme/mit/trainbenchmark/benchmark/emfapi/config/EmfApiBenchmarkConfig.java deleted file mode 100644 index a5ceafd26..000000000 --- a/trainbenchmark-tool-emfapi/src/main/java/hu/bme/mit/trainbenchmark/benchmark/emfapi/config/EmfApiBenchmarkConfig.java +++ /dev/null @@ -1,34 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2010-2015, Benedek Izso, Gabor Szarnyas, Istvan Rath and Daniel Varro - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Benedek Izso - initial API and implementation - * Gabor Szarnyas - initial API and implementation - *******************************************************************************/ - -package hu.bme.mit.trainbenchmark.benchmark.emfapi.config; - -import hu.bme.mit.trainbenchmark.benchmark.config.BenchmarkConfig; -import hu.bme.mit.trainbenchmark.benchmark.config.BenchmarkConfigBase; - -public class EmfApiBenchmarkConfig extends BenchmarkConfig { - - protected EmfApiBenchmarkConfig(final BenchmarkConfigBase configBase) { - super(configBase); - } - - @Override - public String getToolName() { - return "EMF API"; - } - - @Override - public String getProjectName() { - return "emfapi"; - } - -} diff --git a/trainbenchmark-tool-emfapi/src/main/java/hu/bme/mit/trainbenchmark/benchmark/emfapi/config/EmfApiBenchmarkConfigBuilder.java b/trainbenchmark-tool-emfapi/src/main/java/hu/bme/mit/trainbenchmark/benchmark/emfapi/config/EmfApiBenchmarkConfigBuilder.java deleted file mode 100644 index 843f3d417..000000000 --- a/trainbenchmark-tool-emfapi/src/main/java/hu/bme/mit/trainbenchmark/benchmark/emfapi/config/EmfApiBenchmarkConfigBuilder.java +++ /dev/null @@ -1,14 +0,0 @@ -package hu.bme.mit.trainbenchmark.benchmark.emfapi.config; - -import hu.bme.mit.trainbenchmark.benchmark.config.BenchmarkConfigBuilder; - -public class EmfApiBenchmarkConfigBuilder - extends BenchmarkConfigBuilder<EmfApiBenchmarkConfig, EmfApiBenchmarkConfigBuilder> { - - @Override - public EmfApiBenchmarkConfig createConfig() { - checkNotNulls(); - return new EmfApiBenchmarkConfig(configBase); - } - -} diff --git a/trainbenchmark-tool-emfapi/src/main/java/hu/bme/mit/trainbenchmark/benchmark/emfapi/operations/EmfApiModelOperationFactory.java b/trainbenchmark-tool-emfapi/src/main/java/hu/bme/mit/trainbenchmark/benchmark/emfapi/operations/EmfApiModelOperationFactory.java deleted file mode 100644 index 1fcddb59d..000000000 --- a/trainbenchmark-tool-emfapi/src/main/java/hu/bme/mit/trainbenchmark/benchmark/emfapi/operations/EmfApiModelOperationFactory.java +++ /dev/null @@ -1,174 +0,0 @@ -package hu.bme.mit.trainbenchmark.benchmark.emfapi.operations; - -import hu.bme.mit.trainbenchmark.benchmark.emf.driver.EmfDriver; -import hu.bme.mit.trainbenchmark.benchmark.emf.matches.EmfConnectedSegmentsInjectMatch; -import hu.bme.mit.trainbenchmark.benchmark.emf.matches.EmfConnectedSegmentsMatch; -import hu.bme.mit.trainbenchmark.benchmark.emf.matches.EmfMatch; -import hu.bme.mit.trainbenchmark.benchmark.emf.matches.EmfPosLengthInjectMatch; -import hu.bme.mit.trainbenchmark.benchmark.emf.matches.EmfPosLengthMatch; -import hu.bme.mit.trainbenchmark.benchmark.emf.matches.EmfRouteSensorInjectMatch; -import hu.bme.mit.trainbenchmark.benchmark.emf.matches.EmfRouteSensorMatch; -import hu.bme.mit.trainbenchmark.benchmark.emf.matches.EmfSemaphoreNeighborInjectMatch; -import hu.bme.mit.trainbenchmark.benchmark.emf.matches.EmfSemaphoreNeighborMatch; -import hu.bme.mit.trainbenchmark.benchmark.emf.matches.EmfSwitchMonitoredInjectMatch; -import hu.bme.mit.trainbenchmark.benchmark.emf.matches.EmfSwitchMonitoredMatch; -import hu.bme.mit.trainbenchmark.benchmark.emf.matches.EmfSwitchSetInjectMatch; -import hu.bme.mit.trainbenchmark.benchmark.emf.matches.EmfSwitchSetMatch; -import hu.bme.mit.trainbenchmark.benchmark.emf.transformation.EmfTransformation; -import hu.bme.mit.trainbenchmark.benchmark.emf.transformation.inject.EmfTransformationInjectConnectedSegments; -import hu.bme.mit.trainbenchmark.benchmark.emf.transformation.inject.EmfTransformationInjectPosLength; -import hu.bme.mit.trainbenchmark.benchmark.emf.transformation.inject.EmfTransformationInjectRouteSensor; -import hu.bme.mit.trainbenchmark.benchmark.emf.transformation.inject.EmfTransformationInjectSemaphoreNeighbor; -import hu.bme.mit.trainbenchmark.benchmark.emf.transformation.inject.EmfTransformationInjectSwitchMonitored; -import hu.bme.mit.trainbenchmark.benchmark.emf.transformation.inject.EmfTransformationInjectSwitchSet; -import hu.bme.mit.trainbenchmark.benchmark.emf.transformation.query.EmfApiQuery; -import hu.bme.mit.trainbenchmark.benchmark.emf.transformation.query.EmfApiQueryConnectedSegmentsInject; -import hu.bme.mit.trainbenchmark.benchmark.emf.transformation.query.EmfApiQueryPosLengthInject; -import hu.bme.mit.trainbenchmark.benchmark.emf.transformation.query.EmfApiQueryRouteSensorInject; -import hu.bme.mit.trainbenchmark.benchmark.emf.transformation.query.EmfApiQuerySemaphoreNeighborInject; -import hu.bme.mit.trainbenchmark.benchmark.emf.transformation.query.EmfApiQuerySwitchMonitoredInject; -import hu.bme.mit.trainbenchmark.benchmark.emf.transformation.query.EmfApiQuerySwitchSetInject; -import hu.bme.mit.trainbenchmark.benchmark.emf.transformation.repair.EmfTransformationRepairConnectedSegments; -import hu.bme.mit.trainbenchmark.benchmark.emf.transformation.repair.EmfTransformationRepairPosLength; -import hu.bme.mit.trainbenchmark.benchmark.emf.transformation.repair.EmfTransformationRepairRouteSensor; -import hu.bme.mit.trainbenchmark.benchmark.emf.transformation.repair.EmfTransformationRepairSemaphoreNeighbor; -import hu.bme.mit.trainbenchmark.benchmark.emf.transformation.repair.EmfTransformationRepairSwitchMonitored; -import hu.bme.mit.trainbenchmark.benchmark.emf.transformation.repair.EmfTransformationRepairSwitchSet; -import hu.bme.mit.trainbenchmark.benchmark.emfapi.queries.EmfApiQueryConnectedSegments; -import hu.bme.mit.trainbenchmark.benchmark.emfapi.queries.EmfApiQueryPosLength; -import hu.bme.mit.trainbenchmark.benchmark.emfapi.queries.EmfApiQueryRouteSensor; -import hu.bme.mit.trainbenchmark.benchmark.emfapi.queries.EmfApiQuerySemaphoreNeighbor; -import hu.bme.mit.trainbenchmark.benchmark.emfapi.queries.EmfApiQuerySwitchMonitored; -import hu.bme.mit.trainbenchmark.benchmark.emfapi.queries.EmfApiQuerySwitchSet; -import hu.bme.mit.trainbenchmark.benchmark.operations.ModelOperation; -import hu.bme.mit.trainbenchmark.benchmark.operations.ModelOperationFactory; -import hu.bme.mit.trainbenchmark.constants.RailwayOperation; - -public class EmfApiModelOperationFactory<TDriver extends EmfDriver> extends ModelOperationFactory<EmfMatch, TDriver> { - - @Override - public ModelOperation<? extends EmfMatch, TDriver> createOperation(final RailwayOperation operationEnum, final String workspaceDir, - final TDriver driver) throws Exception { - - switch (operationEnum) { - // ConnectedSegments - case CONNECTEDSEGMENTS: { - final EmfApiQuery<EmfConnectedSegmentsMatch, TDriver> query = new EmfApiQueryConnectedSegments<>(driver); - final ModelOperation<EmfConnectedSegmentsMatch, TDriver> operation = ModelOperation.of(query); - return operation; - } - case CONNECTEDSEGMENTS_INJECT: { - final EmfApiQuery<EmfConnectedSegmentsInjectMatch, TDriver> query = new EmfApiQueryConnectedSegmentsInject<>(driver); - final EmfTransformation<EmfConnectedSegmentsInjectMatch, TDriver> transformation = new EmfTransformationInjectConnectedSegments<>(driver); - final ModelOperation<EmfConnectedSegmentsInjectMatch, TDriver> operation = ModelOperation.of(query, transformation); - return operation; - - } - case CONNECTEDSEGMENTS_REPAIR: { - final EmfApiQuery<EmfConnectedSegmentsMatch, TDriver> query = new EmfApiQueryConnectedSegments<>(driver); - final EmfTransformation<EmfConnectedSegmentsMatch, TDriver> transformation = new EmfTransformationRepairConnectedSegments<>(driver); - final ModelOperation<EmfConnectedSegmentsMatch, TDriver> operation = ModelOperation.of(query, transformation); - return operation; - } - - // PosLength - case POSLENGTH: { - final EmfApiQuery<EmfPosLengthMatch, TDriver> query = new EmfApiQueryPosLength<>(driver); - final ModelOperation<EmfPosLengthMatch, TDriver> operation = ModelOperation.of(query); - return operation; - } - case POSLENGTH_INJECT: { - final EmfApiQuery<EmfPosLengthInjectMatch, TDriver> query = new EmfApiQueryPosLengthInject<>(driver); - final EmfTransformation<EmfPosLengthInjectMatch, TDriver> transformation = new EmfTransformationInjectPosLength<>(driver); - final ModelOperation<EmfPosLengthInjectMatch, TDriver> operation = ModelOperation.of(query, transformation); - return operation; - } - case POSLENGTH_REPAIR: { - final EmfApiQuery<EmfPosLengthMatch, TDriver> query = new EmfApiQueryPosLength<>(driver); - final EmfTransformation<EmfPosLengthMatch, TDriver> transformation = new EmfTransformationRepairPosLength<>(driver); - final ModelOperation<EmfPosLengthMatch, TDriver> operation = ModelOperation.of(query, transformation); - return operation; - } - - // RouteSensor - case ROUTESENSOR: { - final EmfApiQuery<EmfRouteSensorMatch, TDriver> query = new EmfApiQueryRouteSensor<>(driver); - final ModelOperation<EmfRouteSensorMatch, TDriver> operation = ModelOperation.of(query); - return operation; - } - case ROUTESENSOR_INJECT: { - final EmfApiQuery<EmfRouteSensorInjectMatch, TDriver> query = new EmfApiQueryRouteSensorInject<>(driver); - final EmfTransformation<EmfRouteSensorInjectMatch, TDriver> transformation = new EmfTransformationInjectRouteSensor<>(driver); - final ModelOperation<EmfRouteSensorInjectMatch, TDriver> operation = ModelOperation.of(query, transformation); - return operation; - } - case ROUTESENSOR_REPAIR: { - final EmfApiQuery<EmfRouteSensorMatch, TDriver> query = new EmfApiQueryRouteSensor<>(driver); - final EmfTransformation<EmfRouteSensorMatch, TDriver> transformation = new EmfTransformationRepairRouteSensor<>(driver); - final ModelOperation<EmfRouteSensorMatch, TDriver> operation = ModelOperation.of(query, transformation); - return operation; - } - - // SemaphoreNeighbor - case SEMAPHORENEIGHBOR: { - final EmfApiQuery<EmfSemaphoreNeighborMatch, TDriver> query = new EmfApiQuerySemaphoreNeighbor<>(driver); - final ModelOperation<EmfSemaphoreNeighborMatch, TDriver> operation = ModelOperation.of(query); - return operation; - } - case SEMAPHORENEIGHBOR_INJECT: { - final EmfApiQuery<EmfSemaphoreNeighborInjectMatch, TDriver> query = new EmfApiQuerySemaphoreNeighborInject<>(driver); - final EmfTransformation<EmfSemaphoreNeighborInjectMatch, TDriver> transformation = new EmfTransformationInjectSemaphoreNeighbor<>(driver); - final ModelOperation<EmfSemaphoreNeighborInjectMatch, TDriver> operation = ModelOperation.of(query, transformation); - return operation; - } - case SEMAPHORENEIGHBOR_REPAIR: { - final EmfApiQuery<EmfSemaphoreNeighborMatch, TDriver> query = new EmfApiQuerySemaphoreNeighbor<>(driver); - final EmfTransformation<EmfSemaphoreNeighborMatch, TDriver> transformation = new EmfTransformationRepairSemaphoreNeighbor<>(driver); - final ModelOperation<EmfSemaphoreNeighborMatch, TDriver> operation = ModelOperation.of(query, transformation); - return operation; - } - - // SwitchMonitored - case SWITCHMONITORED: { - final EmfApiQuery<EmfSwitchMonitoredMatch, TDriver> query = new EmfApiQuerySwitchMonitored<>(driver); - final ModelOperation<EmfSwitchMonitoredMatch, TDriver> operation = ModelOperation.of(query); - return operation; - } - case SWITCHMONITORED_INJECT: { - final EmfApiQuery<EmfSwitchMonitoredInjectMatch, TDriver> query = new EmfApiQuerySwitchMonitoredInject<>(driver); - final EmfTransformation<EmfSwitchMonitoredInjectMatch, TDriver> transformation = new EmfTransformationInjectSwitchMonitored<>(driver); - final ModelOperation<EmfSwitchMonitoredInjectMatch, TDriver> operation = ModelOperation.of(query, transformation); - return operation; - } - case SWITCHMONITORED_REPAIR: { - final EmfApiQuery<EmfSwitchMonitoredMatch, TDriver> query = new EmfApiQuerySwitchMonitored<>(driver); - final EmfTransformation<EmfSwitchMonitoredMatch, TDriver> transformation = new EmfTransformationRepairSwitchMonitored<>(driver); - final ModelOperation<EmfSwitchMonitoredMatch, TDriver> operation = ModelOperation.of(query, transformation); - return operation; - } - - // SwitchSet - case SWITCHSET: { - final EmfApiQuery<EmfSwitchSetMatch, TDriver> query = new EmfApiQuerySwitchSet<>(driver); - final ModelOperation<EmfSwitchSetMatch, TDriver> operation = ModelOperation.of(query); - return operation; - } - case SWITCHSET_INJECT: { - final EmfApiQuery<EmfSwitchSetInjectMatch, TDriver> query = new EmfApiQuerySwitchSetInject<>(driver); - final EmfTransformation<EmfSwitchSetInjectMatch, TDriver> transformation = new EmfTransformationInjectSwitchSet<>(driver); - final ModelOperation<EmfSwitchSetInjectMatch, TDriver> operation = ModelOperation.of(query, transformation); - return operation; - } - case SWITCHSET_REPAIR: { - final EmfApiQuery<EmfSwitchSetMatch, TDriver> query = new EmfApiQuerySwitchSet<>(driver); - final EmfTransformation<EmfSwitchSetMatch, TDriver> transformation = new EmfTransformationRepairSwitchSet<>(driver); - final ModelOperation<EmfSwitchSetMatch, TDriver> operation = ModelOperation.of(query, transformation); - return operation; - } - default: - break; - } - throw new UnsupportedOperationException("Operation " + operationEnum + " not supported."); - } - -} diff --git a/trainbenchmark-tool-emfapi/src/main/java/hu/bme/mit/trainbenchmark/benchmark/emfapi/queries/EmfApiQueryConnectedSegments.java b/trainbenchmark-tool-emfapi/src/main/java/hu/bme/mit/trainbenchmark/benchmark/emfapi/queries/EmfApiQueryConnectedSegments.java deleted file mode 100644 index 3d8c65bc7..000000000 --- a/trainbenchmark-tool-emfapi/src/main/java/hu/bme/mit/trainbenchmark/benchmark/emfapi/queries/EmfApiQueryConnectedSegments.java +++ /dev/null @@ -1,124 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2010-2015, Benedek Izso, Gabor Szarnyas, Istvan Rath and Daniel Varro - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Benedek Izso - initial API and implementation - * Gabor Szarnyas - initial API and implementation - *******************************************************************************/ -package hu.bme.mit.trainbenchmark.benchmark.emfapi.queries; - -import java.util.ArrayList; -import java.util.Collection; -import java.util.List; - -import org.eclipse.emf.common.util.EList; - -import hu.bme.mit.trainbenchmark.benchmark.emf.driver.EmfDriver; -import hu.bme.mit.trainbenchmark.benchmark.emf.matches.EmfConnectedSegmentsMatch; -import hu.bme.mit.trainbenchmark.benchmark.emf.transformation.query.EmfApiQuery; -import hu.bme.mit.trainbenchmark.constants.RailwayQuery; -import hu.bme.mit.trainbenchmark.railway.RailwayPackage; -import hu.bme.mit.trainbenchmark.railway.Region; -import hu.bme.mit.trainbenchmark.railway.Segment; -import hu.bme.mit.trainbenchmark.railway.Sensor; -import hu.bme.mit.trainbenchmark.railway.TrackElement; - -public class EmfApiQueryConnectedSegments<TDriver extends EmfDriver> extends EmfApiQuery<EmfConnectedSegmentsMatch, TDriver> { - - public EmfApiQueryConnectedSegments(final TDriver driver) { - super(RailwayQuery.CONNECTEDSEGMENTS, driver); - } - - @Override - public Collection<EmfConnectedSegmentsMatch> evaluate() { - final List<EmfConnectedSegmentsMatch> matches = new ArrayList<>(); - - final EList<Region> regions = driver.getContainer().getRegions(); - for (final Region region : regions) { - for (final Sensor sensor : region.getSensors()) { - // (sensor)-[:monitors]->(segment1:Segment) - for (final TrackElement element1 : sensor.getMonitors()) { - if (!RailwayPackage.eINSTANCE.getSegment().isInstance(element1)) { - continue; - } - final Segment segment1 = (Segment) element1; - - // (segment1)-[:connectsTo]->(segment2:Segment) - for (final TrackElement element2 : segment1.getConnectsTo()) { - if (!RailwayPackage.eINSTANCE.getSegment().isInstance(element2)) { - continue; - } - final Segment segment2 = (Segment) element2; - - // (segment2:Segment)-[:monitoredBy]->(sensor) - if (!segment2.getMonitoredBy().contains(sensor)) { - continue; - } - - // (segment2)-[:connectsTo]->(segment3:Segment) - for (final TrackElement element3 : segment2.getConnectsTo()) { - if (!RailwayPackage.eINSTANCE.getSegment().isInstance(element3)) { - continue; - } - final Segment segment3 = (Segment) element3; - - // (segment3:Segment)-[:monitoredBy]->(sensor) - if (!segment3.getMonitoredBy().contains(sensor)) { - continue; - } - - // (segment3)-[:connectsTo]->(segment4:Segment) - for (final TrackElement element4 : segment3.getConnectsTo()) { - if (!RailwayPackage.eINSTANCE.getSegment().isInstance(element4)) { - continue; - } - final Segment segment4 = (Segment) element4; - - // (segment4:Segment)-[:monitoredBy]->(sensor) - if (!segment4.getMonitoredBy().contains(sensor)) { - continue; - } - - // (segment4)-[:connectsTo]->(segment5:Segment) - for (final TrackElement element5 : segment4.getConnectsTo()) { - if (!RailwayPackage.eINSTANCE.getSegment().isInstance(element5)) { - continue; - } - final Segment segment5 = (Segment) element5; - - // (segment5:Segment)-[:monitoredBy]->(sensor) - if (!segment5.getMonitoredBy().contains(sensor)) { - continue; - } - - // (segment5)-[:connectsTo]->(segment6:Segment) - for (final TrackElement element6 : segment5.getConnectsTo()) { - if (!RailwayPackage.eINSTANCE.getSegment().isInstance(element6)) { - continue; - } - final Segment segment6 = (Segment) element6; - - // (segment6:Segment)-[:monitoredBy]->(sensor) - if (!segment6.getMonitoredBy().contains(sensor)) { - continue; - } - - final EmfConnectedSegmentsMatch csm = new EmfConnectedSegmentsMatch(sensor, segment1, segment2, - segment3, segment4, segment5, segment6); - matches.add(csm); - } - } - } - } - } - } - } - } - return matches; - } - -} diff --git a/trainbenchmark-tool-emfapi/src/main/java/hu/bme/mit/trainbenchmark/benchmark/emfapi/queries/EmfApiQueryPosLength.java b/trainbenchmark-tool-emfapi/src/main/java/hu/bme/mit/trainbenchmark/benchmark/emfapi/queries/EmfApiQueryPosLength.java deleted file mode 100644 index 4f8644d57..000000000 --- a/trainbenchmark-tool-emfapi/src/main/java/hu/bme/mit/trainbenchmark/benchmark/emfapi/queries/EmfApiQueryPosLength.java +++ /dev/null @@ -1,59 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2010-2015, Benedek Izso, Gabor Szarnyas, Istvan Rath and Daniel Varro - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Benedek Izso - initial API and implementation - * Gabor Szarnyas - initial API and implementation - *******************************************************************************/ - -package hu.bme.mit.trainbenchmark.benchmark.emfapi.queries; - -import java.util.ArrayList; -import java.util.Collection; -import java.util.List; - -import org.eclipse.emf.common.util.EList; - -import hu.bme.mit.trainbenchmark.benchmark.emf.driver.EmfDriver; -import hu.bme.mit.trainbenchmark.benchmark.emf.matches.EmfPosLengthMatch; -import hu.bme.mit.trainbenchmark.benchmark.emf.transformation.query.EmfApiQuery; -import hu.bme.mit.trainbenchmark.constants.RailwayQuery; -import hu.bme.mit.trainbenchmark.railway.RailwayPackage; -import hu.bme.mit.trainbenchmark.railway.Region; -import hu.bme.mit.trainbenchmark.railway.Segment; -import hu.bme.mit.trainbenchmark.railway.TrackElement; - -public class EmfApiQueryPosLength<TDriver extends EmfDriver> extends EmfApiQuery<EmfPosLengthMatch, TDriver> { - - public EmfApiQueryPosLength(final TDriver driver) { - super(RailwayQuery.POSLENGTH, driver); - } - - @Override - public Collection<EmfPosLengthMatch> evaluate() { - final List<EmfPosLengthMatch> matches = new ArrayList<>(); - - final EList<Region> regions = driver.getContainer().getRegions(); - for (final Region region : regions) { - for (final TrackElement element : region.getElements()) { - - // (segment:Segment) - if (RailwayPackage.eINSTANCE.getSegment().isInstance(element)) { - final Segment segment = (Segment) element; - - // segment.length <= 0 - if (segment.getLength() <= 0) { - matches.add(new EmfPosLengthMatch(segment)); - } - } - } - } - - return matches; - } - -} diff --git a/trainbenchmark-tool-emfapi/src/main/java/hu/bme/mit/trainbenchmark/benchmark/emfapi/queries/EmfApiQueryRouteSensor.java b/trainbenchmark-tool-emfapi/src/main/java/hu/bme/mit/trainbenchmark/benchmark/emfapi/queries/EmfApiQueryRouteSensor.java deleted file mode 100644 index c9ffc7afc..000000000 --- a/trainbenchmark-tool-emfapi/src/main/java/hu/bme/mit/trainbenchmark/benchmark/emfapi/queries/EmfApiQueryRouteSensor.java +++ /dev/null @@ -1,68 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2010-2015, Benedek Izso, Gabor Szarnyas, Istvan Rath and Daniel Varro - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Benedek Izso - initial API and implementation - * Gabor Szarnyas - initial API and implementation - *******************************************************************************/ - -package hu.bme.mit.trainbenchmark.benchmark.emfapi.queries; - -import java.util.ArrayList; -import java.util.Collection; -import java.util.List; - -import org.eclipse.emf.common.util.EList; - -import hu.bme.mit.trainbenchmark.benchmark.emf.driver.EmfDriver; -import hu.bme.mit.trainbenchmark.benchmark.emf.matches.EmfRouteSensorMatch; -import hu.bme.mit.trainbenchmark.benchmark.emf.transformation.query.EmfApiQuery; -import hu.bme.mit.trainbenchmark.constants.RailwayQuery; -import hu.bme.mit.trainbenchmark.railway.Route; -import hu.bme.mit.trainbenchmark.railway.Sensor; -import hu.bme.mit.trainbenchmark.railway.Switch; -import hu.bme.mit.trainbenchmark.railway.SwitchPosition; - -public class EmfApiQueryRouteSensor<TDriver extends EmfDriver> extends EmfApiQuery<EmfRouteSensorMatch, TDriver> { - - public EmfApiQueryRouteSensor(final TDriver driver) { - super(RailwayQuery.ROUTESENSOR, driver); - } - - @Override - public Collection<EmfRouteSensorMatch> evaluate() { - final List<EmfRouteSensorMatch> matches = new ArrayList<>(); - - final EList<Route> routes = driver.getContainer().getRoutes(); - // (route:Route) - for (final Route route : routes) { - // (route)-[:follows]->(swP:SwitchPosition) - for (final SwitchPosition swP : route.getFollows()) { - // (swP:switchPosition)-[:target]->(sw:Switch) - final Switch sw = swP.getTarget(); - if (sw == null) { - continue; - } - - // (switch:Switch)-[:monitoredBy]->(sensor:Sensor) - final List<Sensor> sensors = sw.getMonitoredBy(); - - // TODO check n-m edge - for (final Sensor sensor2 : sensors) { - // (route)-[:requires]->(sensor) NAC - if (!route.getRequires().contains(sensor2)) { - final EmfRouteSensorMatch match = new EmfRouteSensorMatch(route, sensor2, swP, sw); - matches.add(match); - } - } - } - } - - return matches; - } - -} diff --git a/trainbenchmark-tool-emfapi/src/main/java/hu/bme/mit/trainbenchmark/benchmark/emfapi/queries/EmfApiQuerySemaphoreNeighbor.java b/trainbenchmark-tool-emfapi/src/main/java/hu/bme/mit/trainbenchmark/benchmark/emfapi/queries/EmfApiQuerySemaphoreNeighbor.java deleted file mode 100644 index 45a6a6b01..000000000 --- a/trainbenchmark-tool-emfapi/src/main/java/hu/bme/mit/trainbenchmark/benchmark/emfapi/queries/EmfApiQuerySemaphoreNeighbor.java +++ /dev/null @@ -1,81 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2010-2015, Benedek Izso, Gabor Szarnyas, Istvan Rath and Daniel Varro - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Benedek Izso - initial API and implementation - * Gabor Szarnyas - initial API and implementation - *******************************************************************************/ - -package hu.bme.mit.trainbenchmark.benchmark.emfapi.queries; - -import java.util.ArrayList; -import java.util.Collection; -import java.util.List; - -import org.eclipse.emf.common.util.EList; - -import hu.bme.mit.trainbenchmark.benchmark.emf.driver.EmfDriver; -import hu.bme.mit.trainbenchmark.benchmark.emf.matches.EmfSemaphoreNeighborMatch; -import hu.bme.mit.trainbenchmark.benchmark.emf.transformation.query.EmfApiQuery; -import hu.bme.mit.trainbenchmark.constants.RailwayQuery; -import hu.bme.mit.trainbenchmark.railway.Route; -import hu.bme.mit.trainbenchmark.railway.Semaphore; -import hu.bme.mit.trainbenchmark.railway.Sensor; -import hu.bme.mit.trainbenchmark.railway.TrackElement; - -public class EmfApiQuerySemaphoreNeighbor<TDriver extends EmfDriver> extends EmfApiQuery<EmfSemaphoreNeighborMatch, TDriver> { - - public EmfApiQuerySemaphoreNeighbor(final TDriver driver) { - super(RailwayQuery.SEMAPHORENEIGHBOR, driver); - } - - @Override - public Collection<EmfSemaphoreNeighborMatch> evaluate() { - final List<EmfSemaphoreNeighborMatch> matches = new ArrayList<>(); - - final EList<Route> routes = driver.getContainer().getRoutes(); - for (final Route route1 : routes) { - // (route1:Route)-[:exit]->(semaphore:Semaphore) - final Semaphore semaphore = route1.getExit(); - if (semaphore == null) { - continue; - } - - // (route1:Route)-[:requires]->(sensor1:Sensor) - for (final Sensor sensor1 : route1.getRequires()) { - // (sensor1:Sensor)<-[:monitoredBy]-(te1:TrackElement) - for (final TrackElement te1 : sensor1.getMonitors()) { - // (te1:TrackElement)-[:connectsTo]->(te2:TrackElement) - for (final TrackElement te2 : te1.getConnectsTo()) { - // (te2:TrackElement)<-[:monitoredBy]-(sensor2:Sensor) - for (final Sensor sensor2 : te2.getMonitoredBy()) { - // (route2:Route)-[:requires]->(sensor2:Sensor) - for (final Route route2 : routes) { - if (!route2.getRequires().contains(sensor2)) { - continue; - } - - // route1 != route2 - if (route1.equals(route2)) { - continue; - } - - // (route2:Route)-[:entry]->(semaphore:Semaphore) NAC - if (!semaphore.equals(route2.getEntry())) { - matches.add(new EmfSemaphoreNeighborMatch(semaphore, route1, route2, sensor1, sensor2, te1, te2)); - } - } - } - } - } - } - } - - return matches; - } - -} diff --git a/trainbenchmark-tool-emfapi/src/main/java/hu/bme/mit/trainbenchmark/benchmark/emfapi/queries/EmfApiQuerySwitchMonitored.java b/trainbenchmark-tool-emfapi/src/main/java/hu/bme/mit/trainbenchmark/benchmark/emfapi/queries/EmfApiQuerySwitchMonitored.java deleted file mode 100644 index 4a7125e24..000000000 --- a/trainbenchmark-tool-emfapi/src/main/java/hu/bme/mit/trainbenchmark/benchmark/emfapi/queries/EmfApiQuerySwitchMonitored.java +++ /dev/null @@ -1,59 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2010-2015, Benedek Izso, Gabor Szarnyas, Istvan Rath and Daniel Varro - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Benedek Izso - initial API and implementation - * Gabor Szarnyas - initial API and implementation - *******************************************************************************/ - -package hu.bme.mit.trainbenchmark.benchmark.emfapi.queries; - -import java.util.ArrayList; -import java.util.Collection; -import java.util.List; - -import org.eclipse.emf.common.util.EList; - -import hu.bme.mit.trainbenchmark.benchmark.emf.driver.EmfDriver; -import hu.bme.mit.trainbenchmark.benchmark.emf.matches.EmfSwitchMonitoredMatch; -import hu.bme.mit.trainbenchmark.benchmark.emf.transformation.query.EmfApiQuery; -import hu.bme.mit.trainbenchmark.constants.RailwayQuery; -import hu.bme.mit.trainbenchmark.railway.RailwayPackage; -import hu.bme.mit.trainbenchmark.railway.Region; -import hu.bme.mit.trainbenchmark.railway.Switch; -import hu.bme.mit.trainbenchmark.railway.TrackElement; - -public class EmfApiQuerySwitchMonitored<TDriver extends EmfDriver> extends EmfApiQuery<EmfSwitchMonitoredMatch, TDriver> { - - public EmfApiQuerySwitchMonitored(final TDriver driver) { - super(RailwayQuery.SWITCHMONITORED, driver); - } - - @Override - public Collection<EmfSwitchMonitoredMatch> evaluate() { - final List<EmfSwitchMonitoredMatch> matches = new ArrayList<>(); - - final EList<Region> regions = driver.getContainer().getRegions(); - for (final Region region : regions) { - for (final TrackElement element : region.getElements()) { - if (!RailwayPackage.eINSTANCE.getSwitch().isInstance(element)) { - continue; - } - - // (sw:Switch) - final Switch sw = (Switch) element; - - // (sw)-[:monitoredBy]->() NAC - if (sw.getMonitoredBy().isEmpty()) { - matches.add(new EmfSwitchMonitoredMatch(sw)); - } - } - } - - return matches; - } -} diff --git a/trainbenchmark-tool-emfapi/src/main/java/hu/bme/mit/trainbenchmark/benchmark/emfapi/queries/EmfApiQuerySwitchSet.java b/trainbenchmark-tool-emfapi/src/main/java/hu/bme/mit/trainbenchmark/benchmark/emfapi/queries/EmfApiQuerySwitchSet.java deleted file mode 100644 index daa9b8276..000000000 --- a/trainbenchmark-tool-emfapi/src/main/java/hu/bme/mit/trainbenchmark/benchmark/emfapi/queries/EmfApiQuerySwitchSet.java +++ /dev/null @@ -1,68 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2010-2015, Benedek Izso, Gabor Szarnyas, Istvan Rath and Daniel Varro - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Benedek Izso - initial API and implementation - * Gabor Szarnyas - initial API and implementation - *******************************************************************************/ - -package hu.bme.mit.trainbenchmark.benchmark.emfapi.queries; - -import java.util.ArrayList; -import java.util.Collection; -import java.util.List; - -import org.eclipse.emf.common.util.EList; - -import hu.bme.mit.trainbenchmark.benchmark.emf.driver.EmfDriver; -import hu.bme.mit.trainbenchmark.benchmark.emf.matches.EmfSwitchSetMatch; -import hu.bme.mit.trainbenchmark.benchmark.emf.transformation.query.EmfApiQuery; -import hu.bme.mit.trainbenchmark.constants.RailwayQuery; -import hu.bme.mit.trainbenchmark.railway.Route; -import hu.bme.mit.trainbenchmark.railway.Semaphore; -import hu.bme.mit.trainbenchmark.railway.Signal; -import hu.bme.mit.trainbenchmark.railway.Switch; -import hu.bme.mit.trainbenchmark.railway.SwitchPosition; - -public class EmfApiQuerySwitchSet<TDriver extends EmfDriver> extends EmfApiQuery<EmfSwitchSetMatch, TDriver> { - - public EmfApiQuerySwitchSet(final TDriver driver) { - super(RailwayQuery.SWITCHSET, driver); - } - - @Override - public Collection<EmfSwitchSetMatch> evaluate() { - final List<EmfSwitchSetMatch> matches = new ArrayList<>(); - - final EList<Route> routes = driver.getContainer().getRoutes(); - for (final Route route : routes) { - if (!route.isActive()) { - continue; - } - - // (route:Route)-[:entry]->(semaphore:Semaphore) - final Semaphore semaphore = route.getEntry(); - if (semaphore == null) { - continue; - } - // semaphore.signal == GO - if (semaphore.getSignal() == Signal.GO) { - // (route:Route)-[:follows]->(swP:SwitchPosition) - for (final SwitchPosition switchPosition : route.getFollows()) { - // (swP:SwitchPosition)-[:target]->(sw:Switch) - final Switch sw = switchPosition.getTarget(); - // sw.currentPosition != swP.position - if (sw.getCurrentPosition() != switchPosition.getPosition()) { - matches.add(new EmfSwitchSetMatch(semaphore, route, switchPosition, sw)); - } - } - } - } - - return matches; - } -} diff --git a/trainbenchmark-tool-emfapi/src/main/resources/.gitignore b/trainbenchmark-tool-emfapi/src/main/resources/.gitignore deleted file mode 100644 index e69de29bb..000000000 diff --git a/trainbenchmark-tool-emfapi/src/test/java/hu/bme/mit/trainbenchmark/benchmark/emfapi/test/EmfApiTest.java b/trainbenchmark-tool-emfapi/src/test/java/hu/bme/mit/trainbenchmark/benchmark/emfapi/test/EmfApiTest.java deleted file mode 100644 index 84e75e74e..000000000 --- a/trainbenchmark-tool-emfapi/src/test/java/hu/bme/mit/trainbenchmark/benchmark/emfapi/test/EmfApiTest.java +++ /dev/null @@ -1,32 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2010-2015, Benedek Izso, Gabor Szarnyas, Istvan Rath and Daniel Varro - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Benedek Izso - initial API and implementation - * Gabor Szarnyas - initial API and implementation - *******************************************************************************/ - -package hu.bme.mit.trainbenchmark.benchmark.emfapi.test; - -import hu.bme.mit.trainbenchmark.benchmark.config.BenchmarkConfigBase; -import hu.bme.mit.trainbenchmark.benchmark.emfapi.EmfApiBenchmarkScenario; -import hu.bme.mit.trainbenchmark.benchmark.emfapi.config.EmfApiBenchmarkConfig; -import hu.bme.mit.trainbenchmark.benchmark.emfapi.config.EmfApiBenchmarkConfigBuilder; -import hu.bme.mit.trainbenchmark.benchmark.runcomponents.BenchmarkResult; -import hu.bme.mit.trainbenchmark.benchmark.test.TrainBenchmarkTest; - -public class EmfApiTest extends TrainBenchmarkTest { - - @Override - protected BenchmarkResult runTest(final BenchmarkConfigBase bcb) throws Exception { - final EmfApiBenchmarkConfig bc = new EmfApiBenchmarkConfigBuilder().setConfigBase(bcb).createConfig(); - final EmfApiBenchmarkScenario scenario = new EmfApiBenchmarkScenario(bc); - final BenchmarkResult result = scenario.performBenchmark(); - return result; - } - -} diff --git a/trainbenchmark-tool-epsilon/build.gradle b/trainbenchmark-tool-epsilon/build.gradle deleted file mode 100644 index 1f0ca6c2c..000000000 --- a/trainbenchmark-tool-epsilon/build.gradle +++ /dev/null @@ -1,11 +0,0 @@ -plugins { id "com.github.johnrengelman.shadow" version "1.2.3" } - -shadowJar { - classifier = 'fat' - manifest { attributes 'Main-Class': 'hu.bme.mit.trainbenchmark.benchmark.epsilon.EpsilonBenchmarkMain' } -} - -dependencies { - compile project(':trainbenchmark-tool-emf') - compile group: 'org.eclipse.epsilon', name: 'epsilon-core', version:'1.4.0-SNAPSHOT' -} diff --git a/trainbenchmark-tool-epsilon/src/main/java/hu/bme/mit/trainbenchmark/benchmark/epsilon/EpsilonBenchmarkMain.java b/trainbenchmark-tool-epsilon/src/main/java/hu/bme/mit/trainbenchmark/benchmark/epsilon/EpsilonBenchmarkMain.java deleted file mode 100644 index 4b02f92b5..000000000 --- a/trainbenchmark-tool-epsilon/src/main/java/hu/bme/mit/trainbenchmark/benchmark/epsilon/EpsilonBenchmarkMain.java +++ /dev/null @@ -1,24 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2010-2015, Benedek Izso, Gabor Szarnyas, Istvan Rath and Daniel Varro - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Benedek Izso - initial API and implementation - * Gabor Szarnyas - initial API and implementation - *******************************************************************************/ -package hu.bme.mit.trainbenchmark.benchmark.epsilon; - -import hu.bme.mit.trainbenchmark.benchmark.config.BenchmarkConfig; -import hu.bme.mit.trainbenchmark.benchmark.epsilon.config.EpsilonBenchmarkConfig; - -public class EpsilonBenchmarkMain { - - public static void main(final String[] args) throws Exception { - final EpsilonBenchmarkConfig bc = BenchmarkConfig.fromFile(args[0], EpsilonBenchmarkConfig.class); - final EpsilonBenchmarkScenario scenario = new EpsilonBenchmarkScenario(bc); - scenario.performBenchmark(); - } -} diff --git a/trainbenchmark-tool-epsilon/src/main/java/hu/bme/mit/trainbenchmark/benchmark/epsilon/EpsilonBenchmarkScenario.java b/trainbenchmark-tool-epsilon/src/main/java/hu/bme/mit/trainbenchmark/benchmark/epsilon/EpsilonBenchmarkScenario.java deleted file mode 100644 index b3e576e8d..000000000 --- a/trainbenchmark-tool-epsilon/src/main/java/hu/bme/mit/trainbenchmark/benchmark/epsilon/EpsilonBenchmarkScenario.java +++ /dev/null @@ -1,18 +0,0 @@ -package hu.bme.mit.trainbenchmark.benchmark.epsilon; - -import hu.bme.mit.trainbenchmark.benchmark.emf.comparators.EmfMatchComparator; -import hu.bme.mit.trainbenchmark.benchmark.emf.driver.EmfDriver; -import hu.bme.mit.trainbenchmark.benchmark.emf.driver.EmfDriverFactory; -import hu.bme.mit.trainbenchmark.benchmark.emf.matches.EmfMatch; -import hu.bme.mit.trainbenchmark.benchmark.epsilon.config.EpsilonBenchmarkConfig; -import hu.bme.mit.trainbenchmark.benchmark.epsilon.operations.EpsilonModelOperationFactory; -import hu.bme.mit.trainbenchmark.benchmark.phases.BenchmarkScenario; - -public class EpsilonBenchmarkScenario - extends BenchmarkScenario<EmfMatch, EmfDriver, EpsilonBenchmarkConfig> { - - public EpsilonBenchmarkScenario(final EpsilonBenchmarkConfig bc) throws Exception { - super(new EmfDriverFactory(), new EpsilonModelOperationFactory<EmfDriver>(), new EmfMatchComparator(), bc); - } - -} diff --git a/trainbenchmark-tool-epsilon/src/main/java/hu/bme/mit/trainbenchmark/benchmark/epsilon/config/EpsilonBenchmarkConfig.java b/trainbenchmark-tool-epsilon/src/main/java/hu/bme/mit/trainbenchmark/benchmark/epsilon/config/EpsilonBenchmarkConfig.java deleted file mode 100644 index 53a7db1d3..000000000 --- a/trainbenchmark-tool-epsilon/src/main/java/hu/bme/mit/trainbenchmark/benchmark/epsilon/config/EpsilonBenchmarkConfig.java +++ /dev/null @@ -1,37 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2010-2015, Benedek Izso, Gabor Szarnyas, Istvan Rath and Daniel Varro - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Benedek Izso - initial API and implementation - * Gabor Szarnyas - initial API and implementation - *******************************************************************************/ - -package hu.bme.mit.trainbenchmark.benchmark.epsilon.config; - -import hu.bme.mit.trainbenchmark.benchmark.config.BenchmarkConfig; -import hu.bme.mit.trainbenchmark.benchmark.config.BenchmarkConfigBase; - -public class EpsilonBenchmarkConfig extends BenchmarkConfig { - - protected EpsilonBenchmarkConfig() { - } - - public EpsilonBenchmarkConfig(final BenchmarkConfigBase bcb) { - super(bcb); - } - - @Override - public String getToolName() { - return "Epsilon"; - } - - @Override - public String getProjectName() { - return "epsilon"; - } - -} diff --git a/trainbenchmark-tool-epsilon/src/main/java/hu/bme/mit/trainbenchmark/benchmark/epsilon/operations/EpsilonModelOperationFactory.java b/trainbenchmark-tool-epsilon/src/main/java/hu/bme/mit/trainbenchmark/benchmark/epsilon/operations/EpsilonModelOperationFactory.java deleted file mode 100644 index baa859560..000000000 --- a/trainbenchmark-tool-epsilon/src/main/java/hu/bme/mit/trainbenchmark/benchmark/epsilon/operations/EpsilonModelOperationFactory.java +++ /dev/null @@ -1,160 +0,0 @@ -package hu.bme.mit.trainbenchmark.benchmark.epsilon.operations; - -import org.eclipse.epsilon.etl.EtlModule; - -import hu.bme.mit.trainbenchmark.benchmark.emf.driver.EmfDriver; -import hu.bme.mit.trainbenchmark.benchmark.emf.matches.EmfMatch; -import hu.bme.mit.trainbenchmark.benchmark.operations.ModelOperation; -import hu.bme.mit.trainbenchmark.benchmark.operations.ModelOperationFactory; -import hu.bme.mit.trainbenchmark.constants.RailwayOperation; - -public class EpsilonModelOperationFactory<TDriver extends EmfDriver> extends ModelOperationFactory<EmfMatch, TDriver> { - - @Override - public ModelOperation<? extends EmfMatch, TDriver> createOperation(final RailwayOperation operationEnum, final String workspaceDir, final TDriver driver) - throws Exception { - final EtlModule etl = new EtlModule(); - - // switch (operationEnum) { - // // ConnectedSegments - // case CONNECTEDSEGMENTS: { - // final EpsilonQuery<EmfConnectedSegmentsMatch, TDriver> query = new EpsilonQueryConnectedSegments<>(driver); - // final ModelOperation<EmfConnectedSegmentsMatch, TDriver> operation = ModelOperation.of(query); - // return operation; - // } - // case CONNECTEDSEGMENTS_INJECT: { - // final EpsilonQuery<EmfConnectedSegmentsInjectMatch, TDriver> query = new - // EpsilonQueryConnectedSegmentsInject<>(driver); - // final EmfTransformation<EmfConnectedSegmentsInjectMatch, TDriver> transformation = new - // EmfTransformationInjectConnectedSegments<>(driver); - // final ModelOperation<EmfConnectedSegmentsInjectMatch, TDriver> operation = ModelOperation.of(query, - // transformation); - // return operation; - // - // } - // case CONNECTEDSEGMENTS_REPAIR: { - // final EpsilonQuery<EmfConnectedSegmentsMatch, TDriver> query = new EpsilonQueryConnectedSegments<>(driver); - // final EmfTransformation<EmfConnectedSegmentsMatch, TDriver> transformation = new - // EmfTransformationRepairConnectedSegments<>(driver); - // final ModelOperation<EmfConnectedSegmentsMatch, TDriver> operation = ModelOperation.of(query, - // transformation); - // return operation; - // } - // - // // PosLength - // case POSLENGTH: { - // final EpsilonQuery<EmfPosLengthMatch, TDriver> query = new EpsilonQueryPosLength<>(driver); - // final ModelOperation<EmfPosLengthMatch, TDriver> operation = ModelOperation.of(query); - // return operation; - // } - // case POSLENGTH_INJECT: { - // final EpsilonQuery<EmfPosLengthInjectMatch, TDriver> query = new EpsilonQueryPosLengthInject<>(driver); - // final EmfTransformation<EmfPosLengthInjectMatch, TDriver> transformation = new - // EmfTransformationInjectPosLength<>(driver); - // final ModelOperation<EmfPosLengthInjectMatch, TDriver> operation = ModelOperation.of(query, transformation); - // return operation; - // } - // case POSLENGTH_REPAIR: { - // final EpsilonQuery<EmfPosLengthMatch, TDriver> query = new EpsilonQueryPosLength<>(driver); - // final EmfTransformation<EmfPosLengthMatch, TDriver> transformation = new - // EmfTransformationRepairPosLength<>(driver); - // final ModelOperation<EmfPosLengthMatch, TDriver> operation = ModelOperation.of(query, transformation); - // return operation; - // } - // - // // RouteSensor - // case ROUTESENSOR: { - // final EpsilonQuery<EmfRouteSensorMatch, TDriver> query = new EpsilonQueryRouteSensor<>(driver); - // final ModelOperation<EmfRouteSensorMatch, TDriver> operation = ModelOperation.of(query); - // return operation; - // } - // case ROUTESENSOR_INJECT: { - // final EpsilonQuery<EmfRouteSensorInjectMatch, TDriver> query = new EpsilonQueryRouteSensorInject<>(driver); - // final EmfTransformation<EmfRouteSensorInjectMatch, TDriver> transformation = new - // EmfTransformationInjectRouteSensor<>(driver); - // final ModelOperation<EmfRouteSensorInjectMatch, TDriver> operation = ModelOperation.of(query, - // transformation); - // return operation; - // } - // case ROUTESENSOR_REPAIR: { - // final EpsilonQuery<EmfRouteSensorMatch, TDriver> query = new EpsilonQueryRouteSensor<>(driver); - // final EmfTransformation<EmfRouteSensorMatch, TDriver> transformation = new - // EmfTransformationRepairRouteSensor<>(driver); - // final ModelOperation<EmfRouteSensorMatch, TDriver> operation = ModelOperation.of(query, transformation); - // return operation; - // } - // - // // SemaphoreNeighbor - // case SEMAPHORENEIGHBOR: { - // final EpsilonQuery<EmfSemaphoreNeighborMatch, TDriver> query = new EpsilonQuerySemaphoreNeighbor<>(driver); - // final ModelOperation<EmfSemaphoreNeighborMatch, TDriver> operation = ModelOperation.of(query); - // return operation; - // } - // case SEMAPHORENEIGHBOR_INJECT: { - // final EpsilonQuery<EmfSemaphoreNeighborInjectMatch, TDriver> query = new - // EpsilonQuerySemaphoreNeighborInject<>(driver); - // final EmfTransformation<EmfSemaphoreNeighborInjectMatch, TDriver> transformation = new - // EmfTransformationInjectSemaphoreNeighbor<>(driver); - // final ModelOperation<EmfSemaphoreNeighborInjectMatch, TDriver> operation = ModelOperation.of(query, - // transformation); - // return operation; - // } - // case SEMAPHORENEIGHBOR_REPAIR: { - // final EpsilonQuery<EmfSemaphoreNeighborMatch, TDriver> query = new EpsilonQuerySemaphoreNeighbor<>(driver); - // final EmfTransformation<EmfSemaphoreNeighborMatch, TDriver> transformation = new - // EmfTransformationRepairSemaphoreNeighbor<>(driver); - // final ModelOperation<EmfSemaphoreNeighborMatch, TDriver> operation = ModelOperation.of(query, - // transformation); - // return operation; - // } - // - // // SwitchMonitored - // case SWITCHMONITORED: { - // final EpsilonQuery<EmfSwitchMonitoredMatch, TDriver> query = new EpsilonQuerySwitchMonitored<>(driver); - // final ModelOperation<EmfSwitchMonitoredMatch, TDriver> operation = ModelOperation.of(query); - // return operation; - // } - // case SWITCHMONITORED_INJECT: { - // final EpsilonQuery<EmfSwitchMonitoredInjectMatch, TDriver> query = new - // EpsilonQuerySwitchMonitoredInject<>(driver); - // final EmfTransformation<EmfSwitchMonitoredInjectMatch, TDriver> transformation = new - // EmfTransformationInjectSwitchMonitored<>(driver); - // final ModelOperation<EmfSwitchMonitoredInjectMatch, TDriver> operation = ModelOperation.of(query, - // transformation); - // return operation; - // } - // case SWITCHMONITORED_REPAIR: { - // final EpsilonQuery<EmfSwitchMonitoredMatch, TDriver> query = new EpsilonQuerySwitchMonitored<>(driver); - // final EmfTransformation<EmfSwitchMonitoredMatch, TDriver> transformation = new - // EmfTransformationRepairSwitchMonitored<>(driver); - // final ModelOperation<EmfSwitchMonitoredMatch, TDriver> operation = ModelOperation.of(query, transformation); - // return operation; - // } - // - // // SwitchSet - // case SWITCHSET: { - // final EpsilonQuery<EmfSwitchSetMatch, TDriver> query = new EpsilonQuerySwitchSet<>(driver); - // final ModelOperation<EmfSwitchSetMatch, TDriver> operation = ModelOperation.of(query); - // return operation; - // } - // case SWITCHSET_INJECT: { - // final EpsilonQuery<EmfSwitchSetInjectMatch, TDriver> query = new EpsilonQuerySwitchSetInject<>(driver); - // final EmfTransformation<EmfSwitchSetInjectMatch, TDriver> transformation = new - // EmfTransformationInjectSwitchSet<>(driver); - // final ModelOperation<EmfSwitchSetInjectMatch, TDriver> operation = ModelOperation.of(query, transformation); - // return operation; - // } - // case SWITCHSET_REPAIR: { - // final EpsilonQuery<EmfSwitchSetMatch, TDriver> query = new EpsilonQuerySwitchSet<>(driver); - // final EmfTransformation<EmfSwitchSetMatch, TDriver> transformation = new - // EmfTransformationRepairSwitchSet<>(driver); - // final ModelOperation<EmfSwitchSetMatch, TDriver> operation = ModelOperation.of(query, transformation); - // return operation; - // } - // default: - // break; - // } - throw new UnsupportedOperationException("Operation " + operationEnum + " not supported."); - } - -} diff --git a/trainbenchmark-tool-epsilon/src/main/java/hu/bme/mit/trainbenchmark/benchmark/epsilon/queries/EpsilonQuery.java b/trainbenchmark-tool-epsilon/src/main/java/hu/bme/mit/trainbenchmark/benchmark/epsilon/queries/EpsilonQuery.java deleted file mode 100644 index 1cc6d88cb..000000000 --- a/trainbenchmark-tool-epsilon/src/main/java/hu/bme/mit/trainbenchmark/benchmark/epsilon/queries/EpsilonQuery.java +++ /dev/null @@ -1,21 +0,0 @@ -package hu.bme.mit.trainbenchmark.benchmark.epsilon.queries; - -import java.util.Collection; - -import hu.bme.mit.trainbenchmark.benchmark.emf.driver.EmfDriver; -import hu.bme.mit.trainbenchmark.benchmark.emf.matches.EmfMatch; -import hu.bme.mit.trainbenchmark.benchmark.operations.ModelQuery; -import hu.bme.mit.trainbenchmark.constants.RailwayQuery; - -public class EpsilonQuery<TMatch extends EmfMatch> extends ModelQuery<TMatch, EmfDriver> { - - public EpsilonQuery(RailwayQuery query, EmfDriver driver) { - super(query, driver); - } - - @Override - public Collection<TMatch> evaluate() throws Exception { - return null; - } - -} diff --git a/trainbenchmark-tool-epsilon/src/main/java/hu/bme/mit/trainbenchmark/benchmark/epsilon/queries/EpsilonQueryPosLength.java b/trainbenchmark-tool-epsilon/src/main/java/hu/bme/mit/trainbenchmark/benchmark/epsilon/queries/EpsilonQueryPosLength.java deleted file mode 100644 index 3b0292b46..000000000 --- a/trainbenchmark-tool-epsilon/src/main/java/hu/bme/mit/trainbenchmark/benchmark/epsilon/queries/EpsilonQueryPosLength.java +++ /dev/null @@ -1,59 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2010-2015, Benedek Izso, Gabor Szarnyas, Istvan Rath and Daniel Varro - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Benedek Izso - initial API and implementation - * Gabor Szarnyas - initial API and implementation - *******************************************************************************/ - -package hu.bme.mit.trainbenchmark.benchmark.epsilon.queries; - -import java.util.ArrayList; -import java.util.Collection; -import java.util.List; - -import org.eclipse.emf.common.util.EList; - -import hu.bme.mit.trainbenchmark.benchmark.emf.driver.EmfDriver; -import hu.bme.mit.trainbenchmark.benchmark.emf.matches.EmfPosLengthMatch; -import hu.bme.mit.trainbenchmark.benchmark.emf.transformation.query.EmfApiQuery; -import hu.bme.mit.trainbenchmark.constants.RailwayQuery; -import hu.bme.mit.trainbenchmark.railway.RailwayPackage; -import hu.bme.mit.trainbenchmark.railway.Region; -import hu.bme.mit.trainbenchmark.railway.Segment; -import hu.bme.mit.trainbenchmark.railway.TrackElement; - -public class EpsilonQueryPosLength<TDriver extends EmfDriver> extends EmfApiQuery<EmfPosLengthMatch, TDriver> { - - public EpsilonQueryPosLength(final TDriver driver) { - super(RailwayQuery.POSLENGTH, driver); - } - - @Override - public Collection<EmfPosLengthMatch> evaluate() { - final List<EmfPosLengthMatch> matches = new ArrayList<>(); - - final EList<Region> regions = driver.getContainer().getRegions(); - for (final Region region : regions) { - for (final TrackElement element : region.getElements()) { - - // (segment:Segment) - if (RailwayPackage.eINSTANCE.getSegment().isInstance(element)) { - final Segment segment = (Segment) element; - - // segment.length <= 0 - if (segment.getLength() <= 0) { - matches.add(new EmfPosLengthMatch(segment)); - } - } - } - } - - return matches; - } - -} diff --git a/trainbenchmark-tool-epsilon/src/main/resources/.gitignore b/trainbenchmark-tool-epsilon/src/main/resources/.gitignore deleted file mode 100644 index e69de29bb..000000000 diff --git a/trainbenchmark-tool-epsilon/src/test/java/hu/bme/mit/trainbenchmark/benchmark/epsilon/test/EpsilonTest.java b/trainbenchmark-tool-epsilon/src/test/java/hu/bme/mit/trainbenchmark/benchmark/epsilon/test/EpsilonTest.java deleted file mode 100644 index 7d0e1651e..000000000 --- a/trainbenchmark-tool-epsilon/src/test/java/hu/bme/mit/trainbenchmark/benchmark/epsilon/test/EpsilonTest.java +++ /dev/null @@ -1,31 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2010-2015, Benedek Izso, Gabor Szarnyas, Istvan Rath and Daniel Varro - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Benedek Izso - initial API and implementation - * Gabor Szarnyas - initial API and implementation - *******************************************************************************/ - -package hu.bme.mit.trainbenchmark.benchmark.epsilon.test; - -import hu.bme.mit.trainbenchmark.benchmark.config.BenchmarkConfigBase; -import hu.bme.mit.trainbenchmark.benchmark.epsilon.EpsilonBenchmarkScenario; -import hu.bme.mit.trainbenchmark.benchmark.epsilon.config.EpsilonBenchmarkConfig; -import hu.bme.mit.trainbenchmark.benchmark.runcomponents.BenchmarkResult; -import hu.bme.mit.trainbenchmark.benchmark.test.TrainBenchmarkTest; - -public class EpsilonTest extends TrainBenchmarkTest { - - @Override - protected BenchmarkResult runTest(BenchmarkConfigBase bcb) throws Exception { - final EpsilonBenchmarkConfig bc = new EpsilonBenchmarkConfig(bcb); - final EpsilonBenchmarkScenario scenario = new EpsilonBenchmarkScenario(bc); - final BenchmarkResult result = scenario.performBenchmark(); - return result; - } - -} diff --git a/trainbenchmark-tool-ingraph-query-plans/build.gradle b/trainbenchmark-tool-ingraph-query-plans/build.gradle deleted file mode 100644 index 0cd3b9245..000000000 --- a/trainbenchmark-tool-ingraph-query-plans/build.gradle +++ /dev/null @@ -1,25 +0,0 @@ -apply plugin: 'org.xtext.xtend' -apply from: "${rootDir}/gradle/source-layout-xtext.gradle" -apply plugin: 'eclipse' -apply plugin: 'idea' - -buildscript { - repositories { - jcenter() - maven { url "https://plugins.gradle.org/m2/" } - } - dependencies { classpath 'org.xtext:xtext-gradle-plugin:1.0.12' } -} - -ext { - xtendVersion = '2.10.0' -} - -dependencies { - compile group: 'ingraph', name: 'ingraph-optimization-transformations', version: ingraphVersion - compile group: 'ingraph', name: 'ingraph-cypher2relalg', version: ingraphVersion - compile group: 'ingraph', name: 'ingraph-relalg2tex', version: ingraphVersion - compile group: 'org.eclipse.xtend', name: 'org.eclipse.xtend.lib', version: xtendVersion - compile group: 'org.eclipse.xtext', name: 'org.eclipse.xtext.xbase.lib', version: xtendVersion - compile group: 'junit', name: 'junit', version: junitVersion -} diff --git a/trainbenchmark-tool-ingraph-query-plans/src/main/java/ingraph/trainbenchmark/QueryPlanFactory.xtend b/trainbenchmark-tool-ingraph-query-plans/src/main/java/ingraph/trainbenchmark/QueryPlanFactory.xtend deleted file mode 100644 index edd66a326..000000000 --- a/trainbenchmark-tool-ingraph-query-plans/src/main/java/ingraph/trainbenchmark/QueryPlanFactory.xtend +++ /dev/null @@ -1,14 +0,0 @@ -package ingraph.trainbenchmark - -import ingraph.relalg.util.SchemaInferencer -import relalg.RelalgFactory - -/** - * Query plan factory for generating query plans used in our Periodica Polytechnica submission. - */ -class QueryPlanFactory { - - protected val extension RelalgFactory factory = RelalgFactory.eINSTANCE - protected val extension SchemaInferencer schemaInferencer = new SchemaInferencer - -} diff --git a/trainbenchmark-tool-ingraph-query-plans/src/main/java/ingraph/trainbenchmark/RouteSensorQueryPlanFactory.xtend b/trainbenchmark-tool-ingraph-query-plans/src/main/java/ingraph/trainbenchmark/RouteSensorQueryPlanFactory.xtend deleted file mode 100644 index a9a26ad5f..000000000 --- a/trainbenchmark-tool-ingraph-query-plans/src/main/java/ingraph/trainbenchmark/RouteSensorQueryPlanFactory.xtend +++ /dev/null @@ -1,178 +0,0 @@ -package ingraph.trainbenchmark - -import relalg.Direction - -class RouteSensorQueryPlanFactory extends QueryPlanFactory { - - // container - val routeSensor = createRelalgContainer - - // vertex labels - val routeLabel = createVertexLabel => [name = "Route"] - val sensorLabel = createVertexLabel => [name = "Sensor"] - val switchLabel = createVertexLabel => [name = "Switch"] - val switchPositionLabel = createVertexLabel => [name = "SwitchPosition"] - - // edge labels - val followsLabel = createEdgeLabel => [name = "follows"] - val requiresLabel = createEdgeLabel => [name = "requires"] - val monitoredByLabel = createEdgeLabel => [name = "monitoredBy"] - val targetLabel = createEdgeLabel => [name = "target"] - - // vertex variables - val route = createVertexVariable => [name = "route"; vertexLabels.add(routeLabel)] - val sw = createVertexVariable => [name = "sw"; vertexLabels.add(switchLabel)] - val swP = createVertexVariable => [name = "swP"; vertexLabels.add(switchPositionLabel)] - val sensor = createVertexVariable => [name = "sensor"; vertexLabels.add(sensorLabel)] - - // edge variables - val target = createEdgeVariable => [name = "_e1"; edgeLabels.add(targetLabel)] - val monitoredBy = createEdgeVariable => [name = "_e2"; edgeLabels.add(monitoredByLabel)] - val follows = createEdgeVariable => [name = "_e3"; edgeLabels.add(followsLabel)] - val requires = createEdgeVariable => [name = "_e4"; edgeLabels.add(requiresLabel)] - - // inputs - val getRoutes = createGetVerticesOperator => [vertexVariable = route] - val getRoutesA = createGetVerticesOperator => [vertexVariable = route] - val getRoutesB = createGetVerticesOperator => [vertexVariable = route] - val getSws = createGetVerticesOperator => [vertexVariable = sw] - val getSwPs = createGetVerticesOperator => [vertexVariable = swP] - - def routeSensorA() { - routeSensor.name = "RouteSensorA" - val expand1 = createExpandOperator => [ - input = getRoutesA - direction = Direction.OUT - sourceVertexVariable = route - targetVertexVariable = swP - edgeVariable = follows - ] - val expand2 = createExpandOperator => [ - input = expand1 - direction = Direction.OUT - sourceVertexVariable = swP - targetVertexVariable = sw - edgeVariable = target - ] - val expand3 = createExpandOperator => [ - input = expand2 - direction = Direction.OUT - sourceVertexVariable = sw - targetVertexVariable = sensor - edgeVariable = monitoredBy - ] - val expand4 = createExpandOperator => [ - input = getRoutesB - direction = Direction.OUT - sourceVertexVariable = route - targetVertexVariable = sensor - edgeVariable = requires - ] - - val antiJoin = createAntiJoinOperator => [ - leftInput = expand3 - rightInput = expand4 - ] - val production = createProductionOperator => [ - input = antiJoin - ] - - routeSensor.rootExpression = production - return routeSensor - } - - def routeSensorB() { - routeSensor.name = "RouteSensorB" - val expand1 = createExpandOperator => [ - input = getSwPs - direction = Direction.OUT - sourceVertexVariable = swP - targetVertexVariable = sw - edgeVariable = target - ] - val expand2 = createExpandOperator => [ - input = expand1 - direction = Direction.OUT - sourceVertexVariable = sw - targetVertexVariable = sensor - edgeVariable = monitoredBy - ] - val expand3 = createExpandOperator => [ - input = expand2 - direction = Direction.IN - sourceVertexVariable = swP - targetVertexVariable = route - edgeVariable = follows - ] - val expand4 = createExpandOperator => [ - input = getRoutes - direction = Direction.OUT - sourceVertexVariable = route - targetVertexVariable = sensor - edgeVariable = requires - ] - - val antiJoin = createAntiJoinOperator => [ - leftInput = expand3 - rightInput = expand4 - ] - val production = createProductionOperator => [ - input = antiJoin - ] - - routeSensor.rootExpression = production - return routeSensor - } - - def routeSensorC() { - routeSensor.name = "RouteSensorC" - val expand1 = createExpandOperator => [ - input = getRoutesA - direction = Direction.OUT - sourceVertexVariable = route - targetVertexVariable = swP - edgeVariable = follows - ] - val expand2 = createExpandOperator => [ - input = getSws - direction = Direction.OUT - sourceVertexVariable = sw - targetVertexVariable = sensor - edgeVariable = monitoredBy - ] - val expand3 = createExpandOperator => [ - input = getRoutesB - direction = Direction.OUT - sourceVertexVariable = route - targetVertexVariable = sensor - edgeVariable = requires - ] - val expand4 = createExpandOperator => [ - input = getSwPs - direction = Direction.OUT - sourceVertexVariable = swP - targetVertexVariable = sw - edgeVariable = target - ] - - val join1 = createJoinOperator => [ - leftInput = expand1 - rightInput = expand2 - ] - val antiJoin = createAntiJoinOperator => [ - leftInput = join1 - rightInput = expand3 - ] - val join2 = createJoinOperator => [ - leftInput = antiJoin - rightInput = expand4 - ] - val production = createProductionOperator => [ - input = join2 - ] - - routeSensor.rootExpression = production - return routeSensor - } - -} diff --git a/trainbenchmark-tool-ingraph-query-plans/src/main/java/ingraph/trainbenchmark/SemaphoreNeighborQueryPlanFactory.xtend b/trainbenchmark-tool-ingraph-query-plans/src/main/java/ingraph/trainbenchmark/SemaphoreNeighborQueryPlanFactory.xtend deleted file mode 100644 index 560cd8232..000000000 --- a/trainbenchmark-tool-ingraph-query-plans/src/main/java/ingraph/trainbenchmark/SemaphoreNeighborQueryPlanFactory.xtend +++ /dev/null @@ -1,638 +0,0 @@ -package ingraph.trainbenchmark - -import relalg.ArithmeticComparisonOperator -import relalg.Direction - -class SemaphoreNeighborQueryPlanFactory extends QueryPlanFactory { - - // container - val semaphoreNeighbor = createRelalgContainer - - // vertex labels - val routeLabel = createVertexLabel => [name = "Route"] - val semaphoreLabel = createVertexLabel => [name = "Semaphore"] - val sensorLabel = createVertexLabel => [name = "Sensor"] - val teLabel = createVertexLabel => [name = "TrackElement"] - - // edge labels - val connectsToLabel = createEdgeLabel => [name = "connectsTo"] - val entryLabel = createEdgeLabel => [name = "entry"] - val exitLabel = createEdgeLabel => [name = "exit"] - val requiresLabel = createEdgeLabel => [name = "requires"] - val monitoredByLabel = createEdgeLabel => [name = "monitoredBy"] - - // vertex variables - val route1 = createVertexVariable => [name = "route1"; vertexLabels.add(routeLabel)] - val route2 = createVertexVariable => [name = "route2"; vertexLabels.add(routeLabel)] - val semaphore = createVertexVariable => [ - name = "semaphore" - vertexLabels.add(semaphoreLabel) - container = semaphoreNeighbor - ] - val sensor1 = createVertexVariable => [ - name = "sensor1" - vertexLabels.add(sensorLabel) - container = semaphoreNeighbor - ] - val sensor2 = createVertexVariable => [ - name = "sensor2" - vertexLabels.add(sensorLabel) - container = semaphoreNeighbor - ] - val te1 = createVertexVariable => [name = "te1"; vertexLabels.add(teLabel)] - val te2 = createVertexVariable => [name = "te2"; vertexLabels.add(teLabel)] - - // edge variables - val requires1 = createEdgeVariable => [name = "g1"; edgeLabels.add(requiresLabel)] - val requires2 = createEdgeVariable => [name = "g2"; edgeLabels.add(requiresLabel)] - val monitoredBy1 = createEdgeVariable => [ - name = "mb1" - edgeLabels.add(monitoredByLabel) - container = semaphoreNeighbor - ] - val monitoredBy2 = createEdgeVariable => [ - name = "mb2" - edgeLabels.add(monitoredByLabel) - container = semaphoreNeighbor - ] - val connectsTo = createEdgeVariable => [name = "ct"; edgeLabels.add(connectsToLabel)] - val entry = createEdgeVariable => [name = "entry"; edgeLabels.add(entryLabel)] - val exit = createEdgeVariable => [name = "exit"; edgeLabels.add(exitLabel)] - - // inputs - val route1s = createGetVerticesOperator => [vertexVariable = route1] - val route1sA = createGetVerticesOperator => [vertexVariable = route1] - val route1sB = createGetVerticesOperator => [vertexVariable = route1] - val route2sA = createGetVerticesOperator => [vertexVariable = route2] - val route2sB = createGetVerticesOperator => [vertexVariable = route2] - val route2sC = createGetVerticesOperator => [vertexVariable = route2] - val te1s = createGetVerticesOperator => [vertexVariable = te1] - val te1sA = createGetVerticesOperator => [vertexVariable = te1] - val te1sB = createGetVerticesOperator => [vertexVariable = te1] - val te2s = createGetVerticesOperator => [vertexVariable = te2] - - // conditions - val filterCondition = createArithmeticComparisonExpression => [ - operator = ArithmeticComparisonOperator.NOT_EQUAL_TO - leftOperand = route1 - rightOperand = route2 - ] - - // ////////////////////////////////////////////////////////////////////////////////////////////////// - def semaphoreNeighborA() { - semaphoreNeighbor.name = "SemaphoreNeighborA" - // (sensor1:Sensor)<-[:MONITORED_BY]-(te1:TrackElement)-[:CONNECTS_TO]->(te2:TrackElement)-[:MONITORED_BY]->(sensor2:Sensor) - val expand1 = createExpandOperator => [ - input = te1s - direction = Direction.OUT - sourceVertexVariable = te1 - targetVertexVariable = te2 - edgeVariable = connectsTo - ] - val expand2 = createExpandOperator => [ - input = expand1 - direction = Direction.OUT - sourceVertexVariable = te1 - targetVertexVariable = sensor1 - edgeVariable = monitoredBy1 - ] - val expand3 = createExpandOperator => [ - input = expand2 - direction = Direction.OUT - sourceVertexVariable = te2 - targetVertexVariable = sensor2 - edgeVariable = monitoredBy2 - ] - - val expand4 = createExpandOperator => [ - input = route1s - direction = Direction.OUT - sourceVertexVariable = route1 - targetVertexVariable = semaphore - edgeVariable = exit - ] - val expand5 = createExpandOperator => [ - input = expand4 - direction = Direction.OUT - sourceVertexVariable = route1 - targetVertexVariable = sensor1 - edgeVariable = requires1 - ] - - val expand6 = createExpandOperator => [ - input = route2sA - direction = Direction.OUT - sourceVertexVariable = route2 - targetVertexVariable = sensor2 - edgeVariable = requires2 - ] - - val expand7 = createExpandOperator => [ - input = route2sB - direction = Direction.OUT - sourceVertexVariable = route2 - targetVertexVariable = semaphore - edgeVariable = entry - ] - - val join1 = createJoinOperator => [ - leftInput = expand3 - rightInput = expand5 - ] - val join2 = createJoinOperator => [ - leftInput = join1 - rightInput = expand6 - ] - - val filter = createSelectionOperator => [ - input = join2 - condition = filterCondition - ] - - val antiJoin = createAntiJoinOperator => [ - leftInput = filter - rightInput = expand7 - ] - - val production = createProductionOperator => [ - input = antiJoin - ] - semaphoreNeighbor.rootExpression = production - return semaphoreNeighbor - } - - // ////////////////////////////////////////////////////////////////////////////////////////////////// - def semaphoreNeighborB() { - semaphoreNeighbor.name = "SemaphoreNeighborB" - // (te1:TrackElement)-[:CONNECTS_TO]->(te2:TrackElement) - val expand1 = createExpandOperator => [ - input = te1sA - direction = Direction.OUT - sourceVertexVariable = te1 - targetVertexVariable = te2 - edgeVariable = connectsTo - ] - - // (te1:TrackElement)-[:MONITORED_BY]->(sensor1:Sensor)<-[:REQUIRES]-(route1:Route) - val expand2 = createExpandOperator => [ - input = te1sB - direction = Direction.OUT - sourceVertexVariable = te1 - targetVertexVariable = sensor1 - edgeVariable = monitoredBy1 - ] - val expand3 = createExpandOperator => [ - input = route1sA - direction = Direction.OUT - sourceVertexVariable = route1 - targetVertexVariable = sensor1 - edgeVariable = requires1 - ] - val join1 = createJoinOperator => [ - leftInput = expand2 - rightInput = expand3 - ] - - // (te2:TrackElement)-[:MONITORED_BY]->(sensor2:Sensor)<-[:REQUIRES]-(route2:Route) - val expand4 = createExpandOperator => [ - input = te2s - direction = Direction.OUT - sourceVertexVariable = te2 - targetVertexVariable = sensor2 - edgeVariable = monitoredBy2 - ] - val expand5 = createExpandOperator => [ - input = route2sA - direction = Direction.OUT - sourceVertexVariable = route2 - targetVertexVariable = sensor2 - edgeVariable = requires2 - ] - val join2 = createJoinOperator => [ - leftInput = expand4 - rightInput = expand5 - ] - - // (route2:Route)-[:REQUIRES]->(sensor2:Sensor)<-[:MONITORED_BY]-(te1:TrackElement) - // -[:CONNECTS_TO]-> - // (te2:TrackElement)-[:MONITORED_BY]->(sensor2:Sensor)<-[:REQUIRES]-(route2:Route) - val join3 = createJoinOperator => [leftInput = expand1 rightInput = join1] - - // (route1:Route)-[:EXIT]->(semaphore:Semaphore) - val expand6 = createExpandOperator => [ - input = route1sB - direction = Direction.OUT - sourceVertexVariable = route1 - targetVertexVariable = semaphore - edgeVariable = exit - ] - - // (route2:Route)-[:EXIT]->(semaphore:Semaphore) - val expand7 = createExpandOperator => [ - input = route2sB - direction = Direction.OUT - sourceVertexVariable = route2 - targetVertexVariable = semaphore - edgeVariable = entry - ] - - val join4 = createJoinOperator => [ - leftInput = join3 - rightInput = join2 - ] - - val filter = createSelectionOperator => [ - input = join4 - condition = filterCondition - ] - - val join5 = createJoinOperator => [ - leftInput = filter - rightInput = expand6 - ] - - val antiJoin = createAntiJoinOperator => [ - leftInput = join5 - rightInput = expand7 - ] - - val production = createProductionOperator => [ - input = antiJoin - ] - semaphoreNeighbor.rootExpression = production - return semaphoreNeighbor - } - - // ////////////////////////////////////////////////////////////////////////////////////////////////// - def semaphoreNeighborC() { - semaphoreNeighbor.name = "SemaphoreNeighborC" - // (sensor1:Sensor)<-[:MONITORED_BY]-(te1:TrackElement)-[:CONNECTS_TO]->(te2:TrackElement)-[:MONITORED_BY]->(sensor2:Sensors) - val expand1 = createExpandOperator => [ - input = te1s - direction = Direction.OUT - sourceVertexVariable = te1 - targetVertexVariable = te2 - edgeVariable = connectsTo - ] - val expand2 = createExpandOperator => [ - input = expand1 - direction = Direction.OUT - sourceVertexVariable = te1 - targetVertexVariable = sensor1 - edgeVariable = monitoredBy1 - ] - val expand3 = createExpandOperator => [ - input = expand2 - direction = Direction.OUT - sourceVertexVariable = te2 - targetVertexVariable = sensor2 - edgeVariable = monitoredBy2 - ] - - // (semaphore:Semaphore)<-[:EXIT]-(route1:Route)-[:REQUIRES]->(sensor1:Sensor) - val expand4 = createExpandOperator => [ - input = route1s - direction = Direction.OUT - sourceVertexVariable = route1 - targetVertexVariable = sensor1 - edgeVariable = requires1 - ] - val expand5 = createExpandOperator => [ - input = expand4 - direction = Direction.OUT - sourceVertexVariable = route1 - targetVertexVariable = semaphore - edgeVariable = exit - ] - - val join1 = createJoinOperator => [ - leftInput = expand3 - rightInput = expand5 - ] - - // (route2:Route)-[:REQUIRES]->(sensor2:Sensor) - val expand6 = createExpandOperator => [ - input = route2sA - direction = Direction.OUT - sourceVertexVariable = route2 - targetVertexVariable = sensor2 - edgeVariable = requires2 - ] - - val join2 = createJoinOperator => [ - leftInput = join1 - rightInput = expand6 - ] - - // (route2:Route)-[:EXIT]->(semaphore:Semaphore) - val expand7 = createExpandOperator => [ - input = route2sB - direction = Direction.OUT - sourceVertexVariable = route2 - targetVertexVariable = semaphore - edgeVariable = entry - ] - - val filter = createSelectionOperator => [ - input = join2 - condition = filterCondition - ] - - val antiJoin = createAntiJoinOperator => [ - leftInput = filter - rightInput = expand7 - ] - - val production = createProductionOperator => [ - input = antiJoin - ] - semaphoreNeighbor.rootExpression = production - return semaphoreNeighbor - } - - // ////////////////////////////////////////////////////////////////////////////////////////////////// - def semaphoreNeighborD() { - semaphoreNeighbor.name = "SemaphoreNeighborD" - // (te1:TrackElement)-[:CONNECTS_TO]->(te2:TrackElement) - val expand1 = createExpandOperator => [ - input = te1s - direction = Direction.OUT - sourceVertexVariable = te1 - targetVertexVariable = te2 - edgeVariable = connectsTo - ] - - // (semaphore:Semaphore)<-[:EXIT]-(route1:Route)-[:REQUIRES]->(sensor1:Sensor)<-[:MONITORED_BY]-(te1:TrackElement) - val expand2 = createExpandOperator => [ - input = route1s - direction = Direction.OUT - sourceVertexVariable = route1 - targetVertexVariable = semaphore - edgeVariable = exit - ] - val expand3 = createExpandOperator => [ - input = expand2 - direction = Direction.OUT - sourceVertexVariable = route1 - targetVertexVariable = sensor1 - edgeVariable = requires1 - ] - val expand4 = createExpandOperator => [ - input = expand3 - direction = Direction.IN - sourceVertexVariable = sensor1 - targetVertexVariable = te1 - edgeVariable = monitoredBy1 - ] - - // (semaphore:Semaphore)<-[:EXIT]-(route1:Route)-[:REQUIRES]->(sensor1:Sensor) - val expand5 = createExpandOperator => [ - input = te2s - direction = Direction.OUT - sourceVertexVariable = te2 - targetVertexVariable = sensor2 - edgeVariable = monitoredBy2 - ] - - // (route2:Route)-[:REQUIRES]->(sensor2:Sensor) - val expand6 = createExpandOperator => [ - input = route2sA - direction = Direction.OUT - sourceVertexVariable = route2 - targetVertexVariable = sensor2 - edgeVariable = requires2 - ] - - val join1 = createJoinOperator => [ - leftInput = expand1 - rightInput = expand4 - ] - - val join2 = createJoinOperator => [ - leftInput = join1 - rightInput = expand5 - ] - - val join3 = createJoinOperator => [ - leftInput = join2 - rightInput = expand6 - ] - - val filter = createSelectionOperator => [ - input = join3 - condition = filterCondition - ] - - // (route2:Route)-[:EXIT]->(semaphore:Semaphore) - val expand7 = createExpandOperator => [ - input = route2sB - direction = Direction.OUT - sourceVertexVariable = route2 - targetVertexVariable = semaphore - edgeVariable = entry - ] - - val antiJoin = createAntiJoinOperator => [ - leftInput = filter - rightInput = expand7 - ] - - val production = createProductionOperator => [ - input = antiJoin - ] - semaphoreNeighbor.rootExpression = production - return semaphoreNeighbor - } - - // ////////////////////////////////////////////////////////////////////////////////////////////////// - def semaphoreNeighborE() { - semaphoreNeighbor.name = "SemaphoreNeighborE" - // (route1:Route)-[:EXIT]->(semaphore:Semaphore) - val expand1 = createExpandOperator => [ - input = route1sA - direction = Direction.OUT - sourceVertexVariable = route1 - targetVertexVariable = semaphore - edgeVariable = exit - ] - - // (route1:Route)-[:REQUIRES]->(sensor1:Sensor) - val expand2 = createExpandOperator => [ - input = route2sA - direction = Direction.OUT - sourceVertexVariable = route2 - targetVertexVariable = sensor2 - edgeVariable = requires2 - ] - - val join1 = createJoinOperator => [ - leftInput = expand1 - rightInput = expand2 - ] - - val filter = createSelectionOperator => [ - input = join1 - condition = filterCondition - ] - - // (route2:Route)-[:ENTRY]->(semaphore:Semaphore) - val expand3 = createExpandOperator => [ - input = route2sB - direction = Direction.OUT - sourceVertexVariable = route2 - targetVertexVariable = semaphore - edgeVariable = entry - ] - - val antiJoin = createAntiJoinOperator => [ - leftInput = filter - rightInput = expand3 - ] - - val expand4 = createExpandOperator => [ - input = route1sB - direction = Direction.OUT - sourceVertexVariable = route1 - targetVertexVariable = sensor1 - edgeVariable = requires1 - ] - - val join2 = createJoinOperator => [ - leftInput = antiJoin - rightInput = expand4 - ] - - // (te1:TrackElement)-[:MONITORED_BY]->(sensor1:Sensor) - val expand5 = createExpandOperator => [ - input = te1sA - direction = Direction.OUT - sourceVertexVariable = te1 - targetVertexVariable = sensor1 - edgeVariable = monitoredBy1 - ] - - val join3 = createJoinOperator => [ - leftInput = join2 - rightInput = expand5 - ] - - // (te1:TrackElement)-[:CONNECTS_TO]->(te2:TrackElement) - val expand6 = createExpandOperator => [ - input = te1sB - direction = Direction.OUT - sourceVertexVariable = te1 - targetVertexVariable = te2 - edgeVariable = connectsTo - ] - - val join4 = createJoinOperator => [ - leftInput = join3 - rightInput = expand6 - ] - - // (te2:TrackElement)-[:MONITORED_BY]->(sensor2:Sensor) - val expand7 = createExpandOperator => [ - input = route2sC - direction = Direction.OUT - sourceVertexVariable = te2 - targetVertexVariable = sensor2 - edgeVariable = monitoredBy2 - ] - - val join5 = createJoinOperator => [ - leftInput = join4 - rightInput = expand7 - ] - - val production = createProductionOperator => [ - input = join5 - ] - semaphoreNeighbor.rootExpression = production - return semaphoreNeighbor - } - - // ////////////////////////////////////////////////////////////////////////////////////////////////// - def semaphoreNeighborF() { - semaphoreNeighbor.name = "SemaphoreNeighborF" - val expand1 = createExpandOperator => [ - input = te1sA - direction = Direction.OUT - sourceVertexVariable = te1 - targetVertexVariable = sensor1 - edgeVariable = monitoredBy1 - ] - val expand2 = createExpandOperator => [ - input = te2s - direction = Direction.OUT - sourceVertexVariable = te2 - targetVertexVariable = sensor2 - edgeVariable = monitoredBy2 - ] - - val join1 = createJoinOperator => [ - leftInput = expand1 - rightInput = expand2 - ] - - val expand3 = createExpandOperator => [ - input = join1 - direction = Direction.IN - sourceVertexVariable = sensor1 - targetVertexVariable = route1 - edgeVariable = requires1 - ] - val expand4 = createExpandOperator => [ - input = expand3 - direction = Direction.IN - sourceVertexVariable = sensor2 - targetVertexVariable = route2 - edgeVariable = requires2 - ] - - val filter = createSelectionOperator => [ - input = expand4 - condition = filterCondition - ] - - val expand5 = createExpandOperator => [ - input = filter - direction = Direction.OUT - sourceVertexVariable = route1 - targetVertexVariable = semaphore - edgeVariable = exit - ] - - val expand6 = createExpandOperator => [ - input = te1sB - direction = Direction.OUT - sourceVertexVariable = te1 - targetVertexVariable = te2 - edgeVariable = connectsTo - ] - - val join2 = createJoinOperator => [ - leftInput = expand5 - rightInput = expand6 - ] - - val expand7 = createExpandOperator => [ - input = route2sA - direction = Direction.OUT - sourceVertexVariable = route2 - targetVertexVariable = semaphore - edgeVariable = entry - ] - - val antiJoin = createAntiJoinOperator => [ - leftInput = join2 - rightInput = expand7 - ] - - val production = createProductionOperator => [ - input = antiJoin - ] - semaphoreNeighbor.rootExpression = production - return semaphoreNeighbor - } - -} diff --git a/trainbenchmark-tool-ingraph-query-plans/src/main/java/ingraph/trainbenchmark/TrainBenchmarkUtil.xtend b/trainbenchmark-tool-ingraph-query-plans/src/main/java/ingraph/trainbenchmark/TrainBenchmarkUtil.xtend deleted file mode 100644 index cbc2fa95d..000000000 --- a/trainbenchmark-tool-ingraph-query-plans/src/main/java/ingraph/trainbenchmark/TrainBenchmarkUtil.xtend +++ /dev/null @@ -1,466 +0,0 @@ -package ingraph.trainbenchmark - -import java.util.Arrays -import relalg.ArithmeticComparisonOperator -import relalg.Direction -import relalg.RelalgFactory - -class TrainBenchmarkUtil { - - static val extension RelalgFactory factory = RelalgFactory.eINSTANCE - - def static posLength() { - val posLength = createRelalgContainer - - val segmentLabel = createVertexLabel => [name = "Segment"] - val segment = createVertexVariable => [ - name = "segment" - vertexLabels.add(segmentLabel) - ] - val length = createAttributeVariable => [name = "length"; element = segment] - - val getVertices = createGetVerticesOperator => [vertexVariable = segment] - - val integerLiteral0 = createIntegerLiteral => [value = 0] - val condition = createArithmeticComparisonExpression => [ - leftOperand = length - rightOperand = integerLiteral0 - operator = ArithmeticComparisonOperator.LESS_THAN_OR_EQUAL - ] - val filter1 = createSelectionOperator => [ - input = getVertices - conditionString = "segment.length <= 0" - it.condition = condition - ] - val projection = createProjectionOperator => [ - input = filter1 - variables.addAll(#[segment, length]) - ] - val de = createDuplicateEliminationOperator => [input = projection] - val production = createProductionOperator => [input = de] - posLength.rootExpression = production - posLength - } - - def static routeSensor() { - val routeSensor = createRelalgContainer - - val routeLabel = createVertexLabel => [name = "Route"] - val sensorLabel = createVertexLabel => [name = "Sensor"] - val switchLabel = createVertexLabel => [name = "Switch"] - val switchPositionLabel = createVertexLabel => [name = "SwitchPosition"] - - val followsLabel = createEdgeLabel => [name = "follows"] - val requiresLabel = createEdgeLabel => [name = "requires"] - val monitoredByLabel = createEdgeLabel => [name = "monitoredBy"] - val targetLabel = createEdgeLabel => [name = "target"] - - val route = createVertexVariable => [name = "route"; vertexLabels.add(routeLabel)] - val sw = createVertexVariable => [name = "sw"; vertexLabels.add(switchLabel)] - val swP = createVertexVariable => [name = "swP"; vertexLabels.add(switchPositionLabel)] - val sensor = createVertexVariable => [name = "sensor"; vertexLabels.add(sensorLabel)] - - val _e1 = createEdgeVariable => [ - name = "_e1" - edgeLabels.add(followsLabel) - dontCare = true - ] - val _e2 = createEdgeVariable => [ - name = "_e2" - edgeLabels.add(targetLabel) - dontCare = true - ] - val _e3 = createEdgeVariable => [ - name = "_e3" - edgeLabels.add(monitoredByLabel) - dontCare = true - ] - val _e4 = createEdgeVariable => [ - name = "_e4" - edgeLabels.add(requiresLabel) - dontCare = true - ] - - val getVerticesRoute1 = createGetVerticesOperator => [vertexVariable = route] - val getVerticesRoute2 = createGetVerticesOperator => [vertexVariable = route] - - val expand1 = createExpandOperator => [ - input = getVerticesRoute1 - direction = Direction.OUT - sourceVertexVariable = route - targetVertexVariable = swP - edgeVariable = _e1 - ] - val expand2 = createExpandOperator => [ - input = expand1 - direction = Direction.OUT - sourceVertexVariable = swP - targetVertexVariable = sw - edgeVariable = _e2 - ] - val expand3 = createExpandOperator => [ - input = expand2 - direction = Direction.OUT - sourceVertexVariable = sw - targetVertexVariable = sensor - edgeVariable = _e3 - ] - - val allDifferent = createAllDifferentOperator => [ - input = expand3 - edgeVariables.addAll(#[_e1, _e2, _e3]) - ] - - val expand4 = createExpandOperator => [ - input = getVerticesRoute2 - direction = Direction.OUT - sourceVertexVariable = route - targetVertexVariable = sensor - edgeVariable = _e4 - ] - - val antiJoin = createAntiJoinOperator => [ - leftInput = allDifferent - rightInput = expand4 - ] - val projection = createProjectionOperator => [ - input = antiJoin - variables.addAll(Arrays.asList(route, sensor, swP, sw)) - ] - val de = createDuplicateEliminationOperator => [ - input = projection - ] - val production = createProductionOperator => [ - input = de - ] - routeSensor.rootExpression = production - routeSensor - } - - def static semaphoreNeighbor() { - val semaphoreNeighbor = createRelalgContainer - - val routeLabel = createVertexLabel => [name = "Route"; container = semaphoreNeighbor] - val semaphoreLabel = createVertexLabel => [name = "Semaphore"; container = semaphoreNeighbor] - val sensorLabel = createVertexLabel => [name = "Sensor"; container = semaphoreNeighbor] - - val connectsToLabel = createEdgeLabel => [name = "connectsTo"; container = semaphoreNeighbor] - val entryLabel = createEdgeLabel => [name = "entry"; container = semaphoreNeighbor] - val exitLabel = createEdgeLabel => [name = "exit"; container = semaphoreNeighbor] - val requiresLabel = createEdgeLabel => [name = "requires"; container = semaphoreNeighbor] - val monitoredByLabel = createEdgeLabel => [name = "monitoredBy"; container = semaphoreNeighbor] - - val route1 = createVertexVariable => [ - name = "route1"; - vertexLabels.add(routeLabel); - ] - val route2 = createVertexVariable => [ - name = "route2"; - vertexLabels.add(routeLabel); - ] - val semaphore = createVertexVariable => [ - name = "semaphore" - vertexLabels.add(semaphoreLabel) - ] - val sensor1 = createVertexVariable => [ - name = "sensor1"; - vertexLabels.add(sensorLabel); - ] - val sensor2 = createVertexVariable => [ - name = "sensor"; - vertexLabels.add(sensorLabel); - ] - val te1 = createVertexVariable => [name = "te1"; container = semaphoreNeighbor] - val te2 = createVertexVariable => [name = "te2"; container = semaphoreNeighbor] - - val _e1 = createEdgeVariable => [ - name = "_e1" - edgeLabels.add(exitLabel) - dontCare = true - ] - val _e2 = createEdgeVariable => [ - name = "_e2" - edgeLabels.add(requiresLabel) - dontCare = true - ] - val _e3 = createEdgeVariable => [ - name = "_e3" - edgeLabels.add(monitoredByLabel) - dontCare = true - ] - val _e4 = createEdgeVariable => [ - name = "_e4" - edgeLabels.add(connectsToLabel) - dontCare = true - ] - val _e5 = createEdgeVariable => [ - name = "_e5" - edgeLabels.add(monitoredByLabel) - dontCare = true - ] - val _e6 = createEdgeVariable => [ - name = "_e6" - edgeLabels.add(requiresLabel) - dontCare = true - ] - val _e7 = createEdgeVariable => [ - name = "_e7" - edgeLabels.add(entryLabel) - dontCare = true - ] - - val getVertices1 = createGetVerticesOperator => [ - vertexVariable = semaphore - ] - val getVertices2 = createGetVerticesOperator => [ - vertexVariable = semaphore - ] - - val expand1 = createExpandOperator => [ - input = getVertices1 - direction = Direction.IN - sourceVertexVariable = semaphore - targetVertexVariable = route1 - edgeVariable = _e1 - ] - val expand2 = createExpandOperator => [ - input = expand1 - direction = Direction.OUT - sourceVertexVariable = route1 - targetVertexVariable = sensor1 - edgeVariable = _e2 - ] - val expand3 = createExpandOperator => [ - input = expand2 - direction = Direction.IN - sourceVertexVariable = sensor1 - targetVertexVariable = te1 - edgeVariable = _e3 - ] - val expand4 = createExpandOperator => [ - input = expand3 - direction = Direction.OUT - sourceVertexVariable = te1 - targetVertexVariable = te2 - edgeVariable = _e4 - ] - val expand5 = createExpandOperator => [ - input = expand4 - direction = Direction.OUT - sourceVertexVariable = te2 - targetVertexVariable = sensor2 - edgeVariable = _e5 - ] - val expand6 = createExpandOperator => [ - input = expand5 - direction = Direction.IN - sourceVertexVariable = sensor2 - targetVertexVariable = route2 - edgeVariable = _e6 - ] - - val allDifferent = createAllDifferentOperator => [ - input = expand6 - edgeVariables.addAll(Arrays.asList(_e1, _e2, _e3, _e4, _e5, _e6)) - ] - - val expand7 = createExpandOperator => [ - input = getVertices2 - direction = Direction.IN - sourceVertexVariable = semaphore - targetVertexVariable = route2 - edgeVariable = _e7 - ] - - val antiJoin = createAntiJoinOperator => [ - leftInput = allDifferent - rightInput = expand7 - ] - val condition = createArithmeticComparisonExpression => [ - leftOperand = route1 - rightOperand = route2 - operator = ArithmeticComparisonOperator.NOT_EQUAL_TO - ] - val filter = createSelectionOperator => [ - input = antiJoin - conditionString = "route1 != route2" - it.condition = condition - ] - val projection = createProjectionOperator => [ - input = filter - variables.addAll(Arrays.asList(semaphore, route1, route2, sensor1, sensor2, te1, te2)) - ] - val de = createDuplicateEliminationOperator => [ - input = projection - ] - val production = createProductionOperator => [ - input = de - ] - semaphoreNeighbor.rootExpression = production - semaphoreNeighbor - } - - def static switchMonitored() { - val switchMonitored = createRelalgContainer - - val sensorLabel = createVertexLabel => [name = "Sensor"; container = switchMonitored] - val switchLabel = createVertexLabel => [name = "Switch"; container = switchMonitored] - - val monitoredByLabel = createEdgeLabel => [name = "monitoredBy"; container = switchMonitored] - - val sw = createVertexVariable => [name = "sw"; vertexLabels.add(switchLabel); container = switchMonitored] - val _sensor = createVertexVariable => [ - name = "_sensor" - vertexLabels.add(sensorLabel) - dontCare = true - ] - - val _e1 = createEdgeVariable => [ - name = "_e1" - edgeLabels.add(monitoredByLabel) - dontCare = true - ] - - val getVertices1 = createGetVerticesOperator => [ - vertexVariable = sw - ] - val getVertices2 = createGetVerticesOperator => [ - vertexVariable = sw - ] - - val expand1 = createExpandOperator => [ - input = getVertices2 - direction = Direction.OUT - sourceVertexVariable = sw - targetVertexVariable = _sensor - edgeVariable = _e1 - ] - - val antiJoin = createAntiJoinOperator => [ - leftInput = getVertices1 - rightInput = expand1 - ] - val de = createDuplicateEliminationOperator => [ - input = antiJoin - ] - val production = createProductionOperator => [ - input = de - ] - switchMonitored.rootExpression = production - switchMonitored - } - - def static switchSet() { - val switchSet = createRelalgContainer - - val routeLabel = createVertexLabel => [name = "Route"; container = switchSet] - val semaphoreLabel = createVertexLabel => [name = "Semaphore"; container = switchSet] - val switchLabel = createVertexLabel => [name = "Switch"; container = switchSet] - val switchPositionLabel = createVertexLabel => [name = "SwitchPosition"; container = switchSet] - - val entryLabel = createEdgeLabel => [name = "entry"; container = switchSet] - val followsLabel = createEdgeLabel => [name = "follows"; container = switchSet] - val targetLabel = createEdgeLabel => [name = "target"; container = switchSet] - - val route = createVertexVariable => [name = "route"; vertexLabels.add(routeLabel); container = switchSet] - val sw = createVertexVariable => [ - name = "sw" - vertexLabels.add(switchLabel) - ] - val swP = createVertexVariable => [ - name = "swP" - vertexLabels.add(switchPositionLabel) - ] - val semaphore = createVertexVariable => [ - name = "semaphore" - vertexLabels.add(semaphoreLabel) - ] - - val currentPosition = createAttributeVariable => [name = "currentPosition"; element = sw; container = switchSet] - val position = createAttributeVariable => [name = "position"; element = swP; container = switchSet] - val signal = createAttributeVariable => [name = "signal"; element = semaphore; container = switchSet] - - val _e1 = createEdgeVariable => [ - name = "_e1" - edgeLabels.add(entryLabel) - dontCare = true - ] - val _e2 = createEdgeVariable => [ - name = "_e2" - edgeLabels.add(followsLabel) - dontCare = true - ] - val _e3 = createEdgeVariable => [ - name = "_e3" - edgeLabels.add(targetLabel) - dontCare = true - ] - - val getVertices = createGetVerticesOperator => [ - vertexVariable = semaphore - ] - - val expand1 = createExpandOperator => [ - input = getVertices - direction = Direction.IN - sourceVertexVariable = semaphore - targetVertexVariable = route - edgeVariable = _e1 - ] - val expand2 = createExpandOperator => [ - input = expand1 - direction = Direction.OUT - sourceVertexVariable = route - targetVertexVariable = swP - edgeVariable = _e2 - ] - val expand3 = createExpandOperator => [ - input = expand2 - direction = Direction.OUT - sourceVertexVariable = swP - targetVertexVariable = sw - edgeVariable = _e3 - ] - - val allDifferent = createAllDifferentOperator => [ - input = expand3 - edgeVariables.addAll(Arrays.asList(_e1, _e2, _e3)) - ] - - val stringLiteralGO = createStringLiteral => [value = "GO"] - val condition1 = createArithmeticComparisonExpression => [ - leftOperand = signal - rightOperand = stringLiteralGO - operator = ArithmeticComparisonOperator.EQUAL_TO - ] - val filter1 = createSelectionOperator => [ - input = allDifferent - conditionString = "semaphore.signal = 'GO'" - it.condition = condition1 - ] - - val condition2 = createArithmeticComparisonExpression => [ - leftOperand = currentPosition - rightOperand = position - operator = ArithmeticComparisonOperator.NOT_EQUAL_TO - ] - val filter2 = createSelectionOperator => [ - input = filter1 - conditionString = "sw.currentPosition != swP.position" - it.condition = condition2 - ] - val projection = createProjectionOperator => [ - input = filter2 - variables.addAll(Arrays.asList(semaphore, route, swP, sw, currentPosition, position)) - ] - val de = createDuplicateEliminationOperator => [ - input = projection - ] - val production = createProductionOperator => [ - input = de - ] - switchSet.rootExpression = production - switchSet - } - -} diff --git a/trainbenchmark-tool-ingraph-query-plans/src/test/java/ingraph/trainbenchmark/QueryPlanVisualizationTest.xtend b/trainbenchmark-tool-ingraph-query-plans/src/test/java/ingraph/trainbenchmark/QueryPlanVisualizationTest.xtend deleted file mode 100644 index 49f1715c6..000000000 --- a/trainbenchmark-tool-ingraph-query-plans/src/test/java/ingraph/trainbenchmark/QueryPlanVisualizationTest.xtend +++ /dev/null @@ -1,56 +0,0 @@ -package ingraph.trainbenchmark - -import ingraph.optimization.transformations.relalg2rete.Relalg2ReteTransformation -import ingraph.relalg2tex.RelalgExpressionSerializer -import ingraph.relalg2tex.RelalgSerializerConfig -import ingraph.relalg2tex.RelalgTreeSerializer -import org.junit.Test -import org.junit.runner.RunWith -import org.junit.runners.Parameterized -import org.junit.runners.Parameterized.Parameter -import org.junit.runners.Parameterized.Parameters -import relalg.RelalgContainer - -@RunWith(Parameterized) -class QueryPlanVisualizationTest { - - @Parameters(name="plan={0}") - static def Iterable<? extends Object> data() { - #[ - new RouteSensorQueryPlanFactory().routeSensorA, - new RouteSensorQueryPlanFactory().routeSensorB, - new RouteSensorQueryPlanFactory().routeSensorC, - new SemaphoreNeighborQueryPlanFactory().semaphoreNeighborA, - new SemaphoreNeighborQueryPlanFactory().semaphoreNeighborB, - new SemaphoreNeighborQueryPlanFactory().semaphoreNeighborC, - new SemaphoreNeighborQueryPlanFactory().semaphoreNeighborD, - new SemaphoreNeighborQueryPlanFactory().semaphoreNeighborE, - new SemaphoreNeighborQueryPlanFactory().semaphoreNeighborF - ]; - } - - @Parameter - public RelalgContainer plan - - val treeConfig = new RelalgSerializerConfig => [standaloneDocument = true] - val expressionConfig = new RelalgSerializerConfig => [standaloneDocument = false] - - val extension RelalgTreeSerializer treeSerializer = new RelalgTreeSerializer(treeConfig) - val extension RelalgExpressionSerializer expressionSerializer = new RelalgExpressionSerializer(expressionConfig) - - val extension Relalg2ReteTransformation transformation = new Relalg2ReteTransformation - - @Test - def void serialize() { - val name = plan.name - treeSerializer.serialize(plan, '''query-plans/«name»-Relalg''') - treeSerializer.serialize(plan.transformToRete, '''query-plans/«name»-Rete''') - println(''' - \begin{align*} - \uline{«name.substring(name.length - 1)»:} - «expressionSerializer.serialize(plan.transformToRete, '''query-plans/«name»-ReteExpression''')» - \end{align*} - ''') - } - -} diff --git a/trainbenchmark-tool-ingraph-query-plans/src/test/java/ingraph/trainbenchmark/RelalgBuilderTest.xtend b/trainbenchmark-tool-ingraph-query-plans/src/test/java/ingraph/trainbenchmark/RelalgBuilderTest.xtend deleted file mode 100644 index 478e0b3b8..000000000 --- a/trainbenchmark-tool-ingraph-query-plans/src/test/java/ingraph/trainbenchmark/RelalgBuilderTest.xtend +++ /dev/null @@ -1,51 +0,0 @@ -package ingraph.trainbenchmark - -import ingraph.cypher2relalg.Cypher2Relalg -import ingraph.cypherparser.CypherParser -import ingraph.relalg2tex.RelalgTreeSerializer -import java.io.IOException -import org.junit.Test -import org.junit.Ignore - -@Ignore -class RelalgBuilderTest { - - val static RelalgTreeSerializer drawer = new RelalgTreeSerializer - - def process(String query) { - val cypher = CypherParser.parseFile("trainbenchmark/" + query) - val expression = Cypher2Relalg.processCypher(cypher) - drawer.serialize(expression, "queries/" + query) - } - - @Test - def void testConnectedSegments() throws IOException { - process("ConnectedSegments") - } - - @Test - def void testPosLength() throws IOException { - process("PosLength") - } - - @Test - def void testRouteSensor() throws IOException { - process("RouteSensor") - } - - @Test - def void testSwitchMonitored() throws IOException { - process("SwitchMonitored") - } - - @Test - def void testSwitchSet() throws IOException { - process("SwitchSet") - } - - @Test - def void testSemaphoreNeighbor() throws IOException { - process("SemaphoreNeighbor") - } - -} diff --git a/trainbenchmark-tool-ingraph-query-plans/src/test/java/ingraph/trainbenchmark/cost/CostTest.xtend b/trainbenchmark-tool-ingraph-query-plans/src/test/java/ingraph/trainbenchmark/cost/CostTest.xtend deleted file mode 100644 index c305d76bc..000000000 --- a/trainbenchmark-tool-ingraph-query-plans/src/test/java/ingraph/trainbenchmark/cost/CostTest.xtend +++ /dev/null @@ -1,28 +0,0 @@ -package ingraph.trainbenchmark.cost - -import ingraph.optimization.transformations.cost.ReteCostFunction -import ingraph.optimization.transformations.relalg2rete.Relalg2ReteTransformation -import ingraph.relalg2tex.RelalgTreeSerializer -import ingraph.trainbenchmark.RouteSensorQueryPlanFactory -import ingraph.trainbenchmark.SemaphoreNeighborQueryPlanFactory -import org.junit.Test - -class CostTest { - - val extension RelalgTreeSerializer drawer = new RelalgTreeSerializer - val extension ReteCostFunction function = new ReteCostFunction - val extension RouteSensorQueryPlanFactory routesensorFactory = new RouteSensorQueryPlanFactory - val extension SemaphoreNeighborQueryPlanFactory semaphoreNeighborFactory = new SemaphoreNeighborQueryPlanFactory - val extension Relalg2ReteTransformation transformation = new Relalg2ReteTransformation - - @Test - def void costRouteSensorA() { - drawer.serialize(routeSensorA.transformToRete.estimateCost, "query-plans/RouteSensorA-Rete-cost") - } - - @Test - def void costSemaphoreNeighborA() { - drawer.serialize(semaphoreNeighborA.transformToRete.estimateCost, "query-plans/SemaphoreNeighborA-Rete-cost") - } - -} \ No newline at end of file diff --git a/trainbenchmark-tool-ingraph/.gitignore b/trainbenchmark-tool-ingraph/.gitignore deleted file mode 100644 index 5e02679b0..000000000 --- a/trainbenchmark-tool-ingraph/.gitignore +++ /dev/null @@ -1,3 +0,0 @@ -/target -/native -results/ diff --git a/trainbenchmark-tool-ingraph/build.gradle b/trainbenchmark-tool-ingraph/build.gradle deleted file mode 100644 index f0961b5b2..000000000 --- a/trainbenchmark-tool-ingraph/build.gradle +++ /dev/null @@ -1,18 +0,0 @@ -plugins { id "com.github.johnrengelman.shadow" version "1.2.3" } - -shadowJar { - classifier = 'fat' - manifest { attributes 'Main-Class': 'hu.bme.mit.trainbenchmark.benchmark.ingraph.IngraphBenchmarkMain' } -} - -repositories { - mavenLocal() - maven { url "https://dl.bintray.com/ftsrg/maven" } -} - -dependencies { - compile project(':trainbenchmark-tool') - compile project(':trainbenchmark-tool-ingraph-query-plans') - compile group: 'ingraph', name: 'ingraph-ire', version: ingraphVersion - compile 'com.github.jbellis:jamm:0.3.1' -} diff --git a/trainbenchmark-tool-ingraph/src/main/java/hu/bme/mit/trainbenchmark/benchmark/ingraph/IngraphBenchmarkMain.java b/trainbenchmark-tool-ingraph/src/main/java/hu/bme/mit/trainbenchmark/benchmark/ingraph/IngraphBenchmarkMain.java deleted file mode 100644 index fded3b46a..000000000 --- a/trainbenchmark-tool-ingraph/src/main/java/hu/bme/mit/trainbenchmark/benchmark/ingraph/IngraphBenchmarkMain.java +++ /dev/null @@ -1,27 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2010-2015, Benedek Izso, Gabor Szarnyas, Istvan Rath and Daniel Varro - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Benedek Izso - initial API and implementation - * Gabor Szarnyas - initial API and implementation - *******************************************************************************/ - -package hu.bme.mit.trainbenchmark.benchmark.ingraph; - -import hu.bme.mit.trainbenchmark.benchmark.config.BenchmarkConfig; -import hu.bme.mit.trainbenchmark.benchmark.ingraph.config.IngraphBenchmarkConfig; - -public class IngraphBenchmarkMain { - - public static void main(final String[] args) throws Exception { - final IngraphBenchmarkConfig bc = BenchmarkConfig.fromFile(args[0], IngraphBenchmarkConfig.class); - final IngraphBenchmarkScenario scenario = IngraphBenchmarkScenario.create(bc); - scenario.performBenchmark(); - System.exit(0); - } - -} diff --git a/trainbenchmark-tool-ingraph/src/main/java/hu/bme/mit/trainbenchmark/benchmark/ingraph/IngraphBenchmarkScenario.java b/trainbenchmark-tool-ingraph/src/main/java/hu/bme/mit/trainbenchmark/benchmark/ingraph/IngraphBenchmarkScenario.java deleted file mode 100644 index aebc71bf5..000000000 --- a/trainbenchmark-tool-ingraph/src/main/java/hu/bme/mit/trainbenchmark/benchmark/ingraph/IngraphBenchmarkScenario.java +++ /dev/null @@ -1,30 +0,0 @@ -package hu.bme.mit.trainbenchmark.benchmark.ingraph; - -import java.util.Comparator; - -import hu.bme.mit.ire.TransactionFactory; -import hu.bme.mit.trainbenchmark.benchmark.ingraph.config.IngraphBenchmarkConfig; -import hu.bme.mit.trainbenchmark.benchmark.ingraph.driver.IngraphDriver; -import hu.bme.mit.trainbenchmark.benchmark.ingraph.driver.IngraphDriverFactory; -import hu.bme.mit.trainbenchmark.benchmark.ingraph.match.IngraphMatch; -import hu.bme.mit.trainbenchmark.benchmark.ingraph.match.IngraphMatchComparator; -import hu.bme.mit.trainbenchmark.benchmark.ingraph.operations.IngraphModelOperationFactory; -import hu.bme.mit.trainbenchmark.benchmark.operations.ModelOperationFactory; -import hu.bme.mit.trainbenchmark.benchmark.phases.BenchmarkScenario; - -public class IngraphBenchmarkScenario extends BenchmarkScenario<IngraphMatch, IngraphDriver, IngraphBenchmarkConfig> { - - protected IngraphBenchmarkScenario(final IngraphDriverFactory driverFactory, - final ModelOperationFactory<IngraphMatch, IngraphDriver> modelOperationFactory, - final Comparator<IngraphMatch> comparator, final IngraphBenchmarkConfig bc) throws Exception { - super(driverFactory, modelOperationFactory, comparator, bc); - } - - public static IngraphBenchmarkScenario create(final IngraphBenchmarkConfig bc) throws Exception { - final TransactionFactory transactionFactory = new TransactionFactory(bc.getMessageSize()); - final IngraphDriverFactory driverFactory = new IngraphDriverFactory(bc, transactionFactory); - final IngraphModelOperationFactory modelOperationFactory = new IngraphModelOperationFactory(transactionFactory); - return new IngraphBenchmarkScenario(driverFactory, modelOperationFactory, new IngraphMatchComparator(), bc); - } - -} diff --git a/trainbenchmark-tool-ingraph/src/main/java/hu/bme/mit/trainbenchmark/benchmark/ingraph/IngraphUtils.java b/trainbenchmark-tool-ingraph/src/main/java/hu/bme/mit/trainbenchmark/benchmark/ingraph/IngraphUtils.java deleted file mode 100644 index d77b9232d..000000000 --- a/trainbenchmark-tool-ingraph/src/main/java/hu/bme/mit/trainbenchmark/benchmark/ingraph/IngraphUtils.java +++ /dev/null @@ -1,25 +0,0 @@ -package hu.bme.mit.trainbenchmark.benchmark.ingraph; - -import java.lang.reflect.Method; - -import relalg.RelalgContainer; - -public class IngraphUtils { - public static RelalgContainer getQueryPlan(final String name, final String variant) throws - Exception { - final String prefix = "ingraph.trainbenchmark."; - final Class<?> factoryClass = Class.forName(prefix + name + "QueryPlanFactory"); - final Method declaredMethod = factoryClass.getDeclaredMethod(decapitalize(name) + variant); - final Object factory = factoryClass.getConstructor().newInstance(); - return (RelalgContainer) declaredMethod.invoke(factory); - } - - private static String decapitalize(final String string) { - return Character.toLowerCase(string.charAt(0)) + string.substring(1); - } - -// static Map<Object, Object> createIreTuple(Object pred, Object subj, Object obj) { -// Map<Object, Object>.Map1() -// return new Map<Object, Object>(1, 2, 3); -// } -} diff --git a/trainbenchmark-tool-ingraph/src/main/java/hu/bme/mit/trainbenchmark/benchmark/ingraph/config/IngraphBenchmarkConfig.java b/trainbenchmark-tool-ingraph/src/main/java/hu/bme/mit/trainbenchmark/benchmark/ingraph/config/IngraphBenchmarkConfig.java deleted file mode 100644 index dd55cf3df..000000000 --- a/trainbenchmark-tool-ingraph/src/main/java/hu/bme/mit/trainbenchmark/benchmark/ingraph/config/IngraphBenchmarkConfig.java +++ /dev/null @@ -1,51 +0,0 @@ -package hu.bme.mit.trainbenchmark.benchmark.ingraph.config; - -import hu.bme.mit.trainbenchmark.benchmark.config.BenchmarkConfig; -import hu.bme.mit.trainbenchmark.benchmark.config.BenchmarkConfigBase; - -public class IngraphBenchmarkConfig extends BenchmarkConfig { - - protected final int messageSize; - protected final String queryVariant; - protected final String memoryMeasurementPath; - - protected IngraphBenchmarkConfig(final BenchmarkConfigBase bcb, final int messageSize, final String queryVariant, - final String memoryMeasurementPath) { - super(bcb); - this.messageSize = messageSize; - this.queryVariant = queryVariant; - this.memoryMeasurementPath = memoryMeasurementPath; - } - - public String getFileName() { - return getConfigBase().getModelFilename(); - } - - public int getMessageSize() { - return messageSize; - } - - @Override - public String getToolName() { - return "Ingraph"; - } - - @Override - public String getProjectName() { - return "ingraph"; - } - - public String getQueryVariant() { - return queryVariant; - } - - public String getMemoryMeasurementPath() { - return memoryMeasurementPath; - } - - @Override - public String getDescription() { - return queryVariant; - } - -} diff --git a/trainbenchmark-tool-ingraph/src/main/java/hu/bme/mit/trainbenchmark/benchmark/ingraph/config/IngraphBenchmarkConfigBuilder.java b/trainbenchmark-tool-ingraph/src/main/java/hu/bme/mit/trainbenchmark/benchmark/ingraph/config/IngraphBenchmarkConfigBuilder.java deleted file mode 100644 index 9ebe19bda..000000000 --- a/trainbenchmark-tool-ingraph/src/main/java/hu/bme/mit/trainbenchmark/benchmark/ingraph/config/IngraphBenchmarkConfigBuilder.java +++ /dev/null @@ -1,35 +0,0 @@ -package hu.bme.mit.trainbenchmark.benchmark.ingraph.config; - -import com.google.common.base.Preconditions; - -import hu.bme.mit.trainbenchmark.benchmark.config.BenchmarkConfigBuilder; - -public class IngraphBenchmarkConfigBuilder - extends BenchmarkConfigBuilder<IngraphBenchmarkConfig, IngraphBenchmarkConfigBuilder> { - - protected Integer messageSize; - protected String queryVariant; - - @Override - public void checkNotNulls() { - super.checkNotNulls(); - Preconditions.checkNotNull(messageSize); - } - - public IngraphBenchmarkConfigBuilder setMessageSize(Integer messageSize) { - this.messageSize = messageSize; - return this; - } - - public IngraphBenchmarkConfigBuilder setQueryVariant(String queryVariant) { - this.queryVariant = queryVariant; - return this; - } - - @Override - public IngraphBenchmarkConfig createConfig() { - checkNotNulls(); - return new IngraphBenchmarkConfig(configBase, messageSize, queryVariant, null); - } - -} \ No newline at end of file diff --git a/trainbenchmark-tool-ingraph/src/main/java/hu/bme/mit/trainbenchmark/benchmark/ingraph/driver/IngraphDriver.java b/trainbenchmark-tool-ingraph/src/main/java/hu/bme/mit/trainbenchmark/benchmark/ingraph/driver/IngraphDriver.java deleted file mode 100644 index 542a0ca1d..000000000 --- a/trainbenchmark-tool-ingraph/src/main/java/hu/bme/mit/trainbenchmark/benchmark/ingraph/driver/IngraphDriver.java +++ /dev/null @@ -1,93 +0,0 @@ -package hu.bme.mit.trainbenchmark.benchmark.ingraph.driver; - -import java.io.File; -import java.io.IOException; -import java.nio.charset.Charset; -import java.util.Arrays; - -import org.apache.commons.io.FileUtils; -import org.github.jamm.MemoryMeter; - -import hu.bme.mit.ire.Transaction; -import hu.bme.mit.ire.TransactionFactory; -import hu.bme.mit.trainbenchmark.benchmark.driver.Driver; -import hu.bme.mit.trainbenchmark.benchmark.ingraph.config.IngraphBenchmarkConfig; -import ingraph.ire.IngraphAdapter; - -public class IngraphDriver extends Driver { - - protected final IngraphBenchmarkConfig bc; - protected final TransactionFactory transactionFactory; - protected Transaction tx; - protected IngraphAdapter adapter; - - public IngraphDriver(final IngraphBenchmarkConfig bc, final TransactionFactory transactionFactory) { - super(); - this.bc = bc; - this.transactionFactory = transactionFactory; - } - - @Override - public void read(final String modelPath) throws Exception { - beginTransaction(); - adapter.readGraph(modelPath, tx); - finishTransaction(); - } - - @Override - public String getPostfix() { - return "-tinkerpop.graphml"; - } - - - @Override - public void destroy() { - if (adapter != null) { - adapter.engine().shutdown(); - } - } - - public Transaction newTransaction() { - tx = transactionFactory.newBatchTransaction(); - return tx; - } - - @Override - public void beginTransaction() { - newTransaction(); - } - - @Override - public void finishTransaction() throws Exception { - if (tx != null) { - tx.close(); - tx = null; - adapter.engine().getResults(); - } - } - - public long newKey() { - return transactionFactory.newKey(); - } - - public String getQueryVariant() { - return bc.getQueryVariant(); - } - - public void maybeMeasureMemory() throws IOException { - final String memPath = bc.getMemoryMeasurementPath(); - if (memPath != null) { - final MemoryMeter meter = new MemoryMeter(); - final long memoryB = meter.measureDeep(adapter.engine()); - final double memoryMB = memoryB / Math.pow(10, 6); - final String line = String.join(",", - Arrays.asList(bc.getToolName(), bc.getQueryVariant(), bc.getFileName(), String.format("%.02f", memoryMB))) + "\n"; - - FileUtils.write(new File(memPath), line, Charset.defaultCharset(), true); - } - } - - public void setAdapter(final IngraphAdapter adapter) { - this.adapter = adapter; - } -} diff --git a/trainbenchmark-tool-ingraph/src/main/java/hu/bme/mit/trainbenchmark/benchmark/ingraph/driver/IngraphDriverFactory.java b/trainbenchmark-tool-ingraph/src/main/java/hu/bme/mit/trainbenchmark/benchmark/ingraph/driver/IngraphDriverFactory.java deleted file mode 100644 index 3dd0b7d54..000000000 --- a/trainbenchmark-tool-ingraph/src/main/java/hu/bme/mit/trainbenchmark/benchmark/ingraph/driver/IngraphDriverFactory.java +++ /dev/null @@ -1,22 +0,0 @@ -package hu.bme.mit.trainbenchmark.benchmark.ingraph.driver; - -import hu.bme.mit.ire.TransactionFactory; -import hu.bme.mit.trainbenchmark.benchmark.driver.DriverFactory; -import hu.bme.mit.trainbenchmark.benchmark.ingraph.config.IngraphBenchmarkConfig; - -public class IngraphDriverFactory extends DriverFactory<IngraphDriver> { - - protected IngraphBenchmarkConfig bc; - protected TransactionFactory transactionFactory; - - public IngraphDriverFactory(final IngraphBenchmarkConfig bc, final TransactionFactory transactionFactory) { - this.bc = bc; - this.transactionFactory = transactionFactory; - } - - @Override - public IngraphDriver createInstance() throws Exception { - return new IngraphDriver(bc, transactionFactory); - } - -} diff --git a/trainbenchmark-tool-ingraph/src/main/java/hu/bme/mit/trainbenchmark/benchmark/ingraph/match/IngraphConnectedSegmentsInjectMatch.java b/trainbenchmark-tool-ingraph/src/main/java/hu/bme/mit/trainbenchmark/benchmark/ingraph/match/IngraphConnectedSegmentsInjectMatch.java deleted file mode 100644 index 07514b3ed..000000000 --- a/trainbenchmark-tool-ingraph/src/main/java/hu/bme/mit/trainbenchmark/benchmark/ingraph/match/IngraphConnectedSegmentsInjectMatch.java +++ /dev/null @@ -1,40 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2010-2015, Benedek Izso, Gabor Szarnyas, Istvan Rath and Daniel Varro - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Benedek Izso - initial API and implementation - * Gabor Szarnyas - initial API and implementation - *******************************************************************************/ -package hu.bme.mit.trainbenchmark.benchmark.ingraph.match; - -import hu.bme.mit.trainbenchmark.benchmark.matches.ConnectedSegmentsInjectMatch; -import scala.collection.immutable.Map; - -// The code of the match classes is correct, but it does not compile in Eclipse. See -// http://stackoverflow.com/questions/10852923/method-is-ambiguous-for-the-type-but-the-types-are-not-ambiguous-and-the-erro -public class IngraphConnectedSegmentsInjectMatch extends IngraphMatch implements ConnectedSegmentsInjectMatch { - - public IngraphConnectedSegmentsInjectMatch(final Map<Object, Object> qs) { - super(qs); - } - - @Override - public Long getSensor() { - return (Long) qs.get(0).get(); - } - - @Override - public Long getSegment1() { - return (Long) qs.get(1).get(); - } - - @Override - public Long getSegment3() { - return (Long) qs.get(2).get(); - } - -} diff --git a/trainbenchmark-tool-ingraph/src/main/java/hu/bme/mit/trainbenchmark/benchmark/ingraph/match/IngraphConnectedSegmentsMatch.java b/trainbenchmark-tool-ingraph/src/main/java/hu/bme/mit/trainbenchmark/benchmark/ingraph/match/IngraphConnectedSegmentsMatch.java deleted file mode 100644 index b9ee9cf6d..000000000 --- a/trainbenchmark-tool-ingraph/src/main/java/hu/bme/mit/trainbenchmark/benchmark/ingraph/match/IngraphConnectedSegmentsMatch.java +++ /dev/null @@ -1,58 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2010-2015, Benedek Izso, Gabor Szarnyas, Istvan Rath and Daniel Varro - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Benedek Izso - initial API and implementation - * Gabor Szarnyas - initial API and implementation - *******************************************************************************/ -package hu.bme.mit.trainbenchmark.benchmark.ingraph.match; - -import hu.bme.mit.trainbenchmark.benchmark.matches.ConnectedSegmentsMatch; -import scala.collection.immutable.Map; - -public class IngraphConnectedSegmentsMatch extends IngraphMatch implements ConnectedSegmentsMatch { - - public IngraphConnectedSegmentsMatch(final Map<Object, Object> qs) { - super(qs); - } - - @Override - public Long getSegment1() { - return (Long) qs.get(0).get(); - } - - @Override - public Long getSegment2() { - return (Long) qs.get(1).get(); - } - - @Override - public Long getSegment3() { - return (Long) qs.get(2).get(); - } - - @Override - public Long getSegment4() { - return (Long) qs.get(3).get(); - } - - @Override - public Long getSegment5() { - return (Long) qs.get(4).get(); - } - - @Override - public Long getSegment6() { - return (Long) qs.get(5).get(); - } - - @Override - public Long getSensor() { - return (Long) qs.get(6).get(); - } - -} diff --git a/trainbenchmark-tool-ingraph/src/main/java/hu/bme/mit/trainbenchmark/benchmark/ingraph/match/IngraphMatch.java b/trainbenchmark-tool-ingraph/src/main/java/hu/bme/mit/trainbenchmark/benchmark/ingraph/match/IngraphMatch.java deleted file mode 100644 index 9496bd745..000000000 --- a/trainbenchmark-tool-ingraph/src/main/java/hu/bme/mit/trainbenchmark/benchmark/ingraph/match/IngraphMatch.java +++ /dev/null @@ -1,65 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2010-2015, Benedek Izso, Gabor Szarnyas, Istvan Rath and Daniel Varro - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Benedek Izso - initial API and implementation - * Gabor Szarnyas - initial API and implementation - *******************************************************************************/ -package hu.bme.mit.trainbenchmark.benchmark.ingraph.match; - -import com.google.common.base.Joiner; - -import hu.bme.mit.trainbenchmark.benchmark.matches.BaseMatch; -import hu.bme.mit.trainbenchmark.constants.RailwayQuery; -import scala.collection.immutable.Map; - -public abstract class IngraphMatch extends BaseMatch { - - protected Map<Object, Object> qs; - - public IngraphMatch(final Map<Object, Object> qs) { - this.qs = qs; - } - - public static IngraphMatch createMatch(final RailwayQuery query, final Map<Object, Object> qs) { - switch (query) { - case CONNECTEDSEGMENTS: - return new IngraphConnectedSegmentsMatch(qs); - case CONNECTEDSEGMENTS_INJECT: - return new IngraphConnectedSegmentsInjectMatch(qs); - case POSLENGTH: - return new IngraphPosLengthMatch(qs); - case POSLENGTH_INJECT: - return new IngraphPosLengthInjectMatch(qs); - case ROUTESENSOR: - return new IngraphRouteSensorMatch(qs); - case ROUTESENSOR_INJECT: - return new IngraphRouteSensorInjectMatch(qs); - case SEMAPHORENEIGHBOR: - return new IngraphSemaphoreNeighborMatch(qs); - case SEMAPHORENEIGHBOR_INJECT: - return new IngraphSemaphoreNeighborInjectMatch(qs); - case SWITCHMONITORED: - return new IngraphSwitchMonitoredMatch(qs); - case SWITCHMONITORED_INJECT: - return new IngraphSwitchMonitoredInjectMatch(qs); - case SWITCHSET: - return new IngraphSwitchSetMatch(qs); - case SWITCHSET_INJECT: - return new IngraphSwitchSetInjectMatch(qs); - default: - throw new UnsupportedOperationException("Pattern not supported: " + query); - } - } - - @Override - public String toString() { - final Joiner joiner = Joiner.on(", "); - return "<" + joiner.join(toArray()) + ">"; - } - -} diff --git a/trainbenchmark-tool-ingraph/src/main/java/hu/bme/mit/trainbenchmark/benchmark/ingraph/match/IngraphMatchComparator.java b/trainbenchmark-tool-ingraph/src/main/java/hu/bme/mit/trainbenchmark/benchmark/ingraph/match/IngraphMatchComparator.java deleted file mode 100644 index 53b8b4e7d..000000000 --- a/trainbenchmark-tool-ingraph/src/main/java/hu/bme/mit/trainbenchmark/benchmark/ingraph/match/IngraphMatchComparator.java +++ /dev/null @@ -1,23 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2010-2015, Benedek Izso, Gabor Szarnyas, Istvan Rath and Daniel Varro - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Benedek Izso - initial API and implementation - * Gabor Szarnyas - initial API and implementation - *******************************************************************************/ -package hu.bme.mit.trainbenchmark.benchmark.ingraph.match; - -import hu.bme.mit.trainbenchmark.benchmark.comparators.LongComparator; -import hu.bme.mit.trainbenchmark.benchmark.matches.comparators.BaseMatchComparator; - -public class IngraphMatchComparator extends BaseMatchComparator<IngraphMatch, Long> { - - public IngraphMatchComparator() { - super(new LongComparator()); - } - -} diff --git a/trainbenchmark-tool-ingraph/src/main/java/hu/bme/mit/trainbenchmark/benchmark/ingraph/match/IngraphPosLengthInjectMatch.java b/trainbenchmark-tool-ingraph/src/main/java/hu/bme/mit/trainbenchmark/benchmark/ingraph/match/IngraphPosLengthInjectMatch.java deleted file mode 100644 index 791d39f79..000000000 --- a/trainbenchmark-tool-ingraph/src/main/java/hu/bme/mit/trainbenchmark/benchmark/ingraph/match/IngraphPosLengthInjectMatch.java +++ /dev/null @@ -1,32 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2010-2015, Benedek Izso, Gabor Szarnyas, Istvan Rath and Daniel Varro - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Benedek Izso - initial API and implementation - * Gabor Szarnyas - initial API and implementation - *******************************************************************************/ -package hu.bme.mit.trainbenchmark.benchmark.ingraph.match; - -import hu.bme.mit.trainbenchmark.benchmark.matches.PosLengthInjectMatch; -import scala.collection.immutable.Map; - -public class IngraphPosLengthInjectMatch extends IngraphMatch implements PosLengthInjectMatch { - - public IngraphPosLengthInjectMatch(final Map<Object, Object> qs) { - super(qs); - } - - @Override - public Long getSegment() { - return (Long) qs.get(0).get(); - } - - public Integer getLength() { - return (Integer) qs.get(1).get(); - } - -} diff --git a/trainbenchmark-tool-ingraph/src/main/java/hu/bme/mit/trainbenchmark/benchmark/ingraph/match/IngraphPosLengthMatch.java b/trainbenchmark-tool-ingraph/src/main/java/hu/bme/mit/trainbenchmark/benchmark/ingraph/match/IngraphPosLengthMatch.java deleted file mode 100644 index 999374561..000000000 --- a/trainbenchmark-tool-ingraph/src/main/java/hu/bme/mit/trainbenchmark/benchmark/ingraph/match/IngraphPosLengthMatch.java +++ /dev/null @@ -1,32 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2010-2015, Benedek Izso, Gabor Szarnyas, Istvan Rath and Daniel Varro - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Benedek Izso - initial API and implementation - * Gabor Szarnyas - initial API and implementation - *******************************************************************************/ -package hu.bme.mit.trainbenchmark.benchmark.ingraph.match; - -import hu.bme.mit.trainbenchmark.benchmark.matches.PosLengthMatch; -import scala.collection.immutable.Map; - -public class IngraphPosLengthMatch extends IngraphMatch implements PosLengthMatch { - - public IngraphPosLengthMatch(final Map<Object, Object> qs) { - super(qs); - } - - @Override - public Long getSegment() { - return (Long) qs.get(0).get(); - } - - public Integer getLength() { - return (Integer) qs.get(1).get(); - } - -} diff --git a/trainbenchmark-tool-ingraph/src/main/java/hu/bme/mit/trainbenchmark/benchmark/ingraph/match/IngraphRouteSensorInjectMatch.java b/trainbenchmark-tool-ingraph/src/main/java/hu/bme/mit/trainbenchmark/benchmark/ingraph/match/IngraphRouteSensorInjectMatch.java deleted file mode 100644 index d30682b85..000000000 --- a/trainbenchmark-tool-ingraph/src/main/java/hu/bme/mit/trainbenchmark/benchmark/ingraph/match/IngraphRouteSensorInjectMatch.java +++ /dev/null @@ -1,33 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2010-2015, Benedek Izso, Gabor Szarnyas, Istvan Rath and Daniel Varro - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Benedek Izso - initial API and implementation - * Gabor Szarnyas - initial API and implementation - *******************************************************************************/ -package hu.bme.mit.trainbenchmark.benchmark.ingraph.match; - -import hu.bme.mit.trainbenchmark.benchmark.matches.RouteSensorInjectMatch; -import scala.collection.immutable.Map; - -public class IngraphRouteSensorInjectMatch extends IngraphMatch implements RouteSensorInjectMatch { - - public IngraphRouteSensorInjectMatch(final Map<Object, Object> qs) { - super(qs); - } - - @Override - public Long getRoute() { - return (Long) qs.get(0).get(); - } - - @Override - public Long getSensor() { - return (Long) qs.get(1).get(); - } - -} diff --git a/trainbenchmark-tool-ingraph/src/main/java/hu/bme/mit/trainbenchmark/benchmark/ingraph/match/IngraphRouteSensorMatch.java b/trainbenchmark-tool-ingraph/src/main/java/hu/bme/mit/trainbenchmark/benchmark/ingraph/match/IngraphRouteSensorMatch.java deleted file mode 100644 index 04ccc8442..000000000 --- a/trainbenchmark-tool-ingraph/src/main/java/hu/bme/mit/trainbenchmark/benchmark/ingraph/match/IngraphRouteSensorMatch.java +++ /dev/null @@ -1,43 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2010-2015, Benedek Izso, Gabor Szarnyas, Istvan Rath and Daniel Varro - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Benedek Izso - initial API and implementation - * Gabor Szarnyas - initial API and implementation - *******************************************************************************/ -package hu.bme.mit.trainbenchmark.benchmark.ingraph.match; - -import hu.bme.mit.trainbenchmark.benchmark.matches.RouteSensorMatch; -import scala.collection.immutable.Map; - -public class IngraphRouteSensorMatch extends IngraphMatch implements RouteSensorMatch { - - public IngraphRouteSensorMatch(final Map<Object, Object> qs) { - super(qs); - } - - @Override - public Long getRoute() { - return (Long) qs.get("route").get(); - } - - @Override - public Long getSensor() { - return (Long) qs.get("sensor").get(); - } - - @Override - public Long getSwP() { - return (Long) qs.get("swP").get(); - } - - @Override - public Long getSw() { - return (Long) qs.get("sw").get(); - } - -} diff --git a/trainbenchmark-tool-ingraph/src/main/java/hu/bme/mit/trainbenchmark/benchmark/ingraph/match/IngraphSemaphoreNeighborInjectMatch.java b/trainbenchmark-tool-ingraph/src/main/java/hu/bme/mit/trainbenchmark/benchmark/ingraph/match/IngraphSemaphoreNeighborInjectMatch.java deleted file mode 100644 index 503833d8d..000000000 --- a/trainbenchmark-tool-ingraph/src/main/java/hu/bme/mit/trainbenchmark/benchmark/ingraph/match/IngraphSemaphoreNeighborInjectMatch.java +++ /dev/null @@ -1,33 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2010-2015, Benedek Izso, Gabor Szarnyas, Istvan Rath and Daniel Varro - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Benedek Izso - initial API and implementation - * Gabor Szarnyas - initial API and implementation - *******************************************************************************/ -package hu.bme.mit.trainbenchmark.benchmark.ingraph.match; - -import hu.bme.mit.trainbenchmark.benchmark.matches.SemaphoreNeighborInjectMatch; -import scala.collection.immutable.Map; - -public class IngraphSemaphoreNeighborInjectMatch extends IngraphMatch implements SemaphoreNeighborInjectMatch { - - public IngraphSemaphoreNeighborInjectMatch(final Map<Object, Object> qs) { - super(qs); - } - - @Override - public Long getRoute() { - return (Long) qs.get("route").get(); - } - - @Override - public Object getSemaphore() { - return (Long) qs.get("semaphore").get(); - } - -} diff --git a/trainbenchmark-tool-ingraph/src/main/java/hu/bme/mit/trainbenchmark/benchmark/ingraph/match/IngraphSemaphoreNeighborMatch.java b/trainbenchmark-tool-ingraph/src/main/java/hu/bme/mit/trainbenchmark/benchmark/ingraph/match/IngraphSemaphoreNeighborMatch.java deleted file mode 100644 index 76193585a..000000000 --- a/trainbenchmark-tool-ingraph/src/main/java/hu/bme/mit/trainbenchmark/benchmark/ingraph/match/IngraphSemaphoreNeighborMatch.java +++ /dev/null @@ -1,58 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2010-2015, Benedek Izso, Gabor Szarnyas, Istvan Rath and Daniel Varro - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Benedek Izso - initial API and implementation - * Gabor Szarnyas - initial API and implementation - *******************************************************************************/ -package hu.bme.mit.trainbenchmark.benchmark.ingraph.match; - -import hu.bme.mit.trainbenchmark.benchmark.matches.SemaphoreNeighborMatch; -import scala.collection.immutable.Map; - -public class IngraphSemaphoreNeighborMatch extends IngraphMatch implements SemaphoreNeighborMatch { - - public IngraphSemaphoreNeighborMatch(final Map<Object, Object> qs) { - super(qs); - } - - @Override - public Long getSemaphore() { - return (Long) qs.get("semaphore").get(); - } - - @Override - public Long getRoute1() { - return (Long) qs.get("route1").get(); - } - - @Override - public Long getRoute2() { - return (Long) qs.get("route2").get(); - } - - @Override - public Long getSensor1() { - return (Long) qs.get("sensor1").get(); - } - - @Override - public Long getSensor2() { - return (Long) qs.get("sensor2").get(); - } - - @Override - public Long getTe1() { - return (Long) qs.get("te1").get(); - } - - @Override - public Long getTe2() { - return (Long) qs.get("te2").get(); - } - -} diff --git a/trainbenchmark-tool-ingraph/src/main/java/hu/bme/mit/trainbenchmark/benchmark/ingraph/match/IngraphSwitchMonitoredInjectMatch.java b/trainbenchmark-tool-ingraph/src/main/java/hu/bme/mit/trainbenchmark/benchmark/ingraph/match/IngraphSwitchMonitoredInjectMatch.java deleted file mode 100644 index f2ddfe393..000000000 --- a/trainbenchmark-tool-ingraph/src/main/java/hu/bme/mit/trainbenchmark/benchmark/ingraph/match/IngraphSwitchMonitoredInjectMatch.java +++ /dev/null @@ -1,28 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2010-2015, Benedek Izso, Gabor Szarnyas, Istvan Rath and Daniel Varro - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Benedek Izso - initial API and implementation - * Gabor Szarnyas - initial API and implementation - *******************************************************************************/ -package hu.bme.mit.trainbenchmark.benchmark.ingraph.match; - -import hu.bme.mit.trainbenchmark.benchmark.matches.SwitchMonitoredInjectMatch; -import scala.collection.immutable.Map; - -public class IngraphSwitchMonitoredInjectMatch extends IngraphMatch implements SwitchMonitoredInjectMatch { - - public IngraphSwitchMonitoredInjectMatch(final Map<Object, Object> qs) { - super(qs); - } - - @Override - public Long getSw() { - return (Long) qs.get(0).get(); - } - -} diff --git a/trainbenchmark-tool-ingraph/src/main/java/hu/bme/mit/trainbenchmark/benchmark/ingraph/match/IngraphSwitchMonitoredMatch.java b/trainbenchmark-tool-ingraph/src/main/java/hu/bme/mit/trainbenchmark/benchmark/ingraph/match/IngraphSwitchMonitoredMatch.java deleted file mode 100644 index 38b8c150d..000000000 --- a/trainbenchmark-tool-ingraph/src/main/java/hu/bme/mit/trainbenchmark/benchmark/ingraph/match/IngraphSwitchMonitoredMatch.java +++ /dev/null @@ -1,28 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2010-2015, Benedek Izso, Gabor Szarnyas, Istvan Rath and Daniel Varro - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Benedek Izso - initial API and implementation - * Gabor Szarnyas - initial API and implementation - *******************************************************************************/ -package hu.bme.mit.trainbenchmark.benchmark.ingraph.match; - -import hu.bme.mit.trainbenchmark.benchmark.matches.SwitchMonitoredMatch; -import scala.collection.immutable.Map; - -public class IngraphSwitchMonitoredMatch extends IngraphMatch implements SwitchMonitoredMatch { - - public IngraphSwitchMonitoredMatch(final Map<Object, Object> qs) { - super(qs); - } - - @Override - public Long getSw() { - return (Long) qs.get(0).get(); - } - -} diff --git a/trainbenchmark-tool-ingraph/src/main/java/hu/bme/mit/trainbenchmark/benchmark/ingraph/match/IngraphSwitchSetInjectMatch.java b/trainbenchmark-tool-ingraph/src/main/java/hu/bme/mit/trainbenchmark/benchmark/ingraph/match/IngraphSwitchSetInjectMatch.java deleted file mode 100644 index f0c49a5f6..000000000 --- a/trainbenchmark-tool-ingraph/src/main/java/hu/bme/mit/trainbenchmark/benchmark/ingraph/match/IngraphSwitchSetInjectMatch.java +++ /dev/null @@ -1,28 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2010-2015, Benedek Izso, Gabor Szarnyas, Istvan Rath and Daniel Varro - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Benedek Izso - initial API and implementation - * Gabor Szarnyas - initial API and implementation - *******************************************************************************/ -package hu.bme.mit.trainbenchmark.benchmark.ingraph.match; - -import hu.bme.mit.trainbenchmark.benchmark.matches.SwitchSetInjectMatch; -import scala.collection.immutable.Map; - -public class IngraphSwitchSetInjectMatch extends IngraphMatch implements SwitchSetInjectMatch { - - public IngraphSwitchSetInjectMatch(final Map<Object, Object> qs) { - super(qs); - } - - @Override - public Long getSw() { - return (Long) qs.get(0).get(); - } - -} diff --git a/trainbenchmark-tool-ingraph/src/main/java/hu/bme/mit/trainbenchmark/benchmark/ingraph/match/IngraphSwitchSetMatch.java b/trainbenchmark-tool-ingraph/src/main/java/hu/bme/mit/trainbenchmark/benchmark/ingraph/match/IngraphSwitchSetMatch.java deleted file mode 100644 index 45e45ca1d..000000000 --- a/trainbenchmark-tool-ingraph/src/main/java/hu/bme/mit/trainbenchmark/benchmark/ingraph/match/IngraphSwitchSetMatch.java +++ /dev/null @@ -1,51 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2010-2015, Benedek Izso, Gabor Szarnyas, Istvan Rath and Daniel Varro - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Benedek Izso - initial API and implementation - * Gabor Szarnyas - initial API and implementation - *******************************************************************************/ -package hu.bme.mit.trainbenchmark.benchmark.ingraph.match; - -import hu.bme.mit.trainbenchmark.benchmark.matches.SwitchSetMatch; -import scala.collection.immutable.Map; - -public class IngraphSwitchSetMatch extends IngraphMatch implements SwitchSetMatch { - - public IngraphSwitchSetMatch(final Map<Object, Object> qs) { - super(qs); - } - - @Override - public Long getSemaphore() { - return (Long) qs.get(0).get(); - } - - @Override - public Long getRoute() { - return (Long) qs.get(1).get(); - } - - @Override - public Long getSwP() { - return (Long) qs.get(2).get(); - } - - @Override - public Long getSw() { - return (Long) qs.get(3).get(); - } - - public String getPosition() { - return (String) qs.get(4).get(); - } - - public String getCurrentPosition() { - return (String) qs.get(5).get(); - } - -} diff --git a/trainbenchmark-tool-ingraph/src/main/java/hu/bme/mit/trainbenchmark/benchmark/ingraph/operations/IngraphModelOperationFactory.java b/trainbenchmark-tool-ingraph/src/main/java/hu/bme/mit/trainbenchmark/benchmark/ingraph/operations/IngraphModelOperationFactory.java deleted file mode 100644 index 9af913fec..000000000 --- a/trainbenchmark-tool-ingraph/src/main/java/hu/bme/mit/trainbenchmark/benchmark/ingraph/operations/IngraphModelOperationFactory.java +++ /dev/null @@ -1,167 +0,0 @@ -package hu.bme.mit.trainbenchmark.benchmark.ingraph.operations; - -import hu.bme.mit.ire.TransactionFactory; -import hu.bme.mit.trainbenchmark.benchmark.ingraph.driver.IngraphDriver; -import hu.bme.mit.trainbenchmark.benchmark.ingraph.match.IngraphConnectedSegmentsInjectMatch; -import hu.bme.mit.trainbenchmark.benchmark.ingraph.match.IngraphConnectedSegmentsMatch; -import hu.bme.mit.trainbenchmark.benchmark.ingraph.match.IngraphMatch; -import hu.bme.mit.trainbenchmark.benchmark.ingraph.match.IngraphPosLengthInjectMatch; -import hu.bme.mit.trainbenchmark.benchmark.ingraph.match.IngraphPosLengthMatch; -import hu.bme.mit.trainbenchmark.benchmark.ingraph.match.IngraphRouteSensorInjectMatch; -import hu.bme.mit.trainbenchmark.benchmark.ingraph.match.IngraphRouteSensorMatch; -import hu.bme.mit.trainbenchmark.benchmark.ingraph.match.IngraphSemaphoreNeighborInjectMatch; -import hu.bme.mit.trainbenchmark.benchmark.ingraph.match.IngraphSemaphoreNeighborMatch; -import hu.bme.mit.trainbenchmark.benchmark.ingraph.match.IngraphSwitchMonitoredInjectMatch; -import hu.bme.mit.trainbenchmark.benchmark.ingraph.match.IngraphSwitchMonitoredMatch; -import hu.bme.mit.trainbenchmark.benchmark.ingraph.match.IngraphSwitchSetInjectMatch; -import hu.bme.mit.trainbenchmark.benchmark.ingraph.match.IngraphSwitchSetMatch; -import hu.bme.mit.trainbenchmark.benchmark.ingraph.queries.IngraphQuery; -import hu.bme.mit.trainbenchmark.benchmark.ingraph.transformations.IngraphTransformation; -import hu.bme.mit.trainbenchmark.benchmark.ingraph.transformations.inject.IngraphTransformationInjectConnectedSegments; -import hu.bme.mit.trainbenchmark.benchmark.ingraph.transformations.inject.IngraphTransformationInjectPosLength; -import hu.bme.mit.trainbenchmark.benchmark.ingraph.transformations.inject.IngraphTransformationInjectRouteSensor; -import hu.bme.mit.trainbenchmark.benchmark.ingraph.transformations.inject.IngraphTransformationInjectSemaphoreNeighbor; -import hu.bme.mit.trainbenchmark.benchmark.ingraph.transformations.inject.IngraphTransformationInjectSwitchMonitored; -import hu.bme.mit.trainbenchmark.benchmark.ingraph.transformations.inject.IngraphTransformationInjectSwitchSet; -import hu.bme.mit.trainbenchmark.benchmark.ingraph.transformations.repair.IngraphTransformationRepairConnectedSegments; -import hu.bme.mit.trainbenchmark.benchmark.ingraph.transformations.repair.IngraphTransformationRepairPosLength; -import hu.bme.mit.trainbenchmark.benchmark.ingraph.transformations.repair.IngraphTransformationRepairRouteSensor; -import hu.bme.mit.trainbenchmark.benchmark.ingraph.transformations.repair.IngraphTransformationRepairSemaphoreNeighbor; -import hu.bme.mit.trainbenchmark.benchmark.ingraph.transformations.repair.IngraphTransformationRepairSwitchMonitored; -import hu.bme.mit.trainbenchmark.benchmark.ingraph.transformations.repair.IngraphTransformationRepairSwitchSet; -import hu.bme.mit.trainbenchmark.benchmark.operations.ModelOperation; -import hu.bme.mit.trainbenchmark.benchmark.operations.ModelOperationFactory; -import hu.bme.mit.trainbenchmark.constants.RailwayOperation; -import hu.bme.mit.trainbenchmark.constants.RailwayQuery; - -public class IngraphModelOperationFactory extends ModelOperationFactory<IngraphMatch, IngraphDriver> { - - protected final TransactionFactory transactionFactory; - - public IngraphModelOperationFactory(final TransactionFactory transactionFactory) { - this.transactionFactory = transactionFactory; - } - - @Override - public ModelOperation<? extends IngraphMatch, IngraphDriver> createOperation(final RailwayOperation operationEnum, final String workspaceDir, - final IngraphDriver driver) throws Exception { - switch (operationEnum) { - // ConnectedSegments - case CONNECTEDSEGMENTS: { - final IngraphQuery<IngraphConnectedSegmentsMatch> query = new IngraphQuery<>(driver, RailwayQuery.CONNECTEDSEGMENTS, transactionFactory); - final ModelOperation<IngraphConnectedSegmentsMatch, IngraphDriver> operation = ModelOperation.of(query); - return operation; - } - case CONNECTEDSEGMENTS_INJECT: { - final IngraphQuery<IngraphConnectedSegmentsInjectMatch> query = new IngraphQuery<>(driver, RailwayQuery.CONNECTEDSEGMENTS_INJECT, transactionFactory); - final IngraphTransformation<IngraphConnectedSegmentsInjectMatch> transformation = new IngraphTransformationInjectConnectedSegments(driver); - final ModelOperation<IngraphConnectedSegmentsInjectMatch, IngraphDriver> operation = ModelOperation.of(query, transformation); - return operation; - } - case CONNECTEDSEGMENTS_REPAIR: { - final IngraphQuery<IngraphConnectedSegmentsMatch> query = new IngraphQuery<>(driver, RailwayQuery.CONNECTEDSEGMENTS, transactionFactory); - final IngraphTransformation<IngraphConnectedSegmentsMatch> transformation = new IngraphTransformationRepairConnectedSegments(driver); - final ModelOperation<IngraphConnectedSegmentsMatch, IngraphDriver> operation = ModelOperation.of(query, transformation); - return operation; - } - - // PosLength - case POSLENGTH: { - final IngraphQuery<IngraphPosLengthMatch> query = new IngraphQuery<>(driver, RailwayQuery.POSLENGTH, transactionFactory); - final ModelOperation<IngraphPosLengthMatch, IngraphDriver> operation = ModelOperation.of(query); - return operation; - } - case POSLENGTH_INJECT: { - final IngraphQuery<IngraphPosLengthInjectMatch> query = new IngraphQuery<>(driver, RailwayQuery.POSLENGTH_INJECT, transactionFactory); - final IngraphTransformation<IngraphPosLengthInjectMatch> transformation = new IngraphTransformationInjectPosLength(driver); - final ModelOperation<IngraphPosLengthInjectMatch, IngraphDriver> operation = ModelOperation.of(query, transformation); - return operation; - } - case POSLENGTH_REPAIR: { - final IngraphQuery<IngraphPosLengthMatch> query = new IngraphQuery<>(driver, RailwayQuery.POSLENGTH, transactionFactory); - final IngraphTransformation<IngraphPosLengthMatch> transformation = new IngraphTransformationRepairPosLength(driver); - final ModelOperation<IngraphPosLengthMatch, IngraphDriver> operation = ModelOperation.of(query, transformation); - return operation; - } - - // RouteSensor - case ROUTESENSOR: { - final IngraphQuery<IngraphRouteSensorMatch> query = new IngraphQuery<>(driver, RailwayQuery.ROUTESENSOR, transactionFactory); - final ModelOperation<IngraphRouteSensorMatch, IngraphDriver> operation = ModelOperation.of(query); - return operation; - } - case ROUTESENSOR_INJECT: { - final IngraphQuery<IngraphRouteSensorInjectMatch> query = new IngraphQuery<>(driver, RailwayQuery.ROUTESENSOR_INJECT, transactionFactory); - final IngraphTransformation<IngraphRouteSensorInjectMatch> transformation = new IngraphTransformationInjectRouteSensor(driver); - final ModelOperation<IngraphRouteSensorInjectMatch, IngraphDriver> operation = ModelOperation.of(query, transformation); - return operation; - } - case ROUTESENSOR_REPAIR: { - final IngraphQuery<IngraphRouteSensorMatch> query = new IngraphQuery<>(driver, RailwayQuery.ROUTESENSOR, transactionFactory); - final IngraphTransformation<IngraphRouteSensorMatch> transformation = new IngraphTransformationRepairRouteSensor(driver); - final ModelOperation<IngraphRouteSensorMatch, IngraphDriver> operation = ModelOperation.of(query, transformation); - return operation; - } - - // SemaphoreNeighbor - case SEMAPHORENEIGHBOR: { - final IngraphQuery<IngraphSemaphoreNeighborMatch> query = new IngraphQuery<>(driver, RailwayQuery.SEMAPHORENEIGHBOR, transactionFactory); - final ModelOperation<IngraphSemaphoreNeighborMatch, IngraphDriver> operation = ModelOperation.of(query); - return operation; - } - case SEMAPHORENEIGHBOR_INJECT: { - final IngraphQuery<IngraphSemaphoreNeighborInjectMatch> query = new IngraphQuery<>(driver, RailwayQuery.SEMAPHORENEIGHBOR_INJECT, transactionFactory); - final IngraphTransformation<IngraphSemaphoreNeighborInjectMatch> transformation = new IngraphTransformationInjectSemaphoreNeighbor(driver); - final ModelOperation<IngraphSemaphoreNeighborInjectMatch, IngraphDriver> operation = ModelOperation.of(query, transformation); - return operation; - } - case SEMAPHORENEIGHBOR_REPAIR: { - final IngraphQuery<IngraphSemaphoreNeighborMatch> query = new IngraphQuery<>(driver, RailwayQuery.SEMAPHORENEIGHBOR, transactionFactory); - final IngraphTransformation<IngraphSemaphoreNeighborMatch> transformation = new IngraphTransformationRepairSemaphoreNeighbor(driver); - final ModelOperation<IngraphSemaphoreNeighborMatch, IngraphDriver> operation = ModelOperation.of(query, transformation); - return operation; - } - - // SwitchMonitored - case SWITCHMONITORED: { - final IngraphQuery<IngraphSwitchMonitoredMatch> query = new IngraphQuery<>(driver, RailwayQuery.SWITCHMONITORED, transactionFactory); - final ModelOperation<IngraphSwitchMonitoredMatch, IngraphDriver> operation = ModelOperation.of(query); - return operation; - } - case SWITCHMONITORED_INJECT: { - final IngraphQuery<IngraphSwitchMonitoredInjectMatch> query = new IngraphQuery<>(driver, RailwayQuery.SWITCHMONITORED_INJECT, transactionFactory); - final IngraphTransformation<IngraphSwitchMonitoredInjectMatch> transformation = new IngraphTransformationInjectSwitchMonitored(driver); - final ModelOperation<IngraphSwitchMonitoredInjectMatch, IngraphDriver> operation = ModelOperation.of(query, transformation); - return operation; - } - case SWITCHMONITORED_REPAIR: { - final IngraphQuery<IngraphSwitchMonitoredMatch> query = new IngraphQuery<>(driver, RailwayQuery.SWITCHMONITORED, transactionFactory); - final IngraphTransformation<IngraphSwitchMonitoredMatch> transformation = new IngraphTransformationRepairSwitchMonitored(driver); - final ModelOperation<IngraphSwitchMonitoredMatch, IngraphDriver> operation = ModelOperation.of(query, transformation); - return operation; - } - - // SwitchSet - case SWITCHSET: { - final IngraphQuery<IngraphSwitchSetMatch> query = new IngraphQuery<>(driver, RailwayQuery.SWITCHSET, transactionFactory); - final ModelOperation<IngraphSwitchSetMatch, IngraphDriver> operation = ModelOperation.of(query); - return operation; - } - case SWITCHSET_INJECT: { - final IngraphQuery<IngraphSwitchSetInjectMatch> query = new IngraphQuery<>(driver, RailwayQuery.SWITCHSET_INJECT, transactionFactory); - final IngraphTransformation<IngraphSwitchSetInjectMatch> transformation = new IngraphTransformationInjectSwitchSet(driver); - final ModelOperation<IngraphSwitchSetInjectMatch, IngraphDriver> operation = ModelOperation.of(query, transformation); - return operation; - } - case SWITCHSET_REPAIR: { - final IngraphQuery<IngraphSwitchSetMatch> query = new IngraphQuery<>(driver, RailwayQuery.SWITCHSET, transactionFactory); - final IngraphTransformation<IngraphSwitchSetMatch> transformation = new IngraphTransformationRepairSwitchSet(driver); - final ModelOperation<IngraphSwitchSetMatch, IngraphDriver> operation = ModelOperation.of(query, transformation); - return operation; - } - - default: - throw new UnsupportedOperationException("Operation " + operationEnum + " not supported."); - } - } -} diff --git a/trainbenchmark-tool-ingraph/src/main/java/hu/bme/mit/trainbenchmark/benchmark/ingraph/queries/IngraphChangeListener.java b/trainbenchmark-tool-ingraph/src/main/java/hu/bme/mit/trainbenchmark/benchmark/ingraph/queries/IngraphChangeListener.java deleted file mode 100644 index 95fd30aab..000000000 --- a/trainbenchmark-tool-ingraph/src/main/java/hu/bme/mit/trainbenchmark/benchmark/ingraph/queries/IngraphChangeListener.java +++ /dev/null @@ -1,39 +0,0 @@ -package hu.bme.mit.trainbenchmark.benchmark.ingraph.queries; - -import hu.bme.mit.ire.ChangeListener; -import hu.bme.mit.trainbenchmark.benchmark.ingraph.match.IngraphMatch; -import hu.bme.mit.trainbenchmark.constants.RailwayQuery; -import scala.collection.Iterator; -import scala.collection.immutable.List; -import scala.collection.immutable.Map; - -import java.util.HashSet; - -/** - * Created by wafle on 11/20/2016. - */ -public class IngraphChangeListener extends ChangeListener{ - HashSet<IngraphMatch> results = new HashSet<>(); - private RailwayQuery query; - - IngraphChangeListener(final RailwayQuery query) { - this.query = query; - } - - @Override - public void listener(List<Map<Object, Object>> positive, List<Map<Object, Object>> negative) { - Iterator<Map<Object, Object>> positiveIterator = positive.iterator(); - while (positiveIterator.hasNext()) { - final Map<Object, Object> qs = positiveIterator.next(); - final IngraphMatch match = IngraphMatch.createMatch(query, qs); - results.add(match); - } - - Iterator<Map<Object, Object>> negativeIterator = negative.iterator(); - while (negativeIterator.hasNext()) { - final Map<Object, Object> qs = negativeIterator.next(); - final IngraphMatch match = IngraphMatch.createMatch(query, qs); - results.remove(match); - } - } -} diff --git a/trainbenchmark-tool-ingraph/src/main/java/hu/bme/mit/trainbenchmark/benchmark/ingraph/queries/IngraphQuery.java b/trainbenchmark-tool-ingraph/src/main/java/hu/bme/mit/trainbenchmark/benchmark/ingraph/queries/IngraphQuery.java deleted file mode 100644 index 63915a3a2..000000000 --- a/trainbenchmark-tool-ingraph/src/main/java/hu/bme/mit/trainbenchmark/benchmark/ingraph/queries/IngraphQuery.java +++ /dev/null @@ -1,48 +0,0 @@ -/******************************************************************************* -* Copyright (c) 2010-2015, Benedek Izso, Gabor Szarnyas, Istvan Rath and Daniel Varro -* All rights reserved. This program and the accompanying materials -* are made available under the terms of the Eclipse Public License v1.0 -* which accompanies this distribution, and is available at -* http://www.eclipse.org/legal/epl-v10.html -* -* Contributors: -* Benedek Izso - initial API and implementation -* Gabor Szarnyas - initial API and implementation -*******************************************************************************/ -package hu.bme.mit.trainbenchmark.benchmark.ingraph.queries; - -import java.util.Collection; - -import hu.bme.mit.ire.TransactionFactory; -import hu.bme.mit.ire.trainbenchmark.TrainbenchmarkQuery; -import hu.bme.mit.trainbenchmark.benchmark.ingraph.IngraphUtils; -import hu.bme.mit.trainbenchmark.benchmark.ingraph.driver.IngraphDriver; -import hu.bme.mit.trainbenchmark.benchmark.ingraph.match.IngraphMatch; -import hu.bme.mit.trainbenchmark.benchmark.operations.ModelQuery; -import hu.bme.mit.trainbenchmark.constants.RailwayQuery; -import ingraph.ire.IngraphAdapter; -import relalg.RelalgContainer; - -public class IngraphQuery<TPatternMatch extends IngraphMatch> extends ModelQuery<TPatternMatch, IngraphDriver> { - - private TrainbenchmarkQuery queryEngine; - private IngraphChangeListener listener; - - public IngraphQuery(final IngraphDriver driver, final RailwayQuery query, final TransactionFactory input) throws Exception { - super(query, driver); - final RelalgContainer plan = IngraphUtils.getQueryPlan(query.toString(), driver.getQueryVariant()); - final IngraphAdapter adapter = new IngraphAdapter(plan); - queryEngine = adapter.engine(); - listener = new IngraphChangeListener(query); - queryEngine.addListener(listener); - input.subscribe(queryEngine.inputLookup()); - driver.setAdapter(adapter); - } - - @SuppressWarnings("unchecked") - @Override - public Collection<TPatternMatch> evaluate() { - return (Collection<TPatternMatch>) listener.results; - } - -} diff --git a/trainbenchmark-tool-ingraph/src/main/java/hu/bme/mit/trainbenchmark/benchmark/ingraph/transformations/IngraphTransformation.java b/trainbenchmark-tool-ingraph/src/main/java/hu/bme/mit/trainbenchmark/benchmark/ingraph/transformations/IngraphTransformation.java deleted file mode 100644 index b89d27eb5..000000000 --- a/trainbenchmark-tool-ingraph/src/main/java/hu/bme/mit/trainbenchmark/benchmark/ingraph/transformations/IngraphTransformation.java +++ /dev/null @@ -1,25 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2010-2015, Benedek Izso, Gabor Szarnyas, Istvan Rath and Daniel Varro - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Benedek Izso - initial API and implementation - * Gabor Szarnyas - initial API and implementation - *******************************************************************************/ -package hu.bme.mit.trainbenchmark.benchmark.ingraph.transformations; - -import hu.bme.mit.trainbenchmark.benchmark.ingraph.driver.IngraphDriver; -import hu.bme.mit.trainbenchmark.benchmark.ingraph.match.IngraphMatch; -import hu.bme.mit.trainbenchmark.benchmark.operations.ModelTransformation; - -public abstract class IngraphTransformation<TMatch extends IngraphMatch> extends ModelTransformation<TMatch, IngraphDriver> { - - protected IngraphTransformation(final IngraphDriver driver) { - super(driver); - this.driver = driver; - } - -} diff --git a/trainbenchmark-tool-ingraph/src/main/java/hu/bme/mit/trainbenchmark/benchmark/ingraph/transformations/inject/IngraphTransformationInjectConnectedSegments.java b/trainbenchmark-tool-ingraph/src/main/java/hu/bme/mit/trainbenchmark/benchmark/ingraph/transformations/inject/IngraphTransformationInjectConnectedSegments.java deleted file mode 100644 index cf551fb11..000000000 --- a/trainbenchmark-tool-ingraph/src/main/java/hu/bme/mit/trainbenchmark/benchmark/ingraph/transformations/inject/IngraphTransformationInjectConnectedSegments.java +++ /dev/null @@ -1,35 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2010-2015, Benedek Izso, Gabor Szarnyas, Istvan Rath and Daniel Varro - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Benedek Izso - initial API and implementation - * Gabor Szarnyas - initial API and implementation - *******************************************************************************/ -package hu.bme.mit.trainbenchmark.benchmark.ingraph.transformations.inject; - -import java.io.IOException; -import java.util.Collection; - -import hu.bme.mit.ire.Transaction; -import hu.bme.mit.trainbenchmark.benchmark.ingraph.driver.IngraphDriver; -import hu.bme.mit.trainbenchmark.benchmark.ingraph.match.IngraphConnectedSegmentsInjectMatch; -import hu.bme.mit.trainbenchmark.benchmark.ingraph.transformations.IngraphTransformation; - -public class IngraphTransformationInjectConnectedSegments extends IngraphTransformation<IngraphConnectedSegmentsInjectMatch> { - - public IngraphTransformationInjectConnectedSegments(final IngraphDriver driver) { - super(driver); - } - - @Override - public void activate(final Collection<IngraphConnectedSegmentsInjectMatch> matches) throws IOException { - final Transaction transaction = driver.newTransaction(); - for (final IngraphConnectedSegmentsInjectMatch match : matches) { - // TODO - } - } -} diff --git a/trainbenchmark-tool-ingraph/src/main/java/hu/bme/mit/trainbenchmark/benchmark/ingraph/transformations/inject/IngraphTransformationInjectPosLength.java b/trainbenchmark-tool-ingraph/src/main/java/hu/bme/mit/trainbenchmark/benchmark/ingraph/transformations/inject/IngraphTransformationInjectPosLength.java deleted file mode 100644 index 00d7b128a..000000000 --- a/trainbenchmark-tool-ingraph/src/main/java/hu/bme/mit/trainbenchmark/benchmark/ingraph/transformations/inject/IngraphTransformationInjectPosLength.java +++ /dev/null @@ -1,39 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2010-2015, Benedek Izso, Gabor Szarnyas, Istvan Rath and Daniel Varro - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Benedek Izso - initial API and implementation - * Gabor Szarnyas - initial API and implementation - *******************************************************************************/ -package hu.bme.mit.trainbenchmark.benchmark.ingraph.transformations.inject; - -import java.io.IOException; -import java.util.Collection; - -import hu.bme.mit.ire.Transaction; -import hu.bme.mit.trainbenchmark.benchmark.ingraph.driver.IngraphDriver; -import hu.bme.mit.trainbenchmark.benchmark.ingraph.match.IngraphPosLengthInjectMatch; -import hu.bme.mit.trainbenchmark.benchmark.ingraph.transformations.IngraphTransformation; - -public class IngraphTransformationInjectPosLength extends IngraphTransformation<IngraphPosLengthInjectMatch> { - - public IngraphTransformationInjectPosLength(final IngraphDriver driver) { - super(driver); - } - - @Override - public void activate(final Collection<IngraphPosLengthInjectMatch> matches) throws IOException { - final Transaction transaction = driver.newTransaction(); - for (final IngraphPosLengthInjectMatch match : matches) { - final Long segment = match.getSegment(); - final Integer length = match.getLength(); -// transaction.remove(segment, LENGTH, length); -// transaction.add(segment, LENGTH, 0); - } - } - -} diff --git a/trainbenchmark-tool-ingraph/src/main/java/hu/bme/mit/trainbenchmark/benchmark/ingraph/transformations/inject/IngraphTransformationInjectRouteSensor.java b/trainbenchmark-tool-ingraph/src/main/java/hu/bme/mit/trainbenchmark/benchmark/ingraph/transformations/inject/IngraphTransformationInjectRouteSensor.java deleted file mode 100644 index b1b94386e..000000000 --- a/trainbenchmark-tool-ingraph/src/main/java/hu/bme/mit/trainbenchmark/benchmark/ingraph/transformations/inject/IngraphTransformationInjectRouteSensor.java +++ /dev/null @@ -1,38 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2010-2015, Benedek Izso, Gabor Szarnyas, Istvan Rath and Daniel Varro - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Benedek Izso - initial API and implementation - * Gabor Szarnyas - initial API and implementation - *******************************************************************************/ -package hu.bme.mit.trainbenchmark.benchmark.ingraph.transformations.inject; - -import java.io.IOException; -import java.util.Collection; - -import hu.bme.mit.ire.Transaction; -import hu.bme.mit.trainbenchmark.benchmark.ingraph.driver.IngraphDriver; -import hu.bme.mit.trainbenchmark.benchmark.ingraph.match.IngraphRouteSensorInjectMatch; -import hu.bme.mit.trainbenchmark.benchmark.ingraph.transformations.IngraphTransformation; - -public class IngraphTransformationInjectRouteSensor extends IngraphTransformation<IngraphRouteSensorInjectMatch> { - - public IngraphTransformationInjectRouteSensor(final IngraphDriver driver) { - super(driver); - } - - @Override - public void activate(final Collection<IngraphRouteSensorInjectMatch> matches) throws IOException { - final Transaction transaction = driver.newTransaction(); - for (final IngraphRouteSensorInjectMatch match : matches) { - final Long route = match.getRoute(); - final Long sensor = match.getSensor(); -// transaction.remove(route, REQUIRES, sensor); - } - } - -} diff --git a/trainbenchmark-tool-ingraph/src/main/java/hu/bme/mit/trainbenchmark/benchmark/ingraph/transformations/inject/IngraphTransformationInjectSemaphoreNeighbor.java b/trainbenchmark-tool-ingraph/src/main/java/hu/bme/mit/trainbenchmark/benchmark/ingraph/transformations/inject/IngraphTransformationInjectSemaphoreNeighbor.java deleted file mode 100644 index 446382d9a..000000000 --- a/trainbenchmark-tool-ingraph/src/main/java/hu/bme/mit/trainbenchmark/benchmark/ingraph/transformations/inject/IngraphTransformationInjectSemaphoreNeighbor.java +++ /dev/null @@ -1,38 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2010-2015, Benedek Izso, Gabor Szarnyas, Istvan Rath and Daniel Varro - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Benedek Izso - initial API and implementation - * Gabor Szarnyas - initial API and implementation - *******************************************************************************/ -package hu.bme.mit.trainbenchmark.benchmark.ingraph.transformations.inject; - -import java.io.IOException; -import java.util.Collection; - -import hu.bme.mit.ire.Transaction; -import hu.bme.mit.trainbenchmark.benchmark.ingraph.driver.IngraphDriver; -import hu.bme.mit.trainbenchmark.benchmark.ingraph.match.IngraphSemaphoreNeighborInjectMatch; -import hu.bme.mit.trainbenchmark.benchmark.ingraph.transformations.IngraphTransformation; - -public class IngraphTransformationInjectSemaphoreNeighbor extends IngraphTransformation<IngraphSemaphoreNeighborInjectMatch> { - - public IngraphTransformationInjectSemaphoreNeighbor(final IngraphDriver driver) { - super(driver); - } - - @Override - public void activate(final Collection<IngraphSemaphoreNeighborInjectMatch> matches) throws IOException { - final Transaction transaction = driver.newTransaction(); - for (final IngraphSemaphoreNeighborInjectMatch match : matches) { - final Long route = match.getRoute(); - // TODO remove all outgoing entry edges of the route - //transaction.remove(route, ENTRY, semaphore); - } - } - -} diff --git a/trainbenchmark-tool-ingraph/src/main/java/hu/bme/mit/trainbenchmark/benchmark/ingraph/transformations/inject/IngraphTransformationInjectSwitchMonitored.java b/trainbenchmark-tool-ingraph/src/main/java/hu/bme/mit/trainbenchmark/benchmark/ingraph/transformations/inject/IngraphTransformationInjectSwitchMonitored.java deleted file mode 100644 index 398c97230..000000000 --- a/trainbenchmark-tool-ingraph/src/main/java/hu/bme/mit/trainbenchmark/benchmark/ingraph/transformations/inject/IngraphTransformationInjectSwitchMonitored.java +++ /dev/null @@ -1,35 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2010-2015, Benedek Izso, Gabor Szarnyas, Istvan Rath and Daniel Varro - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Benedek Izso - initial API and implementation - * Gabor Szarnyas - initial API and implementation - *******************************************************************************/ -package hu.bme.mit.trainbenchmark.benchmark.ingraph.transformations.inject; - -import java.util.Collection; - -import hu.bme.mit.ire.Transaction; -import hu.bme.mit.trainbenchmark.benchmark.ingraph.driver.IngraphDriver; -import hu.bme.mit.trainbenchmark.benchmark.ingraph.match.IngraphSwitchMonitoredInjectMatch; -import hu.bme.mit.trainbenchmark.benchmark.ingraph.transformations.IngraphTransformation; - -public class IngraphTransformationInjectSwitchMonitored extends IngraphTransformation<IngraphSwitchMonitoredInjectMatch> { - - public IngraphTransformationInjectSwitchMonitored(final IngraphDriver driver) { - super(driver); - } - - @Override - public void activate(final Collection<IngraphSwitchMonitoredInjectMatch> matches) throws Exception { - final Transaction transaction = driver.newTransaction(); - for (final IngraphSwitchMonitoredInjectMatch match : matches) { - final Long sw = match.getSw(); - // TODO remove all outgoing MonitoredBy edges of the switch - } - } -} diff --git a/trainbenchmark-tool-ingraph/src/main/java/hu/bme/mit/trainbenchmark/benchmark/ingraph/transformations/inject/IngraphTransformationInjectSwitchSet.java b/trainbenchmark-tool-ingraph/src/main/java/hu/bme/mit/trainbenchmark/benchmark/ingraph/transformations/inject/IngraphTransformationInjectSwitchSet.java deleted file mode 100644 index 535af6e8a..000000000 --- a/trainbenchmark-tool-ingraph/src/main/java/hu/bme/mit/trainbenchmark/benchmark/ingraph/transformations/inject/IngraphTransformationInjectSwitchSet.java +++ /dev/null @@ -1,37 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2010-2015, Benedek Izso, Gabor Szarnyas, Istvan Rath and Daniel Varro - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Benedek Izso - initial API and implementation - * Gabor Szarnyas - initial API and implementation - *******************************************************************************/ -package hu.bme.mit.trainbenchmark.benchmark.ingraph.transformations.inject; - -import java.io.IOException; -import java.util.Collection; - -import hu.bme.mit.ire.Transaction; -import hu.bme.mit.trainbenchmark.benchmark.ingraph.driver.IngraphDriver; -import hu.bme.mit.trainbenchmark.benchmark.ingraph.match.IngraphSwitchSetInjectMatch; -import hu.bme.mit.trainbenchmark.benchmark.ingraph.transformations.IngraphTransformation; - -public class IngraphTransformationInjectSwitchSet extends IngraphTransformation<IngraphSwitchSetInjectMatch> { - - public IngraphTransformationInjectSwitchSet(final IngraphDriver driver) { - super(driver); - } - - @Override - public void activate(final Collection<IngraphSwitchSetInjectMatch> matches) throws IOException { - final Transaction transaction = driver.newTransaction(); - for (final IngraphSwitchSetInjectMatch match : matches) { - final Long sw = match.getSw(); - // TODO set the position of the switch to the next enum value - } - } - -} diff --git a/trainbenchmark-tool-ingraph/src/main/java/hu/bme/mit/trainbenchmark/benchmark/ingraph/transformations/repair/IngraphTransformationRepairConnectedSegments.java b/trainbenchmark-tool-ingraph/src/main/java/hu/bme/mit/trainbenchmark/benchmark/ingraph/transformations/repair/IngraphTransformationRepairConnectedSegments.java deleted file mode 100644 index b0e5075a7..000000000 --- a/trainbenchmark-tool-ingraph/src/main/java/hu/bme/mit/trainbenchmark/benchmark/ingraph/transformations/repair/IngraphTransformationRepairConnectedSegments.java +++ /dev/null @@ -1,39 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2010-2015, Benedek Izso, Gabor Szarnyas, Istvan Rath and Daniel Varro - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Benedek Izso - initial API and implementation - * Gabor Szarnyas - initial API and implementation - *******************************************************************************/ -package hu.bme.mit.trainbenchmark.benchmark.ingraph.transformations.repair; - -import java.io.IOException; -import java.util.Collection; - -import hu.bme.mit.ire.Transaction; -import hu.bme.mit.trainbenchmark.benchmark.ingraph.driver.IngraphDriver; -import hu.bme.mit.trainbenchmark.benchmark.ingraph.match.IngraphConnectedSegmentsMatch; -import hu.bme.mit.trainbenchmark.benchmark.ingraph.transformations.IngraphTransformation; - -public class IngraphTransformationRepairConnectedSegments extends IngraphTransformation<IngraphConnectedSegmentsMatch> { - - public IngraphTransformationRepairConnectedSegments(final IngraphDriver driver) { - super(driver); - } - - @Override - public void activate(final Collection<IngraphConnectedSegmentsMatch> matches) throws IOException { - final Transaction transaction = driver.newTransaction(); - for (final IngraphConnectedSegmentsMatch match : matches) { -// transaction.remove(match.getSegment1(), CONNECTS_TO, match.getSegment2()); -// transaction.remove(match.getSegment2(), CONNECTS_TO, match.getSegment3()); -// transaction.add(match.getSegment1(), CONNECTS_TO, match.getSegment3()); -// -// transaction.remove(match.getSegment2(), "sensor", match.getSensor()); - } - } -} diff --git a/trainbenchmark-tool-ingraph/src/main/java/hu/bme/mit/trainbenchmark/benchmark/ingraph/transformations/repair/IngraphTransformationRepairPosLength.java b/trainbenchmark-tool-ingraph/src/main/java/hu/bme/mit/trainbenchmark/benchmark/ingraph/transformations/repair/IngraphTransformationRepairPosLength.java deleted file mode 100644 index 0f044d0fe..000000000 --- a/trainbenchmark-tool-ingraph/src/main/java/hu/bme/mit/trainbenchmark/benchmark/ingraph/transformations/repair/IngraphTransformationRepairPosLength.java +++ /dev/null @@ -1,40 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2010-2015, Benedek Izso, Gabor Szarnyas, Istvan Rath and Daniel Varro - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Benedek Izso - initial API and implementation - * Gabor Szarnyas - initial API and implementation - *******************************************************************************/ -package hu.bme.mit.trainbenchmark.benchmark.ingraph.transformations.repair; - -import java.io.IOException; -import java.util.Collection; - -import hu.bme.mit.ire.Transaction; -import hu.bme.mit.trainbenchmark.benchmark.ingraph.driver.IngraphDriver; -import hu.bme.mit.trainbenchmark.benchmark.ingraph.match.IngraphPosLengthMatch; -import hu.bme.mit.trainbenchmark.benchmark.ingraph.transformations.IngraphTransformation; - -public class IngraphTransformationRepairPosLength extends IngraphTransformation<IngraphPosLengthMatch> { - - public IngraphTransformationRepairPosLength(final IngraphDriver driver) { - super(driver); - } - - @Override - public void activate(final Collection<IngraphPosLengthMatch> matches) throws IOException { - final Transaction transaction = driver.newTransaction(); - for (final IngraphPosLengthMatch match : matches) { - final Long segment = match.getSegment(); - final Integer length = match.getLength(); - final Integer newLength = -length + 1; -// transaction.remove(segment, LENGTH, length); -// transaction.add(segment, LENGTH, newLength); - } - } - -} diff --git a/trainbenchmark-tool-ingraph/src/main/java/hu/bme/mit/trainbenchmark/benchmark/ingraph/transformations/repair/IngraphTransformationRepairRouteSensor.java b/trainbenchmark-tool-ingraph/src/main/java/hu/bme/mit/trainbenchmark/benchmark/ingraph/transformations/repair/IngraphTransformationRepairRouteSensor.java deleted file mode 100644 index b689cef15..000000000 --- a/trainbenchmark-tool-ingraph/src/main/java/hu/bme/mit/trainbenchmark/benchmark/ingraph/transformations/repair/IngraphTransformationRepairRouteSensor.java +++ /dev/null @@ -1,40 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2010-2015, Benedek Izso, Gabor Szarnyas, Istvan Rath and Daniel Varro - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Benedek Izso - initial API and implementation - * Gabor Szarnyas - initial API and implementation - *******************************************************************************/ -package hu.bme.mit.trainbenchmark.benchmark.ingraph.transformations.repair; - -import java.io.IOException; -import java.util.Collection; - -import hu.bme.mit.ire.Transaction; -import hu.bme.mit.trainbenchmark.benchmark.ingraph.driver.IngraphDriver; -import hu.bme.mit.trainbenchmark.benchmark.ingraph.match.IngraphRouteSensorMatch; -import hu.bme.mit.trainbenchmark.benchmark.ingraph.transformations.IngraphTransformation; -import scala.collection.immutable.Map; - -public class IngraphTransformationRepairRouteSensor extends IngraphTransformation<IngraphRouteSensorMatch> { - - public IngraphTransformationRepairRouteSensor(final IngraphDriver driver) { - super(driver); - } - - @Override - public void activate(final Collection<IngraphRouteSensorMatch> matches) throws IOException { - final Transaction transaction = driver.newTransaction(); - for (final IngraphRouteSensorMatch match : matches) { - final Long route = match.getRoute(); - final Long sensor = match.getSensor(); - - transaction.add("_e4", new Map.Map2("route", route, "sensor", sensor)); - } - } - -} diff --git a/trainbenchmark-tool-ingraph/src/main/java/hu/bme/mit/trainbenchmark/benchmark/ingraph/transformations/repair/IngraphTransformationRepairSemaphoreNeighbor.java b/trainbenchmark-tool-ingraph/src/main/java/hu/bme/mit/trainbenchmark/benchmark/ingraph/transformations/repair/IngraphTransformationRepairSemaphoreNeighbor.java deleted file mode 100644 index 2facbd361..000000000 --- a/trainbenchmark-tool-ingraph/src/main/java/hu/bme/mit/trainbenchmark/benchmark/ingraph/transformations/repair/IngraphTransformationRepairSemaphoreNeighbor.java +++ /dev/null @@ -1,41 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2010-2015, Benedek Izso, Gabor Szarnyas, Istvan Rath and Daniel Varro - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Benedek Izso - initial API and implementation - * Gabor Szarnyas - initial API and implementation - *******************************************************************************/ -package hu.bme.mit.trainbenchmark.benchmark.ingraph.transformations.repair; - -import static hu.bme.mit.trainbenchmark.constants.ModelConstants.ENTRY; - -import java.io.IOException; -import java.util.Collection; - -import hu.bme.mit.ire.Transaction; -import hu.bme.mit.trainbenchmark.benchmark.ingraph.driver.IngraphDriver; -import hu.bme.mit.trainbenchmark.benchmark.ingraph.match.IngraphSemaphoreNeighborMatch; -import hu.bme.mit.trainbenchmark.benchmark.ingraph.transformations.IngraphTransformation; -import scala.collection.immutable.Map; - -public class IngraphTransformationRepairSemaphoreNeighbor extends IngraphTransformation<IngraphSemaphoreNeighborMatch> { - - public IngraphTransformationRepairSemaphoreNeighbor(final IngraphDriver driver) { - super(driver); - } - - @Override - public void activate(final Collection<IngraphSemaphoreNeighborMatch> matches) throws IOException { - final Transaction transaction = driver.newTransaction(); - for (final IngraphSemaphoreNeighborMatch match : matches) { - final Long route2 = match.getRoute2(); - final Long semaphore = match.getSemaphore(); - transaction.add(ENTRY, new Map.Map2<>("route2", route2, "semaphore", semaphore)); - } - } - -} diff --git a/trainbenchmark-tool-ingraph/src/main/java/hu/bme/mit/trainbenchmark/benchmark/ingraph/transformations/repair/IngraphTransformationRepairSwitchMonitored.java b/trainbenchmark-tool-ingraph/src/main/java/hu/bme/mit/trainbenchmark/benchmark/ingraph/transformations/repair/IngraphTransformationRepairSwitchMonitored.java deleted file mode 100644 index 74d1574c5..000000000 --- a/trainbenchmark-tool-ingraph/src/main/java/hu/bme/mit/trainbenchmark/benchmark/ingraph/transformations/repair/IngraphTransformationRepairSwitchMonitored.java +++ /dev/null @@ -1,37 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2010-2015, Benedek Izso, Gabor Szarnyas, Istvan Rath and Daniel Varro - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Benedek Izso - initial API and implementation - * Gabor Szarnyas - initial API and implementation - *******************************************************************************/ -package hu.bme.mit.trainbenchmark.benchmark.ingraph.transformations.repair; - -import java.util.Collection; - -import hu.bme.mit.ire.Transaction; -import hu.bme.mit.trainbenchmark.benchmark.ingraph.driver.IngraphDriver; -import hu.bme.mit.trainbenchmark.benchmark.ingraph.match.IngraphSwitchMonitoredMatch; -import hu.bme.mit.trainbenchmark.benchmark.ingraph.transformations.IngraphTransformation; - -public class IngraphTransformationRepairSwitchMonitored extends IngraphTransformation<IngraphSwitchMonitoredMatch> { - - public IngraphTransformationRepairSwitchMonitored(final IngraphDriver driver) { - super(driver); - } - - @Override - public void activate(final Collection<IngraphSwitchMonitoredMatch> matches) throws Exception { - final Transaction transaction = driver.newTransaction(); - for (final IngraphSwitchMonitoredMatch match : matches) { - final Long sw = match.getSw(); - final Long sensorID = driver.newKey(); -// transaction.add(sensorID, "type", SENSOR); -// transaction.add(sw, MONITORED_BY, sensorID); - } - } -} diff --git a/trainbenchmark-tool-ingraph/src/main/java/hu/bme/mit/trainbenchmark/benchmark/ingraph/transformations/repair/IngraphTransformationRepairSwitchSet.java b/trainbenchmark-tool-ingraph/src/main/java/hu/bme/mit/trainbenchmark/benchmark/ingraph/transformations/repair/IngraphTransformationRepairSwitchSet.java deleted file mode 100644 index 708a066e2..000000000 --- a/trainbenchmark-tool-ingraph/src/main/java/hu/bme/mit/trainbenchmark/benchmark/ingraph/transformations/repair/IngraphTransformationRepairSwitchSet.java +++ /dev/null @@ -1,39 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2010-2015, Benedek Izso, Gabor Szarnyas, Istvan Rath and Daniel Varro - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Benedek Izso - initial API and implementation - * Gabor Szarnyas - initial API and implementation - *******************************************************************************/ -package hu.bme.mit.trainbenchmark.benchmark.ingraph.transformations.repair; - -import java.io.IOException; -import java.util.Collection; - -import hu.bme.mit.ire.Transaction; -import hu.bme.mit.trainbenchmark.benchmark.ingraph.driver.IngraphDriver; -import hu.bme.mit.trainbenchmark.benchmark.ingraph.match.IngraphSwitchSetMatch; -import hu.bme.mit.trainbenchmark.benchmark.ingraph.transformations.IngraphTransformation; - -public class IngraphTransformationRepairSwitchSet extends IngraphTransformation<IngraphSwitchSetMatch> { - - public IngraphTransformationRepairSwitchSet(final IngraphDriver driver) { - super(driver); - } - - @Override - public void activate(final Collection<IngraphSwitchSetMatch> matches) throws IOException { - final Transaction transaction = driver.newTransaction(); - for (final IngraphSwitchSetMatch match : matches) { - final Long sw = match.getSw(); - -// transaction.remove(sw, CURRENTPOSITION, match.getCurrentPosition()); -// transaction.add(sw, CURRENTPOSITION, match.getPosition()); - } - } - -} diff --git a/trainbenchmark-tool-ingraph/src/main/resources/log4j.properties b/trainbenchmark-tool-ingraph/src/main/resources/log4j.properties deleted file mode 100644 index 8520d48c3..000000000 --- a/trainbenchmark-tool-ingraph/src/main/resources/log4j.properties +++ /dev/null @@ -1 +0,0 @@ -log4j.rootLogger=OFF diff --git a/trainbenchmark-tool-ingraph/src/test/java/hu/bme/mit/trainbenchmark/benchmark/ingraph/test/IngraphTest.java b/trainbenchmark-tool-ingraph/src/test/java/hu/bme/mit/trainbenchmark/benchmark/ingraph/test/IngraphTest.java deleted file mode 100644 index e3dae7e66..000000000 --- a/trainbenchmark-tool-ingraph/src/test/java/hu/bme/mit/trainbenchmark/benchmark/ingraph/test/IngraphTest.java +++ /dev/null @@ -1,37 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2010-2015, Benedek Izso, Gabor Szarnyas, Istvan Rath and Daniel Varro - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Benedek Izso - initial API and implementation - * Gabor Szarnyas - initial API and implementation - *******************************************************************************/ - -package hu.bme.mit.trainbenchmark.benchmark.ingraph.test; - -import org.junit.Ignore; - -import hu.bme.mit.trainbenchmark.benchmark.config.BenchmarkConfigBase; -import hu.bme.mit.trainbenchmark.benchmark.ingraph.IngraphBenchmarkScenario; -import hu.bme.mit.trainbenchmark.benchmark.ingraph.config.IngraphBenchmarkConfig; -import hu.bme.mit.trainbenchmark.benchmark.ingraph.config.IngraphBenchmarkConfigBuilder; -import hu.bme.mit.trainbenchmark.benchmark.runcomponents.BenchmarkResult; -import hu.bme.mit.trainbenchmark.benchmark.test.TrainBenchmarkTest; - -@Ignore -public class IngraphTest extends TrainBenchmarkTest { - - @Override - protected BenchmarkResult runTest(final BenchmarkConfigBase bcb) throws Exception { - final int messageSize = 16; - final IngraphBenchmarkConfig bc = new IngraphBenchmarkConfigBuilder().setConfigBase(bcb) - .setMessageSize(messageSize).createConfig(); - final IngraphBenchmarkScenario scenario = IngraphBenchmarkScenario.create(bc); - final BenchmarkResult result = scenario.performBenchmark(); - return result; - } - -} diff --git a/trainbenchmark-tool-ingraph/src/test/java/hu/bme/mit/trainbenchmark/benchmark/ingraph/test/queryspecific/IngraphRouteSensorTest.java b/trainbenchmark-tool-ingraph/src/test/java/hu/bme/mit/trainbenchmark/benchmark/ingraph/test/queryspecific/IngraphRouteSensorTest.java deleted file mode 100644 index 464570054..000000000 --- a/trainbenchmark-tool-ingraph/src/test/java/hu/bme/mit/trainbenchmark/benchmark/ingraph/test/queryspecific/IngraphRouteSensorTest.java +++ /dev/null @@ -1,50 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2010-2015, Benedek Izso, Gabor Szarnyas, Istvan Rath and Daniel Varro - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Benedek Izso - initial API and implementation - * Gabor Szarnyas - initial API and implementation - *******************************************************************************/ - -package hu.bme.mit.trainbenchmark.benchmark.ingraph.test.queryspecific; - -import java.util.Arrays; - -import org.junit.runner.RunWith; -import org.junit.runners.Parameterized; -import org.junit.runners.Parameterized.Parameter; -import org.junit.runners.Parameterized.Parameters; - -import hu.bme.mit.trainbenchmark.benchmark.config.BenchmarkConfigBase; -import hu.bme.mit.trainbenchmark.benchmark.ingraph.IngraphBenchmarkScenario; -import hu.bme.mit.trainbenchmark.benchmark.ingraph.config.IngraphBenchmarkConfig; -import hu.bme.mit.trainbenchmark.benchmark.ingraph.config.IngraphBenchmarkConfigBuilder; -import hu.bme.mit.trainbenchmark.benchmark.runcomponents.BenchmarkResult; -import hu.bme.mit.trainbenchmark.benchmark.test.queryspecific.RouteSensorTest; - -@RunWith(Parameterized.class) -public class IngraphRouteSensorTest extends RouteSensorTest { - - @Parameters(name = "variant={0}") - public static Iterable<? extends Object> data() { - return Arrays.asList("A", "B", "C"); - } - - @Parameter - public String variant; - - @Override - protected BenchmarkResult runTest(final BenchmarkConfigBase bcb) throws Exception { - final int messageSize = 16; - final IngraphBenchmarkConfig bc = new IngraphBenchmarkConfigBuilder().setConfigBase(bcb) - .setMessageSize(messageSize).setQueryVariant(variant).createConfig(); - final IngraphBenchmarkScenario scenario = IngraphBenchmarkScenario.create(bc); - final BenchmarkResult result = scenario.performBenchmark(); - return result; - } - -} diff --git a/trainbenchmark-tool-ingraph/src/test/java/hu/bme/mit/trainbenchmark/benchmark/ingraph/test/queryspecific/IngraphSemaphoreNeighborTest.java b/trainbenchmark-tool-ingraph/src/test/java/hu/bme/mit/trainbenchmark/benchmark/ingraph/test/queryspecific/IngraphSemaphoreNeighborTest.java deleted file mode 100644 index 3f9ee962e..000000000 --- a/trainbenchmark-tool-ingraph/src/test/java/hu/bme/mit/trainbenchmark/benchmark/ingraph/test/queryspecific/IngraphSemaphoreNeighborTest.java +++ /dev/null @@ -1,50 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2010-2015, Benedek Izso, Gabor Szarnyas, Istvan Rath and Daniel Varro - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Benedek Izso - initial API and implementation - * Gabor Szarnyas - initial API and implementation - *******************************************************************************/ - -package hu.bme.mit.trainbenchmark.benchmark.ingraph.test.queryspecific; - -import java.util.Arrays; - -import org.junit.runner.RunWith; -import org.junit.runners.Parameterized; -import org.junit.runners.Parameterized.Parameter; -import org.junit.runners.Parameterized.Parameters; - -import hu.bme.mit.trainbenchmark.benchmark.config.BenchmarkConfigBase; -import hu.bme.mit.trainbenchmark.benchmark.ingraph.IngraphBenchmarkScenario; -import hu.bme.mit.trainbenchmark.benchmark.ingraph.config.IngraphBenchmarkConfig; -import hu.bme.mit.trainbenchmark.benchmark.ingraph.config.IngraphBenchmarkConfigBuilder; -import hu.bme.mit.trainbenchmark.benchmark.runcomponents.BenchmarkResult; -import hu.bme.mit.trainbenchmark.benchmark.test.queryspecific.SemaphoreNeighborTest; - -@RunWith(Parameterized.class) -public class IngraphSemaphoreNeighborTest extends SemaphoreNeighborTest { - - @Parameters - public static Iterable<? extends Object> data() { - return Arrays.asList("A", "B", "C", "D", "E", "F"); - } - - @Parameter - public String variant; - - @Override - protected BenchmarkResult runTest(final BenchmarkConfigBase bcb) throws Exception { - final int messageSize = 16; - final IngraphBenchmarkConfig bc = new IngraphBenchmarkConfigBuilder().setConfigBase(bcb) - .setMessageSize(messageSize).setQueryVariant(variant).createConfig(); - final IngraphBenchmarkScenario scenario = IngraphBenchmarkScenario.create(bc); - final BenchmarkResult result = scenario.performBenchmark(); - return result; - } - -} diff --git a/trainbenchmark-tool-jena/.gitignore b/trainbenchmark-tool-jena/.gitignore deleted file mode 100644 index 19f2e002c..000000000 --- a/trainbenchmark-tool-jena/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -/target -/target diff --git a/trainbenchmark-tool-jena/build.gradle b/trainbenchmark-tool-jena/build.gradle deleted file mode 100644 index 6e8d55997..000000000 --- a/trainbenchmark-tool-jena/build.gradle +++ /dev/null @@ -1,12 +0,0 @@ -plugins { id "com.github.johnrengelman.shadow" version "1.2.3" } - -shadowJar { - classifier = 'fat' - manifest { attributes 'Main-Class': 'hu.bme.mit.trainbenchmark.benchmark.jena.JenaBenchmarkMain' } -} - -dependencies { - compile project(':trainbenchmark-tool') - compile project(':trainbenchmark-tool-rdf') - compile group: 'org.apache.jena', name: 'jena-querybuilder', version:'3.0.0' -} diff --git a/trainbenchmark-tool-jena/src/main/java/hu/bme/mit/trainbenchmark/benchmark/jena/JenaBenchmarkMain.java b/trainbenchmark-tool-jena/src/main/java/hu/bme/mit/trainbenchmark/benchmark/jena/JenaBenchmarkMain.java deleted file mode 100644 index efb00b960..000000000 --- a/trainbenchmark-tool-jena/src/main/java/hu/bme/mit/trainbenchmark/benchmark/jena/JenaBenchmarkMain.java +++ /dev/null @@ -1,26 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2010-2015, Benedek Izso, Gabor Szarnyas, Istvan Rath and Daniel Varro - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Benedek Izso - initial API and implementation - * Gabor Szarnyas - initial API and implementation - *******************************************************************************/ - -package hu.bme.mit.trainbenchmark.benchmark.jena; - -import hu.bme.mit.trainbenchmark.benchmark.config.BenchmarkConfig; -import hu.bme.mit.trainbenchmark.benchmark.jena.config.JenaBenchmarkConfig; - -public class JenaBenchmarkMain { - - public static void main(final String[] args) throws Exception { - final JenaBenchmarkConfig bc = BenchmarkConfig.fromFile(args[0], JenaBenchmarkConfig.class); - final JenaBenchmarkScenario scenario = new JenaBenchmarkScenario(bc); - scenario.performBenchmark(); - } - -} diff --git a/trainbenchmark-tool-jena/src/main/java/hu/bme/mit/trainbenchmark/benchmark/jena/JenaBenchmarkScenario.java b/trainbenchmark-tool-jena/src/main/java/hu/bme/mit/trainbenchmark/benchmark/jena/JenaBenchmarkScenario.java deleted file mode 100644 index e394c133f..000000000 --- a/trainbenchmark-tool-jena/src/main/java/hu/bme/mit/trainbenchmark/benchmark/jena/JenaBenchmarkScenario.java +++ /dev/null @@ -1,17 +0,0 @@ -package hu.bme.mit.trainbenchmark.benchmark.jena; - -import hu.bme.mit.trainbenchmark.benchmark.jena.comparators.JenaMatchComparator; -import hu.bme.mit.trainbenchmark.benchmark.jena.config.JenaBenchmarkConfig; -import hu.bme.mit.trainbenchmark.benchmark.jena.driver.JenaDriver; -import hu.bme.mit.trainbenchmark.benchmark.jena.driver.JenaDriverFactory; -import hu.bme.mit.trainbenchmark.benchmark.jena.matches.JenaMatch; -import hu.bme.mit.trainbenchmark.benchmark.jena.operations.JenaModelOperationFactory; -import hu.bme.mit.trainbenchmark.benchmark.phases.BenchmarkScenario; - -public class JenaBenchmarkScenario extends BenchmarkScenario<JenaMatch, JenaDriver, JenaBenchmarkConfig> { - - public JenaBenchmarkScenario(final JenaBenchmarkConfig bc) throws Exception { - super(new JenaDriverFactory(bc.isInferencing()), new JenaModelOperationFactory(), new JenaMatchComparator(), bc); - } - -} diff --git a/trainbenchmark-tool-jena/src/main/java/hu/bme/mit/trainbenchmark/benchmark/jena/comparators/JenaMatchComparator.java b/trainbenchmark-tool-jena/src/main/java/hu/bme/mit/trainbenchmark/benchmark/jena/comparators/JenaMatchComparator.java deleted file mode 100644 index 814608827..000000000 --- a/trainbenchmark-tool-jena/src/main/java/hu/bme/mit/trainbenchmark/benchmark/jena/comparators/JenaMatchComparator.java +++ /dev/null @@ -1,25 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2010-2015, Benedek Izso, Gabor Szarnyas, Istvan Rath and Daniel Varro - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Benedek Izso - initial API and implementation - * Gabor Szarnyas - initial API and implementation - *******************************************************************************/ -package hu.bme.mit.trainbenchmark.benchmark.jena.comparators; - -import org.apache.jena.rdf.model.Resource; - -import hu.bme.mit.trainbenchmark.benchmark.jena.matches.JenaMatch; -import hu.bme.mit.trainbenchmark.benchmark.matches.comparators.BaseMatchComparator; - -public class JenaMatchComparator extends BaseMatchComparator<JenaMatch, Resource> { - - public JenaMatchComparator() { - super(new ResourceComparator()); - } - -} diff --git a/trainbenchmark-tool-jena/src/main/java/hu/bme/mit/trainbenchmark/benchmark/jena/comparators/ResourceComparator.java b/trainbenchmark-tool-jena/src/main/java/hu/bme/mit/trainbenchmark/benchmark/jena/comparators/ResourceComparator.java deleted file mode 100644 index 275057465..000000000 --- a/trainbenchmark-tool-jena/src/main/java/hu/bme/mit/trainbenchmark/benchmark/jena/comparators/ResourceComparator.java +++ /dev/null @@ -1,30 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2010-2015, Benedek Izso, Gabor Szarnyas, Istvan Rath and Daniel Varro - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Benedek Izso - initial API and implementation - * Gabor Szarnyas - initial API and implementation - *******************************************************************************/ -package hu.bme.mit.trainbenchmark.benchmark.jena.comparators; - -import java.util.Comparator; - -import org.apache.jena.rdf.model.Resource; - -import hu.bme.mit.trainbenchmark.rdf.RdfHelper; - -public class ResourceComparator implements Comparator<Resource> { - - @Override - public int compare(final Resource r1, final Resource r2) { - final long id1 = RdfHelper.extractId(r1.getURI()); - final long id2 = RdfHelper.extractId(r2.getURI()); - - return Long.compare(id1, id2); - } - -} diff --git a/trainbenchmark-tool-jena/src/main/java/hu/bme/mit/trainbenchmark/benchmark/jena/config/JenaBenchmarkConfig.java b/trainbenchmark-tool-jena/src/main/java/hu/bme/mit/trainbenchmark/benchmark/jena/config/JenaBenchmarkConfig.java deleted file mode 100644 index dbbfd7a2d..000000000 --- a/trainbenchmark-tool-jena/src/main/java/hu/bme/mit/trainbenchmark/benchmark/jena/config/JenaBenchmarkConfig.java +++ /dev/null @@ -1,34 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2010-2015, Benedek Izso, Gabor Szarnyas, Istvan Rath and Daniel Varro - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Benedek Izso - initial API and implementation - * Gabor Szarnyas - initial API and implementation - *******************************************************************************/ - -package hu.bme.mit.trainbenchmark.benchmark.jena.config; - -import hu.bme.mit.trainbenchmark.benchmark.config.BenchmarkConfigBase; -import hu.bme.mit.trainbenchmark.benchmark.rdf.config.RdfBenchmarkConfig; - -public class JenaBenchmarkConfig extends RdfBenchmarkConfig { - - protected JenaBenchmarkConfig(final BenchmarkConfigBase configBase, final boolean inferencing) { - super(configBase, inferencing); - } - - @Override - public String getToolName() { - return "Jena" + getToolNamePostfix(); - } - - @Override - public String getProjectName() { - return "jena"; - } - -} diff --git a/trainbenchmark-tool-jena/src/main/java/hu/bme/mit/trainbenchmark/benchmark/jena/config/JenaBenchmarkConfigBuilder.java b/trainbenchmark-tool-jena/src/main/java/hu/bme/mit/trainbenchmark/benchmark/jena/config/JenaBenchmarkConfigBuilder.java deleted file mode 100644 index 74c4c2932..000000000 --- a/trainbenchmark-tool-jena/src/main/java/hu/bme/mit/trainbenchmark/benchmark/jena/config/JenaBenchmarkConfigBuilder.java +++ /dev/null @@ -1,14 +0,0 @@ -package hu.bme.mit.trainbenchmark.benchmark.jena.config; - -import hu.bme.mit.trainbenchmark.benchmark.rdf.config.RdfBenchmarkConfigBuilder; - -public class JenaBenchmarkConfigBuilder - extends RdfBenchmarkConfigBuilder<JenaBenchmarkConfig, JenaBenchmarkConfigBuilder> { - - @Override - public JenaBenchmarkConfig createConfig() { - checkNotNulls(); - return new JenaBenchmarkConfig(configBase, inferencing); - } - -} diff --git a/trainbenchmark-tool-jena/src/main/java/hu/bme/mit/trainbenchmark/benchmark/jena/driver/JenaDriver.java b/trainbenchmark-tool-jena/src/main/java/hu/bme/mit/trainbenchmark/benchmark/jena/driver/JenaDriver.java deleted file mode 100644 index d4a582380..000000000 --- a/trainbenchmark-tool-jena/src/main/java/hu/bme/mit/trainbenchmark/benchmark/jena/driver/JenaDriver.java +++ /dev/null @@ -1,121 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2010-2015, Benedek Izso, Gabor Szarnyas, Istvan Rath and Daniel Varro - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Benedek Izso - initial API and implementation - * Gabor Szarnyas - initial API and implementation - *******************************************************************************/ -package hu.bme.mit.trainbenchmark.benchmark.jena.driver; - -import java.io.IOException; -import java.util.ArrayList; -import java.util.Collection; -import java.util.Comparator; -import java.util.List; - -import org.apache.jena.query.QueryExecution; -import org.apache.jena.query.QueryExecutionFactory; -import org.apache.jena.query.QuerySolution; -import org.apache.jena.query.ResultSet; -import org.apache.jena.rdf.model.Model; -import org.apache.jena.rdf.model.ModelFactory; -import org.apache.jena.rdf.model.Property; -import org.apache.jena.rdf.model.RDFNode; -import org.apache.jena.rdf.model.Resource; -import org.apache.jena.rdf.model.Selector; -import org.apache.jena.rdf.model.SimpleSelector; -import org.apache.jena.rdf.model.Statement; -import org.apache.jena.rdf.model.StmtIterator; -import org.apache.jena.reasoner.Reasoner; -import org.apache.jena.reasoner.ReasonerRegistry; - -import hu.bme.mit.trainbenchmark.benchmark.rdf.driver.RdfDriver; -import hu.bme.mit.trainbenchmark.constants.RailwayQuery; -import hu.bme.mit.trainbenchmark.rdf.RdfConstants; - -public class JenaDriver extends RdfDriver { - - protected Model model; - - protected Comparator<Statement> statementComparator = new StatementComparator(); - - public JenaDriver(final boolean inferencing) { - super(inferencing); - } - - public static JenaDriver create(final boolean inferencing) { - return new JenaDriver(inferencing); - } - - @Override - public void read(final String modelPath) throws IOException { - final Model defaultModel = ModelFactory.createDefaultModel(); - defaultModel.read(modelPath); - - // run inferencing if required - if (inferencing) { - final Reasoner reasoner = ReasonerRegistry.getRDFSSimpleReasoner(); - model = ModelFactory.createInfModel(reasoner, defaultModel); - } else { - model = defaultModel; - } - } - - public Collection<QuerySolution> runQuery(final RailwayQuery query, final String queryDefinition) throws IOException { - final Collection<QuerySolution> results = new ArrayList<>(); - try (QueryExecution queryExecution = QueryExecutionFactory.create(queryDefinition, model)) { - final ResultSet resultSet = queryExecution.execSelect(); - - while (resultSet.hasNext()) { - final QuerySolution qs = resultSet.next(); - results.add(qs); - } - } - - return results; - } - - @Override - public void destroy() throws IOException { - if (model != null) { - model.close(); - } - } - - public void deleteOutgoingEdges(final Collection<Resource> vertices, final String edgeType) throws IOException { - final Property property = model.getProperty(RdfConstants.BASE_PREFIX + edgeType); - - for (final Resource vertex : vertices) { - final Selector selector = new SimpleSelector(vertex, property, (RDFNode) null); - - final StmtIterator edges = model.listStatements(selector); - - final List<Statement> statementsToRemove = new ArrayList<>(); - while (edges.hasNext()) { - final Statement edge = edges.next(); - statementsToRemove.add(edge); - } - - for (final Statement statement : statementsToRemove) { - model.remove(statement); - } - } - } - - @Override - protected boolean ask(final String askQuery) { - try (QueryExecution queryExecution = QueryExecutionFactory.create(askQuery, model)) { - final boolean result = queryExecution.execAsk(); - return result; - } - } - - public Model getModel() { - return model; - } - -} diff --git a/trainbenchmark-tool-jena/src/main/java/hu/bme/mit/trainbenchmark/benchmark/jena/driver/JenaDriverFactory.java b/trainbenchmark-tool-jena/src/main/java/hu/bme/mit/trainbenchmark/benchmark/jena/driver/JenaDriverFactory.java deleted file mode 100644 index 513a14445..000000000 --- a/trainbenchmark-tool-jena/src/main/java/hu/bme/mit/trainbenchmark/benchmark/jena/driver/JenaDriverFactory.java +++ /dev/null @@ -1,16 +0,0 @@ -package hu.bme.mit.trainbenchmark.benchmark.jena.driver; - -import hu.bme.mit.trainbenchmark.benchmark.rdf.driver.RdfDriverFactory; - -public class JenaDriverFactory extends RdfDriverFactory<JenaDriver> { - - public JenaDriverFactory(final boolean inferencing) { - super(inferencing); - } - - @Override - public JenaDriver createInstance() throws Exception { - return new JenaDriver(inferencing); - } - -} diff --git a/trainbenchmark-tool-jena/src/main/java/hu/bme/mit/trainbenchmark/benchmark/jena/driver/StatementComparator.java b/trainbenchmark-tool-jena/src/main/java/hu/bme/mit/trainbenchmark/benchmark/jena/driver/StatementComparator.java deleted file mode 100644 index 65069ae23..000000000 --- a/trainbenchmark-tool-jena/src/main/java/hu/bme/mit/trainbenchmark/benchmark/jena/driver/StatementComparator.java +++ /dev/null @@ -1,32 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2010-2015, Benedek Izso, Gabor Szarnyas, Istvan Rath and Daniel Varro - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Benedek Izso - initial API and implementation - * Gabor Szarnyas - initial API and implementation - *******************************************************************************/ -package hu.bme.mit.trainbenchmark.benchmark.jena.driver; - -import java.util.Comparator; - -import org.apache.jena.rdf.model.Resource; -import org.apache.jena.rdf.model.Statement; - -import hu.bme.mit.trainbenchmark.benchmark.jena.comparators.ResourceComparator; - -public class StatementComparator implements Comparator<Statement> { - - protected final ResourceComparator resourceComparator = new ResourceComparator(); - - @Override - public int compare(final Statement o1, final Statement o2) { - final Resource r1 = o1.getObject().asResource(); - final Resource r2 = o2.getObject().asResource(); - - return resourceComparator.compare(r1, r2); - } -} diff --git a/trainbenchmark-tool-jena/src/main/java/hu/bme/mit/trainbenchmark/benchmark/jena/matches/JenaConnectedSegmentsInjectMatch.java b/trainbenchmark-tool-jena/src/main/java/hu/bme/mit/trainbenchmark/benchmark/jena/matches/JenaConnectedSegmentsInjectMatch.java deleted file mode 100644 index f6dfdcafb..000000000 --- a/trainbenchmark-tool-jena/src/main/java/hu/bme/mit/trainbenchmark/benchmark/jena/matches/JenaConnectedSegmentsInjectMatch.java +++ /dev/null @@ -1,44 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2010-2015, Benedek Izso, Gabor Szarnyas, Istvan Rath and Daniel Varro - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Benedek Izso - initial API and implementation - * Gabor Szarnyas - initial API and implementation - *******************************************************************************/ -package hu.bme.mit.trainbenchmark.benchmark.jena.matches; - -import static hu.bme.mit.trainbenchmark.constants.QueryConstants.VAR_SEGMENT1; -import static hu.bme.mit.trainbenchmark.constants.QueryConstants.VAR_SEGMENT3; -import static hu.bme.mit.trainbenchmark.constants.QueryConstants.VAR_SENSOR; - -import org.apache.jena.query.QuerySolution; -import org.apache.jena.rdf.model.Resource; - -import hu.bme.mit.trainbenchmark.benchmark.matches.ConnectedSegmentsInjectMatch; - -public class JenaConnectedSegmentsInjectMatch extends JenaMatch implements ConnectedSegmentsInjectMatch { - - public JenaConnectedSegmentsInjectMatch(final QuerySolution qs) { - super(qs); - } - - @Override - public Resource getSensor() { - return qs.getResource(VAR_SENSOR); - } - - @Override - public Resource getSegment1() { - return qs.getResource(VAR_SEGMENT1); - } - - @Override - public Resource getSegment3() { - return qs.getResource(VAR_SEGMENT3); - } - -} diff --git a/trainbenchmark-tool-jena/src/main/java/hu/bme/mit/trainbenchmark/benchmark/jena/matches/JenaConnectedSegmentsMatch.java b/trainbenchmark-tool-jena/src/main/java/hu/bme/mit/trainbenchmark/benchmark/jena/matches/JenaConnectedSegmentsMatch.java deleted file mode 100644 index 620a7bb4d..000000000 --- a/trainbenchmark-tool-jena/src/main/java/hu/bme/mit/trainbenchmark/benchmark/jena/matches/JenaConnectedSegmentsMatch.java +++ /dev/null @@ -1,68 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2010-2015, Benedek Izso, Gabor Szarnyas, Istvan Rath and Daniel Varro - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Benedek Izso - initial API and implementation - * Gabor Szarnyas - initial API and implementation - *******************************************************************************/ -package hu.bme.mit.trainbenchmark.benchmark.jena.matches; - -import static hu.bme.mit.trainbenchmark.constants.QueryConstants.VAR_SEGMENT1; -import static hu.bme.mit.trainbenchmark.constants.QueryConstants.VAR_SEGMENT2; -import static hu.bme.mit.trainbenchmark.constants.QueryConstants.VAR_SEGMENT3; -import static hu.bme.mit.trainbenchmark.constants.QueryConstants.VAR_SEGMENT4; -import static hu.bme.mit.trainbenchmark.constants.QueryConstants.VAR_SEGMENT5; -import static hu.bme.mit.trainbenchmark.constants.QueryConstants.VAR_SEGMENT6; -import static hu.bme.mit.trainbenchmark.constants.QueryConstants.VAR_SENSOR; - -import org.apache.jena.query.QuerySolution; -import org.apache.jena.rdf.model.Resource; - -import hu.bme.mit.trainbenchmark.benchmark.matches.ConnectedSegmentsMatch; - -public class JenaConnectedSegmentsMatch extends JenaMatch implements ConnectedSegmentsMatch { - - public JenaConnectedSegmentsMatch(final QuerySolution qs) { - super(qs); - } - - @Override - public Resource getSensor() { - return qs.getResource(VAR_SENSOR); - } - - @Override - public Resource getSegment1() { - return qs.getResource(VAR_SEGMENT1); - } - - @Override - public Resource getSegment2() { - return qs.getResource(VAR_SEGMENT2); - } - - @Override - public Resource getSegment3() { - return qs.getResource(VAR_SEGMENT3); - } - - @Override - public Resource getSegment4() { - return qs.getResource(VAR_SEGMENT4); - } - - @Override - public Resource getSegment5() { - return qs.getResource(VAR_SEGMENT5); - } - - @Override - public Resource getSegment6() { - return qs.getResource(VAR_SEGMENT6); - } - -} diff --git a/trainbenchmark-tool-jena/src/main/java/hu/bme/mit/trainbenchmark/benchmark/jena/matches/JenaMatch.java b/trainbenchmark-tool-jena/src/main/java/hu/bme/mit/trainbenchmark/benchmark/jena/matches/JenaMatch.java deleted file mode 100644 index 0014f6c63..000000000 --- a/trainbenchmark-tool-jena/src/main/java/hu/bme/mit/trainbenchmark/benchmark/jena/matches/JenaMatch.java +++ /dev/null @@ -1,65 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2010-2015, Benedek Izso, Gabor Szarnyas, Istvan Rath and Daniel Varro - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Benedek Izso - initial API and implementation - * Gabor Szarnyas - initial API and implementation - *******************************************************************************/ -package hu.bme.mit.trainbenchmark.benchmark.jena.matches; - -import org.apache.jena.ext.com.google.common.base.Joiner; -import org.apache.jena.query.QuerySolution; - -import hu.bme.mit.trainbenchmark.benchmark.matches.BaseMatch; -import hu.bme.mit.trainbenchmark.constants.RailwayQuery; - -public abstract class JenaMatch extends BaseMatch { - - protected QuerySolution qs; - - public JenaMatch(final QuerySolution qs) { - this.qs = qs; - } - - public static JenaMatch createMatch(final RailwayQuery query, final QuerySolution qs) { - switch (query) { - case CONNECTEDSEGMENTS: - return new JenaConnectedSegmentsMatch(qs); - case CONNECTEDSEGMENTS_INJECT: - return new JenaConnectedSegmentsInjectMatch(qs); - case POSLENGTH: - return new JenaPosLengthMatch(qs); - case POSLENGTH_INJECT: - return new JenaPosLengthInjectMatch(qs); - case ROUTESENSOR: - return new JenaRouteSensorMatch(qs); - case ROUTESENSOR_INJECT: - return new JenaRouteSensorInjectMatch(qs); - case SEMAPHORENEIGHBOR: - return new JenaSemaphoreNeighborMatch(qs); - case SEMAPHORENEIGHBOR_INJECT: - return new JenaSemaphoreNeighborInjectMatch(qs); - case SWITCHMONITORED: - return new JenaSwitchMonitoredMatch(qs); - case SWITCHMONITORED_INJECT: - return new JenaSwitchMonitoredInjectMatch(qs); - case SWITCHSET: - return new JenaSwitchSetMatch(qs); - case SWITCHSET_INJECT: - return new JenaSwitchSetInjectMatch(qs); - default: - throw new UnsupportedOperationException("Pattern not supported: " + query); - } - } - - @Override - public String toString() { - final Joiner joiner = Joiner.on(", "); - return joiner.join(toArray()); - } - -} diff --git a/trainbenchmark-tool-jena/src/main/java/hu/bme/mit/trainbenchmark/benchmark/jena/matches/JenaPosLengthInjectMatch.java b/trainbenchmark-tool-jena/src/main/java/hu/bme/mit/trainbenchmark/benchmark/jena/matches/JenaPosLengthInjectMatch.java deleted file mode 100644 index 6b54dc362..000000000 --- a/trainbenchmark-tool-jena/src/main/java/hu/bme/mit/trainbenchmark/benchmark/jena/matches/JenaPosLengthInjectMatch.java +++ /dev/null @@ -1,32 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2010-2015, Benedek Izso, Gabor Szarnyas, Istvan Rath and Daniel Varro - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Benedek Izso - initial API and implementation - * Gabor Szarnyas - initial API and implementation - *******************************************************************************/ -package hu.bme.mit.trainbenchmark.benchmark.jena.matches; - -import static hu.bme.mit.trainbenchmark.constants.QueryConstants.VAR_SEGMENT; - -import org.apache.jena.query.QuerySolution; -import org.apache.jena.rdf.model.Resource; - -import hu.bme.mit.trainbenchmark.benchmark.matches.PosLengthInjectMatch; - -public class JenaPosLengthInjectMatch extends JenaMatch implements PosLengthInjectMatch { - - public JenaPosLengthInjectMatch(final QuerySolution qs) { - super(qs); - } - - @Override - public Resource getSegment() { - return qs.getResource(VAR_SEGMENT); - } - -} diff --git a/trainbenchmark-tool-jena/src/main/java/hu/bme/mit/trainbenchmark/benchmark/jena/matches/JenaPosLengthMatch.java b/trainbenchmark-tool-jena/src/main/java/hu/bme/mit/trainbenchmark/benchmark/jena/matches/JenaPosLengthMatch.java deleted file mode 100644 index 550028066..000000000 --- a/trainbenchmark-tool-jena/src/main/java/hu/bme/mit/trainbenchmark/benchmark/jena/matches/JenaPosLengthMatch.java +++ /dev/null @@ -1,38 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2010-2015, Benedek Izso, Gabor Szarnyas, Istvan Rath and Daniel Varro - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Benedek Izso - initial API and implementation - * Gabor Szarnyas - initial API and implementation - *******************************************************************************/ -package hu.bme.mit.trainbenchmark.benchmark.jena.matches; - -import static hu.bme.mit.trainbenchmark.constants.QueryConstants.VAR_LENGTH; -import static hu.bme.mit.trainbenchmark.constants.QueryConstants.VAR_SEGMENT; - -import org.apache.jena.query.QuerySolution; -import org.apache.jena.rdf.model.Literal; -import org.apache.jena.rdf.model.Resource; - -import hu.bme.mit.trainbenchmark.benchmark.matches.PosLengthMatch; - -public class JenaPosLengthMatch extends JenaMatch implements PosLengthMatch { - - public JenaPosLengthMatch(final QuerySolution qs) { - super(qs); - } - - @Override - public Resource getSegment() { - return qs.getResource(VAR_SEGMENT); - } - - public Literal getLength() { - return qs.getLiteral(VAR_LENGTH); - } - -} diff --git a/trainbenchmark-tool-jena/src/main/java/hu/bme/mit/trainbenchmark/benchmark/jena/matches/JenaRouteSensorInjectMatch.java b/trainbenchmark-tool-jena/src/main/java/hu/bme/mit/trainbenchmark/benchmark/jena/matches/JenaRouteSensorInjectMatch.java deleted file mode 100644 index a0a301be9..000000000 --- a/trainbenchmark-tool-jena/src/main/java/hu/bme/mit/trainbenchmark/benchmark/jena/matches/JenaRouteSensorInjectMatch.java +++ /dev/null @@ -1,38 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2010-2015, Benedek Izso, Gabor Szarnyas, Istvan Rath and Daniel Varro - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Benedek Izso - initial API and implementation - * Gabor Szarnyas - initial API and implementation - *******************************************************************************/ -package hu.bme.mit.trainbenchmark.benchmark.jena.matches; - -import static hu.bme.mit.trainbenchmark.constants.QueryConstants.VAR_ROUTE; -import static hu.bme.mit.trainbenchmark.constants.QueryConstants.VAR_SENSOR; - -import org.apache.jena.query.QuerySolution; -import org.apache.jena.rdf.model.Resource; - -import hu.bme.mit.trainbenchmark.benchmark.matches.RouteSensorInjectMatch; - -public class JenaRouteSensorInjectMatch extends JenaMatch implements RouteSensorInjectMatch { - - public JenaRouteSensorInjectMatch(final QuerySolution qs) { - super(qs); - } - - @Override - public Resource getRoute() { - return qs.getResource(VAR_ROUTE); - } - - @Override - public Resource getSensor() { - return qs.getResource(VAR_SENSOR); - } - -} diff --git a/trainbenchmark-tool-jena/src/main/java/hu/bme/mit/trainbenchmark/benchmark/jena/matches/JenaRouteSensorMatch.java b/trainbenchmark-tool-jena/src/main/java/hu/bme/mit/trainbenchmark/benchmark/jena/matches/JenaRouteSensorMatch.java deleted file mode 100644 index 9cea37c2d..000000000 --- a/trainbenchmark-tool-jena/src/main/java/hu/bme/mit/trainbenchmark/benchmark/jena/matches/JenaRouteSensorMatch.java +++ /dev/null @@ -1,50 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2010-2015, Benedek Izso, Gabor Szarnyas, Istvan Rath and Daniel Varro - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Benedek Izso - initial API and implementation - * Gabor Szarnyas - initial API and implementation - *******************************************************************************/ -package hu.bme.mit.trainbenchmark.benchmark.jena.matches; - -import static hu.bme.mit.trainbenchmark.constants.QueryConstants.VAR_ROUTE; -import static hu.bme.mit.trainbenchmark.constants.QueryConstants.VAR_SENSOR; -import static hu.bme.mit.trainbenchmark.constants.QueryConstants.VAR_SW; -import static hu.bme.mit.trainbenchmark.constants.QueryConstants.VAR_SWP; - -import org.apache.jena.query.QuerySolution; -import org.apache.jena.rdf.model.Resource; - -import hu.bme.mit.trainbenchmark.benchmark.matches.RouteSensorMatch; - -public class JenaRouteSensorMatch extends JenaMatch implements RouteSensorMatch { - - public JenaRouteSensorMatch(final QuerySolution qs) { - super(qs); - } - - @Override - public Resource getRoute() { - return qs.getResource(VAR_ROUTE); - } - - @Override - public Resource getSensor() { - return qs.getResource(VAR_SENSOR); - } - - @Override - public Resource getSwP() { - return qs.getResource(VAR_SWP); - } - - @Override - public Resource getSw() { - return qs.getResource(VAR_SW); - } - -} diff --git a/trainbenchmark-tool-jena/src/main/java/hu/bme/mit/trainbenchmark/benchmark/jena/matches/JenaSemaphoreNeighborInjectMatch.java b/trainbenchmark-tool-jena/src/main/java/hu/bme/mit/trainbenchmark/benchmark/jena/matches/JenaSemaphoreNeighborInjectMatch.java deleted file mode 100644 index 6a8c4472c..000000000 --- a/trainbenchmark-tool-jena/src/main/java/hu/bme/mit/trainbenchmark/benchmark/jena/matches/JenaSemaphoreNeighborInjectMatch.java +++ /dev/null @@ -1,38 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2010-2015, Benedek Izso, Gabor Szarnyas, Istvan Rath and Daniel Varro - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Benedek Izso - initial API and implementation - * Gabor Szarnyas - initial API and implementation - *******************************************************************************/ -package hu.bme.mit.trainbenchmark.benchmark.jena.matches; - -import static hu.bme.mit.trainbenchmark.constants.QueryConstants.VAR_ROUTE; -import static hu.bme.mit.trainbenchmark.constants.QueryConstants.VAR_SEMAPHORE; - -import org.apache.jena.query.QuerySolution; -import org.apache.jena.rdf.model.Resource; - -import hu.bme.mit.trainbenchmark.benchmark.matches.SemaphoreNeighborInjectMatch; - -public class JenaSemaphoreNeighborInjectMatch extends JenaMatch implements SemaphoreNeighborInjectMatch { - - public JenaSemaphoreNeighborInjectMatch(final QuerySolution qs) { - super(qs); - } - - @Override - public Resource getRoute() { - return qs.getResource(VAR_ROUTE); - } - - @Override - public Resource getSemaphore() { - return qs.getResource(VAR_SEMAPHORE); - } - -} diff --git a/trainbenchmark-tool-jena/src/main/java/hu/bme/mit/trainbenchmark/benchmark/jena/matches/JenaSemaphoreNeighborMatch.java b/trainbenchmark-tool-jena/src/main/java/hu/bme/mit/trainbenchmark/benchmark/jena/matches/JenaSemaphoreNeighborMatch.java deleted file mode 100644 index 8011b2d76..000000000 --- a/trainbenchmark-tool-jena/src/main/java/hu/bme/mit/trainbenchmark/benchmark/jena/matches/JenaSemaphoreNeighborMatch.java +++ /dev/null @@ -1,68 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2010-2015, Benedek Izso, Gabor Szarnyas, Istvan Rath and Daniel Varro - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Benedek Izso - initial API and implementation - * Gabor Szarnyas - initial API and implementation - *******************************************************************************/ -package hu.bme.mit.trainbenchmark.benchmark.jena.matches; - -import static hu.bme.mit.trainbenchmark.constants.QueryConstants.VAR_ROUTE1; -import static hu.bme.mit.trainbenchmark.constants.QueryConstants.VAR_ROUTE2; -import static hu.bme.mit.trainbenchmark.constants.QueryConstants.VAR_SEMAPHORE; -import static hu.bme.mit.trainbenchmark.constants.QueryConstants.VAR_SENSOR1; -import static hu.bme.mit.trainbenchmark.constants.QueryConstants.VAR_SENSOR2; -import static hu.bme.mit.trainbenchmark.constants.QueryConstants.VAR_TE1; -import static hu.bme.mit.trainbenchmark.constants.QueryConstants.VAR_TE2; - -import org.apache.jena.query.QuerySolution; -import org.apache.jena.rdf.model.Resource; - -import hu.bme.mit.trainbenchmark.benchmark.matches.SemaphoreNeighborMatch; - -public class JenaSemaphoreNeighborMatch extends JenaMatch implements SemaphoreNeighborMatch { - - public JenaSemaphoreNeighborMatch(final QuerySolution qs) { - super(qs); - } - - @Override - public Resource getSemaphore() { - return qs.getResource(VAR_SEMAPHORE); - } - - @Override - public Resource getRoute1() { - return qs.getResource(VAR_ROUTE1); - } - - @Override - public Resource getRoute2() { - return qs.getResource(VAR_ROUTE2); - } - - @Override - public Resource getSensor1() { - return qs.getResource(VAR_SENSOR1); - } - - @Override - public Resource getSensor2() { - return qs.getResource(VAR_SENSOR2); - } - - @Override - public Resource getTe1() { - return qs.getResource(VAR_TE1); - } - - @Override - public Resource getTe2() { - return qs.getResource(VAR_TE2); - } - -} diff --git a/trainbenchmark-tool-jena/src/main/java/hu/bme/mit/trainbenchmark/benchmark/jena/matches/JenaSwitchMonitoredInjectMatch.java b/trainbenchmark-tool-jena/src/main/java/hu/bme/mit/trainbenchmark/benchmark/jena/matches/JenaSwitchMonitoredInjectMatch.java deleted file mode 100644 index 1adbe1e40..000000000 --- a/trainbenchmark-tool-jena/src/main/java/hu/bme/mit/trainbenchmark/benchmark/jena/matches/JenaSwitchMonitoredInjectMatch.java +++ /dev/null @@ -1,32 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2010-2015, Benedek Izso, Gabor Szarnyas, Istvan Rath and Daniel Varro - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Benedek Izso - initial API and implementation - * Gabor Szarnyas - initial API and implementation - *******************************************************************************/ -package hu.bme.mit.trainbenchmark.benchmark.jena.matches; - -import static hu.bme.mit.trainbenchmark.constants.QueryConstants.VAR_SW; - -import org.apache.jena.query.QuerySolution; -import org.apache.jena.rdf.model.Resource; - -import hu.bme.mit.trainbenchmark.benchmark.matches.SwitchMonitoredInjectMatch; - -public class JenaSwitchMonitoredInjectMatch extends JenaMatch implements SwitchMonitoredInjectMatch { - - public JenaSwitchMonitoredInjectMatch(final QuerySolution qs) { - super(qs); - } - - @Override - public Resource getSw() { - return qs.getResource(VAR_SW); - } - -} diff --git a/trainbenchmark-tool-jena/src/main/java/hu/bme/mit/trainbenchmark/benchmark/jena/matches/JenaSwitchMonitoredMatch.java b/trainbenchmark-tool-jena/src/main/java/hu/bme/mit/trainbenchmark/benchmark/jena/matches/JenaSwitchMonitoredMatch.java deleted file mode 100644 index e1e1b5b60..000000000 --- a/trainbenchmark-tool-jena/src/main/java/hu/bme/mit/trainbenchmark/benchmark/jena/matches/JenaSwitchMonitoredMatch.java +++ /dev/null @@ -1,32 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2010-2015, Benedek Izso, Gabor Szarnyas, Istvan Rath and Daniel Varro - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Benedek Izso - initial API and implementation - * Gabor Szarnyas - initial API and implementation - *******************************************************************************/ -package hu.bme.mit.trainbenchmark.benchmark.jena.matches; - -import static hu.bme.mit.trainbenchmark.constants.QueryConstants.VAR_SW; - -import org.apache.jena.query.QuerySolution; -import org.apache.jena.rdf.model.Resource; - -import hu.bme.mit.trainbenchmark.benchmark.matches.SwitchMonitoredMatch; - -public class JenaSwitchMonitoredMatch extends JenaMatch implements SwitchMonitoredMatch { - - public JenaSwitchMonitoredMatch(final QuerySolution qs) { - super(qs); - } - - @Override - public Resource getSw() { - return qs.getResource(VAR_SW); - } - -} diff --git a/trainbenchmark-tool-jena/src/main/java/hu/bme/mit/trainbenchmark/benchmark/jena/matches/JenaSwitchSetInjectMatch.java b/trainbenchmark-tool-jena/src/main/java/hu/bme/mit/trainbenchmark/benchmark/jena/matches/JenaSwitchSetInjectMatch.java deleted file mode 100644 index dabfde0d8..000000000 --- a/trainbenchmark-tool-jena/src/main/java/hu/bme/mit/trainbenchmark/benchmark/jena/matches/JenaSwitchSetInjectMatch.java +++ /dev/null @@ -1,42 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2010-2015, Benedek Izso, Gabor Szarnyas, Istvan Rath and Daniel Varro - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Benedek Izso - initial API and implementation - * Gabor Szarnyas - initial API and implementation - *******************************************************************************/ -package hu.bme.mit.trainbenchmark.benchmark.jena.matches; - -import static hu.bme.mit.trainbenchmark.constants.QueryConstants.VAR_CURRENTPOSITION; -import static hu.bme.mit.trainbenchmark.constants.QueryConstants.VAR_POSITION; -import static hu.bme.mit.trainbenchmark.constants.QueryConstants.VAR_SW; - -import org.apache.jena.query.QuerySolution; -import org.apache.jena.rdf.model.Resource; - -import hu.bme.mit.trainbenchmark.benchmark.matches.SwitchSetInjectMatch; - -public class JenaSwitchSetInjectMatch extends JenaMatch implements SwitchSetInjectMatch { - - public JenaSwitchSetInjectMatch(final QuerySolution qs) { - super(qs); - } - - @Override - public Resource getSw() { - return qs.getResource(VAR_SW); - } - - public Resource getPosition() { - return qs.getResource(VAR_POSITION); - } - - public Resource getCurrentPosition() { - return qs.getResource(VAR_CURRENTPOSITION); - } - -} diff --git a/trainbenchmark-tool-jena/src/main/java/hu/bme/mit/trainbenchmark/benchmark/jena/matches/JenaSwitchSetMatch.java b/trainbenchmark-tool-jena/src/main/java/hu/bme/mit/trainbenchmark/benchmark/jena/matches/JenaSwitchSetMatch.java deleted file mode 100644 index 0f640eb31..000000000 --- a/trainbenchmark-tool-jena/src/main/java/hu/bme/mit/trainbenchmark/benchmark/jena/matches/JenaSwitchSetMatch.java +++ /dev/null @@ -1,60 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2010-2015, Benedek Izso, Gabor Szarnyas, Istvan Rath and Daniel Varro - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Benedek Izso - initial API and implementation - * Gabor Szarnyas - initial API and implementation - *******************************************************************************/ -package hu.bme.mit.trainbenchmark.benchmark.jena.matches; - -import static hu.bme.mit.trainbenchmark.constants.QueryConstants.VAR_CURRENTPOSITION; -import static hu.bme.mit.trainbenchmark.constants.QueryConstants.VAR_POSITION; -import static hu.bme.mit.trainbenchmark.constants.QueryConstants.VAR_ROUTE; -import static hu.bme.mit.trainbenchmark.constants.QueryConstants.VAR_SEMAPHORE; -import static hu.bme.mit.trainbenchmark.constants.QueryConstants.VAR_SW; -import static hu.bme.mit.trainbenchmark.constants.QueryConstants.VAR_SWP; - -import org.apache.jena.query.QuerySolution; -import org.apache.jena.rdf.model.Resource; - -import hu.bme.mit.trainbenchmark.benchmark.matches.SwitchSetMatch; - -public class JenaSwitchSetMatch extends JenaMatch implements SwitchSetMatch { - - public JenaSwitchSetMatch(final QuerySolution qs) { - super(qs); - } - - @Override - public Resource getSemaphore() { - return qs.getResource(VAR_SEMAPHORE); - } - - @Override - public Resource getRoute() { - return qs.getResource(VAR_ROUTE); - } - - @Override - public Resource getSwP() { - return qs.getResource(VAR_SWP); - } - - @Override - public Resource getSw() { - return qs.getResource(VAR_SW); - } - - public Resource getPosition() { - return qs.getResource(VAR_POSITION); - } - - public Resource getCurrentPosition() { - return qs.getResource(VAR_CURRENTPOSITION); - } - -} diff --git a/trainbenchmark-tool-jena/src/main/java/hu/bme/mit/trainbenchmark/benchmark/jena/operations/JenaModelOperationFactory.java b/trainbenchmark-tool-jena/src/main/java/hu/bme/mit/trainbenchmark/benchmark/jena/operations/JenaModelOperationFactory.java deleted file mode 100644 index 00c09043b..000000000 --- a/trainbenchmark-tool-jena/src/main/java/hu/bme/mit/trainbenchmark/benchmark/jena/operations/JenaModelOperationFactory.java +++ /dev/null @@ -1,164 +0,0 @@ -package hu.bme.mit.trainbenchmark.benchmark.jena.operations; - -import hu.bme.mit.trainbenchmark.benchmark.jena.driver.JenaDriver; -import hu.bme.mit.trainbenchmark.benchmark.jena.matches.JenaConnectedSegmentsInjectMatch; -import hu.bme.mit.trainbenchmark.benchmark.jena.matches.JenaConnectedSegmentsMatch; -import hu.bme.mit.trainbenchmark.benchmark.jena.matches.JenaMatch; -import hu.bme.mit.trainbenchmark.benchmark.jena.matches.JenaPosLengthInjectMatch; -import hu.bme.mit.trainbenchmark.benchmark.jena.matches.JenaPosLengthMatch; -import hu.bme.mit.trainbenchmark.benchmark.jena.matches.JenaRouteSensorInjectMatch; -import hu.bme.mit.trainbenchmark.benchmark.jena.matches.JenaRouteSensorMatch; -import hu.bme.mit.trainbenchmark.benchmark.jena.matches.JenaSemaphoreNeighborInjectMatch; -import hu.bme.mit.trainbenchmark.benchmark.jena.matches.JenaSemaphoreNeighborMatch; -import hu.bme.mit.trainbenchmark.benchmark.jena.matches.JenaSwitchMonitoredInjectMatch; -import hu.bme.mit.trainbenchmark.benchmark.jena.matches.JenaSwitchMonitoredMatch; -import hu.bme.mit.trainbenchmark.benchmark.jena.matches.JenaSwitchSetInjectMatch; -import hu.bme.mit.trainbenchmark.benchmark.jena.matches.JenaSwitchSetMatch; -import hu.bme.mit.trainbenchmark.benchmark.jena.queries.JenaQuery; -import hu.bme.mit.trainbenchmark.benchmark.jena.transformations.JenaTransformation; -import hu.bme.mit.trainbenchmark.benchmark.jena.transformations.inject.JenaTransformationInjectConnectedSegments; -import hu.bme.mit.trainbenchmark.benchmark.jena.transformations.inject.JenaTransformationInjectPosLength; -import hu.bme.mit.trainbenchmark.benchmark.jena.transformations.inject.JenaTransformationInjectRouteSensor; -import hu.bme.mit.trainbenchmark.benchmark.jena.transformations.inject.JenaTransformationInjectSemaphoreNeighbor; -import hu.bme.mit.trainbenchmark.benchmark.jena.transformations.inject.JenaTransformationInjectSwitchMonitored; -import hu.bme.mit.trainbenchmark.benchmark.jena.transformations.inject.JenaTransformationInjectSwitchSet; -import hu.bme.mit.trainbenchmark.benchmark.jena.transformations.repair.JenaTransformationRepairConnectedSegments; -import hu.bme.mit.trainbenchmark.benchmark.jena.transformations.repair.JenaTransformationRepairPosLength; -import hu.bme.mit.trainbenchmark.benchmark.jena.transformations.repair.JenaTransformationRepairRouteSensor; -import hu.bme.mit.trainbenchmark.benchmark.jena.transformations.repair.JenaTransformationRepairSemaphoreNeighbor; -import hu.bme.mit.trainbenchmark.benchmark.jena.transformations.repair.JenaTransformationRepairSwitchMonitored; -import hu.bme.mit.trainbenchmark.benchmark.jena.transformations.repair.JenaTransformationRepairSwitchSet; -import hu.bme.mit.trainbenchmark.benchmark.operations.ModelOperation; -import hu.bme.mit.trainbenchmark.benchmark.operations.ModelOperationFactory; -import hu.bme.mit.trainbenchmark.constants.RailwayOperation; -import hu.bme.mit.trainbenchmark.constants.RailwayQuery; - -public class JenaModelOperationFactory extends ModelOperationFactory<JenaMatch, JenaDriver> { - - @Override - public ModelOperation<? extends JenaMatch, JenaDriver> createOperation(final RailwayOperation operationEnum, final String workspaceDir, - final JenaDriver driver) throws Exception { - - switch (operationEnum) { - // ConnectedSegments - case CONNECTEDSEGMENTS: { - final JenaQuery<JenaConnectedSegmentsMatch> query = JenaQuery.create(driver, workspaceDir, RailwayQuery.CONNECTEDSEGMENTS); - final ModelOperation<JenaConnectedSegmentsMatch, JenaDriver> operation = ModelOperation.of(query); - return operation; - } - case CONNECTEDSEGMENTS_INJECT: { - final JenaQuery<JenaConnectedSegmentsInjectMatch> query = JenaQuery.create(driver, workspaceDir, RailwayQuery.CONNECTEDSEGMENTS_INJECT); - final JenaTransformation<JenaConnectedSegmentsInjectMatch> transformation = new JenaTransformationInjectConnectedSegments(driver); - final ModelOperation<JenaConnectedSegmentsInjectMatch, JenaDriver> operation = ModelOperation.of(query, transformation); - return operation; - } - case CONNECTEDSEGMENTS_REPAIR: { - final JenaQuery<JenaConnectedSegmentsMatch> query = JenaQuery.create(driver, workspaceDir, RailwayQuery.CONNECTEDSEGMENTS); - final JenaTransformation<JenaConnectedSegmentsMatch> transformation = new JenaTransformationRepairConnectedSegments(driver); - final ModelOperation<JenaConnectedSegmentsMatch, JenaDriver> operation = ModelOperation.of(query, transformation); - return operation; - } - - // PosLength - case POSLENGTH: { - final JenaQuery<JenaPosLengthMatch> query = JenaQuery.create(driver, workspaceDir, RailwayQuery.POSLENGTH); - final ModelOperation<JenaPosLengthMatch, JenaDriver> operation = ModelOperation.of(query); - return operation; - } - case POSLENGTH_INJECT: { - final JenaQuery<JenaPosLengthInjectMatch> query = JenaQuery.create(driver, workspaceDir, RailwayQuery.POSLENGTH_INJECT); - final JenaTransformation<JenaPosLengthInjectMatch> transformation = new JenaTransformationInjectPosLength(driver); - final ModelOperation<JenaPosLengthInjectMatch, JenaDriver> operation = ModelOperation.of(query, transformation); - return operation; - - } - case POSLENGTH_REPAIR: { - final JenaQuery<JenaPosLengthMatch> query = JenaQuery.create(driver, workspaceDir, RailwayQuery.POSLENGTH); - final JenaTransformation<JenaPosLengthMatch> transformation = new JenaTransformationRepairPosLength(driver); - final ModelOperation<JenaPosLengthMatch, JenaDriver> operation = ModelOperation.of(query, transformation); - return operation; - - } - - // RouteSensor - case ROUTESENSOR: { - final JenaQuery<JenaRouteSensorMatch> query = JenaQuery.create(driver, workspaceDir, RailwayQuery.ROUTESENSOR); - final ModelOperation<JenaRouteSensorMatch, JenaDriver> operation = ModelOperation.of(query); - return operation; - } - case ROUTESENSOR_INJECT: { - final JenaQuery<JenaRouteSensorInjectMatch> query = JenaQuery.create(driver, workspaceDir, RailwayQuery.ROUTESENSOR_INJECT); - final JenaTransformation<JenaRouteSensorInjectMatch> transformation = new JenaTransformationInjectRouteSensor(driver); - final ModelOperation<JenaRouteSensorInjectMatch, JenaDriver> operation = ModelOperation.of(query, transformation); - return operation; - } - case ROUTESENSOR_REPAIR: { - final JenaQuery<JenaRouteSensorMatch> query = JenaQuery.create(driver, workspaceDir, RailwayQuery.ROUTESENSOR); - final JenaTransformation<JenaRouteSensorMatch> transformation = new JenaTransformationRepairRouteSensor(driver); - final ModelOperation<JenaRouteSensorMatch, JenaDriver> operation = ModelOperation.of(query, transformation); - return operation; - } - - // SemaphoreNeighbor - case SEMAPHORENEIGHBOR: { - final JenaQuery<JenaSemaphoreNeighborMatch> query = JenaQuery.create(driver, workspaceDir, RailwayQuery.SEMAPHORENEIGHBOR); - final ModelOperation<JenaSemaphoreNeighborMatch, JenaDriver> operation = ModelOperation.of(query); - return operation; - } - case SEMAPHORENEIGHBOR_INJECT: { - final JenaQuery<JenaSemaphoreNeighborInjectMatch> query = JenaQuery.create(driver, workspaceDir, RailwayQuery.SEMAPHORENEIGHBOR_INJECT); - final JenaTransformation<JenaSemaphoreNeighborInjectMatch> transformation = new JenaTransformationInjectSemaphoreNeighbor(driver); - final ModelOperation<JenaSemaphoreNeighborInjectMatch, JenaDriver> operation = ModelOperation.of(query, transformation); - return operation; - } - case SEMAPHORENEIGHBOR_REPAIR: { - final JenaQuery<JenaSemaphoreNeighborMatch> query = JenaQuery.create(driver, workspaceDir, RailwayQuery.SEMAPHORENEIGHBOR); - final JenaTransformation<JenaSemaphoreNeighborMatch> transformation = new JenaTransformationRepairSemaphoreNeighbor(driver); - final ModelOperation<JenaSemaphoreNeighborMatch, JenaDriver> operation = ModelOperation.of(query, transformation); - return operation; - } - - // SwitchMonitored - case SWITCHMONITORED: { - final JenaQuery<JenaSwitchMonitoredMatch> query = JenaQuery.create(driver, workspaceDir, RailwayQuery.SWITCHMONITORED); - final ModelOperation<JenaSwitchMonitoredMatch, JenaDriver> operation = ModelOperation.of(query); - return operation; - } - case SWITCHMONITORED_INJECT: { - final JenaQuery<JenaSwitchMonitoredInjectMatch> query = JenaQuery.create(driver, workspaceDir, RailwayQuery.SWITCHMONITORED_INJECT); - final JenaTransformation<JenaSwitchMonitoredInjectMatch> transformation = new JenaTransformationInjectSwitchMonitored(driver); - final ModelOperation<JenaSwitchMonitoredInjectMatch, JenaDriver> operation = ModelOperation.of(query, transformation); - return operation; - } - case SWITCHMONITORED_REPAIR: { - final JenaQuery<JenaSwitchMonitoredMatch> query = JenaQuery.create(driver, workspaceDir, RailwayQuery.SWITCHMONITORED); - final JenaTransformation<JenaSwitchMonitoredMatch> transformation = new JenaTransformationRepairSwitchMonitored(driver); - final ModelOperation<JenaSwitchMonitoredMatch, JenaDriver> operation = ModelOperation.of(query, transformation); - return operation; - } - - // SwitchSet - case SWITCHSET: { - final JenaQuery<JenaSwitchSetMatch> query = JenaQuery.create(driver, workspaceDir, RailwayQuery.SWITCHSET); - final ModelOperation<JenaSwitchSetMatch, JenaDriver> operation = ModelOperation.of(query); - return operation; - } - case SWITCHSET_INJECT: { - final JenaQuery<JenaSwitchSetInjectMatch> query = JenaQuery.create(driver, workspaceDir, RailwayQuery.SWITCHSET_INJECT); - final JenaTransformation<JenaSwitchSetInjectMatch> transformation = new JenaTransformationInjectSwitchSet(driver); - final ModelOperation<JenaSwitchSetInjectMatch, JenaDriver> operation = ModelOperation.of(query, transformation); - return operation; - } - case SWITCHSET_REPAIR: { - final JenaQuery<JenaSwitchSetMatch> query = JenaQuery.create(driver, workspaceDir, RailwayQuery.SWITCHSET); - final JenaTransformation<JenaSwitchSetMatch> transformation = new JenaTransformationRepairSwitchSet(driver); - final ModelOperation<JenaSwitchSetMatch, JenaDriver> operation = ModelOperation.of(query, transformation); - return operation; - } - - default: - throw new UnsupportedOperationException("Operation " + operationEnum + " not supported."); - } - } - -} diff --git a/trainbenchmark-tool-jena/src/main/java/hu/bme/mit/trainbenchmark/benchmark/jena/queries/JenaQuery.java b/trainbenchmark-tool-jena/src/main/java/hu/bme/mit/trainbenchmark/benchmark/jena/queries/JenaQuery.java deleted file mode 100644 index 8e1e40909..000000000 --- a/trainbenchmark-tool-jena/src/main/java/hu/bme/mit/trainbenchmark/benchmark/jena/queries/JenaQuery.java +++ /dev/null @@ -1,64 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2010-2015, Benedek Izso, Gabor Szarnyas, Istvan Rath and Daniel Varro - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Benedek Izso - initial API and implementation - * Gabor Szarnyas - initial API and implementation - *******************************************************************************/ -package hu.bme.mit.trainbenchmark.benchmark.jena.queries; - -import java.io.IOException; -import java.util.ArrayList; -import java.util.Collection; -import java.util.List; - -import org.apache.jena.query.Query; -import org.apache.jena.query.QueryExecution; -import org.apache.jena.query.QueryExecutionFactory; -import org.apache.jena.query.QueryFactory; -import org.apache.jena.query.QuerySolution; -import org.apache.jena.query.ResultSet; - -import hu.bme.mit.trainbenchmark.benchmark.jena.driver.JenaDriver; -import hu.bme.mit.trainbenchmark.benchmark.jena.matches.JenaMatch; -import hu.bme.mit.trainbenchmark.benchmark.rdf.queries.RdfModelQuery; -import hu.bme.mit.trainbenchmark.constants.RailwayQuery; - -public class JenaQuery<TPatternMatch extends JenaMatch> extends RdfModelQuery<TPatternMatch, JenaDriver> { - - protected Query jenaQuery; - - public JenaQuery(final JenaDriver driver, final String workspaceDir, final RailwayQuery query) - throws IOException { - super(driver, workspaceDir, query); - this.jenaQuery = QueryFactory.read(queryPath); - } - - public static <TPatternMatch extends JenaMatch> JenaQuery<TPatternMatch> create(final JenaDriver driver, final String workspaceDir, final RailwayQuery query) - throws IOException { - return new JenaQuery<TPatternMatch>(driver, workspaceDir, query); - } - - @SuppressWarnings("unchecked") - @Override - public Collection<TPatternMatch> evaluate() throws IOException { - final List<TPatternMatch> matches = new ArrayList<>(); - - try (QueryExecution queryExecution = QueryExecutionFactory.create(jenaQuery, driver.getModel())) { - final ResultSet resultSet = queryExecution.execSelect(); - - while (resultSet.hasNext()) { - final QuerySolution qs = resultSet.next(); - final JenaMatch match = JenaMatch.createMatch(query, qs); - matches.add((TPatternMatch) match); - } - } - - return matches; - } - -} diff --git a/trainbenchmark-tool-jena/src/main/java/hu/bme/mit/trainbenchmark/benchmark/jena/transformations/JenaTransformation.java b/trainbenchmark-tool-jena/src/main/java/hu/bme/mit/trainbenchmark/benchmark/jena/transformations/JenaTransformation.java deleted file mode 100644 index 5d6121a35..000000000 --- a/trainbenchmark-tool-jena/src/main/java/hu/bme/mit/trainbenchmark/benchmark/jena/transformations/JenaTransformation.java +++ /dev/null @@ -1,23 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2010-2015, Benedek Izso, Gabor Szarnyas, Istvan Rath and Daniel Varro - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Benedek Izso - initial API and implementation - * Gabor Szarnyas - initial API and implementation - *******************************************************************************/ -package hu.bme.mit.trainbenchmark.benchmark.jena.transformations; - -import hu.bme.mit.trainbenchmark.benchmark.jena.driver.JenaDriver; -import hu.bme.mit.trainbenchmark.benchmark.operations.ModelTransformation; - -public abstract class JenaTransformation<TObject> extends ModelTransformation<TObject, JenaDriver> { - - protected JenaTransformation(final JenaDriver driver) { - super(driver); - } - -} diff --git a/trainbenchmark-tool-jena/src/main/java/hu/bme/mit/trainbenchmark/benchmark/jena/transformations/inject/JenaTransformationInjectConnectedSegments.java b/trainbenchmark-tool-jena/src/main/java/hu/bme/mit/trainbenchmark/benchmark/jena/transformations/inject/JenaTransformationInjectConnectedSegments.java deleted file mode 100644 index 786d9dc18..000000000 --- a/trainbenchmark-tool-jena/src/main/java/hu/bme/mit/trainbenchmark/benchmark/jena/transformations/inject/JenaTransformationInjectConnectedSegments.java +++ /dev/null @@ -1,64 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2010-2015, Benedek Izso, Gabor Szarnyas, Istvan Rath and Daniel Varro - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Benedek Izso - initial API and implementation - * Gabor Szarnyas - initial API and implementation - *******************************************************************************/ -package hu.bme.mit.trainbenchmark.benchmark.jena.transformations.inject; - -import static hu.bme.mit.trainbenchmark.rdf.RdfConstants.BASE_PREFIX; -import static hu.bme.mit.trainbenchmark.rdf.RdfConstants.ID_PREFIX; - -import java.util.Collection; - -import org.apache.jena.rdf.model.Model; -import org.apache.jena.rdf.model.Property; -import org.apache.jena.rdf.model.Resource; -import org.apache.jena.vocabulary.RDF; - -import hu.bme.mit.trainbenchmark.benchmark.jena.driver.JenaDriver; -import hu.bme.mit.trainbenchmark.benchmark.jena.matches.JenaConnectedSegmentsInjectMatch; -import hu.bme.mit.trainbenchmark.benchmark.jena.transformations.JenaTransformation; -import hu.bme.mit.trainbenchmark.constants.ModelConstants; -import hu.bme.mit.trainbenchmark.constants.TrainBenchmarkConstants; - -public class JenaTransformationInjectConnectedSegments extends JenaTransformation<JenaConnectedSegmentsInjectMatch> { - - public JenaTransformationInjectConnectedSegments(final JenaDriver driver) { - super(driver); - } - - @Override - public void activate(final Collection<JenaConnectedSegmentsInjectMatch> matches) throws Exception { - final Model model = driver.getModel(); - - final Property length = model.getProperty(BASE_PREFIX + ModelConstants.LENGTH); - final Property connectsTo = model.getProperty(BASE_PREFIX + ModelConstants.CONNECTS_TO); - final Property monitoredBy = model.getProperty(BASE_PREFIX + ModelConstants.MONITORED_BY); - final Property segmentType = model.getProperty(BASE_PREFIX + ModelConstants.SEGMENT); - - for (final JenaConnectedSegmentsInjectMatch csim : matches) { - // create (segment2) node - final Long newVertexId = driver.generateNewVertexId(); - final Resource segment2 = model.createResource(BASE_PREFIX + ID_PREFIX + newVertexId); - model.add(model.createStatement(segment2, RDF.type, segmentType)); - model.add(model.createLiteralStatement(segment2, length, TrainBenchmarkConstants.DEFAULT_SEGMENT_LENGTH)); - - // (segment1)-[:connectsTo]->(segment2) - model.add(csim.getSegment1(), connectsTo, segment2); - // (segment2)-[:connectsTo]->(segment3) - model.add(segment2, connectsTo, csim.getSegment3()); - // (segment2)-[:monitoredBy]->(sensor) - model.add(segment2, monitoredBy, csim.getSensor()); - - // remove (segment1)-[:connectsTo]->(segment3) - model.remove(csim.getSegment1(), connectsTo, csim.getSegment3()); - } - } - -} diff --git a/trainbenchmark-tool-jena/src/main/java/hu/bme/mit/trainbenchmark/benchmark/jena/transformations/inject/JenaTransformationInjectPosLength.java b/trainbenchmark-tool-jena/src/main/java/hu/bme/mit/trainbenchmark/benchmark/jena/transformations/inject/JenaTransformationInjectPosLength.java deleted file mode 100644 index 2f0d1968e..000000000 --- a/trainbenchmark-tool-jena/src/main/java/hu/bme/mit/trainbenchmark/benchmark/jena/transformations/inject/JenaTransformationInjectPosLength.java +++ /dev/null @@ -1,59 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2010-2015, Benedek Izso, Gabor Szarnyas, Istvan Rath and Daniel Varro - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Benedek Izso - initial API and implementation - * Gabor Szarnyas - initial API and implementation - *******************************************************************************/ -package hu.bme.mit.trainbenchmark.benchmark.jena.transformations.inject; - -import static hu.bme.mit.trainbenchmark.constants.ModelConstants.LENGTH; -import static hu.bme.mit.trainbenchmark.rdf.RdfConstants.BASE_PREFIX; - -import java.io.IOException; -import java.util.Collection; - -import org.apache.jena.rdf.model.Model; -import org.apache.jena.rdf.model.Property; -import org.apache.jena.rdf.model.RDFNode; -import org.apache.jena.rdf.model.Resource; -import org.apache.jena.rdf.model.Selector; -import org.apache.jena.rdf.model.SimpleSelector; -import org.apache.jena.rdf.model.Statement; -import org.apache.jena.rdf.model.StmtIterator; - -import hu.bme.mit.trainbenchmark.benchmark.jena.driver.JenaDriver; -import hu.bme.mit.trainbenchmark.benchmark.jena.matches.JenaPosLengthInjectMatch; -import hu.bme.mit.trainbenchmark.benchmark.jena.transformations.JenaTransformation; - -public class JenaTransformationInjectPosLength extends JenaTransformation<JenaPosLengthInjectMatch> { - - public JenaTransformationInjectPosLength(final JenaDriver driver) { - super(driver); - } - - @Override - public void activate(final Collection<JenaPosLengthInjectMatch> matches) throws IOException { - final Model model = driver.getModel(); - final Property lengthProperty = model.getProperty(BASE_PREFIX + LENGTH); - - for (final JenaPosLengthInjectMatch match : matches) { - final Resource segment = match.getSegment(); - final Selector selector = new SimpleSelector(segment, lengthProperty, (RDFNode) null); - final StmtIterator oldStatements = model.listStatements(selector); - if (!oldStatements.hasNext()) { - continue; - - } - final Statement oldStatement = oldStatements.next(); - model.remove(oldStatement); - final Statement newStatement = model.createLiteralStatement(segment, lengthProperty, 0); - model.add(newStatement); - } - } - -} diff --git a/trainbenchmark-tool-jena/src/main/java/hu/bme/mit/trainbenchmark/benchmark/jena/transformations/inject/JenaTransformationInjectRouteSensor.java b/trainbenchmark-tool-jena/src/main/java/hu/bme/mit/trainbenchmark/benchmark/jena/transformations/inject/JenaTransformationInjectRouteSensor.java deleted file mode 100644 index fbb3224f8..000000000 --- a/trainbenchmark-tool-jena/src/main/java/hu/bme/mit/trainbenchmark/benchmark/jena/transformations/inject/JenaTransformationInjectRouteSensor.java +++ /dev/null @@ -1,44 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2010-2015, Benedek Izso, Gabor Szarnyas, Istvan Rath and Daniel Varro - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Benedek Izso - initial API and implementation - * Gabor Szarnyas - initial API and implementation - *******************************************************************************/ -package hu.bme.mit.trainbenchmark.benchmark.jena.transformations.inject; - -import static hu.bme.mit.trainbenchmark.rdf.RdfConstants.BASE_PREFIX; - -import java.io.IOException; -import java.util.Collection; - -import org.apache.jena.rdf.model.Model; -import org.apache.jena.rdf.model.Property; - -import hu.bme.mit.trainbenchmark.benchmark.jena.driver.JenaDriver; -import hu.bme.mit.trainbenchmark.benchmark.jena.matches.JenaRouteSensorInjectMatch; -import hu.bme.mit.trainbenchmark.benchmark.jena.transformations.JenaTransformation; -import hu.bme.mit.trainbenchmark.constants.ModelConstants; - -public class JenaTransformationInjectRouteSensor extends JenaTransformation<JenaRouteSensorInjectMatch> { - - public JenaTransformationInjectRouteSensor(final JenaDriver driver) { - super(driver); - } - - @Override - public void activate(final Collection<JenaRouteSensorInjectMatch> routeSensorInjectMatchsMatches) throws IOException { - final Model model = driver.getModel(); - final Property requires = model.getProperty(BASE_PREFIX + ModelConstants.REQUIRES); - - for (final JenaRouteSensorInjectMatch rsim : routeSensorInjectMatchsMatches) { - model.remove(rsim.getRoute(), requires, rsim.getSensor()); - } - - } - -} diff --git a/trainbenchmark-tool-jena/src/main/java/hu/bme/mit/trainbenchmark/benchmark/jena/transformations/inject/JenaTransformationInjectSemaphoreNeighbor.java b/trainbenchmark-tool-jena/src/main/java/hu/bme/mit/trainbenchmark/benchmark/jena/transformations/inject/JenaTransformationInjectSemaphoreNeighbor.java deleted file mode 100644 index 813793704..000000000 --- a/trainbenchmark-tool-jena/src/main/java/hu/bme/mit/trainbenchmark/benchmark/jena/transformations/inject/JenaTransformationInjectSemaphoreNeighbor.java +++ /dev/null @@ -1,41 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2010-2015, Benedek Izso, Gabor Szarnyas, Istvan Rath and Daniel Varro - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Benedek Izso - initial API and implementation - * Gabor Szarnyas - initial API and implementation - *******************************************************************************/ -package hu.bme.mit.trainbenchmark.benchmark.jena.transformations.inject; - -import java.io.IOException; -import java.util.Collection; - -import org.apache.jena.rdf.model.Model; -import org.apache.jena.rdf.model.Property; - -import hu.bme.mit.trainbenchmark.benchmark.jena.driver.JenaDriver; -import hu.bme.mit.trainbenchmark.benchmark.jena.matches.JenaSemaphoreNeighborInjectMatch; -import hu.bme.mit.trainbenchmark.benchmark.jena.transformations.JenaTransformation; -import hu.bme.mit.trainbenchmark.constants.ModelConstants; -import hu.bme.mit.trainbenchmark.rdf.RdfConstants; - -public class JenaTransformationInjectSemaphoreNeighbor extends JenaTransformation<JenaSemaphoreNeighborInjectMatch> { - - public JenaTransformationInjectSemaphoreNeighbor(final JenaDriver driver) { - super(driver); - } - - @Override - public void activate(final Collection<JenaSemaphoreNeighborInjectMatch> matches) throws IOException { - final Model model = driver.getModel(); - final Property entry = model.getProperty(RdfConstants.BASE_PREFIX + ModelConstants.ENTRY); - for (JenaSemaphoreNeighborInjectMatch match : matches) { - model.remove(match.getRoute(), entry, match.getSemaphore()); - } - } - -} diff --git a/trainbenchmark-tool-jena/src/main/java/hu/bme/mit/trainbenchmark/benchmark/jena/transformations/inject/JenaTransformationInjectSwitchMonitored.java b/trainbenchmark-tool-jena/src/main/java/hu/bme/mit/trainbenchmark/benchmark/jena/transformations/inject/JenaTransformationInjectSwitchMonitored.java deleted file mode 100644 index 19b18fd27..000000000 --- a/trainbenchmark-tool-jena/src/main/java/hu/bme/mit/trainbenchmark/benchmark/jena/transformations/inject/JenaTransformationInjectSwitchMonitored.java +++ /dev/null @@ -1,39 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2010-2015, Benedek Izso, Gabor Szarnyas, Istvan Rath and Daniel Varro - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Benedek Izso - initial API and implementation - * Gabor Szarnyas - initial API and implementation - *******************************************************************************/ -package hu.bme.mit.trainbenchmark.benchmark.jena.transformations.inject; - -import static hu.bme.mit.trainbenchmark.constants.ModelConstants.MONITORED_BY; - -import java.io.IOException; -import java.util.Collection; -import java.util.List; -import java.util.stream.Collectors; - -import org.apache.jena.rdf.model.Resource; - -import hu.bme.mit.trainbenchmark.benchmark.jena.driver.JenaDriver; -import hu.bme.mit.trainbenchmark.benchmark.jena.matches.JenaSwitchMonitoredInjectMatch; -import hu.bme.mit.trainbenchmark.benchmark.jena.transformations.JenaTransformation; - -public class JenaTransformationInjectSwitchMonitored extends JenaTransformation<JenaSwitchMonitoredInjectMatch> { - - public JenaTransformationInjectSwitchMonitored(final JenaDriver jenaDriver) { - super(jenaDriver); - } - - @Override - public void activate(final Collection<JenaSwitchMonitoredInjectMatch> matches) throws IOException { - final List<Resource> switches = matches.stream().map(it -> it.getSw()).collect(Collectors.toList()); - driver.deleteOutgoingEdges(switches, MONITORED_BY); - } - -} diff --git a/trainbenchmark-tool-jena/src/main/java/hu/bme/mit/trainbenchmark/benchmark/jena/transformations/inject/JenaTransformationInjectSwitchSet.java b/trainbenchmark-tool-jena/src/main/java/hu/bme/mit/trainbenchmark/benchmark/jena/transformations/inject/JenaTransformationInjectSwitchSet.java deleted file mode 100644 index 5194de13c..000000000 --- a/trainbenchmark-tool-jena/src/main/java/hu/bme/mit/trainbenchmark/benchmark/jena/transformations/inject/JenaTransformationInjectSwitchSet.java +++ /dev/null @@ -1,75 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2010-2015, Benedek Izso, Gabor Szarnyas, Istvan Rath and Daniel Varro - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Benedek Izso - initial API and implementation - * Gabor Szarnyas - initial API and implementation - *******************************************************************************/ -package hu.bme.mit.trainbenchmark.benchmark.jena.transformations.inject; - -import static hu.bme.mit.trainbenchmark.constants.ModelConstants.CURRENTPOSITION; -import static hu.bme.mit.trainbenchmark.rdf.RdfConstants.BASE_PREFIX; - -import java.util.Collection; - -import org.apache.jena.rdf.model.Model; -import org.apache.jena.rdf.model.Property; -import org.apache.jena.rdf.model.RDFNode; -import org.apache.jena.rdf.model.Resource; -import org.apache.jena.rdf.model.Selector; -import org.apache.jena.rdf.model.SimpleSelector; -import org.apache.jena.rdf.model.Statement; -import org.apache.jena.rdf.model.StmtIterator; - -import hu.bme.mit.trainbenchmark.benchmark.jena.driver.JenaDriver; -import hu.bme.mit.trainbenchmark.benchmark.jena.matches.JenaSwitchSetInjectMatch; -import hu.bme.mit.trainbenchmark.benchmark.jena.transformations.JenaTransformation; -import hu.bme.mit.trainbenchmark.constants.Position; -import hu.bme.mit.trainbenchmark.rdf.RdfHelper; - -public class JenaTransformationInjectSwitchSet extends JenaTransformation<JenaSwitchSetInjectMatch> { - - public JenaTransformationInjectSwitchSet(final JenaDriver jenaDriver) { - super(jenaDriver); - } - - @Override - public void activate(final Collection<JenaSwitchSetInjectMatch> matches) { - final Model model = driver.getModel(); - final Property currentPositionProperty = model.getProperty(BASE_PREFIX + CURRENTPOSITION); - - for (final JenaSwitchSetInjectMatch match : matches) { - final Resource sw = match.getSw(); - - final Selector selector = new SimpleSelector(sw, currentPositionProperty, (RDFNode) null); - final StmtIterator statementsToRemove = model.listStatements(selector); - if (!statementsToRemove.hasNext()) { - continue; - - } - - // delete old statement - final Statement oldStatement = statementsToRemove.next(); - model.remove(oldStatement); - - // get next enum value - final Resource currentPositionResource = oldStatement.getObject().asResource(); - final String currentPositionRDFString = currentPositionResource.getLocalName(); - final String currentPositionString = RdfHelper.removePrefix(Position.class, currentPositionRDFString); - final Position currentPosition = Position.valueOf(currentPositionString); - final Position newCurrentPosition = Position.values()[(currentPosition.ordinal() + 1) % Position.values().length]; - final String newCurrentPositionString = RdfHelper.addEnumPrefix(newCurrentPosition); - final Resource newCurrentPositionResource = model.createResource(BASE_PREFIX + newCurrentPositionString); - - // set new value - final Statement newStatement = model.createLiteralStatement(sw, currentPositionProperty, newCurrentPositionResource); - model.add(newStatement); - - } - } - -} diff --git a/trainbenchmark-tool-jena/src/main/java/hu/bme/mit/trainbenchmark/benchmark/jena/transformations/repair/JenaTransformationRepairConnectedSegments.java b/trainbenchmark-tool-jena/src/main/java/hu/bme/mit/trainbenchmark/benchmark/jena/transformations/repair/JenaTransformationRepairConnectedSegments.java deleted file mode 100644 index 2666db64c..000000000 --- a/trainbenchmark-tool-jena/src/main/java/hu/bme/mit/trainbenchmark/benchmark/jena/transformations/repair/JenaTransformationRepairConnectedSegments.java +++ /dev/null @@ -1,70 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2010-2015, Benedek Izso, Gabor Szarnyas, Istvan Rath and Daniel Varro - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Benedek Izso - initial API and implementation - * Gabor Szarnyas - initial API and implementation - *******************************************************************************/ -package hu.bme.mit.trainbenchmark.benchmark.jena.transformations.repair; - -import static hu.bme.mit.trainbenchmark.rdf.RdfConstants.BASE_PREFIX; - -import java.io.IOException; -import java.util.ArrayList; -import java.util.Collection; - -import org.apache.jena.rdf.model.Model; -import org.apache.jena.rdf.model.Property; -import org.apache.jena.rdf.model.RDFNode; -import org.apache.jena.rdf.model.Resource; -import org.apache.jena.rdf.model.Selector; -import org.apache.jena.rdf.model.SimpleSelector; -import org.apache.jena.rdf.model.Statement; -import org.apache.jena.rdf.model.StmtIterator; - -import hu.bme.mit.trainbenchmark.benchmark.jena.driver.JenaDriver; -import hu.bme.mit.trainbenchmark.benchmark.jena.matches.JenaConnectedSegmentsMatch; -import hu.bme.mit.trainbenchmark.benchmark.jena.transformations.JenaTransformation; -import hu.bme.mit.trainbenchmark.constants.ModelConstants; - -public class JenaTransformationRepairConnectedSegments extends JenaTransformation<JenaConnectedSegmentsMatch> { - - public JenaTransformationRepairConnectedSegments(final JenaDriver driver) { - super(driver); - } - - @Override - public void activate(final Collection<JenaConnectedSegmentsMatch> matches) throws IOException { - final Model model = driver.getModel(); - final Property connectsToProperty = model.getProperty(BASE_PREFIX + ModelConstants.LENGTH); - - for (final JenaConnectedSegmentsMatch match : matches) { - final Resource segment2 = match.getSegment2(); - - // delete segment2 by removing all (segment2, _, _) and (_, _, segment2) triples - final Collection<Statement> statementsToRemove = new ArrayList<>(); - - final Selector selectorOutgoingEdges = new SimpleSelector(segment2, null, (RDFNode) null); - final StmtIterator statementsOutgoingEdges = model.listStatements(selectorOutgoingEdges); - while (statementsOutgoingEdges.hasNext()) { - statementsToRemove.add(statementsOutgoingEdges.next()); - } - final Selector selectorIncomingEdges = new SimpleSelector(null, null, segment2); - final StmtIterator statementsIncomingEdges = model.listStatements(selectorIncomingEdges); - while (statementsIncomingEdges.hasNext()) { - statementsToRemove.add(statementsIncomingEdges.next()); - } - for (final Statement statement : statementsToRemove) { - model.remove(statement); - } - - // insert (segment1)-[:connectsTo]->(segment3) edge - model.add(model.createStatement(match.getSegment1(), connectsToProperty, match.getSegment3())); - } - } - -} diff --git a/trainbenchmark-tool-jena/src/main/java/hu/bme/mit/trainbenchmark/benchmark/jena/transformations/repair/JenaTransformationRepairPosLength.java b/trainbenchmark-tool-jena/src/main/java/hu/bme/mit/trainbenchmark/benchmark/jena/transformations/repair/JenaTransformationRepairPosLength.java deleted file mode 100644 index 1a898f285..000000000 --- a/trainbenchmark-tool-jena/src/main/java/hu/bme/mit/trainbenchmark/benchmark/jena/transformations/repair/JenaTransformationRepairPosLength.java +++ /dev/null @@ -1,61 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2010-2015, Benedek Izso, Gabor Szarnyas, Istvan Rath and Daniel Varro - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Benedek Izso - initial API and implementation - * Gabor Szarnyas - initial API and implementation - *******************************************************************************/ -package hu.bme.mit.trainbenchmark.benchmark.jena.transformations.repair; - -import static hu.bme.mit.trainbenchmark.constants.ModelConstants.LENGTH; -import static hu.bme.mit.trainbenchmark.rdf.RdfConstants.BASE_PREFIX; - -import java.io.IOException; -import java.util.Collection; - -import org.apache.jena.rdf.model.Model; -import org.apache.jena.rdf.model.Property; -import org.apache.jena.rdf.model.RDFNode; -import org.apache.jena.rdf.model.Resource; -import org.apache.jena.rdf.model.Selector; -import org.apache.jena.rdf.model.SimpleSelector; -import org.apache.jena.rdf.model.Statement; -import org.apache.jena.rdf.model.StmtIterator; - -import hu.bme.mit.trainbenchmark.benchmark.jena.driver.JenaDriver; -import hu.bme.mit.trainbenchmark.benchmark.jena.matches.JenaPosLengthMatch; -import hu.bme.mit.trainbenchmark.benchmark.jena.transformations.JenaTransformation; - -public class JenaTransformationRepairPosLength extends JenaTransformation<JenaPosLengthMatch> { - - public JenaTransformationRepairPosLength(final JenaDriver driver) { - super(driver); - } - - @Override - public void activate(final Collection<JenaPosLengthMatch> matches) throws IOException { - final Model model = driver.getModel(); - final Property lengthProperty = model.getProperty(BASE_PREFIX + LENGTH); - - for (final JenaPosLengthMatch match : matches) { - final Resource segment = match.getSegment(); - final int length = match.getLength().getInt(); - final int newLength = -length + 1; - - final Selector selector = new SimpleSelector(segment, lengthProperty, (RDFNode) null); - final StmtIterator statementsToRemove = model.listStatements(selector); - if (statementsToRemove.hasNext()) { - final Statement oldStatement = statementsToRemove.next(); - model.remove(oldStatement); - } - - final Statement newStatement = model.createLiteralStatement(segment, lengthProperty, newLength); - model.add(newStatement); - } - } - -} diff --git a/trainbenchmark-tool-jena/src/main/java/hu/bme/mit/trainbenchmark/benchmark/jena/transformations/repair/JenaTransformationRepairRouteSensor.java b/trainbenchmark-tool-jena/src/main/java/hu/bme/mit/trainbenchmark/benchmark/jena/transformations/repair/JenaTransformationRepairRouteSensor.java deleted file mode 100644 index 46c4a84db..000000000 --- a/trainbenchmark-tool-jena/src/main/java/hu/bme/mit/trainbenchmark/benchmark/jena/transformations/repair/JenaTransformationRepairRouteSensor.java +++ /dev/null @@ -1,47 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2010-2015, Benedek Izso, Gabor Szarnyas, Istvan Rath and Daniel Varro - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Benedek Izso - initial API and implementation - * Gabor Szarnyas - initial API and implementation - *******************************************************************************/ -package hu.bme.mit.trainbenchmark.benchmark.jena.transformations.repair; - -import static hu.bme.mit.trainbenchmark.constants.ModelConstants.REQUIRES; -import static hu.bme.mit.trainbenchmark.rdf.RdfConstants.BASE_PREFIX; - -import java.io.IOException; -import java.util.Collection; - -import org.apache.jena.rdf.model.Model; -import org.apache.jena.rdf.model.Property; -import org.apache.jena.rdf.model.Resource; - -import hu.bme.mit.trainbenchmark.benchmark.jena.driver.JenaDriver; -import hu.bme.mit.trainbenchmark.benchmark.jena.matches.JenaRouteSensorMatch; -import hu.bme.mit.trainbenchmark.benchmark.jena.transformations.JenaTransformation; - -public class JenaTransformationRepairRouteSensor extends JenaTransformation<JenaRouteSensorMatch> { - - public JenaTransformationRepairRouteSensor(final JenaDriver driver) { - super(driver); - } - - @Override - public void activate(final Collection<JenaRouteSensorMatch> matches) throws IOException { - final Model model = driver.getModel(); - - final Property requires = model.getProperty(BASE_PREFIX + REQUIRES); - for (final JenaRouteSensorMatch match : matches) { - final Resource route = match.getRoute(); - final Resource sensor = match.getSensor(); - - model.add(model.createStatement(route, requires, sensor)); - } - } - -} diff --git a/trainbenchmark-tool-jena/src/main/java/hu/bme/mit/trainbenchmark/benchmark/jena/transformations/repair/JenaTransformationRepairSemaphoreNeighbor.java b/trainbenchmark-tool-jena/src/main/java/hu/bme/mit/trainbenchmark/benchmark/jena/transformations/repair/JenaTransformationRepairSemaphoreNeighbor.java deleted file mode 100644 index b3df02683..000000000 --- a/trainbenchmark-tool-jena/src/main/java/hu/bme/mit/trainbenchmark/benchmark/jena/transformations/repair/JenaTransformationRepairSemaphoreNeighbor.java +++ /dev/null @@ -1,47 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2010-2015, Benedek Izso, Gabor Szarnyas, Istvan Rath and Daniel Varro - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Benedek Izso - initial API and implementation - * Gabor Szarnyas - initial API and implementation - *******************************************************************************/ -package hu.bme.mit.trainbenchmark.benchmark.jena.transformations.repair; - -import static hu.bme.mit.trainbenchmark.constants.ModelConstants.ENTRY; -import static hu.bme.mit.trainbenchmark.rdf.RdfConstants.BASE_PREFIX; - -import java.io.IOException; -import java.util.Collection; - -import org.apache.jena.rdf.model.Model; -import org.apache.jena.rdf.model.Property; -import org.apache.jena.rdf.model.Resource; - -import hu.bme.mit.trainbenchmark.benchmark.jena.driver.JenaDriver; -import hu.bme.mit.trainbenchmark.benchmark.jena.matches.JenaSemaphoreNeighborMatch; -import hu.bme.mit.trainbenchmark.benchmark.jena.transformations.JenaTransformation; - -public class JenaTransformationRepairSemaphoreNeighbor extends JenaTransformation<JenaSemaphoreNeighborMatch> { - - public JenaTransformationRepairSemaphoreNeighbor(final JenaDriver driver) { - super(driver); - } - - @Override - public void activate(final Collection<JenaSemaphoreNeighborMatch> matches) throws IOException { - final Model model = driver.getModel(); - - final Property entry = model.getProperty(BASE_PREFIX + ENTRY); - for (final JenaSemaphoreNeighborMatch match : matches) { - final Resource route2 = match.getRoute2(); - final Resource semaphore = match.getSemaphore(); - - model.add(model.createStatement(route2, entry, semaphore)); - } - } - -} diff --git a/trainbenchmark-tool-jena/src/main/java/hu/bme/mit/trainbenchmark/benchmark/jena/transformations/repair/JenaTransformationRepairSwitchMonitored.java b/trainbenchmark-tool-jena/src/main/java/hu/bme/mit/trainbenchmark/benchmark/jena/transformations/repair/JenaTransformationRepairSwitchMonitored.java deleted file mode 100644 index d869a5f08..000000000 --- a/trainbenchmark-tool-jena/src/main/java/hu/bme/mit/trainbenchmark/benchmark/jena/transformations/repair/JenaTransformationRepairSwitchMonitored.java +++ /dev/null @@ -1,52 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2010-2015, Benedek Izso, Gabor Szarnyas, Istvan Rath and Daniel Varro - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Benedek Izso - initial API and implementation - * Gabor Szarnyas - initial API and implementation - *******************************************************************************/ -package hu.bme.mit.trainbenchmark.benchmark.jena.transformations.repair; - -import static hu.bme.mit.trainbenchmark.constants.ModelConstants.MONITORED_BY; -import static hu.bme.mit.trainbenchmark.constants.ModelConstants.SENSOR; -import static hu.bme.mit.trainbenchmark.rdf.RdfConstants.BASE_PREFIX; -import static hu.bme.mit.trainbenchmark.rdf.RdfConstants.ID_PREFIX; - -import java.util.Collection; - -import org.apache.jena.rdf.model.Model; -import org.apache.jena.rdf.model.Property; -import org.apache.jena.rdf.model.Resource; -import org.apache.jena.vocabulary.RDF; - -import hu.bme.mit.trainbenchmark.benchmark.jena.driver.JenaDriver; -import hu.bme.mit.trainbenchmark.benchmark.jena.matches.JenaSwitchMonitoredMatch; -import hu.bme.mit.trainbenchmark.benchmark.jena.transformations.JenaTransformation; - -public class JenaTransformationRepairSwitchMonitored extends JenaTransformation<JenaSwitchMonitoredMatch> { - - public JenaTransformationRepairSwitchMonitored(final JenaDriver driver) { - super(driver); - } - - @Override - public void activate(final Collection<JenaSwitchMonitoredMatch> matches) throws Exception { - final Model model = driver.getModel(); - final Property sensorEdge = model.getProperty(BASE_PREFIX + MONITORED_BY); - final Resource sensorType = model.getResource(BASE_PREFIX + SENSOR); - - for (final JenaSwitchMonitoredMatch match : matches) { - final Resource sw = match.getSw(); - final Long newVertexId = driver.generateNewVertexId(); - final Resource sensor = model.createResource(BASE_PREFIX + ID_PREFIX + newVertexId); - - model.add(model.createStatement(sw, sensorEdge, sensor)); - model.add(model.createStatement(sensor, RDF.type, sensorType)); - } - - } -} diff --git a/trainbenchmark-tool-jena/src/main/java/hu/bme/mit/trainbenchmark/benchmark/jena/transformations/repair/JenaTransformationRepairSwitchSet.java b/trainbenchmark-tool-jena/src/main/java/hu/bme/mit/trainbenchmark/benchmark/jena/transformations/repair/JenaTransformationRepairSwitchSet.java deleted file mode 100644 index fd43e82ac..000000000 --- a/trainbenchmark-tool-jena/src/main/java/hu/bme/mit/trainbenchmark/benchmark/jena/transformations/repair/JenaTransformationRepairSwitchSet.java +++ /dev/null @@ -1,47 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2010-2015, Benedek Izso, Gabor Szarnyas, Istvan Rath and Daniel Varro - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Benedek Izso - initial API and implementation - * Gabor Szarnyas - initial API and implementation - *******************************************************************************/ -package hu.bme.mit.trainbenchmark.benchmark.jena.transformations.repair; - -import static hu.bme.mit.trainbenchmark.constants.ModelConstants.CURRENTPOSITION; -import static hu.bme.mit.trainbenchmark.rdf.RdfConstants.BASE_PREFIX; - -import java.io.IOException; -import java.util.Collection; - -import org.apache.jena.rdf.model.Model; -import org.apache.jena.rdf.model.Property; -import org.apache.jena.rdf.model.Resource; - -import hu.bme.mit.trainbenchmark.benchmark.jena.driver.JenaDriver; -import hu.bme.mit.trainbenchmark.benchmark.jena.matches.JenaSwitchSetMatch; -import hu.bme.mit.trainbenchmark.benchmark.jena.transformations.JenaTransformation; - -public class JenaTransformationRepairSwitchSet extends JenaTransformation<JenaSwitchSetMatch> { - - public JenaTransformationRepairSwitchSet(final JenaDriver driver) { - super(driver); - } - - @Override - public void activate(final Collection<JenaSwitchSetMatch> matches) throws IOException { - final Model model = driver.getModel(); - final Property currentPositionProperty = model.getProperty(BASE_PREFIX + CURRENTPOSITION); - - for (final JenaSwitchSetMatch match : matches) { - final Resource sw = match.getSw(); - - model.remove(sw, currentPositionProperty, match.getCurrentPosition()); - model.add(sw, currentPositionProperty, match.getPosition()); - } - } - -} diff --git a/trainbenchmark-tool-jena/src/main/resources/log4j.properties b/trainbenchmark-tool-jena/src/main/resources/log4j.properties deleted file mode 100644 index df642e511..000000000 --- a/trainbenchmark-tool-jena/src/main/resources/log4j.properties +++ /dev/null @@ -1,13 +0,0 @@ -############################################################################### -# Copyright (c) 2010-2015, Benedek Izso, Gabor Szarnyas, Istvan Rath and Daniel Varro -# All rights reserved. This program and the accompanying materials -# are made available under the terms of the Eclipse Public License v1.0 -# which accompanies this distribution, and is available at -# http://www.eclipse.org/legal/epl-v10.html -# -# Contributors: -# Benedek Izso - initial API and implementation -# Gabor Szarnyas - initial API and implementation -############################################################################### - log4j.rootLogger=OFF - \ No newline at end of file diff --git a/trainbenchmark-tool-jena/src/test/java/hu/bme/mit/trainbenchmark/benchmark/jena/test/JenaTest.java b/trainbenchmark-tool-jena/src/test/java/hu/bme/mit/trainbenchmark/benchmark/jena/test/JenaTest.java deleted file mode 100644 index b87ae04b6..000000000 --- a/trainbenchmark-tool-jena/src/test/java/hu/bme/mit/trainbenchmark/benchmark/jena/test/JenaTest.java +++ /dev/null @@ -1,36 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2010-2015, Benedek Izso, Gabor Szarnyas, Istvan Rath and Daniel Varro - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Benedek Izso - initial API and implementation - * Gabor Szarnyas - initial API and implementation - *******************************************************************************/ - -package hu.bme.mit.trainbenchmark.benchmark.jena.test; - -import org.junit.runner.RunWith; -import org.junit.runners.Parameterized; - -import hu.bme.mit.trainbenchmark.benchmark.config.BenchmarkConfigBase; -import hu.bme.mit.trainbenchmark.benchmark.jena.JenaBenchmarkScenario; -import hu.bme.mit.trainbenchmark.benchmark.jena.config.JenaBenchmarkConfig; -import hu.bme.mit.trainbenchmark.benchmark.jena.config.JenaBenchmarkConfigBuilder; -import hu.bme.mit.trainbenchmark.benchmark.rdf.tests.RdfTest; -import hu.bme.mit.trainbenchmark.benchmark.runcomponents.BenchmarkResult; - -@RunWith(Parameterized.class) -public class JenaTest extends RdfTest { - - @Override - protected BenchmarkResult runTest(final BenchmarkConfigBase bcb) throws Exception { - final JenaBenchmarkConfig bc = new JenaBenchmarkConfigBuilder().setConfigBase(bcb).setInferencing(inferencing).createConfig(); - final JenaBenchmarkScenario scenario = new JenaBenchmarkScenario(bc); - final BenchmarkResult result = scenario.performBenchmark(); - return result; - } - -} diff --git a/trainbenchmark-tool-kiama/build.gradle b/trainbenchmark-tool-kiama/build.gradle deleted file mode 100644 index 3f30b0d5e..000000000 --- a/trainbenchmark-tool-kiama/build.gradle +++ /dev/null @@ -1,32 +0,0 @@ -plugins { id "com.github.johnrengelman.shadow" version "1.2.3" } - -shadowJar { - classifier = 'fat' - manifest { attributes('Main-Class': 'de.tudresden.inf.st.train.kiama.KiamaBenchmarkMain')} -} - - -task kiama(type: JavaExec) { - main = "-jar" -} - -sourceSets { - main { - java { - srcDir 'src/main/java' - } - } -} - -repositories { - mavenCentral() -} - -dependencies { - runtime files('../trainbenchmark-tool-kiama/libs/kiamatrain.jar') - compile files('../trainbenchmark-tool-kiama/libs/kiamatrain.jar') - compile project(':trainbenchmark-tool') - compile 'org.scala-lang:scala-library:2.12.3' - compile 'org.bitbucket.inkytonik.kiama:kiama_2.12:2.1.0' - compile group: 'com.fasterxml.jackson.core', name: 'jackson-databind', version: '2.8.8.1' -} diff --git a/trainbenchmark-tool-kiama/kiamatrain-src/build.sbt b/trainbenchmark-tool-kiama/kiamatrain-src/build.sbt deleted file mode 100644 index f6f947fdd..000000000 --- a/trainbenchmark-tool-kiama/kiamatrain-src/build.sbt +++ /dev/null @@ -1,30 +0,0 @@ -val scalatestVersion = "3.0.1" -val kiamaVersion = "2.1.0" - -lazy val commonSettings = Seq( - scalaVersion := "2.12.3", - version := "1.0", - mainClass := None, - libraryDependencies ++= Seq( - "org.bitbucket.inkytonik.kiama" %% "kiama" % kiamaVersion, - "org.scalatest" %% "scalatest" % scalatestVersion % "test" - ), - javacOptions in Compile ++= Seq("-source", "1.8", "-target", "1.8"), - scalacOptions ++= Seq( - "-deprecation", - "-feature", - "-target:jvm-1.8", - "-Xfatal-warnings", - "-Xlint", - "-Xlint:-missing-interpolator", - "-Yno-adapted-args", - "-Ywarn-numeric-widen", - "-Ywarn-value-discard", - "-Xfuture") -) - -lazy val root = (project in file(".")). - settings(commonSettings: _*). - settings( - name := "KiamaTrain" - ) diff --git a/trainbenchmark-tool-kiama/kiamatrain-src/project/build.properties b/trainbenchmark-tool-kiama/kiamatrain-src/project/build.properties deleted file mode 100644 index 94005e587..000000000 --- a/trainbenchmark-tool-kiama/kiamatrain-src/project/build.properties +++ /dev/null @@ -1 +0,0 @@ -sbt.version=1.0.0 diff --git a/trainbenchmark-tool-kiama/kiamatrain-src/src/main/java/de/tudresden/inf/st/train/kiama/enums/Position.java b/trainbenchmark-tool-kiama/kiamatrain-src/src/main/java/de/tudresden/inf/st/train/kiama/enums/Position.java deleted file mode 100644 index 916edfbb4..000000000 --- a/trainbenchmark-tool-kiama/kiamatrain-src/src/main/java/de/tudresden/inf/st/train/kiama/enums/Position.java +++ /dev/null @@ -1,5 +0,0 @@ -package de.tudresden.inf.st.train.kiama.enums; - -public enum Position { - FAILURE, STRAIGHT, DIVERGING -} diff --git a/trainbenchmark-tool-kiama/kiamatrain-src/src/main/java/de/tudresden/inf/st/train/kiama/enums/Signal.java b/trainbenchmark-tool-kiama/kiamatrain-src/src/main/java/de/tudresden/inf/st/train/kiama/enums/Signal.java deleted file mode 100644 index 547dab782..000000000 --- a/trainbenchmark-tool-kiama/kiamatrain-src/src/main/java/de/tudresden/inf/st/train/kiama/enums/Signal.java +++ /dev/null @@ -1,5 +0,0 @@ -package de.tudresden.inf.st.train.kiama.enums; - -public enum Signal { - FAILURE, STOP, GO -} \ No newline at end of file diff --git a/trainbenchmark-tool-kiama/kiamatrain-src/src/main/java/de/tudresden/inf/st/train/kiama/matches/KiamaInternalConnectedSegmentsInjectMatch.java b/trainbenchmark-tool-kiama/kiamatrain-src/src/main/java/de/tudresden/inf/st/train/kiama/matches/KiamaInternalConnectedSegmentsInjectMatch.java deleted file mode 100644 index 59312e757..000000000 --- a/trainbenchmark-tool-kiama/kiamatrain-src/src/main/java/de/tudresden/inf/st/train/kiama/matches/KiamaInternalConnectedSegmentsInjectMatch.java +++ /dev/null @@ -1,31 +0,0 @@ -package de.tudresden.inf.st.train.kiama.matches; - -import de.tudresden.inf.st.train.kiama.ast.Segment; -import de.tudresden.inf.st.train.kiama.ast.Sensor; - -public class KiamaInternalConnectedSegmentsInjectMatch { - - protected final Sensor sensor; - protected final Segment segment1; - protected final Segment segment3; - - public KiamaInternalConnectedSegmentsInjectMatch(final Sensor sensor, final Segment segment1, final Segment segment3) { - super(); - this.sensor = sensor; - this.segment1 = segment1; - this.segment3 = segment3; - } - - public Sensor getSensor() { - return sensor; - } - - public Segment getSegment1() { - return segment1; - } - - public Segment getSegment3() { - return segment3; - } - -} diff --git a/trainbenchmark-tool-kiama/kiamatrain-src/src/main/java/de/tudresden/inf/st/train/kiama/matches/KiamaInternalConnectedSegmentsMatch.java b/trainbenchmark-tool-kiama/kiamatrain-src/src/main/java/de/tudresden/inf/st/train/kiama/matches/KiamaInternalConnectedSegmentsMatch.java deleted file mode 100644 index 22d6439d1..000000000 --- a/trainbenchmark-tool-kiama/kiamatrain-src/src/main/java/de/tudresden/inf/st/train/kiama/matches/KiamaInternalConnectedSegmentsMatch.java +++ /dev/null @@ -1,56 +0,0 @@ -package de.tudresden.inf.st.train.kiama.matches; - -import de.tudresden.inf.st.train.kiama.ast.Segment; -import de.tudresden.inf.st.train.kiama.ast.Sensor; - -public class KiamaInternalConnectedSegmentsMatch { - - protected final Sensor sensor; - protected final Segment segment1; - protected final Segment segment2; - protected final Segment segment3; - protected final Segment segment4; - protected final Segment segment5; - protected final Segment segment6; - - public KiamaInternalConnectedSegmentsMatch(final Sensor sensor, final Segment segment1, final Segment segment2, - final Segment segment3, final Segment segment4, final Segment segment5, final Segment segment6) { - super(); - this.sensor = sensor; - this.segment1 = segment1; - this.segment2 = segment2; - this.segment3 = segment3; - this.segment4 = segment4; - this.segment5 = segment5; - this.segment6 = segment6; - } - - public Sensor getSensor() { - return sensor; - } - - public Segment getSegment1() { - return segment1; - } - - public Segment getSegment2() { - return segment2; - } - - public Segment getSegment3() { - return segment3; - } - - public Segment getSegment4() { - return segment4; - } - - public Segment getSegment5() { - return segment5; - } - - public Segment getSegment6() { - return segment6; - } - -} diff --git a/trainbenchmark-tool-kiama/kiamatrain-src/src/main/java/de/tudresden/inf/st/train/kiama/matches/KiamaInternalPosLengthInjectMatch.java b/trainbenchmark-tool-kiama/kiamatrain-src/src/main/java/de/tudresden/inf/st/train/kiama/matches/KiamaInternalPosLengthInjectMatch.java deleted file mode 100644 index 5c7111f05..000000000 --- a/trainbenchmark-tool-kiama/kiamatrain-src/src/main/java/de/tudresden/inf/st/train/kiama/matches/KiamaInternalPosLengthInjectMatch.java +++ /dev/null @@ -1,17 +0,0 @@ -package de.tudresden.inf.st.train.kiama.matches; - -import de.tudresden.inf.st.train.kiama.ast.Segment; - -public class KiamaInternalPosLengthInjectMatch { - - protected final Segment segment; - - public KiamaInternalPosLengthInjectMatch(final Segment segment) { - super(); - this.segment = segment; - } - - public Segment getSegment() { - return segment; - } -} diff --git a/trainbenchmark-tool-kiama/kiamatrain-src/src/main/java/de/tudresden/inf/st/train/kiama/matches/KiamaInternalPosLengthMatch.java b/trainbenchmark-tool-kiama/kiamatrain-src/src/main/java/de/tudresden/inf/st/train/kiama/matches/KiamaInternalPosLengthMatch.java deleted file mode 100644 index f68d5e5ce..000000000 --- a/trainbenchmark-tool-kiama/kiamatrain-src/src/main/java/de/tudresden/inf/st/train/kiama/matches/KiamaInternalPosLengthMatch.java +++ /dev/null @@ -1,24 +0,0 @@ -package de.tudresden.inf.st.train.kiama.matches; - -import de.tudresden.inf.st.train.kiama.ast.Segment; - -public class KiamaInternalPosLengthMatch { - - protected final Segment segment; - protected final int length; - - public KiamaInternalPosLengthMatch(final Segment segment, final int length) { - super(); - this.segment = segment; - this.length = length; - } - - public Segment getSegment() { - return segment; - } - - public int getLength() { - return length; - } - -} diff --git a/trainbenchmark-tool-kiama/kiamatrain-src/src/main/java/de/tudresden/inf/st/train/kiama/matches/KiamaInternalRouteSensorInjectMatch.java b/trainbenchmark-tool-kiama/kiamatrain-src/src/main/java/de/tudresden/inf/st/train/kiama/matches/KiamaInternalRouteSensorInjectMatch.java deleted file mode 100644 index 893328958..000000000 --- a/trainbenchmark-tool-kiama/kiamatrain-src/src/main/java/de/tudresden/inf/st/train/kiama/matches/KiamaInternalRouteSensorInjectMatch.java +++ /dev/null @@ -1,25 +0,0 @@ -package de.tudresden.inf.st.train.kiama.matches; - -import de.tudresden.inf.st.train.kiama.ast.Route; -import de.tudresden.inf.st.train.kiama.ast.Sensor; - -public class KiamaInternalRouteSensorInjectMatch { - - protected final Route route; - protected final Sensor sensor; - - public KiamaInternalRouteSensorInjectMatch(final Route route, final Sensor sensor) { - super(); - this.route = route; - this.sensor = sensor; - } - - public Route getRoute() { - return route; - } - - public Sensor getSensor() { - return sensor; - } - -} diff --git a/trainbenchmark-tool-kiama/kiamatrain-src/src/main/java/de/tudresden/inf/st/train/kiama/matches/KiamaInternalRouteSensorMatch.java b/trainbenchmark-tool-kiama/kiamatrain-src/src/main/java/de/tudresden/inf/st/train/kiama/matches/KiamaInternalRouteSensorMatch.java deleted file mode 100644 index 3991ea058..000000000 --- a/trainbenchmark-tool-kiama/kiamatrain-src/src/main/java/de/tudresden/inf/st/train/kiama/matches/KiamaInternalRouteSensorMatch.java +++ /dev/null @@ -1,39 +0,0 @@ -package de.tudresden.inf.st.train.kiama.matches; - -import de.tudresden.inf.st.train.kiama.ast.Route; -import de.tudresden.inf.st.train.kiama.ast.Sensor; -import de.tudresden.inf.st.train.kiama.ast.Switch; -import de.tudresden.inf.st.train.kiama.ast.SwitchPosition; - -public class KiamaInternalRouteSensorMatch { - - protected final Route route; - protected final Sensor sensor; - protected final SwitchPosition swP; - protected final Switch sw; - - public KiamaInternalRouteSensorMatch(final Route route, final Sensor sensor, final SwitchPosition swP, final Switch sw) { - super(); - this.route = route; - this.sensor = sensor; - this.swP = swP; - this.sw = sw; - } - - public Route getRoute() { - return route; - } - - public Sensor getSensor() { - return sensor; - } - - public SwitchPosition getSwP() { - return swP; - } - - public Switch getSw() { - return sw; - } - -} diff --git a/trainbenchmark-tool-kiama/kiamatrain-src/src/main/java/de/tudresden/inf/st/train/kiama/matches/KiamaInternalSemaphoreNeighborInjectMatch.java b/trainbenchmark-tool-kiama/kiamatrain-src/src/main/java/de/tudresden/inf/st/train/kiama/matches/KiamaInternalSemaphoreNeighborInjectMatch.java deleted file mode 100644 index f088255cf..000000000 --- a/trainbenchmark-tool-kiama/kiamatrain-src/src/main/java/de/tudresden/inf/st/train/kiama/matches/KiamaInternalSemaphoreNeighborInjectMatch.java +++ /dev/null @@ -1,25 +0,0 @@ -package de.tudresden.inf.st.train.kiama.matches; - -import de.tudresden.inf.st.train.kiama.ast.Route; -import de.tudresden.inf.st.train.kiama.ast.Semaphore; - -public class KiamaInternalSemaphoreNeighborInjectMatch { - - protected final Route route; - protected final Semaphore semaphore; - - public KiamaInternalSemaphoreNeighborInjectMatch(final Route route, final Semaphore semaphore) { - super(); - this.route = route; - this.semaphore = semaphore; - } - - public Route getRoute() { - return route; - } - - public Semaphore getSemaphore() { - return semaphore; - } - -} diff --git a/trainbenchmark-tool-kiama/kiamatrain-src/src/main/java/de/tudresden/inf/st/train/kiama/matches/KiamaInternalSemaphoreNeighborMatch.java b/trainbenchmark-tool-kiama/kiamatrain-src/src/main/java/de/tudresden/inf/st/train/kiama/matches/KiamaInternalSemaphoreNeighborMatch.java deleted file mode 100644 index 621673f84..000000000 --- a/trainbenchmark-tool-kiama/kiamatrain-src/src/main/java/de/tudresden/inf/st/train/kiama/matches/KiamaInternalSemaphoreNeighborMatch.java +++ /dev/null @@ -1,58 +0,0 @@ -package de.tudresden.inf.st.train.kiama.matches; - -import de.tudresden.inf.st.train.kiama.ast.Route; -import de.tudresden.inf.st.train.kiama.ast.Semaphore; -import de.tudresden.inf.st.train.kiama.ast.Sensor; -import de.tudresden.inf.st.train.kiama.ast.TrackElement; - -public class KiamaInternalSemaphoreNeighborMatch { - - protected final Semaphore semaphore; - protected final Route route1; - protected final Route route2; - protected final Sensor sensor1; - protected final Sensor sensor2; - protected final TrackElement te1; - protected final TrackElement te2; - - public KiamaInternalSemaphoreNeighborMatch(final Semaphore semaphore, final Route route1, final Route route2, final Sensor sensor1, final Sensor sensor2, - final TrackElement te1, final TrackElement te2) { - super(); - this.semaphore = semaphore; - this.route1 = route1; - this.route2 = route2; - this.sensor1 = sensor1; - this.sensor2 = sensor2; - this.te1 = te1; - this.te2 = te2; - } - - public Semaphore getSemaphore() { - return semaphore; - } - - public Route getRoute1() { - return route1; - } - - public Route getRoute2() { - return route2; - } - - public Sensor getSensor1() { - return sensor1; - } - - public Sensor getSensor2() { - return sensor2; - } - - public TrackElement getTe1() { - return te1; - } - - public TrackElement getTe2() { - return te2; - } - -} diff --git a/trainbenchmark-tool-kiama/kiamatrain-src/src/main/java/de/tudresden/inf/st/train/kiama/matches/KiamaInternalSwitchSetInjectMatch.java b/trainbenchmark-tool-kiama/kiamatrain-src/src/main/java/de/tudresden/inf/st/train/kiama/matches/KiamaInternalSwitchSetInjectMatch.java deleted file mode 100644 index ccedaa5ee..000000000 --- a/trainbenchmark-tool-kiama/kiamatrain-src/src/main/java/de/tudresden/inf/st/train/kiama/matches/KiamaInternalSwitchSetInjectMatch.java +++ /dev/null @@ -1,18 +0,0 @@ -package de.tudresden.inf.st.train.kiama.matches; - -import de.tudresden.inf.st.train.kiama.ast.Switch; - -public class KiamaInternalSwitchSetInjectMatch { - - protected final Switch sw; - - public KiamaInternalSwitchSetInjectMatch(final Switch sw) { - super(); - this.sw = sw; - } - - public Switch getSw() { - return sw; - } - -} diff --git a/trainbenchmark-tool-kiama/kiamatrain-src/src/main/java/de/tudresden/inf/st/train/kiama/matches/KiamaInternalSwitchSetMatch.java b/trainbenchmark-tool-kiama/kiamatrain-src/src/main/java/de/tudresden/inf/st/train/kiama/matches/KiamaInternalSwitchSetMatch.java deleted file mode 100644 index bb7d8b03c..000000000 --- a/trainbenchmark-tool-kiama/kiamatrain-src/src/main/java/de/tudresden/inf/st/train/kiama/matches/KiamaInternalSwitchSetMatch.java +++ /dev/null @@ -1,53 +0,0 @@ -package de.tudresden.inf.st.train.kiama.matches; - -import de.tudresden.inf.st.train.kiama.ast.Semaphore; -import de.tudresden.inf.st.train.kiama.ast.Route; -import de.tudresden.inf.st.train.kiama.ast.Switch; -import de.tudresden.inf.st.train.kiama.ast.SwitchPosition; -import de.tudresden.inf.st.train.kiama.enums.Position; - -public class KiamaInternalSwitchSetMatch { - - protected final Semaphore semaphore; - protected final Route route; - protected final SwitchPosition swP; - protected final Switch sw; - protected final Position position; - protected final Position currentPosition; - - public KiamaInternalSwitchSetMatch(final Semaphore semaphore, final Route route, final SwitchPosition swP, final Switch sw, final Position position, - final Position currentPosition) { - super(); - this.semaphore = semaphore; - this.route = route; - this.swP = swP; - this.sw = sw; - this.position = position; - this.currentPosition = currentPosition; - } - - public Semaphore getSemaphore() { - return semaphore; - } - - public Route getRoute() { - return route; - } - - public SwitchPosition getSwP() { - return swP; - } - - public Switch getSw() { - return sw; - } - - public Position getPosition() { - return position; - } - - public Position getCurrentPosition() { - return currentPosition; - } - -} diff --git a/trainbenchmark-tool-kiama/kiamatrain-src/src/main/scala/de/tudresden/inf/st/train/kiama/ast/Id.scala b/trainbenchmark-tool-kiama/kiamatrain-src/src/main/scala/de/tudresden/inf/st/train/kiama/ast/Id.scala deleted file mode 100644 index dcba3c209..000000000 --- a/trainbenchmark-tool-kiama/kiamatrain-src/src/main/scala/de/tudresden/inf/st/train/kiama/ast/Id.scala +++ /dev/null @@ -1,12 +0,0 @@ -package de.tudresden.inf.st.train.kiama.ast - -case class Id() extends KiamaTrainTreeNode { - var Value: Integer = 0 - - override def equals(o: Any) = o match { - case other: Id => other.Value.equals(this.Value) - case _ => false - } - - override def hashCode() = this.Value.hashCode() -} \ No newline at end of file diff --git a/trainbenchmark-tool-kiama/kiamatrain-src/src/main/scala/de/tudresden/inf/st/train/kiama/ast/KiamaTrainTreeNode.scala b/trainbenchmark-tool-kiama/kiamatrain-src/src/main/scala/de/tudresden/inf/st/train/kiama/ast/KiamaTrainTreeNode.scala deleted file mode 100644 index 1a9b94e11..000000000 --- a/trainbenchmark-tool-kiama/kiamatrain-src/src/main/scala/de/tudresden/inf/st/train/kiama/ast/KiamaTrainTreeNode.scala +++ /dev/null @@ -1,3 +0,0 @@ -package de.tudresden.inf.st.train.kiama.ast - -abstract class KiamaTrainTreeNode extends Product \ No newline at end of file diff --git a/trainbenchmark-tool-kiama/kiamatrain-src/src/main/scala/de/tudresden/inf/st/train/kiama/ast/RailwayContainer.scala b/trainbenchmark-tool-kiama/kiamatrain-src/src/main/scala/de/tudresden/inf/st/train/kiama/ast/RailwayContainer.scala deleted file mode 100644 index 06f3dc88c..000000000 --- a/trainbenchmark-tool-kiama/kiamatrain-src/src/main/scala/de/tudresden/inf/st/train/kiama/ast/RailwayContainer.scala +++ /dev/null @@ -1,6 +0,0 @@ -package de.tudresden.inf.st.train.kiama.ast - -case class RailwayContainer() extends KiamaTrainTreeNode { - var Route: java.util.ArrayList[Route] = new java.util.ArrayList[Route]() - var Region: java.util.ArrayList[Region] = new java.util.ArrayList[Region]() -} diff --git a/trainbenchmark-tool-kiama/kiamatrain-src/src/main/scala/de/tudresden/inf/st/train/kiama/ast/RailwayElement.scala b/trainbenchmark-tool-kiama/kiamatrain-src/src/main/scala/de/tudresden/inf/st/train/kiama/ast/RailwayElement.scala deleted file mode 100644 index c11071fbb..000000000 --- a/trainbenchmark-tool-kiama/kiamatrain-src/src/main/scala/de/tudresden/inf/st/train/kiama/ast/RailwayElement.scala +++ /dev/null @@ -1,12 +0,0 @@ -package de.tudresden.inf.st.train.kiama.ast - -abstract class RailwayElement extends KiamaTrainTreeNode { - var Id: Id = new Id() - - override def equals(obj: scala.Any): Boolean = obj match { - case e: RailwayElement => e.Id.Value.equals(this.Id.Value) - case _ => false - } - - override def hashCode() = this.Id.Value.hashCode() -} diff --git a/trainbenchmark-tool-kiama/kiamatrain-src/src/main/scala/de/tudresden/inf/st/train/kiama/ast/Ref.scala b/trainbenchmark-tool-kiama/kiamatrain-src/src/main/scala/de/tudresden/inf/st/train/kiama/ast/Ref.scala deleted file mode 100644 index a19739acf..000000000 --- a/trainbenchmark-tool-kiama/kiamatrain-src/src/main/scala/de/tudresden/inf/st/train/kiama/ast/Ref.scala +++ /dev/null @@ -1,12 +0,0 @@ -package de.tudresden.inf.st.train.kiama.ast - -case class Ref() extends KiamaTrainTreeNode { - var Value: Integer = 0 - - override def equals(other: Any): Boolean = other match { - case r: Ref => r.Value.equals(this.Value) - case _ => false - } - - override def hashCode() = this.Value.hashCode() -} \ No newline at end of file diff --git a/trainbenchmark-tool-kiama/kiamatrain-src/src/main/scala/de/tudresden/inf/st/train/kiama/ast/Region.scala b/trainbenchmark-tool-kiama/kiamatrain-src/src/main/scala/de/tudresden/inf/st/train/kiama/ast/Region.scala deleted file mode 100644 index a06143f2b..000000000 --- a/trainbenchmark-tool-kiama/kiamatrain-src/src/main/scala/de/tudresden/inf/st/train/kiama/ast/Region.scala +++ /dev/null @@ -1,6 +0,0 @@ -package de.tudresden.inf.st.train.kiama.ast - -case class Region() extends RailwayElement { - var TrackElement: java.util.ArrayList[TrackElement] = new java.util.ArrayList[TrackElement]() - var Sensor: java.util.ArrayList[Sensor] = new java.util.ArrayList[Sensor]() -} \ No newline at end of file diff --git a/trainbenchmark-tool-kiama/kiamatrain-src/src/main/scala/de/tudresden/inf/st/train/kiama/ast/Route.scala b/trainbenchmark-tool-kiama/kiamatrain-src/src/main/scala/de/tudresden/inf/st/train/kiama/ast/Route.scala deleted file mode 100644 index 16a01e135..000000000 --- a/trainbenchmark-tool-kiama/kiamatrain-src/src/main/scala/de/tudresden/inf/st/train/kiama/ast/Route.scala +++ /dev/null @@ -1,9 +0,0 @@ -package de.tudresden.inf.st.train.kiama.ast - -case class Route() extends RailwayElement { - var Active: Boolean = true - var SwitchPosition: java.util.ArrayList[SwitchPosition] = new java.util.ArrayList[SwitchPosition]() - var RequiredSensor: java.util.ArrayList[Ref] = new java.util.ArrayList[Ref]() - var Entry: java.util.ArrayList[Ref] = new java.util.ArrayList[Ref]() - var Exit: java.util.ArrayList[Ref] = new java.util.ArrayList[Ref]() -} \ No newline at end of file diff --git a/trainbenchmark-tool-kiama/kiamatrain-src/src/main/scala/de/tudresden/inf/st/train/kiama/ast/Segment.scala b/trainbenchmark-tool-kiama/kiamatrain-src/src/main/scala/de/tudresden/inf/st/train/kiama/ast/Segment.scala deleted file mode 100644 index ed377128b..000000000 --- a/trainbenchmark-tool-kiama/kiamatrain-src/src/main/scala/de/tudresden/inf/st/train/kiama/ast/Segment.scala +++ /dev/null @@ -1,6 +0,0 @@ -package de.tudresden.inf.st.train.kiama.ast - -case class Segment() extends TrackElement { - var Length: Integer = 0 - var Semaphore: java.util.ArrayList[Semaphore] = new java.util.ArrayList[Semaphore]() -} diff --git a/trainbenchmark-tool-kiama/kiamatrain-src/src/main/scala/de/tudresden/inf/st/train/kiama/ast/Semaphore.scala b/trainbenchmark-tool-kiama/kiamatrain-src/src/main/scala/de/tudresden/inf/st/train/kiama/ast/Semaphore.scala deleted file mode 100644 index f77fdc9de..000000000 --- a/trainbenchmark-tool-kiama/kiamatrain-src/src/main/scala/de/tudresden/inf/st/train/kiama/ast/Semaphore.scala +++ /dev/null @@ -1,7 +0,0 @@ -package de.tudresden.inf.st.train.kiama.ast - -import de.tudresden.inf.st.train.kiama.enums - -case class Semaphore() extends RailwayElement { - var Signal: enums.Signal = enums.Signal.GO -} \ No newline at end of file diff --git a/trainbenchmark-tool-kiama/kiamatrain-src/src/main/scala/de/tudresden/inf/st/train/kiama/ast/Sensor.scala b/trainbenchmark-tool-kiama/kiamatrain-src/src/main/scala/de/tudresden/inf/st/train/kiama/ast/Sensor.scala deleted file mode 100644 index 6574650d5..000000000 --- a/trainbenchmark-tool-kiama/kiamatrain-src/src/main/scala/de/tudresden/inf/st/train/kiama/ast/Sensor.scala +++ /dev/null @@ -1,5 +0,0 @@ -package de.tudresden.inf.st.train.kiama.ast - -case class Sensor() extends RailwayElement { - var MonitoredElement: java.util.ArrayList[Ref] = new java.util.ArrayList[Ref]() -} diff --git a/trainbenchmark-tool-kiama/kiamatrain-src/src/main/scala/de/tudresden/inf/st/train/kiama/ast/Switch.scala b/trainbenchmark-tool-kiama/kiamatrain-src/src/main/scala/de/tudresden/inf/st/train/kiama/ast/Switch.scala deleted file mode 100644 index 72e37e36e..000000000 --- a/trainbenchmark-tool-kiama/kiamatrain-src/src/main/scala/de/tudresden/inf/st/train/kiama/ast/Switch.scala +++ /dev/null @@ -1,7 +0,0 @@ -package de.tudresden.inf.st.train.kiama.ast - -import de.tudresden.inf.st.train.kiama.enums.Position - -case class Switch() extends TrackElement { - var CurrentPosition: Position = Position.STRAIGHT -} diff --git a/trainbenchmark-tool-kiama/kiamatrain-src/src/main/scala/de/tudresden/inf/st/train/kiama/ast/SwitchPosition.scala b/trainbenchmark-tool-kiama/kiamatrain-src/src/main/scala/de/tudresden/inf/st/train/kiama/ast/SwitchPosition.scala deleted file mode 100644 index d34ed8b34..000000000 --- a/trainbenchmark-tool-kiama/kiamatrain-src/src/main/scala/de/tudresden/inf/st/train/kiama/ast/SwitchPosition.scala +++ /dev/null @@ -1,8 +0,0 @@ -package de.tudresden.inf.st.train.kiama.ast - -import de.tudresden.inf.st.train.kiama.enums - -case class SwitchPosition() extends RailwayElement { - var Position: enums.Position = enums.Position.STRAIGHT - var Target: Ref = Ref() -} \ No newline at end of file diff --git a/trainbenchmark-tool-kiama/kiamatrain-src/src/main/scala/de/tudresden/inf/st/train/kiama/ast/TrackElement.scala b/trainbenchmark-tool-kiama/kiamatrain-src/src/main/scala/de/tudresden/inf/st/train/kiama/ast/TrackElement.scala deleted file mode 100644 index 6e022f206..000000000 --- a/trainbenchmark-tool-kiama/kiamatrain-src/src/main/scala/de/tudresden/inf/st/train/kiama/ast/TrackElement.scala +++ /dev/null @@ -1,7 +0,0 @@ -package de.tudresden.inf.st.train.kiama.ast - -abstract class TrackElement() extends RailwayElement { - var ConnectsTo: java.util.ArrayList[Ref] = new java.util.ArrayList[Ref]() - - def getConnectsTo: java.util.ArrayList[Ref] = ConnectsTo -} diff --git a/trainbenchmark-tool-kiama/kiamatrain-src/src/main/scala/de/tudresden/inf/st/train/kiama/queries/KiamaTrainQueries.scala b/trainbenchmark-tool-kiama/kiamatrain-src/src/main/scala/de/tudresden/inf/st/train/kiama/queries/KiamaTrainQueries.scala deleted file mode 100644 index 9910e2c6a..000000000 --- a/trainbenchmark-tool-kiama/kiamatrain-src/src/main/scala/de/tudresden/inf/st/train/kiama/queries/KiamaTrainQueries.scala +++ /dev/null @@ -1,602 +0,0 @@ -package de.tudresden.inf.st.train.kiama.queries - -import de.tudresden.inf.st.train.kiama.ast._ -import de.tudresden.inf.st.train.kiama.enums.Signal -import de.tudresden.inf.st.train.kiama.matches._ -import org.bitbucket.inkytonik.kiama.attribution.Attribution - -import scala.collection.JavaConverters._ - -class KiamaTrainQueries(root: RailwayContainer) extends Attribution { - - val getRoot: RailwayContainer = root match { - case c if c != null => c - case null => throw new RuntimeException("No root specified!") - } - - // attributes for navigation: - val segments: (RailwayContainer) => java.util.List[Segment] = attr { - container => - val _segments = new java.util.ArrayList[Segment]() - for (region <- container.Region.asScala) { - for (trackElement <- region.TrackElement.asScala) { - val segment = asSegment(trackElement) - if (segment != null) _segments.add(segment) - } - } - _segments - } - - val segmentMap: (RailwayContainer) => java.util.Map[Integer, Segment] = attr { - container => - val _segments = new java.util.HashMap[Integer, Segment]() - for (region <- container.Region.asScala) { - for (trackElement <- region.TrackElement.asScala) { - val segment = asSegment(trackElement) - if (segment != null) _segments.put(segment.Id.Value, segment) - } - } - _segments - } - - val semaphores: (RailwayContainer) => java.util.List[Semaphore] = attr { - container => - val _semaphores = new java.util.ArrayList[Semaphore]() - for (segment <- segments(container).asScala) { - for (semaphore <- segment.Semaphore.asScala) { - _semaphores.add(semaphore) - } - } - _semaphores - } - val semaphoreMap: (RailwayContainer) => java.util.Map[Integer, Semaphore] = attr { - container => - val _semaphores = new java.util.HashMap[Integer, Semaphore]() - for (segment <- segments(container).asScala) { - for (semaphore <- segment.Semaphore.asScala) { - _semaphores.put(semaphore.Id.Value, semaphore) - } - } - _semaphores - } - - val sensors: (RailwayContainer) => java.util.List[Sensor] = attr { - container => - val _sensors = new java.util.ArrayList[Sensor]() - for (region <- container.Region.asScala) { - for (sensor <- region.Sensor.asScala) { - _sensors.add(sensor) - } - } - _sensors - } - - val sensorMap: (RailwayContainer) => java.util.Map[Integer, Sensor] = attr { - container => - val _sensors = new java.util.HashMap[Integer, Sensor]() - for (region <- container.Region.asScala) { - for (sensor <- region.Sensor.asScala) { - _sensors.put(sensor.Id.Value, sensor) - } - } - _sensors - } - - val trackElements: (RailwayContainer) => java.util.List[TrackElement] = attr { - container => - val _trackElements = new java.util.ArrayList[TrackElement] - for (region <- container.Region.asScala) { - for (trackElement <- region.TrackElement.asScala) { - _trackElements.add(trackElement) - } - } - _trackElements - } - - val trackElementMap: (RailwayContainer) => java.util.Map[Integer, TrackElement] = attr { - container => - val _trackElements = new java.util.HashMap[Integer, TrackElement]() - for (region <- container.Region.asScala) { - for (trackElement <- region.TrackElement.asScala) { - _trackElements.put(trackElement.Id.Value, trackElement) - } - } - _trackElements - } - - val switchMap: (RailwayContainer) => java.util.Map[Integer, Switch] = attr { - container => - val switches = new java.util.HashMap[Integer, Switch]() - for (region <- container.Region.asScala) { - for (trackElement <- region.TrackElement.asScala) { - val sw = asSwitch(trackElement) - if (sw != null) switches.put(sw.Id.Value, sw) - } - } - switches; - } - - val refAsTrackElement: (Ref) => TrackElement = attr { - ref => - val result = segmentMap(getRoot).get(ref.Value) - if (result == null) { - switchMap(getRoot).get(ref.Value) - } else { - result - } - } - - def getMonitoredElement(s: Sensor): java.util.List[TrackElement] = getMonitoredElementListResolved(s) - - val getMonitoredElementListResolved: (Sensor) => java.util.List[TrackElement] = attr { - sensor => - val _trackElements = new java.util.ArrayList[TrackElement]() - for (ref <- sensor.MonitoredElement.asScala) { - _trackElements.add(refAsTrackElement(ref)) - } - _trackElements - } - - def getMonitoredElement(index: Integer, s: Sensor): TrackElement = getMonitoredElementResolved(index)(s) - - val getMonitoredElementResolved: (Integer) => (Sensor) => TrackElement = paramAttr { - i => - sensor => trackElementMap(getRoot).get(sensor.MonitoredElement.get(i).Value) - } - - val getConnectsToListResolved: (TrackElement) => java.util.List[TrackElement] = attr { - trackElement => - val _trackElements = new java.util.ArrayList[TrackElement]() - for (teRef <- trackElement.getConnectsTo.asScala) { - _trackElements.add(trackElementMap(getRoot).get(teRef.Value)) - } - _trackElements - } - - val getRequiredSensorsResolvedForID: (Integer) => (Route) => Sensor = paramAttr { - i => - route => sensorMap(getRoot).get(route.RequiredSensor.get(i).Value) - } - - val getRequiredSensorsResolved: (Route) => java.util.List[Sensor] = attr { - route => - val _sensors = new java.util.ArrayList[Sensor]() - for (sensorRef <- route.RequiredSensor.asScala) { - _sensors.add(sensorMap(getRoot).get(sensorRef.Value)) - } - _sensors - } - - val getEntryResolvedForRoute: (Route) => Semaphore = attr { - case r: Route if r.Entry.size() == 1 => semaphoreMap(getRoot).get(r.Entry.get(0).Value) - case _ => null - } - - val getEntryResolvedForSwitchPosition: (SwitchPosition) => Switch = attr { - switchPosition => trackElementMap(getRoot).get(switchPosition.Target.Value).asInstanceOf[Switch] - } - - val getExitResolved: (Route) => Semaphore = attr { - case r: Route if r.Exit.size() == 1 => semaphoreMap(getRoot).get(r.Exit.get(0).Value) - case _ => null - } - - val monitoringSensorsForRegion: (Region) => (Switch) => java.util.List[Sensor] = paramAttr { - region => - switch => - val _monitoringSensors = new java.util.ArrayList[Sensor]() - for (sensor <- region.Sensor.asScala) { - for (ref <- sensor.MonitoredElement.asScala) { - if (ref.Value.equals(switch.Id.Value)) { - _monitoringSensors.add(sensor) - } - } - } - _monitoringSensors - } - - val monitoringSensorsForRailwayContainer: (Switch) => (RailwayContainer) => java.util.List[Sensor] = paramAttr { - switch => - container => - val _monitoringSensors = new java.util.ArrayList[Sensor]() - for (region <- container.Region.asScala) { - _monitoringSensors.addAll(monitoringSensorsForRegion(region)(switch)) - } - _monitoringSensors - } - - def getMonitoringSensorsForSwitch(s: Switch): java.util.List[Sensor] = monitoringSensorsForSwitch(s) - - val monitoringSensorsForSwitch: (Switch) => java.util.List[Sensor] = attr { - switch => monitoringSensorsForRailwayContainer(switch)(getRoot) - } - - def getIsSwitch(t: TrackElement): Boolean = isSwitch(t) - - val isSwitch: (TrackElement) => Boolean = attr { - case _: Switch => true - case _: Segment => false - } - - def asSwitch(t: TrackElement): Switch = t match { - case s: Switch => s - case _: Segment => null - } - - val isSegment: (TrackElement) => Boolean = attr { - case _: Switch => false - case _: Segment => true - } - - val refAsSegment: (Ref) => Segment = attr { - ref => - segmentMap(getRoot).get(ref.Value) - } - - def asSegment(t: TrackElement): Segment = t match { - case _: Switch => null - case s: Segment => s - } - - val switches: (RailwayContainer) => java.util.List[Switch] = attr { - container => - val _switches = new java.util.ArrayList[Switch]() - for (region <- container.Region.asScala) { - for (element <- region.TrackElement.asScala) { - if (isSwitch(element)) { - _switches.add(element.asInstanceOf[Switch]) - } - } - } - _switches - } - - val monitoringSensorsMap: (RailwayContainer) => java.util.Map[Integer, java.util.Set[Sensor]] = attr { - container => - val sensorMap = new java.util.HashMap[Integer, java.util.Set[Sensor]]() - // fill the keys - for (sw <- switches(container).asScala) { - sensorMap.put(sw.Id.Value, new java.util.HashSet[Sensor]()) - } - for (segment <- segments(container).asScala) { - sensorMap.put(segment.Id.Value, new java.util.HashSet[Sensor]()) - } - // update the values - for (sensor <- sensors(container).asScala) { - for (teRef <- getMonitoredElementListResolved(sensor).asScala) { - sensorMap.get(teRef.Id.Value).add(sensor) - } - } - sensorMap - } - - val monitoringSensors: (TrackElement) => java.util.List[Sensor] = attr { - element => - val _sensors = new java.util.ArrayList[Sensor]() - _sensors.addAll(monitoringSensorsMap(getRoot).get(element.Id.Value)) - _sensors - } - - val requiringRoutes: (Sensor) => java.util.List[Route] = attr { - sensor => - val _routes = new java.util.ArrayList[Route]() - for (route <- getRoot.Route.asScala) { - for (sensorRef <- route.RequiredSensor.asScala) { - if (sensorRef.Value.equals(sensor.Id.Value)) { - _routes.add(route) - } - } - } - _routes - } - - val getTargetResolved: (SwitchPosition) => Switch = attr { - switchPosition => asSwitch(trackElementMap(getRoot).get(switchPosition.Target.Value)) - } - - // attributes for queries: - val monitors: (Segment) => (Sensor) => Boolean = paramAttr { - segment => - sensor => sensor.MonitoredElement.asScala.exists(ref => ref.Value.equals(segment.Id.Value)) - } - - val connectsToSegments: (TrackElement) => java.util.ArrayList[Segment] = attr { - trackElement => - val _segments = new java.util.ArrayList[Segment]() - for (ref <- trackElement.ConnectsTo.asScala) { - val segment = refAsSegment(ref) - if (segment != null) { - _segments.add(segment) - } - } - _segments - } - - val connectedSegmentsForSensor: (Sensor) => (TrackElement) => java.util.List[Segment] = paramAttr { - sensor => - trackElement => - val _segments = new java.util.ArrayList[Segment]() - for (segment <- connectsToSegments(trackElement).asScala) { - if (monitors(segment)(sensor)) { - _segments.add(segment) - } - } - _segments - } - - val monitoredSegments: (Sensor) => java.util.List[Segment] = attr { - sensor => - val _segments = new java.util.ArrayList[Segment]() - for (ref <- sensor.MonitoredElement.asScala) { - val segment = refAsSegment(ref) - if (segment != null) { - _segments.add(segment) - } - } - _segments - } - - class ElementComparator(limit: Int) extends java.util.Comparator[java.util.List[_]] { - override def compare(o1: java.util.List[_], o2: java.util.List[_]): Int = { - val s1 = o1.size() - val s2 = o2.size() - for (index <- 0 to limit) { - val v1 = index match { - case i if i < s1 => o1.get(index).hashCode() - case _ => 0 - } - val v2 = index match { - case i if i < s2 => o2.get(index).hashCode() - case _ => 0 - } - if (v1 < v2) return -1 - else if (v1 > v2) return 1 - } - 0 - } - } - - def getConnectedSegments: java.util.List[KiamaInternalConnectedSegmentsMatch] = connectedSegments(getRoot) - - val transConnectedSegments: (Segment) => java.util.SortedSet[java.util.List[Segment]] = attr { - segment => - val results = new java.util.TreeSet[java.util.List[Segment]](new ElementComparator(5)) - for (seg <- connectsToSegments(segment).asScala) { - val segmentResult = transConnectedSegments(seg) - if (segmentResult.isEmpty) { - val newList = new java.util.ArrayList[Segment]() - newList.add(seg) - results.add(newList) - } else { - for (segmentList <- segmentResult.asScala) { - val newList = new java.util.ArrayList[Segment]() - newList.add(seg) - for (index <- 0 until Math.min(segmentList.size(), 5)) { - newList.add(segmentList.get(index)) - } - results.add(newList) - } - } - } - results - } - - val connectedSegments: (RailwayContainer) => java.util.List[KiamaInternalConnectedSegmentsMatch] = attr { - container => - val matches = new java.util.ArrayList[KiamaInternalConnectedSegmentsMatch]() - for (sensor <- sensors(container).asScala) { - for (segment <- monitoredSegments(sensor).asScala) { - val t = transConnectedSegments(segment).asScala.filter(l => { - l.size() >= 5 && (0 until 5).forall(i => monitors(l.get(i))(sensor)) - }) - for (segmentSequence <- t) { - matches.add(new KiamaInternalConnectedSegmentsMatch(sensor, segment, segmentSequence.get(0), segmentSequence.get(1), segmentSequence.get(2), segmentSequence.get(3), segmentSequence.get(4))) - } - } - } - matches - } - - def getContainingRegion(tr: TrackElement): Region = containingRegion(tr) - - val containingRegion: (TrackElement) => Region = attr { - trackElement => - getRoot.Region.asScala.find(r => { - r.TrackElement.asScala.exists(t => t.Id.Value.equals(trackElement.Id.Value)) - }).get - } - - def getConnectedSegmentsInjectMatches: java.util.List[KiamaInternalConnectedSegmentsInjectMatch] = connectedSegmentsInjectMatches(getRoot) - - val connectedSegmentsInjectMatches: (RailwayContainer) => java.util.List[KiamaInternalConnectedSegmentsInjectMatch] = attr { - container => - val matches = new java.util.ArrayList[KiamaInternalConnectedSegmentsInjectMatch]() - for (sensor <- sensors(container).asScala) { - for (segment1 <- monitoredSegments(sensor).asScala) { - for (segment3 <- connectedSegmentsForSensor(sensor)(segment1).asScala) { - matches.add(new KiamaInternalConnectedSegmentsInjectMatch(sensor, segment1, segment3)) - } - } - } - matches - } - - def getPosLengthMatches: java.util.List[KiamaInternalPosLengthMatch] = posLengthMatches(getRoot) - - val posLengthMatches: (RailwayContainer) => java.util.List[KiamaInternalPosLengthMatch] = attr { - container => - val matches = new java.util.ArrayList[KiamaInternalPosLengthMatch]() - for (region <- container.Region.asScala) { - for (trackElement <- region.TrackElement.asScala) { - val segment = asSegment(trackElement) - if (segment != null && segment.Length <= 0) { - matches.add(new KiamaInternalPosLengthMatch(segment, segment.Length)) - } - } - } - matches - - } - - def getPosLengthInjectMatches: java.util.List[KiamaInternalPosLengthInjectMatch] = posLengthInjectMatches(getRoot) - - val posLengthInjectMatches: (RailwayContainer) => java.util.List[KiamaInternalPosLengthInjectMatch] = attr { - container => - val matches = new java.util.ArrayList[KiamaInternalPosLengthInjectMatch]() - for (region <- container.Region.asScala) { - for (trackElement <- region.TrackElement.asScala) { - val segment = asSegment(trackElement) - if (segment != null) { - matches.add(new KiamaInternalPosLengthInjectMatch(segment)) - } - } - } - matches - } - - def getRouteSensorMatches: java.util.List[KiamaInternalRouteSensorMatch] = routeSensorMatches(getRoot) - - val routeSensorMatches: (RailwayContainer) => java.util.List[KiamaInternalRouteSensorMatch] = attr { - container => - val matches = new java.util.ArrayList[KiamaInternalRouteSensorMatch]() - for (route <- container.Route.asScala) { - for (sp <- route.SwitchPosition.asScala) { - val sw = getTargetResolved(sp) - val sensors = monitoringSensors(sw) - for (sensor <- sensors.asScala) { - var validSensor = false - for (sensor2 <- getRequiredSensorsResolved(route).asScala; if sensor2.equals(sensor)) { - validSensor = true - } - if (!validSensor) { - matches.add(new KiamaInternalRouteSensorMatch(route, sensor, sp, sw)) - } - } - } - } - matches - } - - def getRouteSensorInjectMatches: java.util.List[KiamaInternalRouteSensorInjectMatch] = routeSensorInjectMatches(getRoot) - - val routeSensorInjectMatches: (RailwayContainer) => java.util.List[KiamaInternalRouteSensorInjectMatch] = attr { - container => - val matches = new java.util.ArrayList[KiamaInternalRouteSensorInjectMatch]() - for (route <- container.Route.asScala) { - for (sensor <- getRequiredSensorsResolved(route).asScala) { - matches.add(new KiamaInternalRouteSensorInjectMatch(route, sensor)) - } - } - matches - } - - def getSemaphoreNeighborMatches: java.util.List[KiamaInternalSemaphoreNeighborMatch] = semaphoreNeighborMatches(getRoot) - - val semaphoreNeighborMatches: (RailwayContainer) => java.util.List[KiamaInternalSemaphoreNeighborMatch] = attr { - container => - val matches = new java.util.ArrayList[KiamaInternalSemaphoreNeighborMatch]() - - for (route1 <- container.Route.asScala) { - val exitRef = route1.Exit.get(0) - val exitSemaphore = getExitResolved(route1) - - for (sensor1 <- getRequiredSensorsResolved(route1).asScala) { - for (te1 <- getMonitoredElementListResolved(sensor1).asScala) { - for (te2 <- getConnectsToListResolved(te1).asScala) { - for (sensor2 <- monitoringSensors(te2).asScala) { - for (route2 <- requiringRoutes(sensor2).asScala) { - if (!route1.Id.Value.equals(route2.Id.Value)) { - if (route2.Entry.isEmpty || !route2.Entry.get(0).Value.equals(exitRef.Value)) { - matches.add(new KiamaInternalSemaphoreNeighborMatch(exitSemaphore, route1, route2, sensor1, sensor2, te1, te2)) - } - } - } - } - } - } - } - } - matches - } - - def getSemaphoreNeighborInjectMatches: java.util.List[KiamaInternalSemaphoreNeighborInjectMatch] = semaphoreNeighborInjectMatches(getRoot) - - val semaphoreNeighborInjectMatches: (RailwayContainer) => java.util.List[KiamaInternalSemaphoreNeighborInjectMatch] = attr { - container => - val matches = new java.util.ArrayList[KiamaInternalSemaphoreNeighborInjectMatch]() - for (route <- container.Route.asScala; if !route.Entry.isEmpty) { - matches.add(new KiamaInternalSemaphoreNeighborInjectMatch(route, getEntryResolvedForRoute(route))) - } - matches - } - - def getMonitoredSwitches: java.util.List[Switch] = monitoredSwitches(getRoot) - - val monitoredSwitchesForSensor: (Sensor) => java.util.List[Switch] = attr { - sensor => - val _switches = new java.util.ArrayList[Switch]() - for (ref <- getMonitoredElementListResolved(sensor).asScala) { - val sw = asSwitch(ref) - if (sw != null) { - _switches.add(sw) - } - } - _switches - } - - val monitoredSwitches: (RailwayContainer) => java.util.List[Switch] = attr { - container => - val mSwitches = new java.util.ArrayList[Switch]() - for (sensor <- sensors(container).asScala) { - for (switch <- monitoredSwitchesForSensor(sensor).asScala) { - mSwitches.add(switch) - } - } - mSwitches - } - - def getUnmonitoredSwitches: java.util.List[Switch] = unmonitoredSwitches(getRoot) - - val unmonitoredSwitches: (RailwayContainer) => java.util.List[Switch] = attr { - container => - val unmSwitches = new java.util.ArrayList[Switch]() - unmSwitches.addAll(switches(container)) - for (sensor <- sensors(container).asScala) { - for (sw <- monitoredSwitchesForSensor(sensor).asScala) { - unmSwitches.remove(sw) - } - } - unmSwitches - } - - def getSwitchSetMatches: java.util.List[KiamaInternalSwitchSetMatch] = switchSetMatches(getRoot) - - val switchSetMatches: (RailwayContainer) => java.util.List[KiamaInternalSwitchSetMatch] = attr { - container => - val matches = new java.util.ArrayList[KiamaInternalSwitchSetMatch]() - for (route <- container.Route.asScala) { - if (route.Entry.size() == 1 && getEntryResolvedForRoute(route).Signal == Signal.GO) { - for (swp <- route.SwitchPosition.asScala) { - val target = getTargetResolved(swp) - val semaphore = getEntryResolvedForRoute(route) - if (swp.Position != target.CurrentPosition) { - matches.add(new KiamaInternalSwitchSetMatch(semaphore, route, swp, target, swp.Position, target.CurrentPosition)) - } - } - } - } - matches - } - - def getSwitchSetInjectMatches: java.util.List[KiamaInternalSwitchSetInjectMatch] = switchSetInjectMatches(getRoot) - - val switchSetInjectMatches: (RailwayContainer) => java.util.List[KiamaInternalSwitchSetInjectMatch] = attr { - container => - val matches = new java.util.ArrayList[KiamaInternalSwitchSetInjectMatch]() - for (sw <- switches(container).asScala) { - matches.add(new KiamaInternalSwitchSetInjectMatch(sw)) - } - matches - } - -} diff --git a/trainbenchmark-tool-kiama/libs/kiamatrain.jar b/trainbenchmark-tool-kiama/libs/kiamatrain.jar deleted file mode 100644 index bbeaf467a139959d478cf87c2ea27ed66ffee99d..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 73227 zcmWIWW@Zs#;Nak35DZcDW<UZW3@i-3t|5-Po_=onzK(vLZmz*0dcJP|PBAci_C0gj z$6HtLBCofu*10q1HwPJ9F@Es$(;3|po@af}YJ2K1a=mIxnf7E!lx9V`+B3B_5!JM3 zi7Ong%Ee5WHD~6unLLwEd!N+b6m)_uQ@=68J=C%1r-E^bZSV)l=Ii`7Vh)~WWeD(Q z=kQnDC!7j$6e9yefHyM>7Xt$a1BO$X85kH+QuT2w;DsnCDNQL#Elx?z!=qFXU1?@s z8Xn~$*pwHS;L#z4Lq|zbVkSO^Dd5$Yotc=Mh{skHB6KI>b+;N3CZy(-<`&~|g$5C3 z<R+FRXQWbUN?~bgQ6|(BNc!dqKuzC)B)G*J6uO>yC8<Sui8;ZkxrqfC`9-OIshQ~+ zN%=*-AQ$T;=Oh*vuMN4KciBN?&e^k`2ELiW2bKzOZSkFRdQw1VyHeZ^j}_ue)L#8o zixk@4*_+e;o{5vYlijYN-)T<i-H?ch1xvIp$-K`>JNM?<js5@s{9#RypR3e$LwiBP zs-{^?!H%(x&W^#3-ptoO%vt#0<jNm5WiclY^tVm=y?LSb-i2Fsrq(~2cfK|}!fgMB zBOwKjuis65(4hF-$~b<T<g3ml%e!o+mr9uU-<tP$lB05BzN`HV?vqNg-`=ZC`W|Dr zqr!Y*aOQ9Jg;RKn*6ZB<6mR@(+pZ@+r(1mX4PM;6qwt-*`IbG4%8pH_e9V(M!^?e| zu7BF)eI?b4>=(+`s{DQTb<5V(TbDjx>mauL;t5mXSL@sI)-C<NN5ZYsZT(aW50jef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d04PAFc_hP>X%5u)`HSFbO9We^Z}~W zyOy;5x94DBSjfk~po?Pu$r$3y4@ynLo*<N8o{VZ>Vqhp|Wni#GF*-SwIHMr}1WOQD zd;m%j0e7`D6d4&97?~ItK>a#|O<oy<t-+ciAod2QmJqBpkPjxZN7&53!0;lIu;n;w z4eSAmd{zu<BkAyY!j?hOLT)1R$w%m^?H|(aX3&{42p`S8M4SylXv^WS`viH1D{89t zy+ha@NOKQ)=QO%MY>+mapf<@i-Xm;2B&5L0MzK2|dF?7{W!?6iSmQx6Uf4}XUZ05C z%%Aq2u<2M6G)9{YPeF&gXbiLn5|IW3J`uJa6n5xo07u3}Ude+Riod=PX%W(jG~^@z zYR@6h!lPD4=e`qZIwUFMY#xAm709!rsKsZ&AL49*&+j990939aPtKtx1H1o(jmDY` zkZL--B^$_k<bgEQ*pXsn#5yd2+}Q>v18}<pdm2X`0YWXb-*OT*9joWyEk-O}V`T%S TVgm*PhGZcIhDqFv3=9ka@!KGb diff --git a/trainbenchmark-tool-kiama/src/main/java/de/tudresden/inf/st/train/kiama/KiamaAbstractBenchmarkScenario.java b/trainbenchmark-tool-kiama/src/main/java/de/tudresden/inf/st/train/kiama/KiamaAbstractBenchmarkScenario.java deleted file mode 100644 index ac898b44e..000000000 --- a/trainbenchmark-tool-kiama/src/main/java/de/tudresden/inf/st/train/kiama/KiamaAbstractBenchmarkScenario.java +++ /dev/null @@ -1,29 +0,0 @@ -package de.tudresden.inf.st.train.kiama; - -import de.tudresden.inf.st.train.kiama.comparators.KiamaMatchComparator; -import de.tudresden.inf.st.train.kiama.driver.KiamaDriver; -import de.tudresden.inf.st.train.kiama.driver.KiamaDriverFactory; -import de.tudresden.inf.st.train.kiama.matches.KiamaMatch; -import de.tudresden.inf.st.train.kiama.operations.KiamaModelOperationFactory; -import hu.bme.mit.trainbenchmark.benchmark.phases.BenchmarkScenario; -import hu.bme.mit.trainbenchmark.constants.RailwayOperation; -import de.tudresden.inf.st.train.kiama.config.KiamaAbstractBenchmarkConfig; - -import java.io.File; -import java.io.FileOutputStream; -import java.io.IOException; -import java.io.PrintStream; - -public abstract class KiamaAbstractBenchmarkScenario<TBenchmarkConfigWrapper extends KiamaAbstractBenchmarkConfig> extends - BenchmarkScenario<KiamaMatch, KiamaDriver, TBenchmarkConfigWrapper> { - - public KiamaAbstractBenchmarkScenario(final TBenchmarkConfigWrapper bc, boolean flushCaches) throws Exception { - super(new KiamaDriverFactory(flushCaches), new KiamaModelOperationFactory(), new KiamaMatchComparator(), bc); - } - - @Override - protected void performRun() throws Exception { - super.performRun(); - } - -} diff --git a/trainbenchmark-tool-kiama/src/main/java/de/tudresden/inf/st/train/kiama/KiamaBenchmarkMain.java b/trainbenchmark-tool-kiama/src/main/java/de/tudresden/inf/st/train/kiama/KiamaBenchmarkMain.java deleted file mode 100644 index 8c32549ac..000000000 --- a/trainbenchmark-tool-kiama/src/main/java/de/tudresden/inf/st/train/kiama/KiamaBenchmarkMain.java +++ /dev/null @@ -1,12 +0,0 @@ -package de.tudresden.inf.st.train.kiama; - -import de.tudresden.inf.st.train.kiama.config.KiamaBenchmarkConfig; -import hu.bme.mit.trainbenchmark.benchmark.config.BenchmarkConfig; - -public class KiamaBenchmarkMain { - public static void main(final String[] args) throws Exception { - final KiamaBenchmarkConfig bc = BenchmarkConfig.fromFile(args[0], KiamaBenchmarkConfig.class); - final KiamaBenchmarkScenario scenario = new KiamaBenchmarkScenario(bc); - scenario.performBenchmark(); - } -} diff --git a/trainbenchmark-tool-kiama/src/main/java/de/tudresden/inf/st/train/kiama/KiamaBenchmarkScenario.java b/trainbenchmark-tool-kiama/src/main/java/de/tudresden/inf/st/train/kiama/KiamaBenchmarkScenario.java deleted file mode 100644 index 61e188e91..000000000 --- a/trainbenchmark-tool-kiama/src/main/java/de/tudresden/inf/st/train/kiama/KiamaBenchmarkScenario.java +++ /dev/null @@ -1,12 +0,0 @@ -package de.tudresden.inf.st.train.kiama; - -import de.tudresden.inf.st.train.kiama.config.KiamaBenchmarkConfig; - -public class KiamaBenchmarkScenario extends - KiamaAbstractBenchmarkScenario<KiamaBenchmarkConfig> { - - public KiamaBenchmarkScenario(final KiamaBenchmarkConfig bc) throws Exception { - super(bc, true); - } - -} diff --git a/trainbenchmark-tool-kiama/src/main/java/de/tudresden/inf/st/train/kiama/comparators/KiamaMatchComparator.java b/trainbenchmark-tool-kiama/src/main/java/de/tudresden/inf/st/train/kiama/comparators/KiamaMatchComparator.java deleted file mode 100644 index ea22851d7..000000000 --- a/trainbenchmark-tool-kiama/src/main/java/de/tudresden/inf/st/train/kiama/comparators/KiamaMatchComparator.java +++ /dev/null @@ -1,13 +0,0 @@ -package de.tudresden.inf.st.train.kiama.comparators; - -import de.tudresden.inf.st.train.kiama.ast.RailwayElement; -import de.tudresden.inf.st.train.kiama.matches.KiamaMatch; -import hu.bme.mit.trainbenchmark.benchmark.matches.comparators.BaseMatchComparator; - -public class KiamaMatchComparator extends BaseMatchComparator<KiamaMatch, RailwayElement> { - - public KiamaMatchComparator() { - super(new RailwayElementComparator()); - } - -} diff --git a/trainbenchmark-tool-kiama/src/main/java/de/tudresden/inf/st/train/kiama/comparators/RailwayElementComparator.java b/trainbenchmark-tool-kiama/src/main/java/de/tudresden/inf/st/train/kiama/comparators/RailwayElementComparator.java deleted file mode 100644 index a4eb0f02b..000000000 --- a/trainbenchmark-tool-kiama/src/main/java/de/tudresden/inf/st/train/kiama/comparators/RailwayElementComparator.java +++ /dev/null @@ -1,13 +0,0 @@ -package de.tudresden.inf.st.train.kiama.comparators; - -import de.tudresden.inf.st.train.kiama.ast.RailwayElement; - -import java.util.Comparator; - -public class RailwayElementComparator implements Comparator<RailwayElement> { - - @Override - public int compare(final RailwayElement r1, final RailwayElement r2) { - return Integer.compare(r1.Id().Value(), r2.Id().Value()); - } -} diff --git a/trainbenchmark-tool-kiama/src/main/java/de/tudresden/inf/st/train/kiama/config/KiamaAbstractBenchmarkConfig.java b/trainbenchmark-tool-kiama/src/main/java/de/tudresden/inf/st/train/kiama/config/KiamaAbstractBenchmarkConfig.java deleted file mode 100644 index 8db29cf36..000000000 --- a/trainbenchmark-tool-kiama/src/main/java/de/tudresden/inf/st/train/kiama/config/KiamaAbstractBenchmarkConfig.java +++ /dev/null @@ -1,12 +0,0 @@ -package de.tudresden.inf.st.train.kiama.config; - -import hu.bme.mit.trainbenchmark.benchmark.config.BenchmarkConfig; -import hu.bme.mit.trainbenchmark.benchmark.config.BenchmarkConfigBase; - -public abstract class KiamaAbstractBenchmarkConfig extends BenchmarkConfig { - - protected KiamaAbstractBenchmarkConfig(final BenchmarkConfigBase configBase) { - super(configBase); - } - -} diff --git a/trainbenchmark-tool-kiama/src/main/java/de/tudresden/inf/st/train/kiama/config/KiamaBenchmarkConfig.java b/trainbenchmark-tool-kiama/src/main/java/de/tudresden/inf/st/train/kiama/config/KiamaBenchmarkConfig.java deleted file mode 100644 index 9ac4e6991..000000000 --- a/trainbenchmark-tool-kiama/src/main/java/de/tudresden/inf/st/train/kiama/config/KiamaBenchmarkConfig.java +++ /dev/null @@ -1,21 +0,0 @@ -package de.tudresden.inf.st.train.kiama.config; - -import hu.bme.mit.trainbenchmark.benchmark.config.BenchmarkConfigBase; - -public class KiamaBenchmarkConfig extends KiamaAbstractBenchmarkConfig { - - protected KiamaBenchmarkConfig(final BenchmarkConfigBase configBase) { - super(configBase); - } - - @Override - public String getToolName() { - return "Kiama"; - } - - @Override - public String getProjectName() { - return "kiama"; - } - -} diff --git a/trainbenchmark-tool-kiama/src/main/java/de/tudresden/inf/st/train/kiama/config/KiamaBenchmarkConfigBuilder.java b/trainbenchmark-tool-kiama/src/main/java/de/tudresden/inf/st/train/kiama/config/KiamaBenchmarkConfigBuilder.java deleted file mode 100644 index f416a84f9..000000000 --- a/trainbenchmark-tool-kiama/src/main/java/de/tudresden/inf/st/train/kiama/config/KiamaBenchmarkConfigBuilder.java +++ /dev/null @@ -1,13 +0,0 @@ -package de.tudresden.inf.st.train.kiama.config; - -import hu.bme.mit.trainbenchmark.benchmark.config.BenchmarkConfigBuilder; - -public class KiamaBenchmarkConfigBuilder extends BenchmarkConfigBuilder<de.tudresden.inf.st.train.kiama.config.KiamaBenchmarkConfig, KiamaBenchmarkConfigBuilder> { - - @Override - public KiamaBenchmarkConfig createConfig() { - checkNotNulls(); - return new KiamaBenchmarkConfig(configBase); - } - -} diff --git a/trainbenchmark-tool-kiama/src/main/java/de/tudresden/inf/st/train/kiama/driver/KiamaDriver.java b/trainbenchmark-tool-kiama/src/main/java/de/tudresden/inf/st/train/kiama/driver/KiamaDriver.java deleted file mode 100644 index ac47ab091..000000000 --- a/trainbenchmark-tool-kiama/src/main/java/de/tudresden/inf/st/train/kiama/driver/KiamaDriver.java +++ /dev/null @@ -1,56 +0,0 @@ -package de.tudresden.inf.st.train.kiama.driver; - -import de.tudresden.inf.st.train.kiama.ast.RailwayContainer; -import de.tudresden.inf.st.train.kiama.driver.deserializer.JsonDeserializer; -import de.tudresden.inf.st.train.kiama.queries.KiamaTrainQueries; -import hu.bme.mit.trainbenchmark.benchmark.driver.Driver; - -import java.io.File; -import java.io.IOException; - - -public class KiamaDriver extends Driver { - - public KiamaTrainQueries queries = null; - private RailwayContainer root; - - private int idCounter = 0; - - private final boolean flushCaches; - - public KiamaDriver(boolean flushCaches) { - super(); - this.flushCaches = flushCaches; - } - - public static KiamaDriver create(boolean flushCaches) { - return new KiamaDriver(flushCaches); - } - - public int nextId() { - idCounter--; - return idCounter; - } - - public RailwayContainer getModel() { - return root; - } - - @Override - public void read(final String modelPath) throws IOException { - File modelFile = new File(modelPath); - root = JsonDeserializer.read(modelFile); - queries = new KiamaTrainQueries(root); - } - - @Override - public String getPostfix() { - return "-ag.json"; - } - - public void flushCache() { - if (flushCaches) { - queries = new KiamaTrainQueries(root); - } - } -} diff --git a/trainbenchmark-tool-kiama/src/main/java/de/tudresden/inf/st/train/kiama/driver/KiamaDriverFactory.java b/trainbenchmark-tool-kiama/src/main/java/de/tudresden/inf/st/train/kiama/driver/KiamaDriverFactory.java deleted file mode 100644 index f809d4fcc..000000000 --- a/trainbenchmark-tool-kiama/src/main/java/de/tudresden/inf/st/train/kiama/driver/KiamaDriverFactory.java +++ /dev/null @@ -1,19 +0,0 @@ -package de.tudresden.inf.st.train.kiama.driver; - -import hu.bme.mit.trainbenchmark.benchmark.driver.DriverFactory; - -public class KiamaDriverFactory extends DriverFactory<KiamaDriver> { - - protected final boolean flushCaches; - - public KiamaDriverFactory(boolean flushCaches) { - super(); - this.flushCaches = flushCaches; - } - - @Override - public KiamaDriver createInstance() throws Exception { - return new KiamaDriver(flushCaches); - } - -} diff --git a/trainbenchmark-tool-kiama/src/main/java/de/tudresden/inf/st/train/kiama/driver/deserializer/ASTNodeDeserializer.java b/trainbenchmark-tool-kiama/src/main/java/de/tudresden/inf/st/train/kiama/driver/deserializer/ASTNodeDeserializer.java deleted file mode 100644 index d4a94637e..000000000 --- a/trainbenchmark-tool-kiama/src/main/java/de/tudresden/inf/st/train/kiama/driver/deserializer/ASTNodeDeserializer.java +++ /dev/null @@ -1,216 +0,0 @@ -package de.tudresden.inf.st.train.kiama.driver.deserializer; - -import com.fasterxml.jackson.core.JsonParser; -import com.fasterxml.jackson.databind.DeserializationContext; -import com.fasterxml.jackson.databind.JsonNode; -import com.fasterxml.jackson.databind.deser.std.StdDeserializer; -import de.tudresden.inf.st.train.kiama.ast.KiamaTrainTreeNode; - -import java.io.IOException; -import java.lang.reflect.InvocationTargetException; -import java.lang.reflect.Method; -import java.util.Iterator; - -/** - * Created by jm on 5/15/17. - */ -public class ASTNodeDeserializer extends StdDeserializer<KiamaTrainTreeNode> { - - public ASTNodeDeserializer() { - this(null); - } - - public ASTNodeDeserializer(Class<?> vc) { - super(vc); - } - - @Override - public KiamaTrainTreeNode deserialize(JsonParser jp, DeserializationContext ctxt) - throws IOException { - - JsonNode node = jp.getCodec().readTree(jp); - - return (KiamaTrainTreeNode) deserializeObject(node); - } - - private Object deserializeObject(JsonNode node) { - if (node.isObject()) { - String kind = node.get("k").asText(); - switch (kind) { - case "NT": - return deserializeNonterminal(node); - case "List": - return deserializeList(node); - case "Opt": - return deserializeOpt(node); - case "t": - return deserializeTerminal(node); - case "enum": - return deserializeEnum(node); - default: - throw new DeserializationException("cannot deserialize node of unknown kind " + kind); - } - } else { - throw new DeserializationException("cannot deserialize non-object node as object node!"); - } - } - - private KiamaTrainTreeNode deserializeNonterminal(JsonNode node) { - - final String packageName = "de.tudresden.inf.st.train.kiama.ast"; - - // get the type we want to create - String type = node.get("t").asText(); - Class typeClass; - try { - typeClass = Class.forName(packageName + "." + type); - } catch (ClassNotFoundException e) { - throw new DeserializationException("Unable to find class of type " + type + " in package" + packageName, e); - } - - // create the instance - KiamaTrainTreeNode instance; - try { - instance = (KiamaTrainTreeNode) (typeClass.getConstructor().newInstance()); - } catch (InstantiationException | IllegalAccessException | InvocationTargetException | NoSuchMethodException e) { - throw new DeserializationException("Unable to construct a nonterminal of type " + typeClass.getCanonicalName(), e); - } - - // call every setter we have a field for - Iterator<String> f = node.get("c").fieldNames(); - while (f.hasNext()) { - String fieldName = f.next(); - - // serialize the parameter - Object parameter = deserializeObject(node.get("c").get(fieldName)); - - // find the setter to call - boolean isList = node.get("c").get(fieldName).get("k").asText().equals("List"); - boolean isOpt = node.get("c").get(fieldName).get("k").asText().equals("Opt"); - // ... by getting its name - //String setterName = "set" + fieldName + (isList ? "List" : "") + (isOpt ? "Opt" : "");+ "_$eq"; - String setterName = fieldName + "_$eq"; - // ... and its type - Class setterType; - if (isList) { - setterType = java.util.ArrayList.class; - } else { - setterType = parameter.getClass(); - } - - // get the method - Method method = null; - try { - method = typeClass.getMethod(setterName, setterType); - } catch (NoSuchMethodException e1) { - try { - if (setterType.equals(Integer.class)) { - method = typeClass.getMethod(setterName, int.class); - } else if (setterType.equals(Double.class)) { - method = typeClass.getMethod(setterName, double.class); - } else if (setterType.equals(Long.class)) { - method = typeClass.getMethod(setterName, long.class); - } else if (setterType.equals(Character.class)) { - method = typeClass.getMethod(setterName, char.class); - } else if (setterType.equals(Boolean.class)) { - method = typeClass.getMethod(setterName, boolean.class); - } else if (setterType.equals(Float.class)) { - method = typeClass.getMethod(setterName, float.class); - } - } catch (NoSuchMethodException e2) { - throw new DeserializationException("Unable to set value of " + fieldName + " with setter " + setterName, e2); - } - } - - if (method == null) { - throw new DeserializationException("Unable to set value of " + fieldName + " with setter " + setterName); - } - - // invoke the method on the instance with the parameter - try { - method.invoke(instance, parameter); - } catch (IllegalAccessException | InvocationTargetException e) { - throw new DeserializationException("Unable to set value of " + fieldName + " with setter " + setterName, e); - } - } - - // finally, return the instance - return instance; - } - - private java.util.List deserializeOpt(JsonNode node) { - java.util.ArrayList list = new java.util.ArrayList(); - if (node.has("c")) { - // opts can only contain Nonterminals - KiamaTrainTreeNode value = deserializeNonterminal(node.get("c")); - list.add(value); - return list; - - } else { - return list; - } - } - - private Object deserializeTerminal(JsonNode node) { - // get the type name - String typeName = node.get("t").asText(); - - // first try the builtin types - if (typeName.equals("int") || typeName.equals("Integer")) { - return node.get("v").asInt(); - } else if (typeName.equals("boolean") || typeName.equals("Boolean")) { - return node.get("v").asBoolean(); - } else if (typeName.equals("double") || typeName.equals("Double")) { - return node.get("v").asDouble(); - } else if (typeName.equals("String")) { - return node.get("v").asText(); - } else if (typeName.equals("long") || typeName.equals("Long")) { - return node.get("v").asLong(); - } else { - throw new DeserializationException("cannot create object of type " + typeName); - } - } - - private Enum deserializeEnum(JsonNode node) { - final String packageName = "de.tudresden.inf.st.train.kiama.enums"; - - // get the type name - String typeName = node.get("t").asText(); - if (typeName.contains("jastadd.ast.Position")) { - typeName = packageName + "." + "Position"; - } - if (typeName.contains("jastadd.ast.Signal")) { - typeName = packageName + "." + "Signal"; - } - - Class type; - try { - type = Class.forName(typeName); - } catch (ClassNotFoundException e) { - throw new DeserializationException("cannot create enum of type " + typeName, e); - } - - Method valueOf; - try { - valueOf = type.getMethod("valueOf", String.class); - } catch (NoSuchMethodException e) { - throw new DeserializationException("cannot call valueOf() on enum of type " + typeName, e); - } - try { - return (Enum) valueOf.invoke(null, node.get("v").asText()); - } catch (IllegalAccessException | InvocationTargetException e) { - throw new DeserializationException("cannot call valueOf() on enum of type " + typeName, e); - } - } - - private java.util.ArrayList deserializeList(JsonNode node) { - java.util.ArrayList list = new java.util.ArrayList(); - Iterator<JsonNode> it = node.get("c").elements(); - while (it.hasNext()) { - JsonNode child = it.next(); - // lists can only contain Nonterminals - list.add(deserializeNonterminal(child)); - } - return list; - } -} diff --git a/trainbenchmark-tool-kiama/src/main/java/de/tudresden/inf/st/train/kiama/driver/deserializer/DeserializationException.java b/trainbenchmark-tool-kiama/src/main/java/de/tudresden/inf/st/train/kiama/driver/deserializer/DeserializationException.java deleted file mode 100644 index 9720e0a00..000000000 --- a/trainbenchmark-tool-kiama/src/main/java/de/tudresden/inf/st/train/kiama/driver/deserializer/DeserializationException.java +++ /dev/null @@ -1,22 +0,0 @@ -package de.tudresden.inf.st.train.kiama.driver.deserializer; - -public class DeserializationException extends RuntimeException { - public DeserializationException() { - } - - public DeserializationException(String message) { - super(message); - } - - public DeserializationException(String message, Throwable cause) { - super(message, cause); - } - - public DeserializationException(Throwable cause) { - super(cause); - } - - public DeserializationException(String message, Throwable cause, boolean enableSuppression, boolean writableStackTrace) { - super(message, cause, enableSuppression, writableStackTrace); - } -} diff --git a/trainbenchmark-tool-kiama/src/main/java/de/tudresden/inf/st/train/kiama/driver/deserializer/JsonDeserializer.java b/trainbenchmark-tool-kiama/src/main/java/de/tudresden/inf/st/train/kiama/driver/deserializer/JsonDeserializer.java deleted file mode 100644 index c0fcb052b..000000000 --- a/trainbenchmark-tool-kiama/src/main/java/de/tudresden/inf/st/train/kiama/driver/deserializer/JsonDeserializer.java +++ /dev/null @@ -1,37 +0,0 @@ -package de.tudresden.inf.st.train.kiama.driver.deserializer; - -import com.fasterxml.jackson.databind.ObjectMapper; -import com.fasterxml.jackson.databind.module.SimpleModule; -import de.tudresden.inf.st.train.kiama.ast.KiamaTrainTreeNode; -import de.tudresden.inf.st.train.kiama.ast.RailwayContainer; - -import java.io.File; -import java.io.IOException; - -/** - * Created by jm on 5/15/17. - */ -public class JsonDeserializer { - - public static RailwayContainer read(File file) { - ObjectMapper mapper = new ObjectMapper(); - SimpleModule module = new SimpleModule(); - module.addDeserializer(KiamaTrainTreeNode.class, new ASTNodeDeserializer()); - mapper.registerModule(module); - - try { - KiamaTrainTreeNode readValue = mapper.readValue(file, KiamaTrainTreeNode.class); - - if (readValue instanceof RailwayContainer) { - return (RailwayContainer) readValue; - } else { - throw new RuntimeException("Cound not read a complete model"); - } - - } catch (IOException e) { - e.printStackTrace(); - } - throw new RuntimeException("Cound not read the model file " + file.getName()); - } - -} diff --git a/trainbenchmark-tool-kiama/src/main/java/de/tudresden/inf/st/train/kiama/matches/KiamaConnectedSegmentsInjectMatch.java b/trainbenchmark-tool-kiama/src/main/java/de/tudresden/inf/st/train/kiama/matches/KiamaConnectedSegmentsInjectMatch.java deleted file mode 100644 index 87f067ea1..000000000 --- a/trainbenchmark-tool-kiama/src/main/java/de/tudresden/inf/st/train/kiama/matches/KiamaConnectedSegmentsInjectMatch.java +++ /dev/null @@ -1,36 +0,0 @@ -package de.tudresden.inf.st.train.kiama.matches; - - -import de.tudresden.inf.st.train.kiama.ast.Segment; -import de.tudresden.inf.st.train.kiama.ast.Sensor; -import hu.bme.mit.trainbenchmark.benchmark.matches.ConnectedSegmentsInjectMatch; - -public class KiamaConnectedSegmentsInjectMatch extends KiamaMatch implements ConnectedSegmentsInjectMatch { - - protected final Sensor sensor; - protected final Segment segment1; - protected final Segment segment3; - - public KiamaConnectedSegmentsInjectMatch(final Sensor sensor, final Segment segment1, final Segment segment3) { - super(); - this.sensor = sensor; - this.segment1 = segment1; - this.segment3 = segment3; - } - - @Override - public Sensor getSensor() { - return sensor; - } - - @Override - public Segment getSegment1() { - return segment1; - } - - @Override - public Segment getSegment3() { - return segment3; - } - -} diff --git a/trainbenchmark-tool-kiama/src/main/java/de/tudresden/inf/st/train/kiama/matches/KiamaConnectedSegmentsMatch.java b/trainbenchmark-tool-kiama/src/main/java/de/tudresden/inf/st/train/kiama/matches/KiamaConnectedSegmentsMatch.java deleted file mode 100644 index f0ae61458..000000000 --- a/trainbenchmark-tool-kiama/src/main/java/de/tudresden/inf/st/train/kiama/matches/KiamaConnectedSegmentsMatch.java +++ /dev/null @@ -1,64 +0,0 @@ -package de.tudresden.inf.st.train.kiama.matches; - -import de.tudresden.inf.st.train.kiama.ast.Segment; -import de.tudresden.inf.st.train.kiama.ast.Sensor; -import hu.bme.mit.trainbenchmark.benchmark.matches.ConnectedSegmentsMatch; - -public class KiamaConnectedSegmentsMatch extends KiamaMatch implements ConnectedSegmentsMatch { - - protected final Sensor sensor; - protected final Segment segment1; - protected final Segment segment2; - protected final Segment segment3; - protected final Segment segment4; - protected final Segment segment5; - protected final Segment segment6; - - public KiamaConnectedSegmentsMatch(final Sensor sensor, final Segment segment1, final Segment segment2, - final Segment segment3, final Segment segment4, final Segment segment5, final Segment segment6) { - super(); - this.sensor = sensor; - this.segment1 = segment1; - this.segment2 = segment2; - this.segment3 = segment3; - this.segment4 = segment4; - this.segment5 = segment5; - this.segment6 = segment6; - } - - @Override - public Sensor getSensor() { - return sensor; - } - - @Override - public Segment getSegment1() { - return segment1; - } - - @Override - public Segment getSegment2() { - return segment2; - } - - @Override - public Segment getSegment3() { - return segment3; - } - - @Override - public Segment getSegment4() { - return segment4; - } - - @Override - public Segment getSegment5() { - return segment5; - } - - @Override - public Segment getSegment6() { - return segment6; - } - -} diff --git a/trainbenchmark-tool-kiama/src/main/java/de/tudresden/inf/st/train/kiama/matches/KiamaMatch.java b/trainbenchmark-tool-kiama/src/main/java/de/tudresden/inf/st/train/kiama/matches/KiamaMatch.java deleted file mode 100644 index 14cfccc49..000000000 --- a/trainbenchmark-tool-kiama/src/main/java/de/tudresden/inf/st/train/kiama/matches/KiamaMatch.java +++ /dev/null @@ -1,14 +0,0 @@ -package de.tudresden.inf.st.train.kiama.matches; - -import hu.bme.mit.trainbenchmark.benchmark.matches.BaseMatch; - -import java.util.Arrays; - -public abstract class KiamaMatch extends BaseMatch { - - @Override - public String toString() { - return "KiamaMatch [match=" + Arrays.toString(toArray()) + "]"; - } - -} diff --git a/trainbenchmark-tool-kiama/src/main/java/de/tudresden/inf/st/train/kiama/matches/KiamaPosLengthInjectMatch.java b/trainbenchmark-tool-kiama/src/main/java/de/tudresden/inf/st/train/kiama/matches/KiamaPosLengthInjectMatch.java deleted file mode 100644 index e7533ed2a..000000000 --- a/trainbenchmark-tool-kiama/src/main/java/de/tudresden/inf/st/train/kiama/matches/KiamaPosLengthInjectMatch.java +++ /dev/null @@ -1,20 +0,0 @@ -package de.tudresden.inf.st.train.kiama.matches; - -import de.tudresden.inf.st.train.kiama.ast.Segment; -import hu.bme.mit.trainbenchmark.benchmark.matches.PosLengthInjectMatch; - -public class KiamaPosLengthInjectMatch extends KiamaMatch implements PosLengthInjectMatch { - - protected final Segment segment; - - public KiamaPosLengthInjectMatch(final Segment segment) { - super(); - this.segment = segment; - } - - @Override - public Segment getSegment() { - return segment; - } - -} diff --git a/trainbenchmark-tool-kiama/src/main/java/de/tudresden/inf/st/train/kiama/matches/KiamaPosLengthMatch.java b/trainbenchmark-tool-kiama/src/main/java/de/tudresden/inf/st/train/kiama/matches/KiamaPosLengthMatch.java deleted file mode 100644 index 838b16134..000000000 --- a/trainbenchmark-tool-kiama/src/main/java/de/tudresden/inf/st/train/kiama/matches/KiamaPosLengthMatch.java +++ /dev/null @@ -1,26 +0,0 @@ -package de.tudresden.inf.st.train.kiama.matches; - -import de.tudresden.inf.st.train.kiama.ast.Segment; -import hu.bme.mit.trainbenchmark.benchmark.matches.PosLengthMatch; - -public class KiamaPosLengthMatch extends KiamaMatch implements PosLengthMatch { - - protected final Segment segment; - protected final int length; - - public KiamaPosLengthMatch(final Segment segment, final int length) { - super(); - this.segment = segment; - this.length = length; - } - - @Override - public Segment getSegment() { - return segment; - } - - public int getLength() { - return length; - } - -} diff --git a/trainbenchmark-tool-kiama/src/main/java/de/tudresden/inf/st/train/kiama/matches/KiamaRouteSensorInjectMatch.java b/trainbenchmark-tool-kiama/src/main/java/de/tudresden/inf/st/train/kiama/matches/KiamaRouteSensorInjectMatch.java deleted file mode 100644 index a29b84511..000000000 --- a/trainbenchmark-tool-kiama/src/main/java/de/tudresden/inf/st/train/kiama/matches/KiamaRouteSensorInjectMatch.java +++ /dev/null @@ -1,28 +0,0 @@ -package de.tudresden.inf.st.train.kiama.matches; - -import de.tudresden.inf.st.train.kiama.ast.Route; -import de.tudresden.inf.st.train.kiama.ast.Sensor; -import hu.bme.mit.trainbenchmark.benchmark.matches.RouteSensorInjectMatch; - -public class KiamaRouteSensorInjectMatch extends KiamaMatch implements RouteSensorInjectMatch { - - protected final Route route; - protected final Sensor sensor; - - public KiamaRouteSensorInjectMatch(final Route route, final Sensor sensor) { - super(); - this.route = route; - this.sensor = sensor; - } - - @Override - public Route getRoute() { - return route; - } - - @Override - public Sensor getSensor() { - return sensor; - } - -} diff --git a/trainbenchmark-tool-kiama/src/main/java/de/tudresden/inf/st/train/kiama/matches/KiamaRouteSensorMatch.java b/trainbenchmark-tool-kiama/src/main/java/de/tudresden/inf/st/train/kiama/matches/KiamaRouteSensorMatch.java deleted file mode 100644 index beee8ba47..000000000 --- a/trainbenchmark-tool-kiama/src/main/java/de/tudresden/inf/st/train/kiama/matches/KiamaRouteSensorMatch.java +++ /dev/null @@ -1,50 +0,0 @@ -package de.tudresden.inf.st.train.kiama.matches; - -import de.tudresden.inf.st.train.kiama.ast.Route; -import de.tudresden.inf.st.train.kiama.ast.Sensor; -import de.tudresden.inf.st.train.kiama.ast.Switch; -import de.tudresden.inf.st.train.kiama.ast.SwitchPosition; -import hu.bme.mit.trainbenchmark.benchmark.matches.RouteSensorMatch; - -public class KiamaRouteSensorMatch extends KiamaMatch implements RouteSensorMatch { - - protected final Route route; - protected final Sensor sensor; - protected final SwitchPosition swP; - protected final Switch sw; - - public KiamaRouteSensorMatch(final Route route, final Sensor sensor, final SwitchPosition swP, final Switch sw) { - super(); - this.route = route; - this.sensor = sensor; - this.swP = swP; - this.sw = sw; - } - - @Override - public String toString() { - return "[RouteSensorMatch Route:" + route.Id() + " Sensor:" + sensor.Id() + " SwitchPos:" - + swP.Id() + " Switch:" + sw.Id() + "]"; - } - - @Override - public Route getRoute() { - return route; - } - - @Override - public Sensor getSensor() { - return sensor; - } - - @Override - public SwitchPosition getSwP() { - return swP; - } - - @Override - public Switch getSw() { - return sw; - } - -} diff --git a/trainbenchmark-tool-kiama/src/main/java/de/tudresden/inf/st/train/kiama/matches/KiamaSemaphoreNeighborInjectMatch.java b/trainbenchmark-tool-kiama/src/main/java/de/tudresden/inf/st/train/kiama/matches/KiamaSemaphoreNeighborInjectMatch.java deleted file mode 100644 index fd6865af9..000000000 --- a/trainbenchmark-tool-kiama/src/main/java/de/tudresden/inf/st/train/kiama/matches/KiamaSemaphoreNeighborInjectMatch.java +++ /dev/null @@ -1,28 +0,0 @@ -package de.tudresden.inf.st.train.kiama.matches; - -import de.tudresden.inf.st.train.kiama.ast.Route; -import de.tudresden.inf.st.train.kiama.ast.Semaphore; -import hu.bme.mit.trainbenchmark.benchmark.matches.SemaphoreNeighborInjectMatch; - -public class KiamaSemaphoreNeighborInjectMatch extends KiamaMatch implements SemaphoreNeighborInjectMatch { - - protected final Route route; - protected final Semaphore semaphore; - - public KiamaSemaphoreNeighborInjectMatch(final Route route, final Semaphore semaphore) { - super(); - this.route = route; - this.semaphore = semaphore; - } - - @Override - public Route getRoute() { - return route; - } - - @Override - public Semaphore getSemaphore() { - return semaphore; - } - -} diff --git a/trainbenchmark-tool-kiama/src/main/java/de/tudresden/inf/st/train/kiama/matches/KiamaSemaphoreNeighborMatch.java b/trainbenchmark-tool-kiama/src/main/java/de/tudresden/inf/st/train/kiama/matches/KiamaSemaphoreNeighborMatch.java deleted file mode 100644 index 9d81ac100..000000000 --- a/trainbenchmark-tool-kiama/src/main/java/de/tudresden/inf/st/train/kiama/matches/KiamaSemaphoreNeighborMatch.java +++ /dev/null @@ -1,66 +0,0 @@ -package de.tudresden.inf.st.train.kiama.matches; - -import de.tudresden.inf.st.train.kiama.ast.Route; -import de.tudresden.inf.st.train.kiama.ast.Semaphore; -import de.tudresden.inf.st.train.kiama.ast.Sensor; -import de.tudresden.inf.st.train.kiama.ast.TrackElement; -import hu.bme.mit.trainbenchmark.benchmark.matches.SemaphoreNeighborMatch; - -public class KiamaSemaphoreNeighborMatch extends KiamaMatch implements SemaphoreNeighborMatch { - - protected final Semaphore semaphore; - protected final Route route1; - protected final Route route2; - protected final Sensor sensor1; - protected final Sensor sensor2; - protected final TrackElement te1; - protected final TrackElement te2; - - public KiamaSemaphoreNeighborMatch(final Semaphore semaphore, final Route route1, final Route route2, final Sensor sensor1, final Sensor sensor2, - final TrackElement te1, final TrackElement te2) { - super(); - this.semaphore = semaphore; - this.route1 = route1; - this.route2 = route2; - this.sensor1 = sensor1; - this.sensor2 = sensor2; - this.te1 = te1; - this.te2 = te2; - } - - @Override - public Semaphore getSemaphore() { - return semaphore; - } - - @Override - public Route getRoute1() { - return route1; - } - - @Override - public Route getRoute2() { - return route2; - } - - @Override - public Sensor getSensor1() { - return sensor1; - } - - @Override - public Sensor getSensor2() { - return sensor2; - } - - @Override - public TrackElement getTe1() { - return te1; - } - - @Override - public TrackElement getTe2() { - return te2; - } - -} diff --git a/trainbenchmark-tool-kiama/src/main/java/de/tudresden/inf/st/train/kiama/matches/KiamaSwitchMonitoredInjectMatch.java b/trainbenchmark-tool-kiama/src/main/java/de/tudresden/inf/st/train/kiama/matches/KiamaSwitchMonitoredInjectMatch.java deleted file mode 100644 index a59eb4794..000000000 --- a/trainbenchmark-tool-kiama/src/main/java/de/tudresden/inf/st/train/kiama/matches/KiamaSwitchMonitoredInjectMatch.java +++ /dev/null @@ -1,20 +0,0 @@ -package de.tudresden.inf.st.train.kiama.matches; - -import de.tudresden.inf.st.train.kiama.ast.Switch; -import hu.bme.mit.trainbenchmark.benchmark.matches.SwitchMonitoredInjectMatch; - -public class KiamaSwitchMonitoredInjectMatch extends KiamaMatch implements SwitchMonitoredInjectMatch { - - protected final Switch sw; - - public KiamaSwitchMonitoredInjectMatch(final Switch sw) { - super(); - this.sw = sw; - } - - @Override - public Switch getSw() { - return sw; - } - -} diff --git a/trainbenchmark-tool-kiama/src/main/java/de/tudresden/inf/st/train/kiama/matches/KiamaSwitchMonitoredMatch.java b/trainbenchmark-tool-kiama/src/main/java/de/tudresden/inf/st/train/kiama/matches/KiamaSwitchMonitoredMatch.java deleted file mode 100644 index d666490e0..000000000 --- a/trainbenchmark-tool-kiama/src/main/java/de/tudresden/inf/st/train/kiama/matches/KiamaSwitchMonitoredMatch.java +++ /dev/null @@ -1,20 +0,0 @@ -package de.tudresden.inf.st.train.kiama.matches; - -import de.tudresden.inf.st.train.kiama.ast.Switch; -import hu.bme.mit.trainbenchmark.benchmark.matches.SwitchMonitoredMatch; - -public class KiamaSwitchMonitoredMatch extends KiamaMatch implements SwitchMonitoredMatch { - - protected final Switch sw; - - public KiamaSwitchMonitoredMatch(final Switch sw) { - super(); - this.sw = sw; - } - - @Override - public Switch getSw() { - return sw; - } - -} diff --git a/trainbenchmark-tool-kiama/src/main/java/de/tudresden/inf/st/train/kiama/matches/KiamaSwitchSetInjectMatch.java b/trainbenchmark-tool-kiama/src/main/java/de/tudresden/inf/st/train/kiama/matches/KiamaSwitchSetInjectMatch.java deleted file mode 100644 index 197a174d2..000000000 --- a/trainbenchmark-tool-kiama/src/main/java/de/tudresden/inf/st/train/kiama/matches/KiamaSwitchSetInjectMatch.java +++ /dev/null @@ -1,20 +0,0 @@ -package de.tudresden.inf.st.train.kiama.matches; - -import de.tudresden.inf.st.train.kiama.ast.Switch; -import hu.bme.mit.trainbenchmark.benchmark.matches.SwitchSetInjectMatch; - -public class KiamaSwitchSetInjectMatch extends KiamaMatch implements SwitchSetInjectMatch { - - protected final Switch sw; - - public KiamaSwitchSetInjectMatch(final Switch sw) { - super(); - this.sw = sw; - } - - @Override - public Switch getSw() { - return sw; - } - -} diff --git a/trainbenchmark-tool-kiama/src/main/java/de/tudresden/inf/st/train/kiama/matches/KiamaSwitchSetMatch.java b/trainbenchmark-tool-kiama/src/main/java/de/tudresden/inf/st/train/kiama/matches/KiamaSwitchSetMatch.java deleted file mode 100644 index 6aa52f9d1..000000000 --- a/trainbenchmark-tool-kiama/src/main/java/de/tudresden/inf/st/train/kiama/matches/KiamaSwitchSetMatch.java +++ /dev/null @@ -1,55 +0,0 @@ -package de.tudresden.inf.st.train.kiama.matches; - -import de.tudresden.inf.st.train.kiama.ast.*; -import de.tudresden.inf.st.train.kiama.enums.Position; -import hu.bme.mit.trainbenchmark.benchmark.matches.SwitchSetMatch; - -public class KiamaSwitchSetMatch extends KiamaMatch implements SwitchSetMatch { - - protected final Semaphore semaphore; - protected final Route route; - protected final SwitchPosition swP; - protected final Switch sw; - protected final Position position; - protected final Position currentPosition; - - public KiamaSwitchSetMatch(final Semaphore semaphore, final Route route, final SwitchPosition swP, final Switch sw, final Position position, - final Position currentPosition) { - super(); - this.semaphore = semaphore; - this.route = route; - this.swP = swP; - this.sw = sw; - this.position = position; - this.currentPosition = currentPosition; - } - - @Override - public Semaphore getSemaphore() { - return semaphore; - } - - @Override - public Route getRoute() { - return route; - } - - @Override - public SwitchPosition getSwP() { - return swP; - } - - @Override - public Switch getSw() { - return sw; - } - - public Position getPosition() { - return position; - } - - public Position getCurrentPosition() { - return currentPosition; - } - -} diff --git a/trainbenchmark-tool-kiama/src/main/java/de/tudresden/inf/st/train/kiama/operations/KiamaModelOperationFactory.java b/trainbenchmark-tool-kiama/src/main/java/de/tudresden/inf/st/train/kiama/operations/KiamaModelOperationFactory.java deleted file mode 100644 index a3d180282..000000000 --- a/trainbenchmark-tool-kiama/src/main/java/de/tudresden/inf/st/train/kiama/operations/KiamaModelOperationFactory.java +++ /dev/null @@ -1,150 +0,0 @@ -package de.tudresden.inf.st.train.kiama.operations; - -import de.tudresden.inf.st.train.kiama.driver.KiamaDriver; -import de.tudresden.inf.st.train.kiama.matches.*; -import de.tudresden.inf.st.train.kiama.queries.*; -import de.tudresden.inf.st.train.kiama.transformations.KiamaTransformation; -import de.tudresden.inf.st.train.kiama.transformations.inject.*; -import de.tudresden.inf.st.train.kiama.transformations.repair.*; -import hu.bme.mit.trainbenchmark.benchmark.operations.ModelOperation; -import hu.bme.mit.trainbenchmark.benchmark.operations.ModelOperationFactory; -import hu.bme.mit.trainbenchmark.constants.RailwayOperation; - -public class KiamaModelOperationFactory extends ModelOperationFactory<KiamaMatch, KiamaDriver> { - - @Override - public ModelOperation<? extends KiamaMatch, KiamaDriver> createOperation(final RailwayOperation operationEnum, - final String workspaceDir, - final KiamaDriver driver) throws Exception { - - switch (operationEnum) { - // ConnectedSegments - case CONNECTEDSEGMENTS: { - final KiamaQuery<KiamaConnectedSegmentsMatch> query = new KiamaQueryConnectedSegments<>(driver); - final ModelOperation<KiamaConnectedSegmentsMatch, KiamaDriver> operation = ModelOperation.of(query); - return operation; - } - case CONNECTEDSEGMENTS_INJECT: { - final KiamaQuery<KiamaConnectedSegmentsInjectMatch> query = new KiamaQueryConnectedSegmentsInject<>(driver); - final KiamaTransformation<KiamaConnectedSegmentsInjectMatch, KiamaDriver> transformation = new KiamaTransformationInjectConnectedSegments<>( - driver); - final ModelOperation<KiamaConnectedSegmentsInjectMatch, KiamaDriver> operation = ModelOperation.of(query, transformation); - return operation; - } - case CONNECTEDSEGMENTS_REPAIR: { - final KiamaQuery<KiamaConnectedSegmentsMatch> query = new KiamaQueryConnectedSegments<>(driver); - final KiamaTransformation<KiamaConnectedSegmentsMatch, KiamaDriver> transformation = new KiamaTransformationRepairConnectedSegments<>( - driver); - final ModelOperation<KiamaConnectedSegmentsMatch, KiamaDriver> operation = ModelOperation.of(query, transformation); - return operation; - } - - // PosLength - case POSLENGTH: { - final KiamaQuery<KiamaPosLengthMatch> query = new KiamaQueryPosLength<>(driver); - final ModelOperation<KiamaPosLengthMatch, KiamaDriver> operation = ModelOperation.of(query); - return operation; - } - case POSLENGTH_INJECT: { - final KiamaQuery<KiamaPosLengthInjectMatch> query = new KiamaQueryPosLengthInject<>(driver); - final KiamaTransformation<KiamaPosLengthInjectMatch, KiamaDriver> transformation = new KiamaTransformationInjectPosLength<>( - driver); - final ModelOperation<KiamaPosLengthInjectMatch, KiamaDriver> operation = ModelOperation.of(query, transformation); - return operation; - } - case POSLENGTH_REPAIR: { - final KiamaQuery<KiamaPosLengthMatch> query = new KiamaQueryPosLength<>(driver); - final KiamaTransformation<KiamaPosLengthMatch, KiamaDriver> transformation = new KiamaTransformationRepairPosLength<>( - driver); - final ModelOperation<KiamaPosLengthMatch, KiamaDriver> operation = ModelOperation.of(query, transformation); - return operation; - } - - // RouteSensor - case ROUTESENSOR: { - final KiamaQuery<KiamaRouteSensorMatch> query = new KiamaQueryRouteSensor<>(driver); - final ModelOperation<KiamaRouteSensorMatch, KiamaDriver> operation = ModelOperation.of(query); - return operation; - } - case ROUTESENSOR_INJECT: { - final KiamaQuery<KiamaRouteSensorInjectMatch> query = new KiamaQueryRouteSensorInject<>(driver); - final KiamaTransformation<KiamaRouteSensorInjectMatch, KiamaDriver> transformation = new KiamaTransformationInjectRouteSensor<>( - driver); - final ModelOperation<KiamaRouteSensorInjectMatch, KiamaDriver> operation = ModelOperation.of(query, transformation); - return operation; - } - case ROUTESENSOR_REPAIR: { - final KiamaQuery<KiamaRouteSensorMatch> query = new KiamaQueryRouteSensor<>(driver); - final KiamaTransformation<KiamaRouteSensorMatch, KiamaDriver> transformation = new KiamaTransformationRepairRouteSensor<>( - driver); - final ModelOperation<KiamaRouteSensorMatch, KiamaDriver> operation = ModelOperation.of(query, transformation); - return operation; - } - - // SemaphoreNeighbor - case SEMAPHORENEIGHBOR: { - final KiamaQuery<KiamaSemaphoreNeighborMatch> query = new KiamaQuerySemaphoreNeighbor<>(driver); - final ModelOperation<KiamaSemaphoreNeighborMatch, KiamaDriver> operation = ModelOperation.of(query); - return operation; - } - case SEMAPHORENEIGHBOR_INJECT: { - final KiamaQuery<KiamaSemaphoreNeighborInjectMatch> query = new KiamaQuerySemaphoreNeighborInject<>(driver); - final KiamaTransformation<KiamaSemaphoreNeighborInjectMatch, KiamaDriver> transformation = new KiamaTransformationInjectSemaphoreNeighbor<>( - driver); - final ModelOperation<KiamaSemaphoreNeighborInjectMatch, KiamaDriver> operation = ModelOperation.of(query, transformation); - return operation; - } - case SEMAPHORENEIGHBOR_REPAIR: { - final KiamaQuery<KiamaSemaphoreNeighborMatch> query = new KiamaQuerySemaphoreNeighbor<>(driver); - final KiamaTransformation<KiamaSemaphoreNeighborMatch, KiamaDriver> transformation = new KiamaTransformationRepairSemaphoreNeighbor<>( - driver); - final ModelOperation<KiamaSemaphoreNeighborMatch, KiamaDriver> operation = ModelOperation.of(query, transformation); - return operation; - } - - // SwitchMonitored - case SWITCHMONITORED: { - final KiamaQuery<KiamaSwitchMonitoredMatch> query = new KiamaQuerySwitchMonitored<>(driver); - final ModelOperation<KiamaSwitchMonitoredMatch, KiamaDriver> operation = ModelOperation.of(query); - return operation; - } - case SWITCHMONITORED_INJECT: { - final KiamaQuery<KiamaSwitchMonitoredInjectMatch> query = new KiamaQuerySwitchMonitoredInject<>(driver); - final KiamaTransformation<KiamaSwitchMonitoredInjectMatch, KiamaDriver> transformation = new KiamaTransformationInjectSwitchMonitored<>( - driver); - final ModelOperation<KiamaSwitchMonitoredInjectMatch, KiamaDriver> operation = ModelOperation.of(query, transformation); - return operation; - } - case SWITCHMONITORED_REPAIR: { - final KiamaQuery<KiamaSwitchMonitoredMatch> query = new KiamaQuerySwitchMonitored<>(driver); - final KiamaTransformation<KiamaSwitchMonitoredMatch, KiamaDriver> transformation = new KiamaTransformationRepairSwitchMonitored<>( - driver); - final ModelOperation<KiamaSwitchMonitoredMatch, KiamaDriver> operation = ModelOperation.of(query, transformation); - return operation; - } - - // SwitchSet - case SWITCHSET: { - final KiamaQuery<KiamaSwitchSetMatch> query = new KiamaQuerySwitchSet<>(driver); - final ModelOperation<KiamaSwitchSetMatch, KiamaDriver> operation = ModelOperation.of(query); - return operation; - } - case SWITCHSET_INJECT: { - final KiamaQuery<KiamaSwitchSetInjectMatch> query = new KiamaQuerySwitchSetInject<>(driver); - final KiamaTransformation<KiamaSwitchSetInjectMatch, KiamaDriver> transformation = new KiamaTransformationInjectSwitchSet<>(driver); - final ModelOperation<KiamaSwitchSetInjectMatch, KiamaDriver> operation = ModelOperation.of(query, transformation); - return operation; - } - case SWITCHSET_REPAIR: { - final KiamaQuery<KiamaSwitchSetMatch> query = new KiamaQuerySwitchSet<>(driver); - final KiamaTransformation<KiamaSwitchSetMatch, KiamaDriver> transformation = new KiamaTransformationRepairSwitchSet<>(driver); - final ModelOperation<KiamaSwitchSetMatch, KiamaDriver> operation = ModelOperation.of(query, transformation); - return operation; - } - - default: - throw new UnsupportedOperationException("Operation " + operationEnum + " not supported."); - } - } - -} diff --git a/trainbenchmark-tool-kiama/src/main/java/de/tudresden/inf/st/train/kiama/queries/KiamaQuery.java b/trainbenchmark-tool-kiama/src/main/java/de/tudresden/inf/st/train/kiama/queries/KiamaQuery.java deleted file mode 100644 index d48a38db5..000000000 --- a/trainbenchmark-tool-kiama/src/main/java/de/tudresden/inf/st/train/kiama/queries/KiamaQuery.java +++ /dev/null @@ -1,24 +0,0 @@ -package de.tudresden.inf.st.train.kiama.queries; - -import de.tudresden.inf.st.train.kiama.driver.KiamaDriver; -import de.tudresden.inf.st.train.kiama.matches.KiamaMatch; -import hu.bme.mit.trainbenchmark.benchmark.operations.ModelQuery; -import hu.bme.mit.trainbenchmark.constants.RailwayQuery; - -import java.io.IOException; -import java.util.Collection; - -public class KiamaQuery<TPatternMatch extends KiamaMatch> extends - ModelQuery<TPatternMatch, KiamaDriver> { - - public KiamaQuery(final RailwayQuery query, final KiamaDriver driver) { - super(query, driver); - } - - @SuppressWarnings("unchecked") - @Override - public Collection<TPatternMatch> evaluate() throws IOException { - return null; - } - -} diff --git a/trainbenchmark-tool-kiama/src/main/java/de/tudresden/inf/st/train/kiama/queries/KiamaQueryConnectedSegments.java b/trainbenchmark-tool-kiama/src/main/java/de/tudresden/inf/st/train/kiama/queries/KiamaQueryConnectedSegments.java deleted file mode 100644 index aebcb4352..000000000 --- a/trainbenchmark-tool-kiama/src/main/java/de/tudresden/inf/st/train/kiama/queries/KiamaQueryConnectedSegments.java +++ /dev/null @@ -1,30 +0,0 @@ -package de.tudresden.inf.st.train.kiama.queries; - -import de.tudresden.inf.st.train.kiama.driver.KiamaDriver; -import de.tudresden.inf.st.train.kiama.matches.KiamaConnectedSegmentsMatch; -import de.tudresden.inf.st.train.kiama.matches.KiamaInternalConnectedSegmentsMatch; -import hu.bme.mit.trainbenchmark.constants.RailwayQuery; - -import java.io.IOException; -import java.util.ArrayList; -import java.util.Collection; -import java.util.List; - -public class KiamaQueryConnectedSegments<TKiamaDriver extends KiamaDriver> - extends KiamaQuery<KiamaConnectedSegmentsMatch> { - - public KiamaQueryConnectedSegments(final TKiamaDriver driver) { - super(RailwayQuery.CONNECTEDSEGMENTS, driver); - } - - @Override - public Collection<KiamaConnectedSegmentsMatch> evaluate() throws IOException { - Collection<KiamaInternalConnectedSegmentsMatch> source = driver.queries.getConnectedSegments(); - List<KiamaConnectedSegmentsMatch> target = new ArrayList<>(); - for (KiamaInternalConnectedSegmentsMatch m : source) { - target.add(new KiamaConnectedSegmentsMatch(m.getSensor(), m.getSegment1(), m.getSegment2(), m.getSegment3(), m.getSegment4(), m.getSegment5(), m.getSegment6())); - } - return target; - } - -} diff --git a/trainbenchmark-tool-kiama/src/main/java/de/tudresden/inf/st/train/kiama/queries/KiamaQueryConnectedSegmentsInject.java b/trainbenchmark-tool-kiama/src/main/java/de/tudresden/inf/st/train/kiama/queries/KiamaQueryConnectedSegmentsInject.java deleted file mode 100644 index fc6afe2e6..000000000 --- a/trainbenchmark-tool-kiama/src/main/java/de/tudresden/inf/st/train/kiama/queries/KiamaQueryConnectedSegmentsInject.java +++ /dev/null @@ -1,30 +0,0 @@ -package de.tudresden.inf.st.train.kiama.queries; - -import de.tudresden.inf.st.train.kiama.driver.KiamaDriver; -import de.tudresden.inf.st.train.kiama.matches.KiamaConnectedSegmentsInjectMatch; -import de.tudresden.inf.st.train.kiama.matches.KiamaInternalConnectedSegmentsInjectMatch; -import hu.bme.mit.trainbenchmark.constants.RailwayQuery; - -import java.io.IOException; -import java.util.ArrayList; -import java.util.Collection; -import java.util.List; - -public class KiamaQueryConnectedSegmentsInject<TKiamaDriver extends KiamaDriver> - extends KiamaQuery<KiamaConnectedSegmentsInjectMatch> { - - public KiamaQueryConnectedSegmentsInject(final TKiamaDriver driver) { - super(RailwayQuery.CONNECTEDSEGMENTS_INJECT, driver); - } - - @Override - public Collection<KiamaConnectedSegmentsInjectMatch> evaluate() throws IOException { - Collection<KiamaInternalConnectedSegmentsInjectMatch> source = driver.queries.getConnectedSegmentsInjectMatches(); - List<KiamaConnectedSegmentsInjectMatch> target = new ArrayList<>(); - for (KiamaInternalConnectedSegmentsInjectMatch m : source) { - target.add(new KiamaConnectedSegmentsInjectMatch(m.getSensor(), m.getSegment1(), m.getSegment3())); - } - return target; - } - -} diff --git a/trainbenchmark-tool-kiama/src/main/java/de/tudresden/inf/st/train/kiama/queries/KiamaQueryPosLength.java b/trainbenchmark-tool-kiama/src/main/java/de/tudresden/inf/st/train/kiama/queries/KiamaQueryPosLength.java deleted file mode 100644 index 344bbfefc..000000000 --- a/trainbenchmark-tool-kiama/src/main/java/de/tudresden/inf/st/train/kiama/queries/KiamaQueryPosLength.java +++ /dev/null @@ -1,27 +0,0 @@ -package de.tudresden.inf.st.train.kiama.queries; - -import de.tudresden.inf.st.train.kiama.driver.KiamaDriver; -import de.tudresden.inf.st.train.kiama.matches.KiamaInternalPosLengthMatch; -import de.tudresden.inf.st.train.kiama.matches.KiamaPosLengthMatch; -import hu.bme.mit.trainbenchmark.constants.RailwayQuery; - -import java.util.ArrayList; -import java.util.Collection; -import java.util.List; - -public class KiamaQueryPosLength<TKiamaDriver extends KiamaDriver> extends KiamaQuery<KiamaPosLengthMatch> { - - public KiamaQueryPosLength(final TKiamaDriver driver) { - super(RailwayQuery.POSLENGTH, driver); - } - - @Override - public Collection<KiamaPosLengthMatch> evaluate() { - Collection<KiamaInternalPosLengthMatch> source = driver.queries.getPosLengthMatches(); - List<KiamaPosLengthMatch> target = new ArrayList<>(); - for (KiamaInternalPosLengthMatch m : source) { - target.add(new KiamaPosLengthMatch(m.getSegment(), m.getLength())); - } - return target; - } -} diff --git a/trainbenchmark-tool-kiama/src/main/java/de/tudresden/inf/st/train/kiama/queries/KiamaQueryPosLengthInject.java b/trainbenchmark-tool-kiama/src/main/java/de/tudresden/inf/st/train/kiama/queries/KiamaQueryPosLengthInject.java deleted file mode 100644 index a8d1f34ce..000000000 --- a/trainbenchmark-tool-kiama/src/main/java/de/tudresden/inf/st/train/kiama/queries/KiamaQueryPosLengthInject.java +++ /dev/null @@ -1,27 +0,0 @@ -package de.tudresden.inf.st.train.kiama.queries; - -import de.tudresden.inf.st.train.kiama.driver.KiamaDriver; -import de.tudresden.inf.st.train.kiama.matches.KiamaInternalPosLengthInjectMatch; -import de.tudresden.inf.st.train.kiama.matches.KiamaPosLengthInjectMatch; -import hu.bme.mit.trainbenchmark.constants.RailwayQuery; - -import java.util.ArrayList; -import java.util.Collection; -import java.util.List; - -public class KiamaQueryPosLengthInject<TKiamaDriver extends KiamaDriver> extends KiamaQuery<KiamaPosLengthInjectMatch> { - - public KiamaQueryPosLengthInject(final TKiamaDriver driver) { - super(RailwayQuery.POSLENGTH_INJECT, driver); - } - - @Override - public Collection<KiamaPosLengthInjectMatch> evaluate() { - Collection<KiamaInternalPosLengthInjectMatch> source = driver.queries.getPosLengthInjectMatches(); - List<KiamaPosLengthInjectMatch> target = new ArrayList<>(); - for (KiamaInternalPosLengthInjectMatch m : source) { - target.add(new KiamaPosLengthInjectMatch(m.getSegment())); - } - return target; - } -} diff --git a/trainbenchmark-tool-kiama/src/main/java/de/tudresden/inf/st/train/kiama/queries/KiamaQueryRouteSensor.java b/trainbenchmark-tool-kiama/src/main/java/de/tudresden/inf/st/train/kiama/queries/KiamaQueryRouteSensor.java deleted file mode 100644 index e2d93702b..000000000 --- a/trainbenchmark-tool-kiama/src/main/java/de/tudresden/inf/st/train/kiama/queries/KiamaQueryRouteSensor.java +++ /dev/null @@ -1,28 +0,0 @@ -package de.tudresden.inf.st.train.kiama.queries; - -import de.tudresden.inf.st.train.kiama.driver.KiamaDriver; -import de.tudresden.inf.st.train.kiama.matches.KiamaInternalRouteSensorMatch; -import de.tudresden.inf.st.train.kiama.matches.KiamaRouteSensorMatch; -import hu.bme.mit.trainbenchmark.constants.RailwayQuery; - -import java.util.ArrayList; -import java.util.Collection; -import java.util.List; - -public class KiamaQueryRouteSensor<TKiamaDriver extends KiamaDriver> extends - KiamaQuery<KiamaRouteSensorMatch> { - - public KiamaQueryRouteSensor(final TKiamaDriver driver) { - super(RailwayQuery.ROUTESENSOR, driver); - } - - @Override - public Collection<KiamaRouteSensorMatch> evaluate() { - Collection<KiamaInternalRouteSensorMatch> source = driver.queries.getRouteSensorMatches(); - List<KiamaRouteSensorMatch> target = new ArrayList<>(); - for (KiamaInternalRouteSensorMatch m : source) { - target.add(new KiamaRouteSensorMatch(m.getRoute(), m.getSensor(), m.getSwP(), m.getSw())); - } - return target; - } -} diff --git a/trainbenchmark-tool-kiama/src/main/java/de/tudresden/inf/st/train/kiama/queries/KiamaQueryRouteSensorInject.java b/trainbenchmark-tool-kiama/src/main/java/de/tudresden/inf/st/train/kiama/queries/KiamaQueryRouteSensorInject.java deleted file mode 100644 index d2a937b4f..000000000 --- a/trainbenchmark-tool-kiama/src/main/java/de/tudresden/inf/st/train/kiama/queries/KiamaQueryRouteSensorInject.java +++ /dev/null @@ -1,28 +0,0 @@ -package de.tudresden.inf.st.train.kiama.queries; - -import de.tudresden.inf.st.train.kiama.driver.KiamaDriver; -import de.tudresden.inf.st.train.kiama.matches.KiamaInternalRouteSensorInjectMatch; -import de.tudresden.inf.st.train.kiama.matches.KiamaRouteSensorInjectMatch; -import hu.bme.mit.trainbenchmark.constants.RailwayQuery; - -import java.util.ArrayList; -import java.util.Collection; -import java.util.List; - -public class KiamaQueryRouteSensorInject<TKiamaDriver extends KiamaDriver> - extends KiamaQuery<KiamaRouteSensorInjectMatch> { - - public KiamaQueryRouteSensorInject(final TKiamaDriver driver) { - super(RailwayQuery.ROUTESENSOR_INJECT, driver); - } - - @Override - public Collection<KiamaRouteSensorInjectMatch> evaluate() { - Collection<KiamaInternalRouteSensorInjectMatch> source = driver.queries.getRouteSensorInjectMatches(); - List<KiamaRouteSensorInjectMatch> target = new ArrayList<>(); - for (KiamaInternalRouteSensorInjectMatch m : source) { - target.add(new KiamaRouteSensorInjectMatch(m.getRoute(), m.getSensor())); - } - return target; - } -} diff --git a/trainbenchmark-tool-kiama/src/main/java/de/tudresden/inf/st/train/kiama/queries/KiamaQuerySemaphoreNeighbor.java b/trainbenchmark-tool-kiama/src/main/java/de/tudresden/inf/st/train/kiama/queries/KiamaQuerySemaphoreNeighbor.java deleted file mode 100644 index 61024f881..000000000 --- a/trainbenchmark-tool-kiama/src/main/java/de/tudresden/inf/st/train/kiama/queries/KiamaQuerySemaphoreNeighbor.java +++ /dev/null @@ -1,27 +0,0 @@ -package de.tudresden.inf.st.train.kiama.queries; - -import de.tudresden.inf.st.train.kiama.driver.KiamaDriver; -import de.tudresden.inf.st.train.kiama.matches.KiamaInternalSemaphoreNeighborMatch; -import de.tudresden.inf.st.train.kiama.matches.KiamaSemaphoreNeighborMatch; -import hu.bme.mit.trainbenchmark.constants.RailwayQuery; - -import java.util.ArrayList; -import java.util.Collection; -import java.util.List; - -public class KiamaQuerySemaphoreNeighbor<TKiamaDriver extends KiamaDriver> extends KiamaQuery<KiamaSemaphoreNeighborMatch> { - - public KiamaQuerySemaphoreNeighbor(final TKiamaDriver driver) { - super(RailwayQuery.SEMAPHORENEIGHBOR, driver); - } - - @Override - public Collection<KiamaSemaphoreNeighborMatch> evaluate() { - Collection<KiamaInternalSemaphoreNeighborMatch> source = driver.queries.getSemaphoreNeighborMatches(); - List<KiamaSemaphoreNeighborMatch> target = new ArrayList<>(); - for (KiamaInternalSemaphoreNeighborMatch m : source) { - target.add(new KiamaSemaphoreNeighborMatch(m.getSemaphore(), m.getRoute1(), m.getRoute2(), m.getSensor1(), m.getSensor2(), m.getTe1(), m.getTe2())); - } - return target; - } -} diff --git a/trainbenchmark-tool-kiama/src/main/java/de/tudresden/inf/st/train/kiama/queries/KiamaQuerySemaphoreNeighborInject.java b/trainbenchmark-tool-kiama/src/main/java/de/tudresden/inf/st/train/kiama/queries/KiamaQuerySemaphoreNeighborInject.java deleted file mode 100644 index 9518f4d15..000000000 --- a/trainbenchmark-tool-kiama/src/main/java/de/tudresden/inf/st/train/kiama/queries/KiamaQuerySemaphoreNeighborInject.java +++ /dev/null @@ -1,28 +0,0 @@ -package de.tudresden.inf.st.train.kiama.queries; - -import de.tudresden.inf.st.train.kiama.driver.KiamaDriver; -import de.tudresden.inf.st.train.kiama.matches.KiamaInternalSemaphoreNeighborInjectMatch; -import de.tudresden.inf.st.train.kiama.matches.KiamaSemaphoreNeighborInjectMatch; -import hu.bme.mit.trainbenchmark.constants.RailwayQuery; - -import java.util.ArrayList; -import java.util.Collection; -import java.util.List; - -public class KiamaQuerySemaphoreNeighborInject<TKiamaDriver extends KiamaDriver> - extends KiamaQuery<KiamaSemaphoreNeighborInjectMatch> { - - public KiamaQuerySemaphoreNeighborInject(final TKiamaDriver driver) { - super(RailwayQuery.SEMAPHORENEIGHBOR_INJECT, driver); - } - - @Override - public Collection<KiamaSemaphoreNeighborInjectMatch> evaluate() { - Collection<KiamaInternalSemaphoreNeighborInjectMatch> source = driver.queries.getSemaphoreNeighborInjectMatches(); - List<KiamaSemaphoreNeighborInjectMatch> target = new ArrayList<>(); - for (KiamaInternalSemaphoreNeighborInjectMatch m : source) { - target.add(new KiamaSemaphoreNeighborInjectMatch(m.getRoute(), m.getSemaphore())); - } - return target; - } -} diff --git a/trainbenchmark-tool-kiama/src/main/java/de/tudresden/inf/st/train/kiama/queries/KiamaQuerySwitchMonitored.java b/trainbenchmark-tool-kiama/src/main/java/de/tudresden/inf/st/train/kiama/queries/KiamaQuerySwitchMonitored.java deleted file mode 100644 index 4f05f8807..000000000 --- a/trainbenchmark-tool-kiama/src/main/java/de/tudresden/inf/st/train/kiama/queries/KiamaQuerySwitchMonitored.java +++ /dev/null @@ -1,28 +0,0 @@ -package de.tudresden.inf.st.train.kiama.queries; - -import de.tudresden.inf.st.train.kiama.ast.Switch; -import de.tudresden.inf.st.train.kiama.driver.KiamaDriver; -import de.tudresden.inf.st.train.kiama.matches.KiamaSwitchMonitoredMatch; -import hu.bme.mit.trainbenchmark.constants.RailwayQuery; - -import java.util.ArrayList; -import java.util.Collection; - -public class KiamaQuerySwitchMonitored<TKiamaDriver extends KiamaDriver> extends - KiamaQuery<KiamaSwitchMonitoredMatch> { - - public KiamaQuerySwitchMonitored(final TKiamaDriver driver) { - super(RailwayQuery.SWITCHMONITORED, driver); - } - - @Override - public Collection<KiamaSwitchMonitoredMatch> evaluate() { - final Collection<KiamaSwitchMonitoredMatch> matches = new ArrayList<>(); - - for (final Switch sw : driver.queries.getUnmonitoredSwitches()) { - matches.add(new KiamaSwitchMonitoredMatch(sw)); - } - - return matches; - } -} diff --git a/trainbenchmark-tool-kiama/src/main/java/de/tudresden/inf/st/train/kiama/queries/KiamaQuerySwitchMonitoredInject.java b/trainbenchmark-tool-kiama/src/main/java/de/tudresden/inf/st/train/kiama/queries/KiamaQuerySwitchMonitoredInject.java deleted file mode 100644 index b8f7642fb..000000000 --- a/trainbenchmark-tool-kiama/src/main/java/de/tudresden/inf/st/train/kiama/queries/KiamaQuerySwitchMonitoredInject.java +++ /dev/null @@ -1,28 +0,0 @@ -package de.tudresden.inf.st.train.kiama.queries; - -import de.tudresden.inf.st.train.kiama.ast.Switch; -import de.tudresden.inf.st.train.kiama.driver.KiamaDriver; -import de.tudresden.inf.st.train.kiama.matches.KiamaSwitchMonitoredInjectMatch; -import hu.bme.mit.trainbenchmark.constants.RailwayQuery; - -import java.util.ArrayList; -import java.util.Collection; - -public class KiamaQuerySwitchMonitoredInject<TKiamaDriver extends KiamaDriver> - extends KiamaQuery<KiamaSwitchMonitoredInjectMatch> { - - public KiamaQuerySwitchMonitoredInject(final TKiamaDriver driver) { - super(RailwayQuery.SWITCHMONITORED_INJECT, driver); - } - - @Override - public Collection<KiamaSwitchMonitoredInjectMatch> evaluate() { - final Collection<KiamaSwitchMonitoredInjectMatch> matches = new ArrayList<>(); - - for (final Switch sw : driver.queries.getMonitoredSwitches()) { - matches.add(new KiamaSwitchMonitoredInjectMatch(sw)); - } - - return matches; - } -} diff --git a/trainbenchmark-tool-kiama/src/main/java/de/tudresden/inf/st/train/kiama/queries/KiamaQuerySwitchSet.java b/trainbenchmark-tool-kiama/src/main/java/de/tudresden/inf/st/train/kiama/queries/KiamaQuerySwitchSet.java deleted file mode 100644 index 7652aa250..000000000 --- a/trainbenchmark-tool-kiama/src/main/java/de/tudresden/inf/st/train/kiama/queries/KiamaQuerySwitchSet.java +++ /dev/null @@ -1,29 +0,0 @@ -package de.tudresden.inf.st.train.kiama.queries; - - -import de.tudresden.inf.st.train.kiama.driver.KiamaDriver; -import de.tudresden.inf.st.train.kiama.matches.KiamaInternalSwitchSetMatch; -import de.tudresden.inf.st.train.kiama.matches.KiamaSwitchSetMatch; -import hu.bme.mit.trainbenchmark.constants.RailwayQuery; - -import java.util.ArrayList; -import java.util.Collection; -import java.util.List; - - -public class KiamaQuerySwitchSet<TKiamaDriver extends KiamaDriver> extends KiamaQuery<KiamaSwitchSetMatch> { - - public KiamaQuerySwitchSet(final TKiamaDriver driver) { - super(RailwayQuery.SWITCHSET, driver); - } - - @Override - public Collection<KiamaSwitchSetMatch> evaluate() { - Collection<KiamaInternalSwitchSetMatch> source = driver.queries.getSwitchSetMatches(); - List<KiamaSwitchSetMatch> target = new ArrayList<>(); - for (KiamaInternalSwitchSetMatch m : source) { - target.add(new KiamaSwitchSetMatch(m.getSemaphore(), m.getRoute(), m.getSwP(), m.getSw(), m.getPosition(), m.getCurrentPosition())); - } - return target; - } -} diff --git a/trainbenchmark-tool-kiama/src/main/java/de/tudresden/inf/st/train/kiama/queries/KiamaQuerySwitchSetInject.java b/trainbenchmark-tool-kiama/src/main/java/de/tudresden/inf/st/train/kiama/queries/KiamaQuerySwitchSetInject.java deleted file mode 100644 index a3827ff46..000000000 --- a/trainbenchmark-tool-kiama/src/main/java/de/tudresden/inf/st/train/kiama/queries/KiamaQuerySwitchSetInject.java +++ /dev/null @@ -1,29 +0,0 @@ -package de.tudresden.inf.st.train.kiama.queries; - - -import de.tudresden.inf.st.train.kiama.driver.KiamaDriver; -import de.tudresden.inf.st.train.kiama.matches.KiamaInternalSwitchSetInjectMatch; -import de.tudresden.inf.st.train.kiama.matches.KiamaSwitchSetInjectMatch; -import hu.bme.mit.trainbenchmark.constants.RailwayQuery; - -import java.util.ArrayList; -import java.util.Collection; -import java.util.List; - -public class KiamaQuerySwitchSetInject<TKiamaDriver extends KiamaDriver> - extends KiamaQuery<KiamaSwitchSetInjectMatch> { - - public KiamaQuerySwitchSetInject(final TKiamaDriver driver) { - super(RailwayQuery.SWITCHSET_INJECT, driver); - } - - @Override - public Collection<KiamaSwitchSetInjectMatch> evaluate() { - Collection<KiamaInternalSwitchSetInjectMatch> source = driver.queries.getSwitchSetInjectMatches(); - List<KiamaSwitchSetInjectMatch> target = new ArrayList<>(); - for (KiamaInternalSwitchSetInjectMatch m : source) { - target.add(new KiamaSwitchSetInjectMatch(m.getSw())); - } - return target; - } -} diff --git a/trainbenchmark-tool-kiama/src/main/java/de/tudresden/inf/st/train/kiama/transformations/KiamaTransformation.java b/trainbenchmark-tool-kiama/src/main/java/de/tudresden/inf/st/train/kiama/transformations/KiamaTransformation.java deleted file mode 100644 index 46289736c..000000000 --- a/trainbenchmark-tool-kiama/src/main/java/de/tudresden/inf/st/train/kiama/transformations/KiamaTransformation.java +++ /dev/null @@ -1,14 +0,0 @@ -package de.tudresden.inf.st.train.kiama.transformations; - -import de.tudresden.inf.st.train.kiama.driver.KiamaDriver; -import de.tudresden.inf.st.train.kiama.matches.KiamaMatch; -import hu.bme.mit.trainbenchmark.benchmark.operations.ModelTransformation; - -public abstract class KiamaTransformation<TMatch extends KiamaMatch, TKiamaDriver extends KiamaDriver> - extends ModelTransformation<TMatch, TKiamaDriver> { - - protected KiamaTransformation(final TKiamaDriver driver) { - super(driver); - } - -} diff --git a/trainbenchmark-tool-kiama/src/main/java/de/tudresden/inf/st/train/kiama/transformations/inject/KiamaTransformationInjectConnectedSegments.java b/trainbenchmark-tool-kiama/src/main/java/de/tudresden/inf/st/train/kiama/transformations/inject/KiamaTransformationInjectConnectedSegments.java deleted file mode 100644 index 9033dcd5a..000000000 --- a/trainbenchmark-tool-kiama/src/main/java/de/tudresden/inf/st/train/kiama/transformations/inject/KiamaTransformationInjectConnectedSegments.java +++ /dev/null @@ -1,52 +0,0 @@ -package de.tudresden.inf.st.train.kiama.transformations.inject; - -import de.tudresden.inf.st.train.kiama.ast.*; -import de.tudresden.inf.st.train.kiama.driver.KiamaDriver; -import de.tudresden.inf.st.train.kiama.matches.KiamaConnectedSegmentsInjectMatch; -import de.tudresden.inf.st.train.kiama.transformations.KiamaTransformation; -import hu.bme.mit.trainbenchmark.constants.TrainBenchmarkConstants; - -import java.util.ArrayList; -import java.util.Collection; - -public class KiamaTransformationInjectConnectedSegments<TKiamaDriver extends KiamaDriver> - extends KiamaTransformation<KiamaConnectedSegmentsInjectMatch, TKiamaDriver> { - - public KiamaTransformationInjectConnectedSegments(final TKiamaDriver driver) { - super(driver); - } - - @Override - public void activate(final Collection<KiamaConnectedSegmentsInjectMatch> matches) { - for (final KiamaConnectedSegmentsInjectMatch match : matches) { - // create segment2 - ArrayList<Ref> connectedSegments = new ArrayList<>(); - Ref ref = new Ref(); - ref.Value_$eq(match.getSegment3().Id().Value()); - connectedSegments.add(ref); - Segment segment2 = new Segment(); - Id id = new Id(); - id.Value_$eq(driver.nextId()); - segment2.Id_$eq(id); - segment2.ConnectsTo_$eq(connectedSegments); - segment2.Length_$eq(TrainBenchmarkConstants.DEFAULT_SEGMENT_LENGTH); - - driver.queries.getContainingRegion(match.getSegment1()).TrackElement().add(segment2); - - // have the sensor monitor the segment - Ref ref2 = new Ref(); - ref2.Value_$eq(segment2.Id().Value()); - match.getSensor().MonitoredElement().add(ref2); - - // remove the connection of segment1 to segment3 - Ref f = new Ref(); - f.Value_$eq(match.getSegment3().Id().Value()); - match.getSegment1().ConnectsTo().remove(f); - - // connect segment1 to segment2 - match.getSegment1().ConnectsTo().add(ref2); - } - driver.flushCache(); - } - -} diff --git a/trainbenchmark-tool-kiama/src/main/java/de/tudresden/inf/st/train/kiama/transformations/inject/KiamaTransformationInjectPosLength.java b/trainbenchmark-tool-kiama/src/main/java/de/tudresden/inf/st/train/kiama/transformations/inject/KiamaTransformationInjectPosLength.java deleted file mode 100644 index 295784e14..000000000 --- a/trainbenchmark-tool-kiama/src/main/java/de/tudresden/inf/st/train/kiama/transformations/inject/KiamaTransformationInjectPosLength.java +++ /dev/null @@ -1,24 +0,0 @@ -package de.tudresden.inf.st.train.kiama.transformations.inject; - -import de.tudresden.inf.st.train.kiama.driver.KiamaDriver; -import de.tudresden.inf.st.train.kiama.matches.KiamaPosLengthInjectMatch; -import de.tudresden.inf.st.train.kiama.transformations.KiamaTransformation; - -import java.util.Collection; - -public class KiamaTransformationInjectPosLength<TKiamaDriver extends KiamaDriver> - extends KiamaTransformation<KiamaPosLengthInjectMatch, TKiamaDriver> { - - public KiamaTransformationInjectPosLength(final TKiamaDriver driver) { - super(driver); - } - - @Override - public void activate(final Collection<KiamaPosLengthInjectMatch> matches) { - for (final KiamaPosLengthInjectMatch match : matches) { - match.getSegment().Length_$eq(0); - } - driver.flushCache(); - } - -} diff --git a/trainbenchmark-tool-kiama/src/main/java/de/tudresden/inf/st/train/kiama/transformations/inject/KiamaTransformationInjectRouteSensor.java b/trainbenchmark-tool-kiama/src/main/java/de/tudresden/inf/st/train/kiama/transformations/inject/KiamaTransformationInjectRouteSensor.java deleted file mode 100644 index 7380e29ef..000000000 --- a/trainbenchmark-tool-kiama/src/main/java/de/tudresden/inf/st/train/kiama/transformations/inject/KiamaTransformationInjectRouteSensor.java +++ /dev/null @@ -1,28 +0,0 @@ -package de.tudresden.inf.st.train.kiama.transformations.inject; - -import de.tudresden.inf.st.train.kiama.ast.Ref; -import de.tudresden.inf.st.train.kiama.ast.Sensor; -import de.tudresden.inf.st.train.kiama.driver.KiamaDriver; -import de.tudresden.inf.st.train.kiama.matches.KiamaRouteSensorInjectMatch; -import de.tudresden.inf.st.train.kiama.transformations.KiamaTransformation; - -import java.util.ArrayList; -import java.util.Collection; - -public class KiamaTransformationInjectRouteSensor<TKiamaDriver extends KiamaDriver> - extends KiamaTransformation<KiamaRouteSensorInjectMatch, TKiamaDriver> { - - public KiamaTransformationInjectRouteSensor(final TKiamaDriver driver) { - super(driver); - } - - @Override - public void activate(final Collection<KiamaRouteSensorInjectMatch> matches) { - for (final KiamaRouteSensorInjectMatch match : matches) { - ArrayList<Ref> refList = match.getRoute().RequiredSensor(); - refList.removeIf(ref -> ref.Value().equals(match.getSensor().Id().Value())); - } - driver.flushCache(); - } - -} diff --git a/trainbenchmark-tool-kiama/src/main/java/de/tudresden/inf/st/train/kiama/transformations/inject/KiamaTransformationInjectSemaphoreNeighbor.java b/trainbenchmark-tool-kiama/src/main/java/de/tudresden/inf/st/train/kiama/transformations/inject/KiamaTransformationInjectSemaphoreNeighbor.java deleted file mode 100644 index 6806b9459..000000000 --- a/trainbenchmark-tool-kiama/src/main/java/de/tudresden/inf/st/train/kiama/transformations/inject/KiamaTransformationInjectSemaphoreNeighbor.java +++ /dev/null @@ -1,24 +0,0 @@ -package de.tudresden.inf.st.train.kiama.transformations.inject; - -import de.tudresden.inf.st.train.kiama.driver.KiamaDriver; -import de.tudresden.inf.st.train.kiama.matches.KiamaSemaphoreNeighborInjectMatch; -import de.tudresden.inf.st.train.kiama.transformations.KiamaTransformation; - -import java.util.Collection; - -public class KiamaTransformationInjectSemaphoreNeighbor<TKiamaDriver extends KiamaDriver> - extends KiamaTransformation<KiamaSemaphoreNeighborInjectMatch, TKiamaDriver> { - - public KiamaTransformationInjectSemaphoreNeighbor(final TKiamaDriver driver) { - super(driver); - } - - @Override - public void activate(final Collection<KiamaSemaphoreNeighborInjectMatch> matches) { - for (final KiamaSemaphoreNeighborInjectMatch match : matches) { - match.getRoute().Entry().clear(); - } - driver.flushCache(); - } - -} diff --git a/trainbenchmark-tool-kiama/src/main/java/de/tudresden/inf/st/train/kiama/transformations/inject/KiamaTransformationInjectSwitchMonitored.java b/trainbenchmark-tool-kiama/src/main/java/de/tudresden/inf/st/train/kiama/transformations/inject/KiamaTransformationInjectSwitchMonitored.java deleted file mode 100644 index 9f36fdbba..000000000 --- a/trainbenchmark-tool-kiama/src/main/java/de/tudresden/inf/st/train/kiama/transformations/inject/KiamaTransformationInjectSwitchMonitored.java +++ /dev/null @@ -1,43 +0,0 @@ -package de.tudresden.inf.st.train.kiama.transformations.inject; - -import de.tudresden.inf.st.train.kiama.ast.Sensor; -import de.tudresden.inf.st.train.kiama.ast.Switch; -import de.tudresden.inf.st.train.kiama.ast.TrackElement; -import de.tudresden.inf.st.train.kiama.driver.KiamaDriver; -import de.tudresden.inf.st.train.kiama.matches.KiamaSwitchMonitoredInjectMatch; -import de.tudresden.inf.st.train.kiama.transformations.KiamaTransformation; - -import java.util.Collection; -import java.util.List; - -public class KiamaTransformationInjectSwitchMonitored<TKiamaDriver extends KiamaDriver> - extends KiamaTransformation<KiamaSwitchMonitoredInjectMatch, TKiamaDriver> { - - public KiamaTransformationInjectSwitchMonitored(final TKiamaDriver driver) { - super(driver); - } - - @Override - public void activate(final Collection<KiamaSwitchMonitoredInjectMatch> matches) { - for (final KiamaSwitchMonitoredInjectMatch match : matches) { - // TODO rewrite this ugly and slow piece of code! - Switch sw = match.getSw(); - List<Sensor> sensors = driver.queries.getMonitoringSensorsForSwitch(sw); - for (final Sensor sensor : sensors) { - boolean changed = false; - while (!changed) { - for (int refIndex = 0; refIndex < sensor.MonitoredElement().size(); refIndex++) { - TrackElement element = driver.queries.getMonitoredElement(refIndex, sensor); - if (element.equals(match.getSw())) { - sensor.MonitoredElement().remove(refIndex); - changed = true; - break; - } - } - } - } - } - driver.flushCache(); - } - -} diff --git a/trainbenchmark-tool-kiama/src/main/java/de/tudresden/inf/st/train/kiama/transformations/inject/KiamaTransformationInjectSwitchSet.java b/trainbenchmark-tool-kiama/src/main/java/de/tudresden/inf/st/train/kiama/transformations/inject/KiamaTransformationInjectSwitchSet.java deleted file mode 100644 index 78cd90540..000000000 --- a/trainbenchmark-tool-kiama/src/main/java/de/tudresden/inf/st/train/kiama/transformations/inject/KiamaTransformationInjectSwitchSet.java +++ /dev/null @@ -1,28 +0,0 @@ -package de.tudresden.inf.st.train.kiama.transformations.inject; - - -import de.tudresden.inf.st.train.kiama.enums.Position; -import de.tudresden.inf.st.train.kiama.driver.KiamaDriver; -import de.tudresden.inf.st.train.kiama.matches.KiamaSwitchSetInjectMatch; -import de.tudresden.inf.st.train.kiama.transformations.KiamaTransformation; - -import java.util.Collection; - -public class KiamaTransformationInjectSwitchSet<TKiamaDriver extends KiamaDriver> - extends KiamaTransformation<KiamaSwitchSetInjectMatch, TKiamaDriver> { - - public KiamaTransformationInjectSwitchSet(final TKiamaDriver driver) { - super(driver); - } - - @Override - public void activate(final Collection<KiamaSwitchSetInjectMatch> matches) { - for (final KiamaSwitchSetInjectMatch match : matches) { - Position oldPosition = match.getSw().CurrentPosition(); - Position newPosition = oldPosition == Position.DIVERGING ? Position.FAILURE : (oldPosition == Position.FAILURE ? Position.STRAIGHT : Position.DIVERGING); - match.getSw().CurrentPosition_$eq(newPosition); - } - driver.flushCache(); - } - -} diff --git a/trainbenchmark-tool-kiama/src/main/java/de/tudresden/inf/st/train/kiama/transformations/repair/KiamaTransformationRepairConnectedSegments.java b/trainbenchmark-tool-kiama/src/main/java/de/tudresden/inf/st/train/kiama/transformations/repair/KiamaTransformationRepairConnectedSegments.java deleted file mode 100644 index 816f40c2c..000000000 --- a/trainbenchmark-tool-kiama/src/main/java/de/tudresden/inf/st/train/kiama/transformations/repair/KiamaTransformationRepairConnectedSegments.java +++ /dev/null @@ -1,45 +0,0 @@ -package de.tudresden.inf.st.train.kiama.transformations.repair; - - -import de.tudresden.inf.st.train.kiama.ast.*; -import de.tudresden.inf.st.train.kiama.driver.KiamaDriver; -import de.tudresden.inf.st.train.kiama.matches.KiamaConnectedSegmentsMatch; -import de.tudresden.inf.st.train.kiama.transformations.KiamaTransformation; - -import java.util.Collection; - -public class KiamaTransformationRepairConnectedSegments<TKiamaDriver extends KiamaDriver> - extends KiamaTransformation<KiamaConnectedSegmentsMatch, TKiamaDriver> { - - public KiamaTransformationRepairConnectedSegments(final TKiamaDriver driver) { - super(driver); - } - - @Override - public void activate(final Collection<KiamaConnectedSegmentsMatch> matches) { - for (final KiamaConnectedSegmentsMatch match : matches) { - final Segment segment2 = match.getSegment2(); - Ref f = new Ref(); - f.Value_$eq(segment2.Id().Value()); - - // delete all references to segment2 (monitoring sensors and other segments connecting to it) - for (Region region : driver.getModel().Region()) { - for (Sensor sensor : region.Sensor()) { - sensor.MonitoredElement().remove(f); - } - for (TrackElement element : region.TrackElement()) { - element.ConnectsTo().remove(f); - } - } - // TODO: is this possible with Kiama? - //segment2.removeSelf(); - driver.queries.getContainingRegion(segment2).TrackElement().remove(segment2); - // connect segment1 to segment3 - Ref r = new Ref(); - r.Value_$eq(match.getSegment3().Id().Value()); - match.getSegment1().ConnectsTo().add(r); - } - driver.flushCache(); - } - -} diff --git a/trainbenchmark-tool-kiama/src/main/java/de/tudresden/inf/st/train/kiama/transformations/repair/KiamaTransformationRepairPosLength.java b/trainbenchmark-tool-kiama/src/main/java/de/tudresden/inf/st/train/kiama/transformations/repair/KiamaTransformationRepairPosLength.java deleted file mode 100644 index dfa2c662a..000000000 --- a/trainbenchmark-tool-kiama/src/main/java/de/tudresden/inf/st/train/kiama/transformations/repair/KiamaTransformationRepairPosLength.java +++ /dev/null @@ -1,26 +0,0 @@ -package de.tudresden.inf.st.train.kiama.transformations.repair; - -import de.tudresden.inf.st.train.kiama.ast.Segment; -import de.tudresden.inf.st.train.kiama.driver.KiamaDriver; -import de.tudresden.inf.st.train.kiama.matches.KiamaPosLengthMatch; -import de.tudresden.inf.st.train.kiama.transformations.KiamaTransformation; - -import java.util.Collection; - -public class KiamaTransformationRepairPosLength<TKiamaDriver extends KiamaDriver> - extends KiamaTransformation<KiamaPosLengthMatch, TKiamaDriver> { - - public KiamaTransformationRepairPosLength(final TKiamaDriver driver) { - super(driver); - } - - @Override - public void activate(final Collection<KiamaPosLengthMatch> matches) { - for (final KiamaPosLengthMatch plm : matches) { - final Segment segment = plm.getSegment(); - segment.Length_$eq(-segment.Length() + 1); - } - driver.flushCache(); - } - -} diff --git a/trainbenchmark-tool-kiama/src/main/java/de/tudresden/inf/st/train/kiama/transformations/repair/KiamaTransformationRepairRouteSensor.java b/trainbenchmark-tool-kiama/src/main/java/de/tudresden/inf/st/train/kiama/transformations/repair/KiamaTransformationRepairRouteSensor.java deleted file mode 100644 index c94054119..000000000 --- a/trainbenchmark-tool-kiama/src/main/java/de/tudresden/inf/st/train/kiama/transformations/repair/KiamaTransformationRepairRouteSensor.java +++ /dev/null @@ -1,31 +0,0 @@ -package de.tudresden.inf.st.train.kiama.transformations.repair; - -import de.tudresden.inf.st.train.kiama.ast.Ref; -import de.tudresden.inf.st.train.kiama.ast.Route; -import de.tudresden.inf.st.train.kiama.ast.Sensor; -import de.tudresden.inf.st.train.kiama.driver.KiamaDriver; -import de.tudresden.inf.st.train.kiama.matches.KiamaRouteSensorMatch; -import de.tudresden.inf.st.train.kiama.transformations.KiamaTransformation; - -import java.util.Collection; - -public class KiamaTransformationRepairRouteSensor<TKiamaDriver extends KiamaDriver> - extends KiamaTransformation<KiamaRouteSensorMatch, TKiamaDriver> { - - public KiamaTransformationRepairRouteSensor(final TKiamaDriver driver) { - super(driver); - } - - @Override - public void activate(final Collection<KiamaRouteSensorMatch> matches) { - for (final KiamaRouteSensorMatch rsm : matches) { - final Route route = rsm.getRoute(); - final Sensor sensor = rsm.getSensor(); - Ref r = new Ref(); - r.Value_$eq(sensor.Id().Value()); - route.RequiredSensor().add(r); - driver.flushCache(); - } - } - -} diff --git a/trainbenchmark-tool-kiama/src/main/java/de/tudresden/inf/st/train/kiama/transformations/repair/KiamaTransformationRepairSemaphoreNeighbor.java b/trainbenchmark-tool-kiama/src/main/java/de/tudresden/inf/st/train/kiama/transformations/repair/KiamaTransformationRepairSemaphoreNeighbor.java deleted file mode 100644 index 23ac515ac..000000000 --- a/trainbenchmark-tool-kiama/src/main/java/de/tudresden/inf/st/train/kiama/transformations/repair/KiamaTransformationRepairSemaphoreNeighbor.java +++ /dev/null @@ -1,27 +0,0 @@ -package de.tudresden.inf.st.train.kiama.transformations.repair; - -import de.tudresden.inf.st.train.kiama.ast.Ref; -import de.tudresden.inf.st.train.kiama.driver.KiamaDriver; -import de.tudresden.inf.st.train.kiama.matches.KiamaSemaphoreNeighborMatch; -import de.tudresden.inf.st.train.kiama.transformations.KiamaTransformation; - -import java.util.Collection; - -public class KiamaTransformationRepairSemaphoreNeighbor<TKiamaDriver extends KiamaDriver> - extends KiamaTransformation<KiamaSemaphoreNeighborMatch, TKiamaDriver> { - - public KiamaTransformationRepairSemaphoreNeighbor(final TKiamaDriver driver) { - super(driver); - } - - @Override - public void activate(final Collection<KiamaSemaphoreNeighborMatch> matches) { - for (final KiamaSemaphoreNeighborMatch match : matches) { - Ref r = new Ref(); - r.Value_$eq(match.getSemaphore().Id().Value()); - match.getRoute2().Entry().add(r); - } - driver.flushCache(); - } - -} diff --git a/trainbenchmark-tool-kiama/src/main/java/de/tudresden/inf/st/train/kiama/transformations/repair/KiamaTransformationRepairSwitchMonitored.java b/trainbenchmark-tool-kiama/src/main/java/de/tudresden/inf/st/train/kiama/transformations/repair/KiamaTransformationRepairSwitchMonitored.java deleted file mode 100644 index 311609edd..000000000 --- a/trainbenchmark-tool-kiama/src/main/java/de/tudresden/inf/st/train/kiama/transformations/repair/KiamaTransformationRepairSwitchMonitored.java +++ /dev/null @@ -1,52 +0,0 @@ -package de.tudresden.inf.st.train.kiama.transformations.repair; - -import de.tudresden.inf.st.train.kiama.ast.*; -import de.tudresden.inf.st.train.kiama.driver.KiamaDriver; -import de.tudresden.inf.st.train.kiama.matches.KiamaSwitchMonitoredMatch; -import de.tudresden.inf.st.train.kiama.transformations.KiamaTransformation; - -import java.util.ArrayList; -import java.util.Collection; -import java.util.Objects; - -public class KiamaTransformationRepairSwitchMonitored<TKiamaDriver extends KiamaDriver> - extends KiamaTransformation<KiamaSwitchMonitoredMatch, TKiamaDriver> { - - public KiamaTransformationRepairSwitchMonitored(final TKiamaDriver driver) { - super(driver); - } - - @Override - public void activate(final Collection<KiamaSwitchMonitoredMatch> matches) { - for (final KiamaSwitchMonitoredMatch ssnm : matches) { - - // gather the stuff we need to create a sensor: - int id = driver.nextId(); - ArrayList<Ref> refList = new ArrayList<>(); - Ref ref = new Ref(); - ref.Value_$eq(ssnm.getSw().Id().Value()); - refList.add(ref); - - Sensor sensor = new Sensor(); - Id i = new Id(); - i.Value_$eq(id); - sensor.Id_$eq(i); - sensor.MonitoredElement_$eq(refList); - - ArrayList<Region> allRegions = driver.getModel().Region(); - Region r = null; - for (Region cr : allRegions) { - ArrayList<TrackElement> te = cr.TrackElement(); - for (TrackElement e : te) { - if (e.Id().Value().equals(ssnm.getSw().Id().Value())) { - r = cr; - } - } - } - - r.Sensor().add(sensor); - } - driver.flushCache(); - } - -} diff --git a/trainbenchmark-tool-kiama/src/main/java/de/tudresden/inf/st/train/kiama/transformations/repair/KiamaTransformationRepairSwitchSet.java b/trainbenchmark-tool-kiama/src/main/java/de/tudresden/inf/st/train/kiama/transformations/repair/KiamaTransformationRepairSwitchSet.java deleted file mode 100644 index cf86888e4..000000000 --- a/trainbenchmark-tool-kiama/src/main/java/de/tudresden/inf/st/train/kiama/transformations/repair/KiamaTransformationRepairSwitchSet.java +++ /dev/null @@ -1,25 +0,0 @@ -package de.tudresden.inf.st.train.kiama.transformations.repair; - -import de.tudresden.inf.st.train.kiama.driver.KiamaDriver; -import de.tudresden.inf.st.train.kiama.matches.KiamaSwitchSetMatch; -import de.tudresden.inf.st.train.kiama.transformations.KiamaTransformation; - -import java.util.Collection; - -public class KiamaTransformationRepairSwitchSet<TKiamaDriver extends KiamaDriver> - extends KiamaTransformation<KiamaSwitchSetMatch, TKiamaDriver> { - - public KiamaTransformationRepairSwitchSet(final TKiamaDriver driver) { - super(driver); - } - - @Override - public void activate(final Collection<KiamaSwitchSetMatch> matches) { - for (final KiamaSwitchSetMatch match : matches) { - match.getSw().CurrentPosition_$eq(match.getSwP().Position()); - } - - driver.flushCache(); - } - -} diff --git a/trainbenchmark-tool-kiama/src/test/java/de/tudresden/inf/st/train/kiama/test/KiamaTest.java b/trainbenchmark-tool-kiama/src/test/java/de/tudresden/inf/st/train/kiama/test/KiamaTest.java deleted file mode 100644 index 1764fa591..000000000 --- a/trainbenchmark-tool-kiama/src/test/java/de/tudresden/inf/st/train/kiama/test/KiamaTest.java +++ /dev/null @@ -1,24 +0,0 @@ -package de.tudresden.inf.st.train.kiama.test; - -import de.tudresden.inf.st.train.kiama.KiamaBenchmarkScenario; -import de.tudresden.inf.st.train.kiama.config.KiamaBenchmarkConfig; -import de.tudresden.inf.st.train.kiama.config.KiamaBenchmarkConfigBuilder; -import hu.bme.mit.trainbenchmark.benchmark.config.BenchmarkConfigBase; -import hu.bme.mit.trainbenchmark.benchmark.runcomponents.BenchmarkResult; -import hu.bme.mit.trainbenchmark.benchmark.test.TrainBenchmarkTest; -import org.junit.Assume; - -public class KiamaTest extends TrainBenchmarkTest { - - @Override - protected BenchmarkResult runTest(final BenchmarkConfigBase bcb) throws Exception { - final KiamaBenchmarkConfig bc = new KiamaBenchmarkConfigBuilder().setConfigBase(bcb).createConfig(); - final KiamaBenchmarkScenario scenario = new KiamaBenchmarkScenario(bc); - return scenario.performBenchmark(); - } - - private void no() { Assume.assumeTrue(false); } - - @Override public void injectTest() throws Exception { no(); } - -} diff --git a/trainbenchmark-tool-mysql/.gitignore b/trainbenchmark-tool-mysql/.gitignore deleted file mode 100644 index ea8c4bf7f..000000000 --- a/trainbenchmark-tool-mysql/.gitignore +++ /dev/null @@ -1 +0,0 @@ -/target diff --git a/trainbenchmark-tool-mysql/README.md b/trainbenchmark-tool-mysql/README.md deleted file mode 100644 index 0219d6215..000000000 --- a/trainbenchmark-tool-mysql/README.md +++ /dev/null @@ -1,28 +0,0 @@ -# Train Benchmark MySQL implementation - -Add the following to `/etc/apt/sources.list` (e.g. `sudo nano /etc/apt/sources.list`): - -``` -deb http://repo.mysql.com/apt/ubuntu/ trusty mysql-5.7 -deb-src http://repo.mysql.com/apt/ubuntu/ trusty mysql-5.7 -``` - -Install/update MySQL server. - -```bash -sudo apt-get update -sudo apt-get install -y mysql-server -``` - -## Ubuntu 16.04 - -On Ubuntu 16.04, you can install MySQL without adding third-party repostories. However, in some installations the login does not work: even if you leave the `root` user's password empty during the install, you will *not* be able to login with the `root` user. To fix this, follow [this guide](http://askubuntu.com/a/784347/415610): - -``` -$ sudo service mysql start -$ sudo mysql -u root -mysql> DROP USER 'root'@'localhost'; -mysql> CREATE USER 'root'@'%' IDENTIFIED BY ''; -mysql> GRANT ALL PRIVILEGES ON *.* TO 'root'@'%'; -mysql> FLUSH PRIVILEGES; -``` diff --git a/trainbenchmark-tool-mysql/build.gradle b/trainbenchmark-tool-mysql/build.gradle deleted file mode 100644 index d9697a79f..000000000 --- a/trainbenchmark-tool-mysql/build.gradle +++ /dev/null @@ -1,12 +0,0 @@ -plugins { id "com.github.johnrengelman.shadow" version "1.2.3" } - -shadowJar { - classifier = 'fat' - manifest { attributes 'Main-Class': 'hu.bme.mit.trainbenchmark.benchmark.mysql.MySqlBenchmarkMain' } -} - -dependencies { - compile project(':trainbenchmark-tool') - compile project(':trainbenchmark-tool-sql') - compile group: 'mysql', name: 'mysql-connector-java', version:'5.1.38' -} diff --git a/trainbenchmark-tool-mysql/src/main/java/hu/bme/mit/trainbenchmark/benchmark/mysql/MySqlBenchmarkMain.java b/trainbenchmark-tool-mysql/src/main/java/hu/bme/mit/trainbenchmark/benchmark/mysql/MySqlBenchmarkMain.java deleted file mode 100644 index 149f6abef..000000000 --- a/trainbenchmark-tool-mysql/src/main/java/hu/bme/mit/trainbenchmark/benchmark/mysql/MySqlBenchmarkMain.java +++ /dev/null @@ -1,26 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2010-2015, Benedek Izso, Gabor Szarnyas, Istvan Rath and Daniel Varro - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Benedek Izso - initial API and implementation - * Gabor Szarnyas - initial API and implementation - *******************************************************************************/ - -package hu.bme.mit.trainbenchmark.benchmark.mysql; - -import hu.bme.mit.trainbenchmark.benchmark.config.BenchmarkConfig; -import hu.bme.mit.trainbenchmark.benchmark.mysql.config.MySqlBenchmarkConfig; - -public class MySqlBenchmarkMain { - - public static void main(final String[] args) throws Exception { - final MySqlBenchmarkConfig bc = BenchmarkConfig.fromFile(args[0], MySqlBenchmarkConfig.class); - final MySqlBenchmarkScenario scenario = new MySqlBenchmarkScenario(bc); - scenario.performBenchmark(); - } - -} diff --git a/trainbenchmark-tool-mysql/src/main/java/hu/bme/mit/trainbenchmark/benchmark/mysql/MySqlBenchmarkScenario.java b/trainbenchmark-tool-mysql/src/main/java/hu/bme/mit/trainbenchmark/benchmark/mysql/MySqlBenchmarkScenario.java deleted file mode 100644 index 91928ba98..000000000 --- a/trainbenchmark-tool-mysql/src/main/java/hu/bme/mit/trainbenchmark/benchmark/mysql/MySqlBenchmarkScenario.java +++ /dev/null @@ -1,17 +0,0 @@ -package hu.bme.mit.trainbenchmark.benchmark.mysql; - -import hu.bme.mit.trainbenchmark.benchmark.comparators.LongMatchComparator; -import hu.bme.mit.trainbenchmark.benchmark.mysql.config.MySqlBenchmarkConfig; -import hu.bme.mit.trainbenchmark.benchmark.mysql.driver.MySqlDriver; -import hu.bme.mit.trainbenchmark.benchmark.mysql.driver.MySqlDriverFactory; -import hu.bme.mit.trainbenchmark.benchmark.mysql.operations.MySqlModelOperationFactory; -import hu.bme.mit.trainbenchmark.benchmark.phases.BenchmarkScenario; -import hu.bme.mit.trainbenchmark.benchmark.sql.matches.SqlMatch; - -public class MySqlBenchmarkScenario extends BenchmarkScenario<SqlMatch, MySqlDriver, MySqlBenchmarkConfig> { - - public MySqlBenchmarkScenario(final MySqlBenchmarkConfig bc) throws Exception { - super(new MySqlDriverFactory(), new MySqlModelOperationFactory(), new LongMatchComparator<SqlMatch>(), bc); - } - -} diff --git a/trainbenchmark-tool-mysql/src/main/java/hu/bme/mit/trainbenchmark/benchmark/mysql/config/MySqlBenchmarkConfig.java b/trainbenchmark-tool-mysql/src/main/java/hu/bme/mit/trainbenchmark/benchmark/mysql/config/MySqlBenchmarkConfig.java deleted file mode 100644 index d7572dad0..000000000 --- a/trainbenchmark-tool-mysql/src/main/java/hu/bme/mit/trainbenchmark/benchmark/mysql/config/MySqlBenchmarkConfig.java +++ /dev/null @@ -1,34 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2010-2015, Benedek Izso, Gabor Szarnyas, Istvan Rath and Daniel Varro - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Benedek Izso - initial API and implementation - * Gabor Szarnyas - initial API and implementation - *******************************************************************************/ - -package hu.bme.mit.trainbenchmark.benchmark.mysql.config; - -import hu.bme.mit.trainbenchmark.benchmark.config.BenchmarkConfig; -import hu.bme.mit.trainbenchmark.benchmark.config.BenchmarkConfigBase; - -public class MySqlBenchmarkConfig extends BenchmarkConfig { - - protected MySqlBenchmarkConfig(final BenchmarkConfigBase configBase) { - super(configBase); - } - - @Override - public String getToolName() { - return "MySQL"; - } - - @Override - public String getProjectName() { - return "mysql"; - } - -} diff --git a/trainbenchmark-tool-mysql/src/main/java/hu/bme/mit/trainbenchmark/benchmark/mysql/config/MySqlBenchmarkConfigBuilder.java b/trainbenchmark-tool-mysql/src/main/java/hu/bme/mit/trainbenchmark/benchmark/mysql/config/MySqlBenchmarkConfigBuilder.java deleted file mode 100644 index 16f7e0e22..000000000 --- a/trainbenchmark-tool-mysql/src/main/java/hu/bme/mit/trainbenchmark/benchmark/mysql/config/MySqlBenchmarkConfigBuilder.java +++ /dev/null @@ -1,13 +0,0 @@ -package hu.bme.mit.trainbenchmark.benchmark.mysql.config; - -import hu.bme.mit.trainbenchmark.benchmark.config.BenchmarkConfigBuilder; - -public class MySqlBenchmarkConfigBuilder - extends BenchmarkConfigBuilder<MySqlBenchmarkConfig, MySqlBenchmarkConfigBuilder> { - - @Override - public MySqlBenchmarkConfig createConfig() { - checkNotNulls(); - return new MySqlBenchmarkConfig(configBase); - } -} diff --git a/trainbenchmark-tool-mysql/src/main/java/hu/bme/mit/trainbenchmark/benchmark/mysql/driver/MySqlDriver.java b/trainbenchmark-tool-mysql/src/main/java/hu/bme/mit/trainbenchmark/benchmark/mysql/driver/MySqlDriver.java deleted file mode 100644 index 342fecff4..000000000 --- a/trainbenchmark-tool-mysql/src/main/java/hu/bme/mit/trainbenchmark/benchmark/mysql/driver/MySqlDriver.java +++ /dev/null @@ -1,79 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2010-2015, Benedek Izso, Gabor Szarnyas, Istvan Rath and Daniel Varro - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Benedek Izso - initial API and implementation - * Gabor Szarnyas - initial API and implementation - *******************************************************************************/ -package hu.bme.mit.trainbenchmark.benchmark.mysql.driver; - -import static hu.bme.mit.trainbenchmark.sql.constants.SqlConstants.PASSWORD; -import static hu.bme.mit.trainbenchmark.sql.constants.SqlConstants.USER; - -import java.io.File; -import java.io.IOException; -import java.sql.DriverManager; -import java.sql.SQLException; - -import hu.bme.mit.trainbenchmark.benchmark.sql.driver.SqlDriver; -import hu.bme.mit.trainbenchmark.sql.process.MySqlProcess; - -public class MySqlDriver extends SqlDriver { - - protected MySqlDriver() { - } - - public static MySqlDriver create() { - return new MySqlDriver(); - } - - protected final String url = "jdbc:mysql://localhost:3306/trainbenchmark?allowMultiQueries=true&useSSL=false"; - - @Override - public void read(final String modelPath) throws IOException, InterruptedException, SQLException { - final Runtime rt = Runtime.getRuntime(); - final File modelFile = new File(modelPath); - if (!modelFile.exists()) { - throw new IOException("Model does not exist: " + modelPath); - } - - final String[] command = { "/bin/bash", "-c", "mysql -u " + USER + " < " + modelPath }; - final Process pr = rt.exec(command); - pr.waitFor(); - if (pr.exitValue() != 0) { - throw new IOException("MySQL process returned non-zero exit value: " + pr.exitValue()); - } - connection = DriverManager.getConnection(url, USER, PASSWORD); - } - - @Override - public void initialize() throws Exception { - try { - MySqlProcess.stopServer(); - } catch (final Exception e) { - // do nothing - } - MySqlProcess.cleanServer(); - MySqlProcess.startServer(); - } - - @Override - public void destroy() throws SQLException, IOException, InterruptedException { - if (connection != null) { - connection.close(); - } - - MySqlProcess.stopServer(); - } - - - @Override - public String getPostfix() { - return "-mysql.sql"; - } - -} diff --git a/trainbenchmark-tool-mysql/src/main/java/hu/bme/mit/trainbenchmark/benchmark/mysql/driver/MySqlDriverFactory.java b/trainbenchmark-tool-mysql/src/main/java/hu/bme/mit/trainbenchmark/benchmark/mysql/driver/MySqlDriverFactory.java deleted file mode 100644 index d277e929c..000000000 --- a/trainbenchmark-tool-mysql/src/main/java/hu/bme/mit/trainbenchmark/benchmark/mysql/driver/MySqlDriverFactory.java +++ /dev/null @@ -1,12 +0,0 @@ -package hu.bme.mit.trainbenchmark.benchmark.mysql.driver; - -import hu.bme.mit.trainbenchmark.benchmark.driver.DriverFactory; - -public class MySqlDriverFactory extends DriverFactory<MySqlDriver> { - - @Override - public MySqlDriver createInstance() throws Exception { - return new MySqlDriver(); - } - -} diff --git a/trainbenchmark-tool-mysql/src/main/java/hu/bme/mit/trainbenchmark/benchmark/mysql/operations/MySqlModelOperationFactory.java b/trainbenchmark-tool-mysql/src/main/java/hu/bme/mit/trainbenchmark/benchmark/mysql/operations/MySqlModelOperationFactory.java deleted file mode 100644 index 621de0074..000000000 --- a/trainbenchmark-tool-mysql/src/main/java/hu/bme/mit/trainbenchmark/benchmark/mysql/operations/MySqlModelOperationFactory.java +++ /dev/null @@ -1,167 +0,0 @@ -package hu.bme.mit.trainbenchmark.benchmark.mysql.operations; - -import hu.bme.mit.trainbenchmark.benchmark.mysql.driver.MySqlDriver; -import hu.bme.mit.trainbenchmark.benchmark.operations.ModelOperation; -import hu.bme.mit.trainbenchmark.benchmark.operations.ModelOperationFactory; -import hu.bme.mit.trainbenchmark.benchmark.sql.matches.SqlConnectedSegmentsInjectMatch; -import hu.bme.mit.trainbenchmark.benchmark.sql.matches.SqlConnectedSegmentsMatch; -import hu.bme.mit.trainbenchmark.benchmark.sql.matches.SqlMatch; -import hu.bme.mit.trainbenchmark.benchmark.sql.matches.SqlPosLengthInjectMatch; -import hu.bme.mit.trainbenchmark.benchmark.sql.matches.SqlPosLengthMatch; -import hu.bme.mit.trainbenchmark.benchmark.sql.matches.SqlRouteSensorInjectMatch; -import hu.bme.mit.trainbenchmark.benchmark.sql.matches.SqlRouteSensorMatch; -import hu.bme.mit.trainbenchmark.benchmark.sql.matches.SqlSemaphoreNeighborInjectMatch; -import hu.bme.mit.trainbenchmark.benchmark.sql.matches.SqlSemaphoreNeighborMatch; -import hu.bme.mit.trainbenchmark.benchmark.sql.matches.SqlSwitchMonitoredInjectMatch; -import hu.bme.mit.trainbenchmark.benchmark.sql.matches.SqlSwitchMonitoredMatch; -import hu.bme.mit.trainbenchmark.benchmark.sql.matches.SqlSwitchSetInjectMatch; -import hu.bme.mit.trainbenchmark.benchmark.sql.matches.SqlSwitchSetMatch; -import hu.bme.mit.trainbenchmark.benchmark.sql.queries.SqlQuery; -import hu.bme.mit.trainbenchmark.benchmark.sql.transformations.SqlTransformation; -import hu.bme.mit.trainbenchmark.benchmark.sql.transformations.inject.SqlTransformationInjectConnectedSegments; -import hu.bme.mit.trainbenchmark.benchmark.sql.transformations.inject.SqlTransformationInjectPosLength; -import hu.bme.mit.trainbenchmark.benchmark.sql.transformations.inject.SqlTransformationInjectRouteSensor; -import hu.bme.mit.trainbenchmark.benchmark.sql.transformations.inject.SqlTransformationInjectSemaphoreNeighbor; -import hu.bme.mit.trainbenchmark.benchmark.sql.transformations.inject.SqlTransformationInjectSwitchMonitored; -import hu.bme.mit.trainbenchmark.benchmark.sql.transformations.inject.SqlTransformationInjectSwitchSet; -import hu.bme.mit.trainbenchmark.benchmark.sql.transformations.repair.SqlTransformationRepairConnectedSegments; -import hu.bme.mit.trainbenchmark.benchmark.sql.transformations.repair.SqlTransformationRepairPosLength; -import hu.bme.mit.trainbenchmark.benchmark.sql.transformations.repair.SqlTransformationRepairRouteSensor; -import hu.bme.mit.trainbenchmark.benchmark.sql.transformations.repair.SqlTransformationRepairSemaphoreNeighbor; -import hu.bme.mit.trainbenchmark.benchmark.sql.transformations.repair.SqlTransformationRepairSwitchMonitored; -import hu.bme.mit.trainbenchmark.benchmark.sql.transformations.repair.SqlTransformationRepairSwitchSet; -import hu.bme.mit.trainbenchmark.constants.RailwayOperation; -import hu.bme.mit.trainbenchmark.constants.RailwayQuery; - -public class MySqlModelOperationFactory extends ModelOperationFactory<SqlMatch, MySqlDriver> { - - @Override - public ModelOperation<? extends SqlMatch, MySqlDriver> createOperation(final RailwayOperation operationEnum, final String workspaceDir, - final MySqlDriver driver) throws Exception { - - switch (operationEnum) { - // ConnectedSegments - case CONNECTEDSEGMENTS: { - final SqlQuery<SqlConnectedSegmentsMatch, MySqlDriver> query = new SqlQuery<>(driver, workspaceDir, RailwayQuery.CONNECTEDSEGMENTS); - final ModelOperation<SqlConnectedSegmentsMatch, MySqlDriver> operation = ModelOperation.of(query); - return operation; - } - case CONNECTEDSEGMENTS_INJECT: { - final SqlQuery<SqlConnectedSegmentsInjectMatch, MySqlDriver> query = new SqlQuery<>(driver, workspaceDir, RailwayQuery.CONNECTEDSEGMENTS_INJECT); - final SqlTransformation<SqlConnectedSegmentsInjectMatch, MySqlDriver> transformation = new SqlTransformationInjectConnectedSegments<>(driver, - workspaceDir); - final ModelOperation<SqlConnectedSegmentsInjectMatch, MySqlDriver> operation = ModelOperation.of(query, transformation); - return operation; - } - case CONNECTEDSEGMENTS_REPAIR: { - final SqlQuery<SqlConnectedSegmentsMatch, MySqlDriver> query = new SqlQuery<>(driver, workspaceDir, RailwayQuery.CONNECTEDSEGMENTS); - final SqlTransformation<SqlConnectedSegmentsMatch, MySqlDriver> transformation = new SqlTransformationRepairConnectedSegments<>(driver, - workspaceDir); - final ModelOperation<SqlConnectedSegmentsMatch, MySqlDriver> operation = ModelOperation.of(query, transformation); - return operation; - } - - // PosLength - case POSLENGTH: { - final SqlQuery<SqlPosLengthMatch, MySqlDriver> query = new SqlQuery<>(driver, workspaceDir, RailwayQuery.POSLENGTH); - final ModelOperation<SqlPosLengthMatch, MySqlDriver> operation = ModelOperation.of(query); - return operation; - } - case POSLENGTH_INJECT: { - final SqlQuery<SqlPosLengthInjectMatch, MySqlDriver> query = new SqlQuery<>(driver, workspaceDir, RailwayQuery.POSLENGTH_INJECT); - final SqlTransformation<SqlPosLengthInjectMatch, MySqlDriver> transformation = new SqlTransformationInjectPosLength<>(driver, workspaceDir); - final ModelOperation<SqlPosLengthInjectMatch, MySqlDriver> operation = ModelOperation.of(query, transformation); - return operation; - } - case POSLENGTH_REPAIR: { - final SqlQuery<SqlPosLengthMatch, MySqlDriver> query = new SqlQuery<>(driver, workspaceDir, RailwayQuery.POSLENGTH); - final SqlTransformation<SqlPosLengthMatch, MySqlDriver> transformation = new SqlTransformationRepairPosLength<>(driver, workspaceDir); - final ModelOperation<SqlPosLengthMatch, MySqlDriver> operation = ModelOperation.of(query, transformation); - return operation; - } - - // RouteSensor - case ROUTESENSOR: { - final SqlQuery<SqlRouteSensorMatch, MySqlDriver> query = new SqlQuery<>(driver, workspaceDir, RailwayQuery.ROUTESENSOR); - final ModelOperation<SqlRouteSensorMatch, MySqlDriver> operation = ModelOperation.of(query); - return operation; - } - case ROUTESENSOR_INJECT: { - final SqlQuery<SqlRouteSensorInjectMatch, MySqlDriver> query = new SqlQuery<>(driver, workspaceDir, RailwayQuery.ROUTESENSOR_INJECT); - final SqlTransformation<SqlRouteSensorInjectMatch, MySqlDriver> transformation = new SqlTransformationInjectRouteSensor<>(driver, workspaceDir); - final ModelOperation<SqlRouteSensorInjectMatch, MySqlDriver> operation = ModelOperation.of(query, transformation); - return operation; - } - case ROUTESENSOR_REPAIR: { - final SqlQuery<SqlRouteSensorMatch, MySqlDriver> query = new SqlQuery<>(driver, workspaceDir, RailwayQuery.ROUTESENSOR); - final SqlTransformation<SqlRouteSensorMatch, MySqlDriver> transformation = new SqlTransformationRepairRouteSensor<>(driver, workspaceDir); - final ModelOperation<SqlRouteSensorMatch, MySqlDriver> operation = ModelOperation.of(query, transformation); - return operation; - } - - // SemaphoreNeighbor - case SEMAPHORENEIGHBOR: { - final SqlQuery<SqlSemaphoreNeighborMatch, MySqlDriver> query = new SqlQuery<>(driver, workspaceDir, RailwayQuery.SEMAPHORENEIGHBOR); - final ModelOperation<SqlSemaphoreNeighborMatch, MySqlDriver> operation = ModelOperation.of(query); - return operation; - } - case SEMAPHORENEIGHBOR_INJECT: { - final SqlQuery<SqlSemaphoreNeighborInjectMatch, MySqlDriver> query = new SqlQuery<>(driver, workspaceDir, RailwayQuery.SEMAPHORENEIGHBOR_INJECT); - final SqlTransformation<SqlSemaphoreNeighborInjectMatch, MySqlDriver> transformation = new SqlTransformationInjectSemaphoreNeighbor<>(driver, - workspaceDir); - final ModelOperation<SqlSemaphoreNeighborInjectMatch, MySqlDriver> operation = ModelOperation.of(query, transformation); - return operation; - } - case SEMAPHORENEIGHBOR_REPAIR: { - final SqlQuery<SqlSemaphoreNeighborMatch, MySqlDriver> query = new SqlQuery<>(driver, workspaceDir, RailwayQuery.SEMAPHORENEIGHBOR); - final SqlTransformation<SqlSemaphoreNeighborMatch, MySqlDriver> transformation = new SqlTransformationRepairSemaphoreNeighbor<>(driver, - workspaceDir); - final ModelOperation<SqlSemaphoreNeighborMatch, MySqlDriver> operation = ModelOperation.of(query, transformation); - return operation; - } - - // SwitchMonitored - case SWITCHMONITORED: { - final SqlQuery<SqlSwitchMonitoredMatch, MySqlDriver> query = new SqlQuery<>(driver, workspaceDir, RailwayQuery.SWITCHMONITORED); - final ModelOperation<SqlSwitchMonitoredMatch, MySqlDriver> operation = ModelOperation.of(query); - return operation; - } - case SWITCHMONITORED_INJECT: { - final SqlQuery<SqlSwitchMonitoredInjectMatch, MySqlDriver> query = new SqlQuery<>(driver, workspaceDir, RailwayQuery.SWITCHMONITORED_INJECT); - final SqlTransformation<SqlSwitchMonitoredInjectMatch, MySqlDriver> transformation = new SqlTransformationInjectSwitchMonitored<>(driver, - workspaceDir); - final ModelOperation<SqlSwitchMonitoredInjectMatch, MySqlDriver> operation = ModelOperation.of(query, transformation); - return operation; - } - case SWITCHMONITORED_REPAIR: { - final SqlQuery<SqlSwitchMonitoredMatch, MySqlDriver> query = new SqlQuery<>(driver, workspaceDir, RailwayQuery.SWITCHMONITORED); - final SqlTransformation<SqlSwitchMonitoredMatch, MySqlDriver> transformation = new SqlTransformationRepairSwitchMonitored<>(driver, workspaceDir); - final ModelOperation<SqlSwitchMonitoredMatch, MySqlDriver> operation = ModelOperation.of(query, transformation); - return operation; - } - - // SwitchSet - case SWITCHSET: { - final SqlQuery<SqlSwitchSetMatch, MySqlDriver> query = new SqlQuery<>(driver, workspaceDir, RailwayQuery.SWITCHSET); - final ModelOperation<SqlSwitchSetMatch, MySqlDriver> operation = ModelOperation.of(query); - return operation; - } - case SWITCHSET_INJECT: { - final SqlQuery<SqlSwitchSetInjectMatch, MySqlDriver> query = new SqlQuery<>(driver, workspaceDir, RailwayQuery.SWITCHSET_INJECT); - final SqlTransformation<SqlSwitchSetInjectMatch, MySqlDriver> transformation = new SqlTransformationInjectSwitchSet<>(driver, workspaceDir); - final ModelOperation<SqlSwitchSetInjectMatch, MySqlDriver> operation = ModelOperation.of(query, transformation); - return operation; - } - case SWITCHSET_REPAIR: { - final SqlQuery<SqlSwitchSetMatch, MySqlDriver> query = new SqlQuery<>(driver, workspaceDir, RailwayQuery.SWITCHSET); - final SqlTransformation<SqlSwitchSetMatch, MySqlDriver> transformation = new SqlTransformationRepairSwitchSet<>(driver, workspaceDir); - final ModelOperation<SqlSwitchSetMatch, MySqlDriver> operation = ModelOperation.of(query, transformation); - return operation; - } - default: - break; - } - throw new UnsupportedOperationException("Operation " + operationEnum + " not supported."); - } - -} diff --git a/trainbenchmark-tool-mysql/src/main/resources/.gitignore b/trainbenchmark-tool-mysql/src/main/resources/.gitignore deleted file mode 100644 index e69de29bb..000000000 diff --git a/trainbenchmark-tool-mysql/src/test/java/hu/bme/mit/trainbenchmark/benchmark/mysql/test/MySqlTest.java b/trainbenchmark-tool-mysql/src/test/java/hu/bme/mit/trainbenchmark/benchmark/mysql/test/MySqlTest.java deleted file mode 100644 index f3ed6fa53..000000000 --- a/trainbenchmark-tool-mysql/src/test/java/hu/bme/mit/trainbenchmark/benchmark/mysql/test/MySqlTest.java +++ /dev/null @@ -1,32 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2010-2015, Benedek Izso, Gabor Szarnyas, Istvan Rath and Daniel Varro - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Benedek Izso - initial API and implementation - * Gabor Szarnyas - initial API and implementation - *******************************************************************************/ - -package hu.bme.mit.trainbenchmark.benchmark.mysql.test; - -import hu.bme.mit.trainbenchmark.benchmark.config.BenchmarkConfigBase; -import hu.bme.mit.trainbenchmark.benchmark.mysql.MySqlBenchmarkScenario; -import hu.bme.mit.trainbenchmark.benchmark.mysql.config.MySqlBenchmarkConfig; -import hu.bme.mit.trainbenchmark.benchmark.mysql.config.MySqlBenchmarkConfigBuilder; -import hu.bme.mit.trainbenchmark.benchmark.runcomponents.BenchmarkResult; -import hu.bme.mit.trainbenchmark.benchmark.test.TrainBenchmarkTest; - -public class MySqlTest extends TrainBenchmarkTest { - - @Override - protected BenchmarkResult runTest(final BenchmarkConfigBase bcb) throws Exception { - final MySqlBenchmarkConfig bc = new MySqlBenchmarkConfigBuilder().setConfigBase(bcb).createConfig(); - final MySqlBenchmarkScenario scenario = new MySqlBenchmarkScenario(bc); - final BenchmarkResult result = scenario.performBenchmark(); - return result; - } - -} diff --git a/trainbenchmark-tool-neo4j/README.md b/trainbenchmark-tool-neo4j/README.md deleted file mode 100644 index 6ca7176c0..000000000 --- a/trainbenchmark-tool-neo4j/README.md +++ /dev/null @@ -1,5 +0,0 @@ -# Neo4j implementation - -Neo4j cannot assign a specific id to a new node. - -This means that if we run multiple transformations (e.g. ConnectedSegmentsInject, which inserts new Segments), we cannot guarantee the precise number of matches. \ No newline at end of file diff --git a/trainbenchmark-tool-neo4j/build.gradle b/trainbenchmark-tool-neo4j/build.gradle deleted file mode 100644 index 8a4e6f528..000000000 --- a/trainbenchmark-tool-neo4j/build.gradle +++ /dev/null @@ -1,12 +0,0 @@ -plugins { id "com.github.johnrengelman.shadow" version "1.2.3" } - -shadowJar { - classifier = 'fat' - mergeServiceFiles() - manifest { attributes 'Main-Class': 'hu.bme.mit.trainbenchmark.benchmark.neo4j.Neo4jBenchmarkMain' } -} - -dependencies { - compile project(':trainbenchmark-tool') - compile project(':trainbenchmark-format-graph-neo4j') -} diff --git a/trainbenchmark-tool-neo4j/src/main/java/hu/bme/mit/trainbenchmark/benchmark/neo4j/Neo4jBenchmarkMain.java b/trainbenchmark-tool-neo4j/src/main/java/hu/bme/mit/trainbenchmark/benchmark/neo4j/Neo4jBenchmarkMain.java deleted file mode 100644 index 395b70023..000000000 --- a/trainbenchmark-tool-neo4j/src/main/java/hu/bme/mit/trainbenchmark/benchmark/neo4j/Neo4jBenchmarkMain.java +++ /dev/null @@ -1,26 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2010-2015, Benedek Izso, Gabor Szarnyas, Istvan Rath and Daniel Varro - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Benedek Izso - initial API and implementation - * Gabor Szarnyas - initial API and implementation - *******************************************************************************/ - -package hu.bme.mit.trainbenchmark.benchmark.neo4j; - -import hu.bme.mit.trainbenchmark.benchmark.config.BenchmarkConfig; -import hu.bme.mit.trainbenchmark.benchmark.neo4j.config.Neo4jBenchmarkConfig; - -public class Neo4jBenchmarkMain { - - public static void main(final String[] args) throws Exception { - final Neo4jBenchmarkConfig bc = BenchmarkConfig.fromFile(args[0], Neo4jBenchmarkConfig.class); - final Neo4jBenchmarkScenario scenario = new Neo4jBenchmarkScenario(bc); - scenario.performBenchmark(); - } - -} diff --git a/trainbenchmark-tool-neo4j/src/main/java/hu/bme/mit/trainbenchmark/benchmark/neo4j/Neo4jBenchmarkScenario.java b/trainbenchmark-tool-neo4j/src/main/java/hu/bme/mit/trainbenchmark/benchmark/neo4j/Neo4jBenchmarkScenario.java deleted file mode 100644 index bfdccf1ee..000000000 --- a/trainbenchmark-tool-neo4j/src/main/java/hu/bme/mit/trainbenchmark/benchmark/neo4j/Neo4jBenchmarkScenario.java +++ /dev/null @@ -1,17 +0,0 @@ -package hu.bme.mit.trainbenchmark.benchmark.neo4j; - -import hu.bme.mit.trainbenchmark.benchmark.neo4j.comparators.Neo4jMatchComparator; -import hu.bme.mit.trainbenchmark.benchmark.neo4j.config.Neo4jBenchmarkConfig; -import hu.bme.mit.trainbenchmark.benchmark.neo4j.driver.Neo4jDriver; -import hu.bme.mit.trainbenchmark.benchmark.neo4j.driver.Neo4jDriverFactory; -import hu.bme.mit.trainbenchmark.benchmark.neo4j.matches.Neo4jMatch; -import hu.bme.mit.trainbenchmark.benchmark.neo4j.operations.Neo4jModelOperationFactory; -import hu.bme.mit.trainbenchmark.benchmark.phases.BenchmarkScenario; - -public class Neo4jBenchmarkScenario extends BenchmarkScenario<Neo4jMatch, Neo4jDriver, Neo4jBenchmarkConfig> { - - public Neo4jBenchmarkScenario(final Neo4jBenchmarkConfig bc) throws Exception { - super(new Neo4jDriverFactory(bc.getConfigBase().getModelDir(), bc.getGraphFormat()), new Neo4jModelOperationFactory(bc.getEngine()), new Neo4jMatchComparator(), bc); - } - -} diff --git a/trainbenchmark-tool-neo4j/src/main/java/hu/bme/mit/trainbenchmark/benchmark/neo4j/comparators/Neo4jMatchComparator.java b/trainbenchmark-tool-neo4j/src/main/java/hu/bme/mit/trainbenchmark/benchmark/neo4j/comparators/Neo4jMatchComparator.java deleted file mode 100644 index 2ee37aafc..000000000 --- a/trainbenchmark-tool-neo4j/src/main/java/hu/bme/mit/trainbenchmark/benchmark/neo4j/comparators/Neo4jMatchComparator.java +++ /dev/null @@ -1,25 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2010-2015, Benedek Izso, Gabor Szarnyas, Istvan Rath and Daniel Varro - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Benedek Izso - initial API and implementation - * Gabor Szarnyas - initial API and implementation - *******************************************************************************/ -package hu.bme.mit.trainbenchmark.benchmark.neo4j.comparators; - -import org.neo4j.graphdb.Node; - -import hu.bme.mit.trainbenchmark.benchmark.matches.comparators.BaseMatchComparator; -import hu.bme.mit.trainbenchmark.benchmark.neo4j.matches.Neo4jMatch; - -public class Neo4jMatchComparator extends BaseMatchComparator<Neo4jMatch, Node> { - - public Neo4jMatchComparator() { - super(new NodeComparator()); - } - -} diff --git a/trainbenchmark-tool-neo4j/src/main/java/hu/bme/mit/trainbenchmark/benchmark/neo4j/comparators/NodeComparator.java b/trainbenchmark-tool-neo4j/src/main/java/hu/bme/mit/trainbenchmark/benchmark/neo4j/comparators/NodeComparator.java deleted file mode 100644 index e797ab12f..000000000 --- a/trainbenchmark-tool-neo4j/src/main/java/hu/bme/mit/trainbenchmark/benchmark/neo4j/comparators/NodeComparator.java +++ /dev/null @@ -1,29 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2010-2015, Benedek Izso, Gabor Szarnyas, Istvan Rath and Daniel Varro - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Benedek Izso - initial API and implementation - * Gabor Szarnyas - initial API and implementation - *******************************************************************************/ -package hu.bme.mit.trainbenchmark.benchmark.neo4j.comparators; - -import org.neo4j.graphdb.Node; - -import java.util.Comparator; - -public class NodeComparator implements Comparator<Node> { - - @Override - public int compare(final Node node1, final Node node2) { -// final long id1 = node1.getProperty(Neo4jConstants.ID); -// final long id2 = node2.getProperty(Neo4jConstants.ID); - final long id1 = node1.getId(); - final long id2 = node2.getId(); - return Long.compare(id1, id2); - } - -} diff --git a/trainbenchmark-tool-neo4j/src/main/java/hu/bme/mit/trainbenchmark/benchmark/neo4j/config/Neo4jBenchmarkConfig.java b/trainbenchmark-tool-neo4j/src/main/java/hu/bme/mit/trainbenchmark/benchmark/neo4j/config/Neo4jBenchmarkConfig.java deleted file mode 100644 index 0cefe5634..000000000 --- a/trainbenchmark-tool-neo4j/src/main/java/hu/bme/mit/trainbenchmark/benchmark/neo4j/config/Neo4jBenchmarkConfig.java +++ /dev/null @@ -1,48 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2010-2015, Benedek Izso, Gabor Szarnyas, Istvan Rath and Daniel Varro - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Benedek Izso - initial API and implementation - * Gabor Szarnyas - initial API and implementation - *******************************************************************************/ - -package hu.bme.mit.trainbenchmark.benchmark.neo4j.config; - -import hu.bme.mit.trainbenchmark.benchmark.config.BenchmarkConfig; -import hu.bme.mit.trainbenchmark.benchmark.config.BenchmarkConfigBase; -import hu.bme.mit.trainbenchmark.neo4j.config.Neo4jGraphFormat; - -public class Neo4jBenchmarkConfig extends BenchmarkConfig { - - protected Neo4jEngine engine; - protected Neo4jGraphFormat graphFormat; - - protected Neo4jBenchmarkConfig(final BenchmarkConfigBase configBase, final Neo4jEngine engine, final Neo4jGraphFormat graphFormat) { - super(configBase); - this.engine = engine; - this.graphFormat = graphFormat; - } - - public Neo4jEngine getEngine() { - return engine; - } - - public Neo4jGraphFormat getGraphFormat() { - return graphFormat; - } - - @Override - public String getToolName() { - return String.format("Neo4j (%s-%s)", getEngine(), getGraphFormat()); - } - - @Override - public String getProjectName() { - return "neo4j"; - } - -} diff --git a/trainbenchmark-tool-neo4j/src/main/java/hu/bme/mit/trainbenchmark/benchmark/neo4j/config/Neo4jBenchmarkConfigBuilder.java b/trainbenchmark-tool-neo4j/src/main/java/hu/bme/mit/trainbenchmark/benchmark/neo4j/config/Neo4jBenchmarkConfigBuilder.java deleted file mode 100644 index 67376028b..000000000 --- a/trainbenchmark-tool-neo4j/src/main/java/hu/bme/mit/trainbenchmark/benchmark/neo4j/config/Neo4jBenchmarkConfigBuilder.java +++ /dev/null @@ -1,36 +0,0 @@ -package hu.bme.mit.trainbenchmark.benchmark.neo4j.config; - -import com.google.common.base.Preconditions; - -import hu.bme.mit.trainbenchmark.benchmark.config.BenchmarkConfigBuilder; -import hu.bme.mit.trainbenchmark.neo4j.config.Neo4jGraphFormat; - -public class Neo4jBenchmarkConfigBuilder - extends BenchmarkConfigBuilder<Neo4jBenchmarkConfig, Neo4jBenchmarkConfigBuilder> { - - private Neo4jEngine engine; - private Neo4jGraphFormat graphFormat; - - public Neo4jBenchmarkConfigBuilder setEngine(final Neo4jEngine engine) { - this.engine = engine; - return this; - } - - public Neo4jBenchmarkConfigBuilder setGraphFormat(final Neo4jGraphFormat graphFormat) { - this.graphFormat = graphFormat; - return this; - } - - @Override - public void checkNotNulls() { - super.checkNotNulls(); - Preconditions.checkNotNull(engine); - Preconditions.checkNotNull(graphFormat); - } - - @Override - public Neo4jBenchmarkConfig createConfig() { - checkNotNulls(); - return new Neo4jBenchmarkConfig(configBase, engine, graphFormat); - } -} diff --git a/trainbenchmark-tool-neo4j/src/main/java/hu/bme/mit/trainbenchmark/benchmark/neo4j/config/Neo4jEngine.java b/trainbenchmark-tool-neo4j/src/main/java/hu/bme/mit/trainbenchmark/benchmark/neo4j/config/Neo4jEngine.java deleted file mode 100644 index 99a5f47bd..000000000 --- a/trainbenchmark-tool-neo4j/src/main/java/hu/bme/mit/trainbenchmark/benchmark/neo4j/config/Neo4jEngine.java +++ /dev/null @@ -1,17 +0,0 @@ -package hu.bme.mit.trainbenchmark.benchmark.neo4j.config; - -public enum Neo4jEngine { - COREAPI("Core API"), CYPHER("Cypher"); - - private String name; - - Neo4jEngine(final String name) { - this.name = name; - } - - @Override - public String toString() { - return name; - } - -} diff --git a/trainbenchmark-tool-neo4j/src/main/java/hu/bme/mit/trainbenchmark/benchmark/neo4j/driver/Neo4jDriver.java b/trainbenchmark-tool-neo4j/src/main/java/hu/bme/mit/trainbenchmark/benchmark/neo4j/driver/Neo4jDriver.java deleted file mode 100644 index 6a53e56cb..000000000 --- a/trainbenchmark-tool-neo4j/src/main/java/hu/bme/mit/trainbenchmark/benchmark/neo4j/driver/Neo4jDriver.java +++ /dev/null @@ -1,228 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2010-2015, Benedek Izso, Gabor Szarnyas, Istvan Rath and Daniel Varro - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Benedek Izso - initial API and implementation - * Gabor Szarnyas - initial API and implementation - *******************************************************************************/ -package hu.bme.mit.trainbenchmark.benchmark.neo4j.driver; - -import apoc.export.graphml.ExportGraphML; -import apoc.graph.Graphs; -import hu.bme.mit.trainbenchmark.benchmark.driver.Driver; -import hu.bme.mit.trainbenchmark.benchmark.neo4j.comparators.NodeComparator; -import hu.bme.mit.trainbenchmark.benchmark.neo4j.matches.Neo4jMatch; -import hu.bme.mit.trainbenchmark.constants.ModelConstants; -import hu.bme.mit.trainbenchmark.constants.RailwayQuery; -import hu.bme.mit.trainbenchmark.neo4j.Neo4jConstants; -import hu.bme.mit.trainbenchmark.neo4j.Neo4jHelper; -import hu.bme.mit.trainbenchmark.neo4j.apoc.ApocHelper; -import hu.bme.mit.trainbenchmark.neo4j.config.Neo4jGraphFormat; -import org.apache.commons.exec.CommandLine; -import org.apache.commons.exec.DefaultExecutor; -import org.apache.commons.io.FileUtils; - -import java.io.BufferedReader; -import java.io.File; -import java.io.FileNotFoundException; -import java.io.FileReader; -import java.io.IOException; -import java.util.ArrayList; -import java.util.Collection; -import java.util.Comparator; -import java.util.Map; -import java.util.concurrent.TimeUnit; -import javax.xml.stream.XMLStreamException; - -import org.neo4j.graphdb.GraphDatabaseService; -import org.neo4j.graphdb.Node; -import org.neo4j.graphdb.Result; -import org.neo4j.graphdb.Transaction; -import org.neo4j.graphdb.schema.Schema; -import org.neo4j.kernel.api.exceptions.KernelException; - -public class Neo4jDriver extends Driver { - - protected Transaction tx; - protected GraphDatabaseService graphDb; - protected final Comparator<Node> nodeComparator = new NodeComparator(); - protected final File databaseDirectory; - protected final Neo4jGraphFormat graphFormat; - - public Neo4jDriver(final String modelDir, final Neo4jGraphFormat graphFormat) throws IOException { - super(); - this.graphFormat = graphFormat; - this.databaseDirectory = new File(modelDir + "/neo4j-dbs/railway-database"); - } - - @Override - public void initialize() throws Exception { - super.initialize(); - - // delete old database directory - if (databaseDirectory.exists()) { - FileUtils.deleteDirectory(databaseDirectory); - } - } - - @Override - public void destroy() { - if (graphDb != null) { - graphDb.shutdown(); - } - } - - @Override - public void beginTransaction() { - tx = graphDb.beginTx(); - } - - @Override - public void finishTransaction() { - tx.success(); - tx.close(); - } - - @Override - public void read(final String modelPath) - throws XMLStreamException, IOException, KernelException { - switch (graphFormat) { - case CSV: - readCsv(modelPath); - break; - case GRAPHML: - readGraphMl(modelPath); - break; - case CYPHER: - readCypher(modelPath); - break; - default: - throw new UnsupportedOperationException("Format " + graphFormat + " not supported"); - } - } - - private void startDb() { - graphDb = Neo4jHelper.startGraphDatabase(databaseDirectory); - - try (final Transaction tx = graphDb.beginTx()) { - final Schema schema = graphDb.schema(); - schema.indexFor(Neo4jConstants.labelSegment).on(ModelConstants.ID).create(); - schema.indexFor(Neo4jConstants.labelSegment).on(ModelConstants.LENGTH).create(); - schema.indexFor(Neo4jConstants.labelSemaphore).on(ModelConstants.SIGNAL).create(); - schema.indexFor(Neo4jConstants.labelRoute).on(ModelConstants.ACTIVE).create(); - tx.success(); - } - try (final Transaction tx = graphDb.beginTx()) { - final Schema schema = graphDb.schema(); - schema.awaitIndexesOnline(5, TimeUnit.MINUTES); - } - } - - private void readCsv(String modelPath) throws IOException { - final String neo4jHome = "../neo4j-server"; - final String dbPath = "../models/neo4j-dbs/railway-database"; - final File databaseDirectory = new File(dbPath); - - if (databaseDirectory.exists()) { - FileUtils.deleteDirectory(databaseDirectory); - } - - // TODO neo4j-import is deprecated and should be changes to neo4j-admin import - // however, it's not trivial as neo4j-admin-import does not take an `--into` argument - // but a `--database` - final String rawImportCommand = "%NEO4J_HOME%/bin/neo4j-import --into %DB_PATH% " // - + "--nodes:Region %MODEL_PREFIX%-Region.csv " // - + "--nodes:Route %MODEL_PREFIX%-Route.csv " // - + "--nodes:Segment:TrackElement %MODEL_PREFIX%-Segment.csv " // - + "--nodes:Semaphore %MODEL_PREFIX%-Semaphore.csv " // - + "--nodes:Sensor %MODEL_PREFIX%-Sensor.csv " // - + "--nodes:Switch:TrackElement %MODEL_PREFIX%-Switch.csv " // - + "--nodes:SwitchPosition %MODEL_PREFIX%-SwitchPosition.csv " // - + "--relationships:connectsTo %MODEL_PREFIX%-connectsTo.csv " // - + "--relationships:entry %MODEL_PREFIX%-entry.csv " // - + "--relationships:exit %MODEL_PREFIX%-exit.csv "// - + "--relationships:follows %MODEL_PREFIX%-follows.csv "// - + "--relationships:monitoredBy %MODEL_PREFIX%-monitoredBy.csv "// - + "--relationships:requires %MODEL_PREFIX%-requires.csv "// - + "--relationships:target %MODEL_PREFIX%-target.csv"; - final String importCommand = rawImportCommand // - .replaceAll("%NEO4J_HOME%", neo4jHome) // - .replaceAll("%DB_PATH%", dbPath) // - .replaceAll("%MODEL_PREFIX%", modelPath); - final CommandLine cmdLine = CommandLine.parse(importCommand); - final DefaultExecutor executor = new DefaultExecutor(); - final int exitValue = executor.execute(cmdLine); - if (exitValue != 0) { - throw new IOException("Neo4j import failed"); - } - startDb(); - } - - private void readCypher(String modelPath) throws IOException { - startDb(); - final File cypherFile = new File(modelPath); - try(final Transaction tx = graphDb.beginTx()) { - BufferedReader bufferedReader = new BufferedReader(new FileReader(cypherFile)); - String line = null; - while ((line = bufferedReader.readLine()) != null){ - graphDb.execute(line); - } - tx.success(); - } - } - - private void readGraphMl(String modelPath) throws FileNotFoundException, XMLStreamException, KernelException { - startDb(); - - ApocHelper.registerProcedure(graphDb, ExportGraphML.class, Graphs.class); - try (final Transaction tx = graphDb.beginTx()) { - graphDb.execute(String.format( // - "CALL apoc.import.graphml('%s', {batchSize: 10000, readLabels: true})", // - modelPath // - )); - tx.success(); - } - } - - @Override - public String getPostfix() { - switch (graphFormat) { - case CSV: - return ""; // hack as we have multiple CSVs - case GRAPHML: - return ".graphml"; - case CYPHER: - return ".cypher"; - default: - throw new UnsupportedOperationException("Format " + graphFormat + " not supported"); - } - } - - public Collection<Neo4jMatch> runQuery(final RailwayQuery query, final String queryDefinition) throws IOException { - final Collection<Neo4jMatch> results = new ArrayList<>(); - - final Result executionResult = graphDb.execute(queryDefinition); - while (executionResult.hasNext()) { - final Map<String, Object> row = executionResult.next(); - results.add(Neo4jMatch.createMatch(query, row)); - } - - return results; - } - - public void runTransformation(final String transformationDefinition, final Map<String, Object> parameters) - throws IOException { - graphDb.execute(transformationDefinition, parameters); - } - - // utility - - public GraphDatabaseService getGraphDb() { - return graphDb; - } - -} diff --git a/trainbenchmark-tool-neo4j/src/main/java/hu/bme/mit/trainbenchmark/benchmark/neo4j/driver/Neo4jDriverFactory.java b/trainbenchmark-tool-neo4j/src/main/java/hu/bme/mit/trainbenchmark/benchmark/neo4j/driver/Neo4jDriverFactory.java deleted file mode 100644 index 9422f12ba..000000000 --- a/trainbenchmark-tool-neo4j/src/main/java/hu/bme/mit/trainbenchmark/benchmark/neo4j/driver/Neo4jDriverFactory.java +++ /dev/null @@ -1,22 +0,0 @@ -package hu.bme.mit.trainbenchmark.benchmark.neo4j.driver; - -import hu.bme.mit.trainbenchmark.benchmark.driver.DriverFactory; -import hu.bme.mit.trainbenchmark.neo4j.config.Neo4jGraphFormat; - -public class Neo4jDriverFactory extends DriverFactory<Neo4jDriver> { - - protected final String modelDir; - protected final Neo4jGraphFormat graphFormat; - - public Neo4jDriverFactory(final String modelDir, final Neo4jGraphFormat graphFormat) { - super(); - this.modelDir = modelDir; - this.graphFormat = graphFormat; - } - - @Override - public Neo4jDriver createInstance() throws Exception { - return new Neo4jDriver(modelDir, graphFormat); - } - -} diff --git a/trainbenchmark-tool-neo4j/src/main/java/hu/bme/mit/trainbenchmark/benchmark/neo4j/matches/Neo4jConnectedSegmentsInjectMatch.java b/trainbenchmark-tool-neo4j/src/main/java/hu/bme/mit/trainbenchmark/benchmark/neo4j/matches/Neo4jConnectedSegmentsInjectMatch.java deleted file mode 100644 index d9556b28d..000000000 --- a/trainbenchmark-tool-neo4j/src/main/java/hu/bme/mit/trainbenchmark/benchmark/neo4j/matches/Neo4jConnectedSegmentsInjectMatch.java +++ /dev/null @@ -1,45 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2010-2015, Benedek Izso, Gabor Szarnyas, Istvan Rath and Daniel Varro - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Benedek Izso - initial API and implementation - * Gabor Szarnyas - initial API and implementation - *******************************************************************************/ -package hu.bme.mit.trainbenchmark.benchmark.neo4j.matches; - -import static hu.bme.mit.trainbenchmark.constants.QueryConstants.VAR_SEGMENT1; -import static hu.bme.mit.trainbenchmark.constants.QueryConstants.VAR_SEGMENT3; -import static hu.bme.mit.trainbenchmark.constants.QueryConstants.VAR_SENSOR; - -import java.util.Map; - -import org.neo4j.graphdb.Node; - -import hu.bme.mit.trainbenchmark.benchmark.matches.ConnectedSegmentsInjectMatch; - -public class Neo4jConnectedSegmentsInjectMatch extends Neo4jMatch implements ConnectedSegmentsInjectMatch { - - public Neo4jConnectedSegmentsInjectMatch(final Map<String, Object> match) { - super(match); - } - - @Override - public Node getSensor() { - return (Node) match.get(VAR_SENSOR); - } - - @Override - public Node getSegment1() { - return (Node) match.get(VAR_SEGMENT1); - } - - @Override - public Node getSegment3() { - return (Node) match.get(VAR_SEGMENT3); - } - -} diff --git a/trainbenchmark-tool-neo4j/src/main/java/hu/bme/mit/trainbenchmark/benchmark/neo4j/matches/Neo4jConnectedSegmentsMatch.java b/trainbenchmark-tool-neo4j/src/main/java/hu/bme/mit/trainbenchmark/benchmark/neo4j/matches/Neo4jConnectedSegmentsMatch.java deleted file mode 100644 index 7dc432b07..000000000 --- a/trainbenchmark-tool-neo4j/src/main/java/hu/bme/mit/trainbenchmark/benchmark/neo4j/matches/Neo4jConnectedSegmentsMatch.java +++ /dev/null @@ -1,69 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2010-2015, Benedek Izso, Gabor Szarnyas, Istvan Rath and Daniel Varro - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Benedek Izso - initial API and implementation - * Gabor Szarnyas - initial API and implementation - *******************************************************************************/ -package hu.bme.mit.trainbenchmark.benchmark.neo4j.matches; - -import static hu.bme.mit.trainbenchmark.constants.QueryConstants.VAR_SEGMENT1; -import static hu.bme.mit.trainbenchmark.constants.QueryConstants.VAR_SEGMENT2; -import static hu.bme.mit.trainbenchmark.constants.QueryConstants.VAR_SEGMENT3; -import static hu.bme.mit.trainbenchmark.constants.QueryConstants.VAR_SEGMENT4; -import static hu.bme.mit.trainbenchmark.constants.QueryConstants.VAR_SEGMENT5; -import static hu.bme.mit.trainbenchmark.constants.QueryConstants.VAR_SEGMENT6; -import static hu.bme.mit.trainbenchmark.constants.QueryConstants.VAR_SENSOR; - -import java.util.Map; - -import org.neo4j.graphdb.Node; - -import hu.bme.mit.trainbenchmark.benchmark.matches.ConnectedSegmentsMatch; - -public class Neo4jConnectedSegmentsMatch extends Neo4jMatch implements ConnectedSegmentsMatch { - - public Neo4jConnectedSegmentsMatch(final Map<String, Object> match) { - super(match); - } - - @Override - public Node getSensor() { - return (Node) match.get(VAR_SENSOR); - } - - @Override - public Node getSegment1() { - return (Node) match.get(VAR_SEGMENT1); - } - - @Override - public Node getSegment2() { - return (Node) match.get(VAR_SEGMENT2); - } - - @Override - public Node getSegment3() { - return (Node) match.get(VAR_SEGMENT3); - } - - @Override - public Node getSegment4() { - return (Node) match.get(VAR_SEGMENT4); - } - - @Override - public Node getSegment5() { - return (Node) match.get(VAR_SEGMENT5); - } - - @Override - public Node getSegment6() { - return (Node) match.get(VAR_SEGMENT6); - } - -} diff --git a/trainbenchmark-tool-neo4j/src/main/java/hu/bme/mit/trainbenchmark/benchmark/neo4j/matches/Neo4jMatch.java b/trainbenchmark-tool-neo4j/src/main/java/hu/bme/mit/trainbenchmark/benchmark/neo4j/matches/Neo4jMatch.java deleted file mode 100644 index 436533555..000000000 --- a/trainbenchmark-tool-neo4j/src/main/java/hu/bme/mit/trainbenchmark/benchmark/neo4j/matches/Neo4jMatch.java +++ /dev/null @@ -1,64 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2010-2015, Benedek Izso, Gabor Szarnyas, Istvan Rath and Daniel Varro - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Benedek Izso - initial API and implementation - * Gabor Szarnyas - initial API and implementation - *******************************************************************************/ -package hu.bme.mit.trainbenchmark.benchmark.neo4j.matches; - -import java.util.Arrays; -import java.util.Map; - -import hu.bme.mit.trainbenchmark.benchmark.matches.BaseMatch; -import hu.bme.mit.trainbenchmark.constants.RailwayQuery; - -public abstract class Neo4jMatch extends BaseMatch { - - protected Map<String, Object> match; - - public Neo4jMatch(final Map<String, Object> match) { - this.match = match; - } - - @Override - public String toString() { - return "Neo4jMatch [match=" + Arrays.toString(toArray()) + "]"; - } - - public static Neo4jMatch createMatch(final RailwayQuery query, final Map<String, Object> match) { - switch (query) { - case CONNECTEDSEGMENTS: - return new Neo4jConnectedSegmentsMatch(match); - case CONNECTEDSEGMENTS_INJECT: - return new Neo4jConnectedSegmentsInjectMatch(match); - case POSLENGTH: - return new Neo4jPosLengthMatch(match); - case POSLENGTH_INJECT: - return new Neo4jPosLengthInjectMatch(match); - case ROUTESENSOR: - return new Neo4jRouteSensorMatch(match); - case ROUTESENSOR_INJECT: - return new Neo4jRouteSensorInjectMatch(match); - case SEMAPHORENEIGHBOR: - return new Neo4jSemaphoreNeighborMatch(match); - case SEMAPHORENEIGHBOR_INJECT: - return new Neo4jSemaphoreNeighborInjectMatch(match); - case SWITCHMONITORED: - return new Neo4jSwitchMonitoredMatch(match); - case SWITCHMONITORED_INJECT: - return new Neo4jSwitchMonitoredInjectMatch(match); - case SWITCHSET: - return new Neo4jSwitchSetMatch(match); - case SWITCHSET_INJECT: - return new Neo4jSwitchSetInjectMatch(match); - default: - throw new UnsupportedOperationException("Query not supported: " + query); - } - } - -} diff --git a/trainbenchmark-tool-neo4j/src/main/java/hu/bme/mit/trainbenchmark/benchmark/neo4j/matches/Neo4jPosLengthInjectMatch.java b/trainbenchmark-tool-neo4j/src/main/java/hu/bme/mit/trainbenchmark/benchmark/neo4j/matches/Neo4jPosLengthInjectMatch.java deleted file mode 100644 index 9abe745f3..000000000 --- a/trainbenchmark-tool-neo4j/src/main/java/hu/bme/mit/trainbenchmark/benchmark/neo4j/matches/Neo4jPosLengthInjectMatch.java +++ /dev/null @@ -1,33 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2010-2015, Benedek Izso, Gabor Szarnyas, Istvan Rath and Daniel Varro - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Benedek Izso - initial API and implementation - * Gabor Szarnyas - initial API and implementation - *******************************************************************************/ -package hu.bme.mit.trainbenchmark.benchmark.neo4j.matches; - -import static hu.bme.mit.trainbenchmark.constants.QueryConstants.VAR_SEGMENT; - -import java.util.Map; - -import org.neo4j.graphdb.Node; - -import hu.bme.mit.trainbenchmark.benchmark.matches.PosLengthInjectMatch; - -public class Neo4jPosLengthInjectMatch extends Neo4jMatch implements PosLengthInjectMatch { - - public Neo4jPosLengthInjectMatch(final Map<String, Object> match) { - super(match); - } - - @Override - public Node getSegment() { - return (Node) match.get(VAR_SEGMENT); - } - -} diff --git a/trainbenchmark-tool-neo4j/src/main/java/hu/bme/mit/trainbenchmark/benchmark/neo4j/matches/Neo4jPosLengthMatch.java b/trainbenchmark-tool-neo4j/src/main/java/hu/bme/mit/trainbenchmark/benchmark/neo4j/matches/Neo4jPosLengthMatch.java deleted file mode 100644 index cbe7d5d0e..000000000 --- a/trainbenchmark-tool-neo4j/src/main/java/hu/bme/mit/trainbenchmark/benchmark/neo4j/matches/Neo4jPosLengthMatch.java +++ /dev/null @@ -1,33 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2010-2015, Benedek Izso, Gabor Szarnyas, Istvan Rath and Daniel Varro - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Benedek Izso - initial API and implementation - * Gabor Szarnyas - initial API and implementation - *******************************************************************************/ -package hu.bme.mit.trainbenchmark.benchmark.neo4j.matches; - -import static hu.bme.mit.trainbenchmark.constants.QueryConstants.VAR_SEGMENT; - -import java.util.Map; - -import org.neo4j.graphdb.Node; - -import hu.bme.mit.trainbenchmark.benchmark.matches.PosLengthMatch; - -public class Neo4jPosLengthMatch extends Neo4jMatch implements PosLengthMatch { - - public Neo4jPosLengthMatch(final Map<String, Object> match) { - super(match); - } - - @Override - public Node getSegment() { - return (Node) match.get(VAR_SEGMENT); - } - -} diff --git a/trainbenchmark-tool-neo4j/src/main/java/hu/bme/mit/trainbenchmark/benchmark/neo4j/matches/Neo4jRouteSensorInjectMatch.java b/trainbenchmark-tool-neo4j/src/main/java/hu/bme/mit/trainbenchmark/benchmark/neo4j/matches/Neo4jRouteSensorInjectMatch.java deleted file mode 100644 index b9639259f..000000000 --- a/trainbenchmark-tool-neo4j/src/main/java/hu/bme/mit/trainbenchmark/benchmark/neo4j/matches/Neo4jRouteSensorInjectMatch.java +++ /dev/null @@ -1,37 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2010-2015, Benedek Izso, Gabor Szarnyas, Istvan Rath and Daniel Varro - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Benedek Izso - initial API and implementation - * Gabor Szarnyas - initial API and implementation - *******************************************************************************/ -package hu.bme.mit.trainbenchmark.benchmark.neo4j.matches; - -import java.util.Map; - -import org.neo4j.graphdb.Node; - -import hu.bme.mit.trainbenchmark.benchmark.matches.RouteSensorInjectMatch; -import hu.bme.mit.trainbenchmark.constants.QueryConstants; - -public class Neo4jRouteSensorInjectMatch extends Neo4jMatch implements RouteSensorInjectMatch { - - public Neo4jRouteSensorInjectMatch(final Map<String, Object> match) { - super(match); - } - - @Override - public Node getRoute() { - return (Node) match.get(QueryConstants.VAR_ROUTE); - } - - @Override - public Node getSensor() { - return (Node) match.get(QueryConstants.VAR_SENSOR); - } - -} diff --git a/trainbenchmark-tool-neo4j/src/main/java/hu/bme/mit/trainbenchmark/benchmark/neo4j/matches/Neo4jRouteSensorMatch.java b/trainbenchmark-tool-neo4j/src/main/java/hu/bme/mit/trainbenchmark/benchmark/neo4j/matches/Neo4jRouteSensorMatch.java deleted file mode 100644 index 81cde8811..000000000 --- a/trainbenchmark-tool-neo4j/src/main/java/hu/bme/mit/trainbenchmark/benchmark/neo4j/matches/Neo4jRouteSensorMatch.java +++ /dev/null @@ -1,47 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2010-2015, Benedek Izso, Gabor Szarnyas, Istvan Rath and Daniel Varro - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Benedek Izso - initial API and implementation - * Gabor Szarnyas - initial API and implementation - *******************************************************************************/ -package hu.bme.mit.trainbenchmark.benchmark.neo4j.matches; - -import java.util.Map; - -import org.neo4j.graphdb.Node; - -import hu.bme.mit.trainbenchmark.benchmark.matches.RouteSensorMatch; -import hu.bme.mit.trainbenchmark.constants.QueryConstants; - -public class Neo4jRouteSensorMatch extends Neo4jMatch implements RouteSensorMatch { - - public Neo4jRouteSensorMatch(final Map<String, Object> match) { - super(match); - } - - @Override - public Node getRoute() { - return (Node) match.get(QueryConstants.VAR_ROUTE); - } - - @Override - public Node getSensor() { - return (Node) match.get(QueryConstants.VAR_SENSOR); - } - - @Override - public Node getSwP() { - return (Node) match.get(QueryConstants.VAR_SWP); - } - - @Override - public Node getSw() { - return (Node) match.get(QueryConstants.VAR_SW); - } - -} diff --git a/trainbenchmark-tool-neo4j/src/main/java/hu/bme/mit/trainbenchmark/benchmark/neo4j/matches/Neo4jSemaphoreNeighborInjectMatch.java b/trainbenchmark-tool-neo4j/src/main/java/hu/bme/mit/trainbenchmark/benchmark/neo4j/matches/Neo4jSemaphoreNeighborInjectMatch.java deleted file mode 100644 index 9d4faa402..000000000 --- a/trainbenchmark-tool-neo4j/src/main/java/hu/bme/mit/trainbenchmark/benchmark/neo4j/matches/Neo4jSemaphoreNeighborInjectMatch.java +++ /dev/null @@ -1,39 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2010-2015, Benedek Izso, Gabor Szarnyas, Istvan Rath and Daniel Varro - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Benedek Izso - initial API and implementation - * Gabor Szarnyas - initial API and implementation - *******************************************************************************/ -package hu.bme.mit.trainbenchmark.benchmark.neo4j.matches; - -import static hu.bme.mit.trainbenchmark.constants.QueryConstants.VAR_ROUTE; -import static hu.bme.mit.trainbenchmark.constants.QueryConstants.VAR_SEMAPHORE; - -import java.util.Map; - -import org.neo4j.graphdb.Node; - -import hu.bme.mit.trainbenchmark.benchmark.matches.SemaphoreNeighborInjectMatch; - -public class Neo4jSemaphoreNeighborInjectMatch extends Neo4jMatch implements SemaphoreNeighborInjectMatch { - - public Neo4jSemaphoreNeighborInjectMatch(final Map<String, Object> match) { - super(match); - } - - @Override - public Node getRoute() { - return (Node) match.get(VAR_ROUTE); - } - - @Override - public Node getSemaphore() { - return (Node) match.get(VAR_SEMAPHORE); - } - -} diff --git a/trainbenchmark-tool-neo4j/src/main/java/hu/bme/mit/trainbenchmark/benchmark/neo4j/matches/Neo4jSemaphoreNeighborMatch.java b/trainbenchmark-tool-neo4j/src/main/java/hu/bme/mit/trainbenchmark/benchmark/neo4j/matches/Neo4jSemaphoreNeighborMatch.java deleted file mode 100644 index 668a77631..000000000 --- a/trainbenchmark-tool-neo4j/src/main/java/hu/bme/mit/trainbenchmark/benchmark/neo4j/matches/Neo4jSemaphoreNeighborMatch.java +++ /dev/null @@ -1,69 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2010-2015, Benedek Izso, Gabor Szarnyas, Istvan Rath and Daniel Varro - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Benedek Izso - initial API and implementation - * Gabor Szarnyas - initial API and implementation - *******************************************************************************/ -package hu.bme.mit.trainbenchmark.benchmark.neo4j.matches; - -import static hu.bme.mit.trainbenchmark.constants.QueryConstants.VAR_ROUTE1; -import static hu.bme.mit.trainbenchmark.constants.QueryConstants.VAR_ROUTE2; -import static hu.bme.mit.trainbenchmark.constants.QueryConstants.VAR_SEMAPHORE; -import static hu.bme.mit.trainbenchmark.constants.QueryConstants.VAR_SENSOR1; -import static hu.bme.mit.trainbenchmark.constants.QueryConstants.VAR_SENSOR2; -import static hu.bme.mit.trainbenchmark.constants.QueryConstants.VAR_TE1; -import static hu.bme.mit.trainbenchmark.constants.QueryConstants.VAR_TE2; - -import java.util.Map; - -import org.neo4j.graphdb.Node; - -import hu.bme.mit.trainbenchmark.benchmark.matches.SemaphoreNeighborMatch; - -public class Neo4jSemaphoreNeighborMatch extends Neo4jMatch implements SemaphoreNeighborMatch { - - public Neo4jSemaphoreNeighborMatch(final Map<String, Object> match) { - super(match); - } - - @Override - public Node getSemaphore() { - return (Node) match.get(VAR_SEMAPHORE); - } - - @Override - public Node getRoute1() { - return (Node) match.get(VAR_ROUTE1); - } - - @Override - public Node getRoute2() { - return (Node) match.get(VAR_ROUTE2); - } - - @Override - public Node getSensor1() { - return (Node) match.get(VAR_SENSOR1); - } - - @Override - public Node getSensor2() { - return (Node) match.get(VAR_SENSOR2); - } - - @Override - public Node getTe1() { - return (Node) match.get(VAR_TE1); - } - - @Override - public Node getTe2() { - return (Node) match.get(VAR_TE2); - } - -} diff --git a/trainbenchmark-tool-neo4j/src/main/java/hu/bme/mit/trainbenchmark/benchmark/neo4j/matches/Neo4jSwitchMonitoredInjectMatch.java b/trainbenchmark-tool-neo4j/src/main/java/hu/bme/mit/trainbenchmark/benchmark/neo4j/matches/Neo4jSwitchMonitoredInjectMatch.java deleted file mode 100644 index 411ee4a0f..000000000 --- a/trainbenchmark-tool-neo4j/src/main/java/hu/bme/mit/trainbenchmark/benchmark/neo4j/matches/Neo4jSwitchMonitoredInjectMatch.java +++ /dev/null @@ -1,33 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2010-2015, Benedek Izso, Gabor Szarnyas, Istvan Rath and Daniel Varro - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Benedek Izso - initial API and implementation - * Gabor Szarnyas - initial API and implementation - *******************************************************************************/ -package hu.bme.mit.trainbenchmark.benchmark.neo4j.matches; - -import static hu.bme.mit.trainbenchmark.constants.QueryConstants.VAR_SW; - -import java.util.Map; - -import org.neo4j.graphdb.Node; - -import hu.bme.mit.trainbenchmark.benchmark.matches.SwitchMonitoredInjectMatch; - -public class Neo4jSwitchMonitoredInjectMatch extends Neo4jMatch implements SwitchMonitoredInjectMatch { - - public Neo4jSwitchMonitoredInjectMatch(final Map<String, Object> match) { - super(match); - } - - @Override - public Node getSw() { - return (Node) match.get(VAR_SW); - } - -} diff --git a/trainbenchmark-tool-neo4j/src/main/java/hu/bme/mit/trainbenchmark/benchmark/neo4j/matches/Neo4jSwitchMonitoredMatch.java b/trainbenchmark-tool-neo4j/src/main/java/hu/bme/mit/trainbenchmark/benchmark/neo4j/matches/Neo4jSwitchMonitoredMatch.java deleted file mode 100644 index 8cdf34dad..000000000 --- a/trainbenchmark-tool-neo4j/src/main/java/hu/bme/mit/trainbenchmark/benchmark/neo4j/matches/Neo4jSwitchMonitoredMatch.java +++ /dev/null @@ -1,33 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2010-2015, Benedek Izso, Gabor Szarnyas, Istvan Rath and Daniel Varro - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Benedek Izso - initial API and implementation - * Gabor Szarnyas - initial API and implementation - *******************************************************************************/ -package hu.bme.mit.trainbenchmark.benchmark.neo4j.matches; - -import static hu.bme.mit.trainbenchmark.constants.QueryConstants.VAR_SW; - -import java.util.Map; - -import org.neo4j.graphdb.Node; - -import hu.bme.mit.trainbenchmark.benchmark.matches.SwitchMonitoredMatch; - -public class Neo4jSwitchMonitoredMatch extends Neo4jMatch implements SwitchMonitoredMatch { - - public Neo4jSwitchMonitoredMatch(final Map<String, Object> match) { - super(match); - } - - @Override - public Node getSw() { - return (Node) match.get(VAR_SW); - } - -} diff --git a/trainbenchmark-tool-neo4j/src/main/java/hu/bme/mit/trainbenchmark/benchmark/neo4j/matches/Neo4jSwitchSetInjectMatch.java b/trainbenchmark-tool-neo4j/src/main/java/hu/bme/mit/trainbenchmark/benchmark/neo4j/matches/Neo4jSwitchSetInjectMatch.java deleted file mode 100644 index b23796fd1..000000000 --- a/trainbenchmark-tool-neo4j/src/main/java/hu/bme/mit/trainbenchmark/benchmark/neo4j/matches/Neo4jSwitchSetInjectMatch.java +++ /dev/null @@ -1,33 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2010-2015, Benedek Izso, Gabor Szarnyas, Istvan Rath and Daniel Varro - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Benedek Izso - initial API and implementation - * Gabor Szarnyas - initial API and implementation - *******************************************************************************/ -package hu.bme.mit.trainbenchmark.benchmark.neo4j.matches; - -import static hu.bme.mit.trainbenchmark.constants.QueryConstants.VAR_SW; - -import java.util.Map; - -import org.neo4j.graphdb.Node; - -import hu.bme.mit.trainbenchmark.benchmark.matches.SwitchSetInjectMatch; - -public class Neo4jSwitchSetInjectMatch extends Neo4jMatch implements SwitchSetInjectMatch { - - public Neo4jSwitchSetInjectMatch(final Map<String, Object> match) { - super(match); - } - - @Override - public Node getSw() { - return (Node) match.get(VAR_SW); - } - -} diff --git a/trainbenchmark-tool-neo4j/src/main/java/hu/bme/mit/trainbenchmark/benchmark/neo4j/matches/Neo4jSwitchSetMatch.java b/trainbenchmark-tool-neo4j/src/main/java/hu/bme/mit/trainbenchmark/benchmark/neo4j/matches/Neo4jSwitchSetMatch.java deleted file mode 100644 index e1266d8e9..000000000 --- a/trainbenchmark-tool-neo4j/src/main/java/hu/bme/mit/trainbenchmark/benchmark/neo4j/matches/Neo4jSwitchSetMatch.java +++ /dev/null @@ -1,60 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2010-2015, Benedek Izso, Gabor Szarnyas, Istvan Rath and Daniel Varro - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Benedek Izso - initial API and implementation - * Gabor Szarnyas - initial API and implementation - *******************************************************************************/ -package hu.bme.mit.trainbenchmark.benchmark.neo4j.matches; - -import static hu.bme.mit.trainbenchmark.constants.QueryConstants.VAR_ROUTE; -import static hu.bme.mit.trainbenchmark.constants.QueryConstants.VAR_SEMAPHORE; -import static hu.bme.mit.trainbenchmark.constants.QueryConstants.VAR_SW; -import static hu.bme.mit.trainbenchmark.constants.QueryConstants.VAR_SWP; - -import java.util.Map; - -import org.neo4j.graphdb.Node; - -import hu.bme.mit.trainbenchmark.benchmark.matches.SwitchSetMatch; -import hu.bme.mit.trainbenchmark.constants.QueryConstants; - -public class Neo4jSwitchSetMatch extends Neo4jMatch implements SwitchSetMatch { - - public Neo4jSwitchSetMatch(final Map<String, Object> match) { - super(match); - } - - @Override - public Node getSemaphore() { - return (Node) match.get(VAR_SEMAPHORE); - } - - @Override - public Node getRoute() { - return (Node) match.get(VAR_ROUTE); - } - - @Override - public Node getSwP() { - return (Node) match.get(VAR_SWP); - } - - @Override - public Node getSw() { - return (Node) match.get(VAR_SW); - } - - public String getCurrentPosition() { - return (String) match.get(QueryConstants.VAR_CURRENTPOSITION); - } - - public String getPosition() { - return (String) match.get(QueryConstants.VAR_POSITION); - } - -} diff --git a/trainbenchmark-tool-neo4j/src/main/java/hu/bme/mit/trainbenchmark/benchmark/neo4j/operations/Neo4jModelOperationFactory.java b/trainbenchmark-tool-neo4j/src/main/java/hu/bme/mit/trainbenchmark/benchmark/neo4j/operations/Neo4jModelOperationFactory.java deleted file mode 100644 index c319bfa0c..000000000 --- a/trainbenchmark-tool-neo4j/src/main/java/hu/bme/mit/trainbenchmark/benchmark/neo4j/operations/Neo4jModelOperationFactory.java +++ /dev/null @@ -1,331 +0,0 @@ -package hu.bme.mit.trainbenchmark.benchmark.neo4j.operations; - -import hu.bme.mit.trainbenchmark.benchmark.neo4j.config.Neo4jEngine; -import hu.bme.mit.trainbenchmark.benchmark.neo4j.driver.Neo4jDriver; -import hu.bme.mit.trainbenchmark.benchmark.neo4j.matches.Neo4jConnectedSegmentsInjectMatch; -import hu.bme.mit.trainbenchmark.benchmark.neo4j.matches.Neo4jConnectedSegmentsMatch; -import hu.bme.mit.trainbenchmark.benchmark.neo4j.matches.Neo4jMatch; -import hu.bme.mit.trainbenchmark.benchmark.neo4j.matches.Neo4jPosLengthInjectMatch; -import hu.bme.mit.trainbenchmark.benchmark.neo4j.matches.Neo4jPosLengthMatch; -import hu.bme.mit.trainbenchmark.benchmark.neo4j.matches.Neo4jRouteSensorInjectMatch; -import hu.bme.mit.trainbenchmark.benchmark.neo4j.matches.Neo4jRouteSensorMatch; -import hu.bme.mit.trainbenchmark.benchmark.neo4j.matches.Neo4jSemaphoreNeighborInjectMatch; -import hu.bme.mit.trainbenchmark.benchmark.neo4j.matches.Neo4jSemaphoreNeighborMatch; -import hu.bme.mit.trainbenchmark.benchmark.neo4j.matches.Neo4jSwitchMonitoredInjectMatch; -import hu.bme.mit.trainbenchmark.benchmark.neo4j.matches.Neo4jSwitchMonitoredMatch; -import hu.bme.mit.trainbenchmark.benchmark.neo4j.matches.Neo4jSwitchSetInjectMatch; -import hu.bme.mit.trainbenchmark.benchmark.neo4j.matches.Neo4jSwitchSetMatch; -import hu.bme.mit.trainbenchmark.benchmark.neo4j.queries.core.Neo4jCoreQueryConnectedSegments; -import hu.bme.mit.trainbenchmark.benchmark.neo4j.queries.core.Neo4jCoreQueryConnectedSegmentsInject; -import hu.bme.mit.trainbenchmark.benchmark.neo4j.queries.core.Neo4jCoreQueryPosLength; -import hu.bme.mit.trainbenchmark.benchmark.neo4j.queries.core.Neo4jCoreQueryPosLengthInject; -import hu.bme.mit.trainbenchmark.benchmark.neo4j.queries.core.Neo4jCoreQueryRouteSensor; -import hu.bme.mit.trainbenchmark.benchmark.neo4j.queries.core.Neo4jCoreQueryRouteSensorInject; -import hu.bme.mit.trainbenchmark.benchmark.neo4j.queries.core.Neo4jCoreQuerySemaphoreNeighbor; -import hu.bme.mit.trainbenchmark.benchmark.neo4j.queries.core.Neo4jCoreQuerySemaphoreNeighborInject; -import hu.bme.mit.trainbenchmark.benchmark.neo4j.queries.core.Neo4jCoreQuerySwitchMonitored; -import hu.bme.mit.trainbenchmark.benchmark.neo4j.queries.core.Neo4jCoreQuerySwitchMonitoredInject; -import hu.bme.mit.trainbenchmark.benchmark.neo4j.queries.core.Neo4jCoreQuerySwitchSet; -import hu.bme.mit.trainbenchmark.benchmark.neo4j.queries.core.Neo4jCoreQuerySwitchSetInject; -import hu.bme.mit.trainbenchmark.benchmark.neo4j.queries.cypher.Neo4jCypherQuery; -import hu.bme.mit.trainbenchmark.benchmark.neo4j.transformations.Neo4jCoreTransformation; -import hu.bme.mit.trainbenchmark.benchmark.neo4j.transformations.Neo4jCypherTransformation; -import hu.bme.mit.trainbenchmark.benchmark.neo4j.transformations.core.inject.Neo4jCoreTransformationInjectConnectedSegments; -import hu.bme.mit.trainbenchmark.benchmark.neo4j.transformations.core.inject.Neo4jCoreTransformationInjectPosLength; -import hu.bme.mit.trainbenchmark.benchmark.neo4j.transformations.core.inject.Neo4jCoreTransformationInjectRouteSensor; -import hu.bme.mit.trainbenchmark.benchmark.neo4j.transformations.core.inject.Neo4jCoreTransformationInjectSemaphoreNeighbor; -import hu.bme.mit.trainbenchmark.benchmark.neo4j.transformations.core.inject.Neo4jCoreTransformationInjectSwitchMonitored; -import hu.bme.mit.trainbenchmark.benchmark.neo4j.transformations.core.inject.Neo4jCoreTransformationInjectSwitchSet; -import hu.bme.mit.trainbenchmark.benchmark.neo4j.transformations.core.repair.Neo4jCoreTransformationRepairConnectedSegments; -import hu.bme.mit.trainbenchmark.benchmark.neo4j.transformations.core.repair.Neo4jCoreTransformationRepairPosLength; -import hu.bme.mit.trainbenchmark.benchmark.neo4j.transformations.core.repair.Neo4jCoreTransformationRepairRouteSensor; -import hu.bme.mit.trainbenchmark.benchmark.neo4j.transformations.core.repair.Neo4jCoreTransformationRepairSemaphoreNeighbor; -import hu.bme.mit.trainbenchmark.benchmark.neo4j.transformations.core.repair.Neo4jCoreTransformationRepairSwitchMonitored; -import hu.bme.mit.trainbenchmark.benchmark.neo4j.transformations.core.repair.Neo4jCoreTransformationRepairSwitchSet; -import hu.bme.mit.trainbenchmark.benchmark.neo4j.transformations.cypher.inject.Neo4jCypherTransformationInjectConnectedSegments; -import hu.bme.mit.trainbenchmark.benchmark.neo4j.transformations.cypher.inject.Neo4jCypherTransformationInjectPosLength; -import hu.bme.mit.trainbenchmark.benchmark.neo4j.transformations.cypher.inject.Neo4jCypherTransformationInjectRouteSensor; -import hu.bme.mit.trainbenchmark.benchmark.neo4j.transformations.cypher.inject.Neo4jCypherTransformationInjectSemaphoreNeighbor; -import hu.bme.mit.trainbenchmark.benchmark.neo4j.transformations.cypher.inject.Neo4jCypherTransformationInjectSwitchMonitored; -import hu.bme.mit.trainbenchmark.benchmark.neo4j.transformations.cypher.inject.Neo4jCypherTransformationInjectSwitchSet; -import hu.bme.mit.trainbenchmark.benchmark.neo4j.transformations.cypher.repair.Neo4jCypherTransformationRepairConnectedSegments; -import hu.bme.mit.trainbenchmark.benchmark.neo4j.transformations.cypher.repair.Neo4jCypherTransformationRepairPosLength; -import hu.bme.mit.trainbenchmark.benchmark.neo4j.transformations.cypher.repair.Neo4jCypherTransformationRepairRouteSensor; -import hu.bme.mit.trainbenchmark.benchmark.neo4j.transformations.cypher.repair.Neo4jCypherTransformationRepairSemaphoreNeighbor; -import hu.bme.mit.trainbenchmark.benchmark.neo4j.transformations.cypher.repair.Neo4jCypherTransformationRepairSwitchMonitored; -import hu.bme.mit.trainbenchmark.benchmark.neo4j.transformations.cypher.repair.Neo4jCypherTransformationRepairSwitchSet; -import hu.bme.mit.trainbenchmark.benchmark.operations.ModelOperation; -import hu.bme.mit.trainbenchmark.benchmark.operations.ModelOperationFactory; -import hu.bme.mit.trainbenchmark.benchmark.operations.ModelQuery; -import hu.bme.mit.trainbenchmark.constants.RailwayOperation; -import hu.bme.mit.trainbenchmark.constants.RailwayQuery; - -public class Neo4jModelOperationFactory extends ModelOperationFactory<Neo4jMatch, Neo4jDriver> { - - protected final Neo4jEngine neo4jEngine; - - public Neo4jModelOperationFactory(final Neo4jEngine neo4jEngine) { - this.neo4jEngine = neo4jEngine; - } - - @Override - public ModelOperation<? extends Neo4jMatch, Neo4jDriver> createOperation(final RailwayOperation operationEnum, final String workspaceDir, - final Neo4jDriver driver) throws Exception { - - switch (neo4jEngine) { - case COREAPI: - switch (operationEnum) { - // ConnectedSegments - case CONNECTEDSEGMENTS: { - final ModelQuery<Neo4jConnectedSegmentsMatch, Neo4jDriver> query = new Neo4jCoreQueryConnectedSegments(driver); - final ModelOperation<Neo4jConnectedSegmentsMatch, Neo4jDriver> operation = ModelOperation.of(query); - return operation; - } - case CONNECTEDSEGMENTS_INJECT: { - final ModelQuery<Neo4jConnectedSegmentsInjectMatch, Neo4jDriver> query = new Neo4jCoreQueryConnectedSegmentsInject(driver); - final Neo4jCoreTransformation<Neo4jConnectedSegmentsInjectMatch> transformation = new Neo4jCoreTransformationInjectConnectedSegments(driver); - final ModelOperation<Neo4jConnectedSegmentsInjectMatch, Neo4jDriver> operation = ModelOperation.of(query, transformation); - return operation; - } - case CONNECTEDSEGMENTS_REPAIR: { - final ModelQuery<Neo4jConnectedSegmentsMatch, Neo4jDriver> query = new Neo4jCoreQueryConnectedSegments(driver); - final Neo4jCoreTransformation<Neo4jConnectedSegmentsMatch> transformation = new Neo4jCoreTransformationRepairConnectedSegments(driver); - final ModelOperation<Neo4jConnectedSegmentsMatch, Neo4jDriver> operation = ModelOperation.of(query, transformation); - return operation; - } - - // PosLength - case POSLENGTH: { - final ModelQuery<Neo4jPosLengthMatch, Neo4jDriver> query = new Neo4jCoreQueryPosLength(driver); - final ModelOperation<Neo4jPosLengthMatch, Neo4jDriver> operation = ModelOperation.of(query); - return operation; - } - case POSLENGTH_INJECT: { - final ModelQuery<Neo4jPosLengthInjectMatch, Neo4jDriver> query = new Neo4jCoreQueryPosLengthInject(driver); - final Neo4jCoreTransformation<Neo4jPosLengthInjectMatch> transformation = new Neo4jCoreTransformationInjectPosLength(driver); - final ModelOperation<Neo4jPosLengthInjectMatch, Neo4jDriver> operation = ModelOperation.of(query, transformation); - return operation; - } - case POSLENGTH_REPAIR: { - final ModelQuery<Neo4jPosLengthMatch, Neo4jDriver> query = new Neo4jCoreQueryPosLength(driver); - final Neo4jCoreTransformation<Neo4jPosLengthMatch> transformation = new Neo4jCoreTransformationRepairPosLength(driver); - final ModelOperation<Neo4jPosLengthMatch, Neo4jDriver> operation = ModelOperation.of(query, transformation); - return operation; - } - - // RouteSensor - case ROUTESENSOR: { - final ModelQuery<Neo4jRouteSensorMatch, Neo4jDriver> query = new Neo4jCoreQueryRouteSensor(driver); - final ModelOperation<Neo4jRouteSensorMatch, Neo4jDriver> operation = ModelOperation.of(query); - return operation; - } - case ROUTESENSOR_INJECT: { - final ModelQuery<Neo4jRouteSensorInjectMatch, Neo4jDriver> query = new Neo4jCoreQueryRouteSensorInject(driver); - final Neo4jCoreTransformation<Neo4jRouteSensorInjectMatch> transformation = new Neo4jCoreTransformationInjectRouteSensor(driver); - final ModelOperation<Neo4jRouteSensorInjectMatch, Neo4jDriver> operation = ModelOperation.of(query, transformation); - return operation; - } - case ROUTESENSOR_REPAIR: { - final ModelQuery<Neo4jRouteSensorMatch, Neo4jDriver> query = new Neo4jCoreQueryRouteSensor(driver); - final Neo4jCoreTransformation<Neo4jRouteSensorMatch> transformation = new Neo4jCoreTransformationRepairRouteSensor(driver); - final ModelOperation<Neo4jRouteSensorMatch, Neo4jDriver> operation = ModelOperation.of(query, transformation); - return operation; - } - - // SemaphoreNeighbor - case SEMAPHORENEIGHBOR: { - final ModelQuery<Neo4jSemaphoreNeighborMatch, Neo4jDriver> query = new Neo4jCoreQuerySemaphoreNeighbor(driver); - final ModelOperation<Neo4jSemaphoreNeighborMatch, Neo4jDriver> operation = ModelOperation.of(query); - return operation; - } - case SEMAPHORENEIGHBOR_INJECT: { - final ModelQuery<Neo4jSemaphoreNeighborInjectMatch, Neo4jDriver> query = new Neo4jCoreQuerySemaphoreNeighborInject(driver); - final Neo4jCoreTransformation<Neo4jSemaphoreNeighborInjectMatch> transformation = new Neo4jCoreTransformationInjectSemaphoreNeighbor(driver); - final ModelOperation<Neo4jSemaphoreNeighborInjectMatch, Neo4jDriver> operation = ModelOperation.of(query, transformation); - return operation; - } - case SEMAPHORENEIGHBOR_REPAIR: { - final ModelQuery<Neo4jSemaphoreNeighborMatch, Neo4jDriver> query = new Neo4jCoreQuerySemaphoreNeighbor(driver); - final Neo4jCoreTransformation<Neo4jSemaphoreNeighborMatch> transformation = new Neo4jCoreTransformationRepairSemaphoreNeighbor(driver); - final ModelOperation<Neo4jSemaphoreNeighborMatch, Neo4jDriver> operation = ModelOperation.of(query, transformation); - return operation; - } - - // SwitchMonitored - case SWITCHMONITORED: { - final ModelQuery<Neo4jSwitchMonitoredMatch, Neo4jDriver> query = new Neo4jCoreQuerySwitchMonitored(driver); - final ModelOperation<Neo4jSwitchMonitoredMatch, Neo4jDriver> operation = ModelOperation.of(query); - return operation; - } - case SWITCHMONITORED_INJECT: { - final ModelQuery<Neo4jSwitchMonitoredInjectMatch, Neo4jDriver> query = new Neo4jCoreQuerySwitchMonitoredInject(driver); - final Neo4jCoreTransformation<Neo4jSwitchMonitoredInjectMatch> transformation = new Neo4jCoreTransformationInjectSwitchMonitored(driver); - final ModelOperation<Neo4jSwitchMonitoredInjectMatch, Neo4jDriver> operation = ModelOperation.of(query, transformation); - return operation; - } - case SWITCHMONITORED_REPAIR: { - final ModelQuery<Neo4jSwitchMonitoredMatch, Neo4jDriver> query = new Neo4jCoreQuerySwitchMonitored(driver); - final Neo4jCoreTransformation<Neo4jSwitchMonitoredMatch> transformation = new Neo4jCoreTransformationRepairSwitchMonitored(driver); - final ModelOperation<Neo4jSwitchMonitoredMatch, Neo4jDriver> operation = ModelOperation.of(query, transformation); - return operation; - } - - // SwitchSet - case SWITCHSET: { - final ModelQuery<Neo4jSwitchSetMatch, Neo4jDriver> query = new Neo4jCoreQuerySwitchSet(driver); - final ModelOperation<Neo4jSwitchSetMatch, Neo4jDriver> operation = ModelOperation.of(query); - return operation; - } - case SWITCHSET_INJECT: { - final ModelQuery<Neo4jSwitchSetInjectMatch, Neo4jDriver> query = new Neo4jCoreQuerySwitchSetInject(driver); - final Neo4jCoreTransformation<Neo4jSwitchSetInjectMatch> transformation = new Neo4jCoreTransformationInjectSwitchSet(driver); - final ModelOperation<Neo4jSwitchSetInjectMatch, Neo4jDriver> operation = ModelOperation.of(query, transformation); - return operation; - } - case SWITCHSET_REPAIR: { - final ModelQuery<Neo4jSwitchSetMatch, Neo4jDriver> query = new Neo4jCoreQuerySwitchSet(driver); - final Neo4jCoreTransformation<Neo4jSwitchSetMatch> transformation = new Neo4jCoreTransformationRepairSwitchSet(driver); - final ModelOperation<Neo4jSwitchSetMatch, Neo4jDriver> operation = ModelOperation.of(query, transformation); - return operation; - } - - default: - throw new UnsupportedOperationException("Operation " + operationEnum + " not supported for Neo4j engine " + neo4jEngine + "."); - } - case CYPHER: - switch (operationEnum) { - // ConnectedSegments - case CONNECTEDSEGMENTS: { - final ModelQuery<Neo4jConnectedSegmentsMatch, Neo4jDriver> query = new Neo4jCypherQuery<>(driver, workspaceDir, RailwayQuery.CONNECTEDSEGMENTS); - final ModelOperation<Neo4jConnectedSegmentsMatch, Neo4jDriver> operation = ModelOperation.of(query); - return operation; - } - case CONNECTEDSEGMENTS_INJECT: { - final ModelQuery<Neo4jConnectedSegmentsInjectMatch, Neo4jDriver> query = new Neo4jCypherQuery<>(driver, workspaceDir, - RailwayQuery.CONNECTEDSEGMENTS_INJECT); - final Neo4jCypherTransformation<Neo4jConnectedSegmentsInjectMatch> transformation = new Neo4jCypherTransformationInjectConnectedSegments(driver, - workspaceDir); - final ModelOperation<Neo4jConnectedSegmentsInjectMatch, Neo4jDriver> operation = ModelOperation.of(query, transformation); - return operation; - } - case CONNECTEDSEGMENTS_REPAIR: { - final ModelQuery<Neo4jConnectedSegmentsMatch, Neo4jDriver> query = new Neo4jCypherQuery<>(driver, workspaceDir, RailwayQuery.CONNECTEDSEGMENTS); - final Neo4jCypherTransformation<Neo4jConnectedSegmentsMatch> transformation = new Neo4jCypherTransformationRepairConnectedSegments(driver, - workspaceDir); - final ModelOperation<Neo4jConnectedSegmentsMatch, Neo4jDriver> operation = ModelOperation.of(query, transformation); - return operation; - } - - // PosLength - case POSLENGTH: { - final ModelQuery<Neo4jPosLengthMatch, Neo4jDriver> query = new Neo4jCypherQuery<>(driver, workspaceDir, RailwayQuery.POSLENGTH); - final ModelOperation<Neo4jPosLengthMatch, Neo4jDriver> operation = ModelOperation.of(query); - return operation; - } - case POSLENGTH_INJECT: { - final ModelQuery<Neo4jPosLengthInjectMatch, Neo4jDriver> query = new Neo4jCypherQuery<>(driver, workspaceDir, RailwayQuery.POSLENGTH_INJECT); - final Neo4jCypherTransformation<Neo4jPosLengthInjectMatch> transformation = new Neo4jCypherTransformationInjectPosLength(driver, workspaceDir); - final ModelOperation<Neo4jPosLengthInjectMatch, Neo4jDriver> operation = ModelOperation.of(query, transformation); - return operation; - } - case POSLENGTH_REPAIR: { - final ModelQuery<Neo4jPosLengthMatch, Neo4jDriver> query = new Neo4jCypherQuery<>(driver, workspaceDir, RailwayQuery.POSLENGTH); - final Neo4jCypherTransformation<Neo4jPosLengthMatch> transformation = new Neo4jCypherTransformationRepairPosLength(driver, workspaceDir); - final ModelOperation<Neo4jPosLengthMatch, Neo4jDriver> operation = ModelOperation.of(query, transformation); - return operation; - } - - // RouteSensor - case ROUTESENSOR: { - final ModelQuery<Neo4jRouteSensorMatch, Neo4jDriver> query = new Neo4jCypherQuery<>(driver, workspaceDir, RailwayQuery.ROUTESENSOR); - final ModelOperation<Neo4jRouteSensorMatch, Neo4jDriver> operation = ModelOperation.of(query); - return operation; - } - case ROUTESENSOR_INJECT: { - final ModelQuery<Neo4jRouteSensorInjectMatch, Neo4jDriver> query = new Neo4jCypherQuery<>(driver, workspaceDir, - RailwayQuery.ROUTESENSOR_INJECT); - final Neo4jCypherTransformation<Neo4jRouteSensorInjectMatch> transformation = new Neo4jCypherTransformationInjectRouteSensor(driver, - workspaceDir); - final ModelOperation<Neo4jRouteSensorInjectMatch, Neo4jDriver> operation = ModelOperation.of(query, transformation); - return operation; - } - case ROUTESENSOR_REPAIR: { - final ModelQuery<Neo4jRouteSensorMatch, Neo4jDriver> query = new Neo4jCypherQuery<>(driver, workspaceDir, RailwayQuery.ROUTESENSOR); - final Neo4jCypherTransformation<Neo4jRouteSensorMatch> transformation = new Neo4jCypherTransformationRepairRouteSensor(driver, workspaceDir); - final ModelOperation<Neo4jRouteSensorMatch, Neo4jDriver> operation = ModelOperation.of(query, transformation); - return operation; - } - - // SemaphoreNeighbor - case SEMAPHORENEIGHBOR: { - final ModelQuery<Neo4jSemaphoreNeighborMatch, Neo4jDriver> query = new Neo4jCypherQuery<>(driver, workspaceDir, RailwayQuery.SEMAPHORENEIGHBOR); - final ModelOperation<Neo4jSemaphoreNeighborMatch, Neo4jDriver> operation = ModelOperation.of(query); - return operation; - } - case SEMAPHORENEIGHBOR_INJECT: { - final ModelQuery<Neo4jSemaphoreNeighborInjectMatch, Neo4jDriver> query = new Neo4jCypherQuery<>(driver, workspaceDir, - RailwayQuery.SEMAPHORENEIGHBOR_INJECT); - final Neo4jCypherTransformation<Neo4jSemaphoreNeighborInjectMatch> transformation = new Neo4jCypherTransformationInjectSemaphoreNeighbor(driver, - workspaceDir); - final ModelOperation<Neo4jSemaphoreNeighborInjectMatch, Neo4jDriver> operation = ModelOperation.of(query, transformation); - return operation; - } - case SEMAPHORENEIGHBOR_REPAIR: { - final ModelQuery<Neo4jSemaphoreNeighborMatch, Neo4jDriver> query = new Neo4jCypherQuery<>(driver, workspaceDir, RailwayQuery.SEMAPHORENEIGHBOR); - final Neo4jCypherTransformation<Neo4jSemaphoreNeighborMatch> transformation = new Neo4jCypherTransformationRepairSemaphoreNeighbor(driver, - workspaceDir); - final ModelOperation<Neo4jSemaphoreNeighborMatch, Neo4jDriver> operation = ModelOperation.of(query, transformation); - return operation; - } - - // SwitchMonitored - case SWITCHMONITORED: { - final ModelQuery<Neo4jSwitchMonitoredMatch, Neo4jDriver> query = new Neo4jCypherQuery<>(driver, workspaceDir, RailwayQuery.SWITCHMONITORED); - final ModelOperation<Neo4jSwitchMonitoredMatch, Neo4jDriver> operation = ModelOperation.of(query); - return operation; - } - case SWITCHMONITORED_INJECT: { - final ModelQuery<Neo4jSwitchMonitoredInjectMatch, Neo4jDriver> query = new Neo4jCypherQuery<>(driver, workspaceDir, - RailwayQuery.SWITCHMONITORED_INJECT); - final Neo4jCypherTransformation<Neo4jSwitchMonitoredInjectMatch> transformation = new Neo4jCypherTransformationInjectSwitchMonitored(driver, - workspaceDir); - final ModelOperation<Neo4jSwitchMonitoredInjectMatch, Neo4jDriver> operation = ModelOperation.of(query, transformation); - return operation; - } - case SWITCHMONITORED_REPAIR: { - final ModelQuery<Neo4jSwitchMonitoredMatch, Neo4jDriver> query = new Neo4jCypherQuery<>(driver, workspaceDir, RailwayQuery.SWITCHMONITORED); - final Neo4jCypherTransformation<Neo4jSwitchMonitoredMatch> transformation = new Neo4jCypherTransformationRepairSwitchMonitored(driver, - workspaceDir); - final ModelOperation<Neo4jSwitchMonitoredMatch, Neo4jDriver> operation = ModelOperation.of(query, transformation); - return operation; - } - - // SwitchSet - case SWITCHSET: { - final ModelQuery<Neo4jSwitchSetMatch, Neo4jDriver> query = new Neo4jCypherQuery<>(driver, workspaceDir, RailwayQuery.SWITCHSET); - final ModelOperation<Neo4jSwitchSetMatch, Neo4jDriver> operation = ModelOperation.of(query); - return operation; - } - case SWITCHSET_INJECT: { - final ModelQuery<Neo4jSwitchSetInjectMatch, Neo4jDriver> query = new Neo4jCypherQuery<>(driver, workspaceDir, RailwayQuery.SWITCHSET_INJECT); - final Neo4jCypherTransformation<Neo4jSwitchSetInjectMatch> transformation = new Neo4jCypherTransformationInjectSwitchSet(driver, workspaceDir); - final ModelOperation<Neo4jSwitchSetInjectMatch, Neo4jDriver> operation = ModelOperation.of(query, transformation); - return operation; - } - case SWITCHSET_REPAIR: { - final ModelQuery<Neo4jSwitchSetMatch, Neo4jDriver> query = new Neo4jCypherQuery<>(driver, workspaceDir, RailwayQuery.SWITCHSET); - final Neo4jCypherTransformation<Neo4jSwitchSetMatch> transformation = new Neo4jCypherTransformationRepairSwitchSet(driver, workspaceDir); - final ModelOperation<Neo4jSwitchSetMatch, Neo4jDriver> operation = ModelOperation.of(query, transformation); - return operation; - } - - default: - throw new UnsupportedOperationException("Operation " + operationEnum + " not supported for Neo4j engine " + neo4jEngine + "."); - } - default: - throw new UnsupportedOperationException("Neo4j engine " + neo4jEngine + " not supported."); - } - - } - -} diff --git a/trainbenchmark-tool-neo4j/src/main/java/hu/bme/mit/trainbenchmark/benchmark/neo4j/queries/Neo4jQuery.java b/trainbenchmark-tool-neo4j/src/main/java/hu/bme/mit/trainbenchmark/benchmark/neo4j/queries/Neo4jQuery.java deleted file mode 100644 index 405806991..000000000 --- a/trainbenchmark-tool-neo4j/src/main/java/hu/bme/mit/trainbenchmark/benchmark/neo4j/queries/Neo4jQuery.java +++ /dev/null @@ -1,14 +0,0 @@ -package hu.bme.mit.trainbenchmark.benchmark.neo4j.queries; - -import hu.bme.mit.trainbenchmark.benchmark.neo4j.driver.Neo4jDriver; -import hu.bme.mit.trainbenchmark.benchmark.neo4j.matches.Neo4jMatch; -import hu.bme.mit.trainbenchmark.benchmark.operations.ModelQuery; -import hu.bme.mit.trainbenchmark.constants.RailwayQuery; - -public abstract class Neo4jQuery<TNeo4jMatch extends Neo4jMatch> extends ModelQuery<TNeo4jMatch, Neo4jDriver> { - - public Neo4jQuery(final RailwayQuery query, final Neo4jDriver driver) { - super(query, driver); - } - -} diff --git a/trainbenchmark-tool-neo4j/src/main/java/hu/bme/mit/trainbenchmark/benchmark/neo4j/queries/core/Neo4jCoreQuery.java b/trainbenchmark-tool-neo4j/src/main/java/hu/bme/mit/trainbenchmark/benchmark/neo4j/queries/core/Neo4jCoreQuery.java deleted file mode 100644 index ecb13f9ad..000000000 --- a/trainbenchmark-tool-neo4j/src/main/java/hu/bme/mit/trainbenchmark/benchmark/neo4j/queries/core/Neo4jCoreQuery.java +++ /dev/null @@ -1,25 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2010-2015, Benedek Izso, Gabor Szarnyas, Istvan Rath and Daniel Varro - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Benedek Izso - initial API and implementation - * Gabor Szarnyas - initial API and implementation - *******************************************************************************/ -package hu.bme.mit.trainbenchmark.benchmark.neo4j.queries.core; - -import hu.bme.mit.trainbenchmark.benchmark.neo4j.driver.Neo4jDriver; -import hu.bme.mit.trainbenchmark.benchmark.neo4j.matches.Neo4jMatch; -import hu.bme.mit.trainbenchmark.benchmark.neo4j.queries.Neo4jQuery; -import hu.bme.mit.trainbenchmark.constants.RailwayQuery; - -public abstract class Neo4jCoreQuery<TNeo4jMatch extends Neo4jMatch> extends Neo4jQuery<TNeo4jMatch> { - - public Neo4jCoreQuery(final RailwayQuery query, final Neo4jDriver driver) { - super(query, driver); - } - -} diff --git a/trainbenchmark-tool-neo4j/src/main/java/hu/bme/mit/trainbenchmark/benchmark/neo4j/queries/core/Neo4jCoreQueryConnectedSegments.java b/trainbenchmark-tool-neo4j/src/main/java/hu/bme/mit/trainbenchmark/benchmark/neo4j/queries/core/Neo4jCoreQueryConnectedSegments.java deleted file mode 100644 index 530155228..000000000 --- a/trainbenchmark-tool-neo4j/src/main/java/hu/bme/mit/trainbenchmark/benchmark/neo4j/queries/core/Neo4jCoreQueryConnectedSegments.java +++ /dev/null @@ -1,123 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2010-2015, Benedek Izso, Gabor Szarnyas, Istvan Rath and Daniel Varro - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Benedek Izso - initial API and implementation - * Gabor Szarnyas - initial API and implementation - *******************************************************************************/ -package hu.bme.mit.trainbenchmark.benchmark.neo4j.queries.core; - -import static hu.bme.mit.trainbenchmark.constants.QueryConstants.VAR_SEGMENT1; -import static hu.bme.mit.trainbenchmark.constants.QueryConstants.VAR_SEGMENT2; -import static hu.bme.mit.trainbenchmark.constants.QueryConstants.VAR_SEGMENT3; -import static hu.bme.mit.trainbenchmark.constants.QueryConstants.VAR_SEGMENT4; -import static hu.bme.mit.trainbenchmark.constants.QueryConstants.VAR_SEGMENT5; -import static hu.bme.mit.trainbenchmark.constants.QueryConstants.VAR_SEGMENT6; -import static hu.bme.mit.trainbenchmark.constants.QueryConstants.VAR_SENSOR; - -import java.io.IOException; -import java.util.ArrayList; -import java.util.Collection; -import java.util.HashMap; -import java.util.Map; - -import org.neo4j.graphdb.Direction; -import org.neo4j.graphdb.GraphDatabaseService; -import org.neo4j.graphdb.Node; -import org.neo4j.graphdb.Transaction; - -import hu.bme.mit.trainbenchmark.benchmark.neo4j.driver.Neo4jDriver; -import hu.bme.mit.trainbenchmark.benchmark.neo4j.matches.Neo4jConnectedSegmentsMatch; -import hu.bme.mit.trainbenchmark.benchmark.neo4j.util.Neo4jUtil; -import hu.bme.mit.trainbenchmark.constants.RailwayQuery; -import hu.bme.mit.trainbenchmark.neo4j.Neo4jConstants; - -public class Neo4jCoreQueryConnectedSegments extends Neo4jCoreQuery<Neo4jConnectedSegmentsMatch> { - - public Neo4jCoreQueryConnectedSegments(final Neo4jDriver driver) { - super(RailwayQuery.CONNECTEDSEGMENTS, driver); - } - - @Override - public Collection<Neo4jConnectedSegmentsMatch> evaluate() throws IOException { - final Collection<Neo4jConnectedSegmentsMatch> matches = new ArrayList<>(); - - final GraphDatabaseService graphDb = driver.getGraphDb(); - try (final Transaction tx = graphDb.beginTx()) { - - // (sensor:Sensor) - final Iterable<Node> sensors = () -> graphDb.findNodes(Neo4jConstants.labelSensor); - for (final Node sensor : sensors) { - // (sensor:Sensor)<-[:sensor]-(segment1:Segment) - final Iterable<Node> segment1s = Neo4jUtil.getAdjacentNodes(sensor, Neo4jConstants.relationshipTypeMonitoredBy, - Direction.INCOMING, Neo4jConstants.labelSegment); - - for (final Node segment1 : segment1s) { - // (segment1:Segment)-[:connectsTo]->(segment2:Segment) - final Iterable<Node> segment2s = Neo4jUtil.getAdjacentNodes(segment1, Neo4jConstants.relationshipTypeConnectsTo, - Direction.OUTGOING, Neo4jConstants.labelSegment); - for (final Node segment2 : segment2s) { - // (segment2:Segment)-[:sensor]->(sensor:Sensor) - if (!Neo4jUtil.isConnected(segment2, sensor, Neo4jConstants.relationshipTypeMonitoredBy)) { - continue; - } - // (segment2:Segment)-[:connectsTo]->(segment3:Segment) - final Iterable<Node> segment3s = Neo4jUtil.getAdjacentNodes(segment2, Neo4jConstants.relationshipTypeConnectsTo, - Direction.OUTGOING, Neo4jConstants.labelSegment); - for (final Node segment3 : segment3s) { - // (segment3:Segment)-[:sensor]->(sensor:Sensor) - if (!Neo4jUtil.isConnected(segment3, sensor, Neo4jConstants.relationshipTypeMonitoredBy)) { - continue; - } - // (segment3:Segment)-[:connectsTo]->(segment4:Segment) - final Iterable<Node> segment4s = Neo4jUtil.getAdjacentNodes(segment3, Neo4jConstants.relationshipTypeConnectsTo, - Direction.OUTGOING, Neo4jConstants.labelSegment); - for (final Node segment4 : segment4s) { - // (segment4:Segment)-[:sensor]->(sensor:Sensor) - if (!Neo4jUtil.isConnected(segment4, sensor, Neo4jConstants.relationshipTypeMonitoredBy)) { - continue; - } - - // (segment4:Segment)-[:connectsTo]->(segment5:Segment) - final Iterable<Node> segment5s = Neo4jUtil.getAdjacentNodes(segment4, - Neo4jConstants.relationshipTypeConnectsTo, Direction.OUTGOING, Neo4jConstants.labelSegment); - for (final Node segment5 : segment5s) { - // (segment5:Segment)-[:sensor]->(sensor:Sensor) - if (!Neo4jUtil.isConnected(segment5, sensor, Neo4jConstants.relationshipTypeMonitoredBy)) { - continue; - } - - // (segment5:Segment)-[:connectsTo]->(segment6:Segment) - final Iterable<Node> segment6s = Neo4jUtil.getAdjacentNodes(segment5, Neo4jConstants.relationshipTypeConnectsTo, Direction.OUTGOING, Neo4jConstants.labelSegment); - for (final Node segment6 : segment6s) { - // (segment6:Segment)-[:sensor]->(sensor:Sensor) - if (!Neo4jUtil.isConnected(segment6, sensor, Neo4jConstants.relationshipTypeMonitoredBy)) { - continue; - } - - final Map<String, Object> match = new HashMap<>(); - match.put(VAR_SENSOR, sensor); - match.put(VAR_SEGMENT1, segment1); - match.put(VAR_SEGMENT2, segment2); - match.put(VAR_SEGMENT3, segment3); - match.put(VAR_SEGMENT4, segment4); - match.put(VAR_SEGMENT5, segment5); - match.put(VAR_SEGMENT6, segment6); - matches.add(new Neo4jConnectedSegmentsMatch(match)); - } - } - } - } - } - } - } - } - - return matches; - } - -} diff --git a/trainbenchmark-tool-neo4j/src/main/java/hu/bme/mit/trainbenchmark/benchmark/neo4j/queries/core/Neo4jCoreQueryConnectedSegmentsInject.java b/trainbenchmark-tool-neo4j/src/main/java/hu/bme/mit/trainbenchmark/benchmark/neo4j/queries/core/Neo4jCoreQueryConnectedSegmentsInject.java deleted file mode 100644 index b9d839fa0..000000000 --- a/trainbenchmark-tool-neo4j/src/main/java/hu/bme/mit/trainbenchmark/benchmark/neo4j/queries/core/Neo4jCoreQueryConnectedSegmentsInject.java +++ /dev/null @@ -1,77 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2010-2015, Benedek Izso, Gabor Szarnyas, Istvan Rath and Daniel Varro - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Benedek Izso - initial API and implementation - * Gabor Szarnyas - initial API and implementation - *******************************************************************************/ -package hu.bme.mit.trainbenchmark.benchmark.neo4j.queries.core; - -import static hu.bme.mit.trainbenchmark.constants.QueryConstants.VAR_SEGMENT1; -import static hu.bme.mit.trainbenchmark.constants.QueryConstants.VAR_SEGMENT3; -import static hu.bme.mit.trainbenchmark.constants.QueryConstants.VAR_SENSOR; - -import java.io.IOException; -import java.util.ArrayList; -import java.util.Collection; -import java.util.HashMap; -import java.util.Map; - -import org.neo4j.graphdb.Direction; -import org.neo4j.graphdb.GraphDatabaseService; -import org.neo4j.graphdb.Node; -import org.neo4j.graphdb.Transaction; - -import hu.bme.mit.trainbenchmark.benchmark.neo4j.driver.Neo4jDriver; -import hu.bme.mit.trainbenchmark.benchmark.neo4j.matches.Neo4jConnectedSegmentsInjectMatch; -import hu.bme.mit.trainbenchmark.benchmark.neo4j.util.Neo4jUtil; -import hu.bme.mit.trainbenchmark.constants.RailwayQuery; -import hu.bme.mit.trainbenchmark.neo4j.Neo4jConstants; - -public class Neo4jCoreQueryConnectedSegmentsInject extends Neo4jCoreQuery<Neo4jConnectedSegmentsInjectMatch> { - - public Neo4jCoreQueryConnectedSegmentsInject(final Neo4jDriver driver) { - super(RailwayQuery.CONNECTEDSEGMENTS_INJECT, driver); - } - - @Override - public Collection<Neo4jConnectedSegmentsInjectMatch> evaluate() throws IOException { - final Collection<Neo4jConnectedSegmentsInjectMatch> matches = new ArrayList<>(); - - final GraphDatabaseService graphDb = driver.getGraphDb(); - try (final Transaction tx = graphDb.beginTx()) { - - // (sensor:Sensor) - final Iterable<Node> sensors = () -> graphDb.findNodes(Neo4jConstants.labelSensor); - for (final Node sensor : sensors) { - // (sensor:Sensor)<-[:sensor]-(segment1:Segment) - final Iterable<Node> segment1s = Neo4jUtil.getAdjacentNodes(sensor, Neo4jConstants.relationshipTypeMonitoredBy, Direction.INCOMING, - Neo4jConstants.labelSegment); - - for (final Node segment1 : segment1s) { - // (segment1:Segment)-[:connectsTo]->(segment3:Segment) - final Iterable<Node> segment3s = Neo4jUtil.getAdjacentNodes(segment1, Neo4jConstants.relationshipTypeConnectsTo, Direction.OUTGOING, - Neo4jConstants.labelSegment); - for (final Node segment3 : segment3s) { - // (segment3:Segment)-[:sensor]->(sensor:Sensor) - if (!Neo4jUtil.isConnected(segment3, sensor, Neo4jConstants.relationshipTypeMonitoredBy)) { - continue; - } - - final Map<String, Object> match = new HashMap<>(); - match.put(VAR_SENSOR, sensor); - match.put(VAR_SEGMENT1, segment1); - match.put(VAR_SEGMENT3, segment3); - matches.add(new Neo4jConnectedSegmentsInjectMatch(match)); - } - } - } - } - return matches; - } - -} diff --git a/trainbenchmark-tool-neo4j/src/main/java/hu/bme/mit/trainbenchmark/benchmark/neo4j/queries/core/Neo4jCoreQueryPosLength.java b/trainbenchmark-tool-neo4j/src/main/java/hu/bme/mit/trainbenchmark/benchmark/neo4j/queries/core/Neo4jCoreQueryPosLength.java deleted file mode 100644 index 21d9e30de..000000000 --- a/trainbenchmark-tool-neo4j/src/main/java/hu/bme/mit/trainbenchmark/benchmark/neo4j/queries/core/Neo4jCoreQueryPosLength.java +++ /dev/null @@ -1,62 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2010-2015, Benedek Izso, Gabor Szarnyas, Istvan Rath and Daniel Varro - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Benedek Izso - initial API and implementation - * Gabor Szarnyas - initial API and implementation - *******************************************************************************/ - -package hu.bme.mit.trainbenchmark.benchmark.neo4j.queries.core; - -import static hu.bme.mit.trainbenchmark.constants.ModelConstants.LENGTH; -import static hu.bme.mit.trainbenchmark.constants.QueryConstants.VAR_LENGTH; -import static hu.bme.mit.trainbenchmark.constants.QueryConstants.VAR_SEGMENT; - -import java.util.ArrayList; -import java.util.Collection; -import java.util.HashMap; -import java.util.Map; - -import org.neo4j.graphdb.GraphDatabaseService; -import org.neo4j.graphdb.Node; -import org.neo4j.graphdb.Transaction; - -import hu.bme.mit.trainbenchmark.benchmark.neo4j.driver.Neo4jDriver; -import hu.bme.mit.trainbenchmark.benchmark.neo4j.matches.Neo4jPosLengthMatch; -import hu.bme.mit.trainbenchmark.constants.RailwayQuery; -import hu.bme.mit.trainbenchmark.neo4j.Neo4jConstants; - -public class Neo4jCoreQueryPosLength extends Neo4jCoreQuery<Neo4jPosLengthMatch> { - - public Neo4jCoreQueryPosLength(final Neo4jDriver driver) { - super(RailwayQuery.POSLENGTH, driver); - } - - @Override - public Collection<Neo4jPosLengthMatch> evaluate() { - final Collection<Neo4jPosLengthMatch> matches = new ArrayList<>(); - - final GraphDatabaseService graphDb = driver.getGraphDb(); - try (Transaction tx = graphDb.beginTx()) { - // (segment:Segment) - final Iterable<Node> segments = () -> graphDb.findNodes(Neo4jConstants.labelSegment); - for (final Node segment : segments) { - final Integer length = (Integer) segment.getProperty(LENGTH); - - // segment.length <= 0 - if (length <= 0) { - final Map<String, Object> match = new HashMap<>(); - match.put(VAR_SEGMENT, segment); - match.put(VAR_LENGTH, length); - matches.add(new Neo4jPosLengthMatch(match)); - } - } - } - - return matches; - } -} diff --git a/trainbenchmark-tool-neo4j/src/main/java/hu/bme/mit/trainbenchmark/benchmark/neo4j/queries/core/Neo4jCoreQueryPosLengthInject.java b/trainbenchmark-tool-neo4j/src/main/java/hu/bme/mit/trainbenchmark/benchmark/neo4j/queries/core/Neo4jCoreQueryPosLengthInject.java deleted file mode 100644 index 0153f3157..000000000 --- a/trainbenchmark-tool-neo4j/src/main/java/hu/bme/mit/trainbenchmark/benchmark/neo4j/queries/core/Neo4jCoreQueryPosLengthInject.java +++ /dev/null @@ -1,54 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2010-2015, Benedek Izso, Gabor Szarnyas, Istvan Rath and Daniel Varro - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Benedek Izso - initial API and implementation - * Gabor Szarnyas - initial API and implementation - *******************************************************************************/ - -package hu.bme.mit.trainbenchmark.benchmark.neo4j.queries.core; - -import static hu.bme.mit.trainbenchmark.constants.QueryConstants.VAR_SEGMENT; - -import java.util.ArrayList; -import java.util.Collection; -import java.util.HashMap; -import java.util.Map; - -import org.neo4j.graphdb.GraphDatabaseService; -import org.neo4j.graphdb.Node; -import org.neo4j.graphdb.Transaction; - -import hu.bme.mit.trainbenchmark.benchmark.neo4j.driver.Neo4jDriver; -import hu.bme.mit.trainbenchmark.benchmark.neo4j.matches.Neo4jPosLengthInjectMatch; -import hu.bme.mit.trainbenchmark.constants.RailwayQuery; -import hu.bme.mit.trainbenchmark.neo4j.Neo4jConstants; - -public class Neo4jCoreQueryPosLengthInject extends Neo4jCoreQuery<Neo4jPosLengthInjectMatch> { - - public Neo4jCoreQueryPosLengthInject(final Neo4jDriver driver) { - super(RailwayQuery.POSLENGTH_INJECT, driver); - } - - @Override - public Collection<Neo4jPosLengthInjectMatch> evaluate() { - final Collection<Neo4jPosLengthInjectMatch> matches = new ArrayList<>(); - - final GraphDatabaseService graphDb = driver.getGraphDb(); - try (Transaction tx = graphDb.beginTx()) { - // (segment:Segment) - final Iterable<Node> segments = () -> graphDb.findNodes(Neo4jConstants.labelSegment); - for (final Node segment : segments) { - final Map<String, Object> match = new HashMap<>(); - match.put(VAR_SEGMENT, segment); - matches.add(new Neo4jPosLengthInjectMatch(match)); - } - } - - return matches; - } -} diff --git a/trainbenchmark-tool-neo4j/src/main/java/hu/bme/mit/trainbenchmark/benchmark/neo4j/queries/core/Neo4jCoreQueryRouteSensor.java b/trainbenchmark-tool-neo4j/src/main/java/hu/bme/mit/trainbenchmark/benchmark/neo4j/queries/core/Neo4jCoreQueryRouteSensor.java deleted file mode 100644 index c0e730bbb..000000000 --- a/trainbenchmark-tool-neo4j/src/main/java/hu/bme/mit/trainbenchmark/benchmark/neo4j/queries/core/Neo4jCoreQueryRouteSensor.java +++ /dev/null @@ -1,76 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2010-2015, Benedek Izso, Gabor Szarnyas, Istvan Rath and Daniel Varro - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Benedek Izso - initial API and implementation - * Gabor Szarnyas - initial API and implementation - *******************************************************************************/ - -package hu.bme.mit.trainbenchmark.benchmark.neo4j.queries.core; - -import static hu.bme.mit.trainbenchmark.constants.QueryConstants.VAR_ROUTE; -import static hu.bme.mit.trainbenchmark.constants.QueryConstants.VAR_SENSOR; -import static hu.bme.mit.trainbenchmark.constants.QueryConstants.VAR_SW; -import static hu.bme.mit.trainbenchmark.constants.QueryConstants.VAR_SWP; - -import java.util.ArrayList; -import java.util.Collection; -import java.util.HashMap; -import java.util.Map; - -import org.neo4j.graphdb.Direction; -import org.neo4j.graphdb.GraphDatabaseService; -import org.neo4j.graphdb.Node; -import org.neo4j.graphdb.Transaction; - -import hu.bme.mit.trainbenchmark.benchmark.neo4j.driver.Neo4jDriver; -import hu.bme.mit.trainbenchmark.benchmark.neo4j.matches.Neo4jRouteSensorMatch; -import hu.bme.mit.trainbenchmark.benchmark.neo4j.util.Neo4jUtil; -import hu.bme.mit.trainbenchmark.constants.RailwayQuery; -import hu.bme.mit.trainbenchmark.neo4j.Neo4jConstants; - -public class Neo4jCoreQueryRouteSensor extends Neo4jCoreQuery<Neo4jRouteSensorMatch> { - - public Neo4jCoreQueryRouteSensor(final Neo4jDriver driver) { - super(RailwayQuery.ROUTESENSOR, driver); - } - - @Override - public Collection<Neo4jRouteSensorMatch> evaluate() { - final Collection<Neo4jRouteSensorMatch> matches = new ArrayList<>(); - - final GraphDatabaseService graphDb = driver.getGraphDb(); - try (final Transaction tx = graphDb.beginTx()) { - final Iterable<Node> routes = () -> graphDb.findNodes(Neo4jConstants.labelRoute); - for (final Node route : routes) { - // (route:Route)-[:follows]->(swp:switchPosition) - final Iterable<Node> swPs = Neo4jUtil.getAdjacentNodes(route, Neo4jConstants.relationshipTypeFollows, Direction.OUTGOING, Neo4jConstants.labelSwitchPosition); - for (final Node swP : swPs) { - // (swP:switchPosition)-[:target]->(sw:Switch) - final Iterable<Node> sws = Neo4jUtil.getAdjacentNodes(swP, Neo4jConstants.relationshipTypeTarget, Direction.OUTGOING, Neo4jConstants.labelSwitch); - for (final Node sw : sws) { - // (sw:Switch)-[:sensor]->(sensor:Sensor) - final Iterable<Node> sensors = Neo4jUtil.getAdjacentNodes(sw, Neo4jConstants.relationshipTypeMonitoredBy, Direction.OUTGOING, Neo4jConstants.labelSensor); - for (final Node sensor : sensors) { - // (sensor:Sensor)<-[:requires]-(route:Route) NAC - if (!Neo4jUtil.isConnected(route, sensor, Neo4jConstants.relationshipTypeRequires)) { - final Map<String, Object> match = new HashMap<>(); - match.put(VAR_ROUTE, route); - match.put(VAR_SENSOR, sensor); - match.put(VAR_SWP, swP); - match.put(VAR_SW, sw); - matches.add(new Neo4jRouteSensorMatch(match)); - } - } - } - } - } - } - - return matches; - } -} diff --git a/trainbenchmark-tool-neo4j/src/main/java/hu/bme/mit/trainbenchmark/benchmark/neo4j/queries/core/Neo4jCoreQueryRouteSensorInject.java b/trainbenchmark-tool-neo4j/src/main/java/hu/bme/mit/trainbenchmark/benchmark/neo4j/queries/core/Neo4jCoreQueryRouteSensorInject.java deleted file mode 100644 index 2fe4992ee..000000000 --- a/trainbenchmark-tool-neo4j/src/main/java/hu/bme/mit/trainbenchmark/benchmark/neo4j/queries/core/Neo4jCoreQueryRouteSensorInject.java +++ /dev/null @@ -1,62 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2010-2015, Benedek Izso, Gabor Szarnyas, Istvan Rath and Daniel Varro - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Benedek Izso - initial API and implementation - * Gabor Szarnyas - initial API and implementation - *******************************************************************************/ - -package hu.bme.mit.trainbenchmark.benchmark.neo4j.queries.core; - -import java.util.ArrayList; -import java.util.Collection; -import java.util.HashMap; -import java.util.Map; - -import org.neo4j.graphdb.Direction; -import org.neo4j.graphdb.GraphDatabaseService; -import org.neo4j.graphdb.Node; -import org.neo4j.graphdb.Transaction; - -import hu.bme.mit.trainbenchmark.benchmark.neo4j.driver.Neo4jDriver; -import hu.bme.mit.trainbenchmark.benchmark.neo4j.matches.Neo4jRouteSensorInjectMatch; -import hu.bme.mit.trainbenchmark.benchmark.neo4j.util.Neo4jUtil; -import hu.bme.mit.trainbenchmark.constants.QueryConstants; -import hu.bme.mit.trainbenchmark.constants.RailwayQuery; -import hu.bme.mit.trainbenchmark.neo4j.Neo4jConstants; - -public class Neo4jCoreQueryRouteSensorInject extends Neo4jCoreQuery<Neo4jRouteSensorInjectMatch> { - - public Neo4jCoreQueryRouteSensorInject(final Neo4jDriver driver) { - super(RailwayQuery.ROUTESENSOR_INJECT, driver); - } - - @Override - public Collection<Neo4jRouteSensorInjectMatch> evaluate() { - final Collection<Neo4jRouteSensorInjectMatch> matches = new ArrayList<>(); - - final GraphDatabaseService graphDb = driver.getGraphDb(); - try (Transaction tx = graphDb.beginTx()) { - // (route:Route) - final Iterable<Node> routes = () -> graphDb.findNodes(Neo4jConstants.labelRoute); - for (final Node route : routes) { - - final Iterable<Node> sensors = Neo4jUtil.getAdjacentNodes(route, Neo4jConstants.relationshipTypeRequires, - Direction.OUTGOING, Neo4jConstants.labelSensor); - - for (final Node sensor : sensors) { - final Map<String, Object> match = new HashMap<>(); - match.put(QueryConstants.VAR_ROUTE, route); - match.put(QueryConstants.VAR_SENSOR, sensor); - matches.add(new Neo4jRouteSensorInjectMatch(match)); - } - } - } - - return matches; - } -} diff --git a/trainbenchmark-tool-neo4j/src/main/java/hu/bme/mit/trainbenchmark/benchmark/neo4j/queries/core/Neo4jCoreQuerySemaphoreNeighbor.java b/trainbenchmark-tool-neo4j/src/main/java/hu/bme/mit/trainbenchmark/benchmark/neo4j/queries/core/Neo4jCoreQuerySemaphoreNeighbor.java deleted file mode 100644 index 77aec26bf..000000000 --- a/trainbenchmark-tool-neo4j/src/main/java/hu/bme/mit/trainbenchmark/benchmark/neo4j/queries/core/Neo4jCoreQuerySemaphoreNeighbor.java +++ /dev/null @@ -1,102 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2010-2015, Benedek Izso, Gabor Szarnyas, Istvan Rath and Daniel Varro - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Benedek Izso - initial API and implementation - * Gabor Szarnyas - initial API and implementation - *******************************************************************************/ -package hu.bme.mit.trainbenchmark.benchmark.neo4j.queries.core; - -import static hu.bme.mit.trainbenchmark.constants.QueryConstants.VAR_ROUTE1; -import static hu.bme.mit.trainbenchmark.constants.QueryConstants.VAR_ROUTE2; -import static hu.bme.mit.trainbenchmark.constants.QueryConstants.VAR_SEMAPHORE; -import static hu.bme.mit.trainbenchmark.constants.QueryConstants.VAR_SENSOR1; -import static hu.bme.mit.trainbenchmark.constants.QueryConstants.VAR_SENSOR2; -import static hu.bme.mit.trainbenchmark.constants.QueryConstants.VAR_TE1; -import static hu.bme.mit.trainbenchmark.constants.QueryConstants.VAR_TE2; - -import java.util.ArrayList; -import java.util.Collection; -import java.util.HashMap; -import java.util.Map; - -import org.neo4j.graphdb.Direction; -import org.neo4j.graphdb.GraphDatabaseService; -import org.neo4j.graphdb.Node; -import org.neo4j.graphdb.Transaction; - -import hu.bme.mit.trainbenchmark.benchmark.neo4j.driver.Neo4jDriver; -import hu.bme.mit.trainbenchmark.benchmark.neo4j.matches.Neo4jSemaphoreNeighborMatch; -import hu.bme.mit.trainbenchmark.benchmark.neo4j.util.Neo4jUtil; -import hu.bme.mit.trainbenchmark.constants.RailwayQuery; -import hu.bme.mit.trainbenchmark.neo4j.Neo4jConstants; - -public class Neo4jCoreQuerySemaphoreNeighbor extends Neo4jCoreQuery<Neo4jSemaphoreNeighborMatch> { - - public Neo4jCoreQuerySemaphoreNeighbor(final Neo4jDriver driver) { - super(RailwayQuery.SEMAPHORENEIGHBOR, driver); - } - - @Override - public Collection<Neo4jSemaphoreNeighborMatch> evaluate() { - final Collection<Neo4jSemaphoreNeighborMatch> matches = new ArrayList<>(); - - final GraphDatabaseService graphDb = driver.getGraphDb(); - try (final Transaction tx = graphDb.beginTx()) { - final Iterable<Node> route1s = () -> graphDb.findNodes(Neo4jConstants.labelRoute); - for (final Node route1 : route1s) { - // (route1:Route)-[:exit]->(semaphore:Semaphore) - final Iterable<Node> semaphores = Neo4jUtil.getAdjacentNodes(route1, Neo4jConstants.relationshipTypeExit, - Direction.OUTGOING, Neo4jConstants.labelSemaphore); - for (final Node semaphore : semaphores) { - - // (route1:Route)-[:requires]->(sensor1:Sensor) - final Iterable<Node> sensor1s = Neo4jUtil.getAdjacentNodes(route1, Neo4jConstants.relationshipTypeRequires, - Direction.OUTGOING, Neo4jConstants.labelSensor); - for (final Node sensor1 : sensor1s) { - // (sensor1:Sensor)<-[:sensor]-(te1:TrackElement) - final Iterable<Node> te1s = Neo4jUtil.getAdjacentNodes(sensor1, Neo4jConstants.relationshipTypeMonitoredBy, Direction.INCOMING, Neo4jConstants.labelTrackElement); - for (final Node te1 : te1s) { - // (te1:TrackElement)-[:connectsTo]->(te2:TrackElement) - final Iterable<Node> te2s = Neo4jUtil.getAdjacentNodes(te1, Neo4jConstants.relationshipTypeConnectsTo, Direction.OUTGOING, Neo4jConstants.labelTrackElement); - for (final Node te2 : te2s) { - // (te2:TrackElement)-[:sensor]->(sensor2:Sensor) - final Iterable<Node> sensor2s = Neo4jUtil.getAdjacentNodes(te2, Neo4jConstants.relationshipTypeMonitoredBy, Direction.OUTGOING, Neo4jConstants.labelSensor); - for (final Node sensor2 : sensor2s) { - // (sensor2:Sensor)<-[:requires]-(route2:Route), - final Iterable<Node> route2s = Neo4jUtil.getAdjacentNodes(sensor2, Neo4jConstants.relationshipTypeRequires, Direction.INCOMING, Neo4jConstants.labelRoute); - for (final Node route2 : route2s) { - // route1 != route2 --> if (route1 == route2), continue - if (route1.equals(route2)) { - continue; - } - - // (route2)-[:entry]->(semaphore) NAC - if (!Neo4jUtil.isConnected(route2, semaphore, Neo4jConstants.relationshipTypeEntry)) { - final Map<String, Object> match = new HashMap<>(); - match.put(VAR_SEMAPHORE, semaphore); - match.put(VAR_ROUTE1, route1); - match.put(VAR_ROUTE2, route2); - match.put(VAR_SENSOR1, sensor1); - match.put(VAR_SENSOR2, sensor2); - match.put(VAR_TE1, te1); - match.put(VAR_TE2, te2); - matches.add(new Neo4jSemaphoreNeighborMatch(match)); - break; - } - } - } - } - } - } - } - } - } - - return matches; - } -} diff --git a/trainbenchmark-tool-neo4j/src/main/java/hu/bme/mit/trainbenchmark/benchmark/neo4j/queries/core/Neo4jCoreQuerySemaphoreNeighborInject.java b/trainbenchmark-tool-neo4j/src/main/java/hu/bme/mit/trainbenchmark/benchmark/neo4j/queries/core/Neo4jCoreQuerySemaphoreNeighborInject.java deleted file mode 100644 index 60e6d0c02..000000000 --- a/trainbenchmark-tool-neo4j/src/main/java/hu/bme/mit/trainbenchmark/benchmark/neo4j/queries/core/Neo4jCoreQuerySemaphoreNeighborInject.java +++ /dev/null @@ -1,61 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2010-2015, Benedek Izso, Gabor Szarnyas, Istvan Rath and Daniel Varro - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Benedek Izso - initial API and implementation - * Gabor Szarnyas - initial API and implementation - *******************************************************************************/ -package hu.bme.mit.trainbenchmark.benchmark.neo4j.queries.core; - -import java.util.ArrayList; -import java.util.Collection; -import java.util.HashMap; -import java.util.Map; - -import org.neo4j.graphdb.Direction; -import org.neo4j.graphdb.GraphDatabaseService; -import org.neo4j.graphdb.Node; -import org.neo4j.graphdb.Relationship; -import org.neo4j.graphdb.Transaction; - -import hu.bme.mit.trainbenchmark.benchmark.neo4j.driver.Neo4jDriver; -import hu.bme.mit.trainbenchmark.benchmark.neo4j.matches.Neo4jSemaphoreNeighborInjectMatch; -import hu.bme.mit.trainbenchmark.constants.QueryConstants; -import hu.bme.mit.trainbenchmark.constants.RailwayQuery; -import hu.bme.mit.trainbenchmark.neo4j.Neo4jConstants; - -public class Neo4jCoreQuerySemaphoreNeighborInject extends Neo4jCoreQuery<Neo4jSemaphoreNeighborInjectMatch> { - - public Neo4jCoreQuerySemaphoreNeighborInject(final Neo4jDriver driver) { - super(RailwayQuery.SEMAPHORENEIGHBOR_INJECT, driver); - } - - @Override - public Collection<Neo4jSemaphoreNeighborInjectMatch> evaluate() { - final Collection<Neo4jSemaphoreNeighborInjectMatch> matches = new ArrayList<>(); - - final GraphDatabaseService graphDb = driver.getGraphDb(); - try (Transaction tx = graphDb.beginTx()) { - // (route:Route) - final Iterable<Node> routes = () -> graphDb.findNodes(Neo4jConstants.labelRoute); - for (final Node route : routes) { - Iterable<Relationship> entries = route.getRelationships(Direction.OUTGOING, Neo4jConstants.relationshipTypeEntry); - - for (Relationship entry : entries) { - final Node semaphore = entry.getEndNode(); - - final Map<String, Object> match = new HashMap<>(); - match.put(QueryConstants.VAR_ROUTE, route); - match.put(QueryConstants.VAR_SEMAPHORE, semaphore); - matches.add(new Neo4jSemaphoreNeighborInjectMatch(match)); - } - } - } - - return matches; - } -} diff --git a/trainbenchmark-tool-neo4j/src/main/java/hu/bme/mit/trainbenchmark/benchmark/neo4j/queries/core/Neo4jCoreQuerySwitchMonitored.java b/trainbenchmark-tool-neo4j/src/main/java/hu/bme/mit/trainbenchmark/benchmark/neo4j/queries/core/Neo4jCoreQuerySwitchMonitored.java deleted file mode 100644 index 5964ff6bc..000000000 --- a/trainbenchmark-tool-neo4j/src/main/java/hu/bme/mit/trainbenchmark/benchmark/neo4j/queries/core/Neo4jCoreQuerySwitchMonitored.java +++ /dev/null @@ -1,70 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2010-2015, Benedek Izso, Gabor Szarnyas, Istvan Rath and Daniel Varro - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Benedek Izso - initial API and implementation - * Gabor Szarnyas - initial API and implementation - *******************************************************************************/ - -package hu.bme.mit.trainbenchmark.benchmark.neo4j.queries.core; - -import static hu.bme.mit.trainbenchmark.constants.QueryConstants.VAR_SW; - -import java.util.ArrayList; -import java.util.Collection; -import java.util.HashMap; -import java.util.Map; - -import org.neo4j.graphdb.Direction; -import org.neo4j.graphdb.GraphDatabaseService; -import org.neo4j.graphdb.Node; -import org.neo4j.graphdb.Relationship; -import org.neo4j.graphdb.Transaction; - -import hu.bme.mit.trainbenchmark.benchmark.neo4j.driver.Neo4jDriver; -import hu.bme.mit.trainbenchmark.benchmark.neo4j.matches.Neo4jSwitchMonitoredMatch; -import hu.bme.mit.trainbenchmark.constants.RailwayQuery; -import hu.bme.mit.trainbenchmark.neo4j.Neo4jConstants; - -public class Neo4jCoreQuerySwitchMonitored extends Neo4jCoreQuery<Neo4jSwitchMonitoredMatch> { - - public Neo4jCoreQuerySwitchMonitored(final Neo4jDriver driver) { - super(RailwayQuery.SWITCHMONITORED, driver); - } - - @Override - public Collection<Neo4jSwitchMonitoredMatch> evaluate() { - final Collection<Neo4jSwitchMonitoredMatch> matches = new ArrayList<>(); - - final GraphDatabaseService graphDb = driver.getGraphDb(); - try (Transaction tx = graphDb.beginTx()) { - final Iterable<Node> sws = () -> graphDb.findNodes(Neo4jConstants.labelSwitch); - // (sw:Switch) - for (final Node sw : sws) { - // (sw)-[:sensor]->(Sensor) NAC - final Iterable<Relationship> relationshipSensors = sw.getRelationships(Direction.OUTGOING, Neo4jConstants.relationshipTypeMonitoredBy); - - boolean hasSensor = false; - for (final Relationship relationshipSensor : relationshipSensors) { - final Node sensor = relationshipSensor.getEndNode(); - if (sensor.hasLabel(Neo4jConstants.labelSensor)) { - hasSensor = true; - break; - } - } - - if (!hasSensor) { - final Map<String, Object> match = new HashMap<>(); - match.put(VAR_SW, sw); - matches.add(new Neo4jSwitchMonitoredMatch(match)); - } - } - } - - return matches; - } -} diff --git a/trainbenchmark-tool-neo4j/src/main/java/hu/bme/mit/trainbenchmark/benchmark/neo4j/queries/core/Neo4jCoreQuerySwitchMonitoredInject.java b/trainbenchmark-tool-neo4j/src/main/java/hu/bme/mit/trainbenchmark/benchmark/neo4j/queries/core/Neo4jCoreQuerySwitchMonitoredInject.java deleted file mode 100644 index 88d2733f0..000000000 --- a/trainbenchmark-tool-neo4j/src/main/java/hu/bme/mit/trainbenchmark/benchmark/neo4j/queries/core/Neo4jCoreQuerySwitchMonitoredInject.java +++ /dev/null @@ -1,53 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2010-2015, Benedek Izso, Gabor Szarnyas, Istvan Rath and Daniel Varro - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Benedek Izso - initial API and implementation - * Gabor Szarnyas - initial API and implementation - *******************************************************************************/ - -package hu.bme.mit.trainbenchmark.benchmark.neo4j.queries.core; - -import java.util.ArrayList; -import java.util.Collection; -import java.util.HashMap; -import java.util.Map; - -import org.neo4j.graphdb.GraphDatabaseService; -import org.neo4j.graphdb.Node; -import org.neo4j.graphdb.Transaction; - -import hu.bme.mit.trainbenchmark.benchmark.neo4j.driver.Neo4jDriver; -import hu.bme.mit.trainbenchmark.benchmark.neo4j.matches.Neo4jSwitchMonitoredInjectMatch; -import hu.bme.mit.trainbenchmark.constants.QueryConstants; -import hu.bme.mit.trainbenchmark.constants.RailwayQuery; -import hu.bme.mit.trainbenchmark.neo4j.Neo4jConstants; - -public class Neo4jCoreQuerySwitchMonitoredInject extends Neo4jCoreQuery<Neo4jSwitchMonitoredInjectMatch> { - - public Neo4jCoreQuerySwitchMonitoredInject(final Neo4jDriver driver) { - super(RailwayQuery.SWITCHMONITORED_INJECT, driver); - } - - @Override - public Collection<Neo4jSwitchMonitoredInjectMatch> evaluate() { - final Collection<Neo4jSwitchMonitoredInjectMatch> matches = new ArrayList<>(); - - final GraphDatabaseService graphDb = driver.getGraphDb(); - try (final Transaction tx = graphDb.beginTx()) { - // (sw:Switch) - final Iterable<Node> sws = () -> graphDb.findNodes(Neo4jConstants.labelSwitch); - for (final Node sw : sws) { - final Map<String, Object> match = new HashMap<>(); - match.put(QueryConstants.VAR_SW, sw); - matches.add(new Neo4jSwitchMonitoredInjectMatch(match)); - } - } - - return matches; - } -} diff --git a/trainbenchmark-tool-neo4j/src/main/java/hu/bme/mit/trainbenchmark/benchmark/neo4j/queries/core/Neo4jCoreQuerySwitchSet.java b/trainbenchmark-tool-neo4j/src/main/java/hu/bme/mit/trainbenchmark/benchmark/neo4j/queries/core/Neo4jCoreQuerySwitchSet.java deleted file mode 100644 index d58421256..000000000 --- a/trainbenchmark-tool-neo4j/src/main/java/hu/bme/mit/trainbenchmark/benchmark/neo4j/queries/core/Neo4jCoreQuerySwitchSet.java +++ /dev/null @@ -1,97 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2010-2015, Benedek Izso, Gabor Szarnyas, Istvan Rath and Daniel Varro - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Benedek Izso - initial API and implementation - * Gabor Szarnyas - initial API and implementation - *******************************************************************************/ - -package hu.bme.mit.trainbenchmark.benchmark.neo4j.queries.core; - -import static hu.bme.mit.trainbenchmark.constants.ModelConstants.SIGNAL; - -import java.util.ArrayList; -import java.util.Collection; -import java.util.HashMap; -import java.util.Map; - -import org.neo4j.graphdb.Direction; -import org.neo4j.graphdb.GraphDatabaseService; -import org.neo4j.graphdb.Node; -import org.neo4j.graphdb.Transaction; - -import hu.bme.mit.trainbenchmark.benchmark.neo4j.driver.Neo4jDriver; -import hu.bme.mit.trainbenchmark.benchmark.neo4j.matches.Neo4jSwitchSetMatch; -import hu.bme.mit.trainbenchmark.benchmark.neo4j.util.Neo4jUtil; -import hu.bme.mit.trainbenchmark.constants.ModelConstants; -import hu.bme.mit.trainbenchmark.constants.QueryConstants; -import hu.bme.mit.trainbenchmark.constants.RailwayQuery; -import hu.bme.mit.trainbenchmark.constants.Signal; -import hu.bme.mit.trainbenchmark.neo4j.Neo4jConstants; - -public class Neo4jCoreQuerySwitchSet extends Neo4jCoreQuery<Neo4jSwitchSetMatch> { - - public Neo4jCoreQuerySwitchSet(final Neo4jDriver driver) { - super(RailwayQuery.SWITCHSET, driver); - } - - @Override - public Collection<Neo4jSwitchSetMatch> evaluate() { - final Collection<Neo4jSwitchSetMatch> matches = new ArrayList<>(); - - final GraphDatabaseService graphDb = driver.getGraphDb(); - try (final Transaction tx = graphDb.beginTx()) { - // (route:Route) - final Iterable<Node> routes = () -> graphDb.findNodes(Neo4jConstants.labelRoute); - for (final Node route : routes) { - final boolean active = (boolean) route.getProperty(ModelConstants.ACTIVE); - if (!active) { - continue; - } - - // (route:Route)-[:entry]->(semaphore:Semaphore) - final Iterable<Node> semaphores = Neo4jUtil.getAdjacentNodes(route, Neo4jConstants.relationshipTypeEntry, Direction.OUTGOING, - Neo4jConstants.labelSemaphore); - for (final Node semaphore : semaphores) { - - // semaphore.signal = "GO" - final String signal = (String) semaphore.getProperty(SIGNAL); - if (!Signal.GO.toString().equals(signal)) { - continue; - } - - // (route:Route)-[:follows]->(swP:SwitchPosition) - final Iterable<Node> swPs = Neo4jUtil.getAdjacentNodes(route, Neo4jConstants.relationshipTypeFollows, Direction.OUTGOING, - Neo4jConstants.labelSwitchPosition); - for (final Node swP : swPs) { - // (swP:SwitchPosition)-[:target]->(sw:Switch) - final Iterable<Node> sws = Neo4jUtil.getAdjacentNodes(swP, Neo4jConstants.relationshipTypeTarget, - Direction.OUTGOING, Neo4jConstants.labelSwitch); - - for (final Node sw : sws) { - final Object currentPosition = sw.getProperty(ModelConstants.CURRENTPOSITION); - final Object position = swP.getProperty(ModelConstants.POSITION); - - if (!currentPosition.equals(position)) { - final Map<String, Object> match = new HashMap<>(); - match.put(QueryConstants.VAR_SEMAPHORE, semaphore); - match.put(QueryConstants.VAR_ROUTE, route); - match.put(QueryConstants.VAR_SWP, swP); - match.put(QueryConstants.VAR_SW, sw); - match.put(QueryConstants.VAR_CURRENTPOSITION, currentPosition); - match.put(QueryConstants.VAR_POSITION, position); - matches.add(new Neo4jSwitchSetMatch(match)); - } - } - } - } - } - } - - return matches; - } -} diff --git a/trainbenchmark-tool-neo4j/src/main/java/hu/bme/mit/trainbenchmark/benchmark/neo4j/queries/core/Neo4jCoreQuerySwitchSetInject.java b/trainbenchmark-tool-neo4j/src/main/java/hu/bme/mit/trainbenchmark/benchmark/neo4j/queries/core/Neo4jCoreQuerySwitchSetInject.java deleted file mode 100644 index a25d42073..000000000 --- a/trainbenchmark-tool-neo4j/src/main/java/hu/bme/mit/trainbenchmark/benchmark/neo4j/queries/core/Neo4jCoreQuerySwitchSetInject.java +++ /dev/null @@ -1,53 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2010-2015, Benedek Izso, Gabor Szarnyas, Istvan Rath and Daniel Varro - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Benedek Izso - initial API and implementation - * Gabor Szarnyas - initial API and implementation - *******************************************************************************/ - -package hu.bme.mit.trainbenchmark.benchmark.neo4j.queries.core; - -import java.util.ArrayList; -import java.util.Collection; -import java.util.HashMap; -import java.util.Map; - -import org.neo4j.graphdb.GraphDatabaseService; -import org.neo4j.graphdb.Node; -import org.neo4j.graphdb.Transaction; - -import hu.bme.mit.trainbenchmark.benchmark.neo4j.driver.Neo4jDriver; -import hu.bme.mit.trainbenchmark.benchmark.neo4j.matches.Neo4jSwitchSetInjectMatch; -import hu.bme.mit.trainbenchmark.constants.QueryConstants; -import hu.bme.mit.trainbenchmark.constants.RailwayQuery; -import hu.bme.mit.trainbenchmark.neo4j.Neo4jConstants; - -public class Neo4jCoreQuerySwitchSetInject extends Neo4jCoreQuery<Neo4jSwitchSetInjectMatch> { - - public Neo4jCoreQuerySwitchSetInject(final Neo4jDriver driver) { - super(RailwayQuery.SWITCHSET_INJECT, driver); - } - - @Override - public Collection<Neo4jSwitchSetInjectMatch> evaluate() { - final Collection<Neo4jSwitchSetInjectMatch> matches = new ArrayList<>(); - - final GraphDatabaseService graphDb = driver.getGraphDb(); - try (Transaction tx = graphDb.beginTx()) { - // (sw:Switch) - final Iterable<Node> sws = () -> graphDb.findNodes(Neo4jConstants.labelSwitch); - for (final Node sw : sws) { - final Map<String, Object> match = new HashMap<>(); - match.put(QueryConstants.VAR_SW, sw); - matches.add(new Neo4jSwitchSetInjectMatch(match)); - } - } - - return matches; - } -} diff --git a/trainbenchmark-tool-neo4j/src/main/java/hu/bme/mit/trainbenchmark/benchmark/neo4j/queries/cypher/Neo4jCypherQuery.java b/trainbenchmark-tool-neo4j/src/main/java/hu/bme/mit/trainbenchmark/benchmark/neo4j/queries/cypher/Neo4jCypherQuery.java deleted file mode 100644 index 0b9db283c..000000000 --- a/trainbenchmark-tool-neo4j/src/main/java/hu/bme/mit/trainbenchmark/benchmark/neo4j/queries/cypher/Neo4jCypherQuery.java +++ /dev/null @@ -1,46 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2010-2015, Benedek Izso, Gabor Szarnyas, Istvan Rath and Daniel Varro - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Benedek Izso - initial API and implementation - * Gabor Szarnyas - initial API and implementation - *******************************************************************************/ -package hu.bme.mit.trainbenchmark.benchmark.neo4j.queries.cypher; - -import java.io.File; -import java.io.IOException; -import java.util.Collection; - -import org.apache.commons.io.FileUtils; - -import hu.bme.mit.trainbenchmark.benchmark.neo4j.driver.Neo4jDriver; -import hu.bme.mit.trainbenchmark.benchmark.neo4j.matches.Neo4jMatch; -import hu.bme.mit.trainbenchmark.benchmark.neo4j.queries.Neo4jQuery; -import hu.bme.mit.trainbenchmark.constants.RailwayQuery; -import hu.bme.mit.trainbenchmark.neo4j.Neo4jConstants; - -public class Neo4jCypherQuery<TNeo4jMatch extends Neo4jMatch> extends Neo4jQuery<TNeo4jMatch> { - - protected final RailwayQuery query; - protected final String queryDefinition; - - public Neo4jCypherQuery(final Neo4jDriver driver, final String workspaceDir, final RailwayQuery query) - throws IOException { - super(query, driver); - - this.query = query; - this.queryDefinition = FileUtils.readFileToString(new File( - workspaceDir + Neo4jConstants.CYPHER_DIR + "queries/" + query + "." + Neo4jConstants.QUERY_EXTENSION)); - } - - @SuppressWarnings("unchecked") - @Override - public Collection<TNeo4jMatch> evaluate() throws IOException { - return (Collection<TNeo4jMatch>) driver.runQuery(query, queryDefinition); - } - -} diff --git a/trainbenchmark-tool-neo4j/src/main/java/hu/bme/mit/trainbenchmark/benchmark/neo4j/transformations/Neo4jCoreTransformation.java b/trainbenchmark-tool-neo4j/src/main/java/hu/bme/mit/trainbenchmark/benchmark/neo4j/transformations/Neo4jCoreTransformation.java deleted file mode 100644 index 494085225..000000000 --- a/trainbenchmark-tool-neo4j/src/main/java/hu/bme/mit/trainbenchmark/benchmark/neo4j/transformations/Neo4jCoreTransformation.java +++ /dev/null @@ -1,23 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2010-2015, Benedek Izso, Gabor Szarnyas, Istvan Rath and Daniel Varro - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Benedek Izso - initial API and implementation - * Gabor Szarnyas - initial API and implementation - *******************************************************************************/ -package hu.bme.mit.trainbenchmark.benchmark.neo4j.transformations; - -import hu.bme.mit.trainbenchmark.benchmark.neo4j.driver.Neo4jDriver; -import hu.bme.mit.trainbenchmark.benchmark.neo4j.matches.Neo4jMatch; - -public abstract class Neo4jCoreTransformation<TNeo4jMatch extends Neo4jMatch> extends Neo4jTransformation<TNeo4jMatch> { - - protected Neo4jCoreTransformation(final Neo4jDriver driver) { - super(driver); - } - -} diff --git a/trainbenchmark-tool-neo4j/src/main/java/hu/bme/mit/trainbenchmark/benchmark/neo4j/transformations/Neo4jCypherTransformation.java b/trainbenchmark-tool-neo4j/src/main/java/hu/bme/mit/trainbenchmark/benchmark/neo4j/transformations/Neo4jCypherTransformation.java deleted file mode 100644 index af1964b2f..000000000 --- a/trainbenchmark-tool-neo4j/src/main/java/hu/bme/mit/trainbenchmark/benchmark/neo4j/transformations/Neo4jCypherTransformation.java +++ /dev/null @@ -1,25 +0,0 @@ -package hu.bme.mit.trainbenchmark.benchmark.neo4j.transformations; - -import java.io.File; -import java.io.IOException; - -import org.apache.commons.io.FileUtils; - -import hu.bme.mit.trainbenchmark.benchmark.neo4j.driver.Neo4jDriver; -import hu.bme.mit.trainbenchmark.benchmark.neo4j.matches.Neo4jMatch; -import hu.bme.mit.trainbenchmark.constants.RailwayOperation; -import hu.bme.mit.trainbenchmark.neo4j.Neo4jConstants; - -public abstract class Neo4jCypherTransformation<TNeo4jMatch extends Neo4jMatch> - extends Neo4jTransformation<TNeo4jMatch> { - - protected final String transformationDefinition; - - public Neo4jCypherTransformation(final Neo4jDriver driver, final String workspaceDir, - final RailwayOperation operation) throws IOException { - super(driver); - this.transformationDefinition = FileUtils.readFileToString(new File(workspaceDir + Neo4jConstants.CYPHER_DIR - + "transformations/" + operation + "Rhs." + Neo4jConstants.QUERY_EXTENSION)); - } - -} diff --git a/trainbenchmark-tool-neo4j/src/main/java/hu/bme/mit/trainbenchmark/benchmark/neo4j/transformations/Neo4jTransformation.java b/trainbenchmark-tool-neo4j/src/main/java/hu/bme/mit/trainbenchmark/benchmark/neo4j/transformations/Neo4jTransformation.java deleted file mode 100644 index e9811004b..000000000 --- a/trainbenchmark-tool-neo4j/src/main/java/hu/bme/mit/trainbenchmark/benchmark/neo4j/transformations/Neo4jTransformation.java +++ /dev/null @@ -1,13 +0,0 @@ -package hu.bme.mit.trainbenchmark.benchmark.neo4j.transformations; - -import hu.bme.mit.trainbenchmark.benchmark.neo4j.driver.Neo4jDriver; -import hu.bme.mit.trainbenchmark.benchmark.neo4j.matches.Neo4jMatch; -import hu.bme.mit.trainbenchmark.benchmark.operations.ModelTransformation; - -public abstract class Neo4jTransformation<TNeo4jMatch extends Neo4jMatch> extends ModelTransformation<TNeo4jMatch, Neo4jDriver> { - - public Neo4jTransformation(final Neo4jDriver driver) { - super(driver); - } - -} diff --git a/trainbenchmark-tool-neo4j/src/main/java/hu/bme/mit/trainbenchmark/benchmark/neo4j/transformations/core/inject/Neo4jCoreTransformationInjectConnectedSegments.java b/trainbenchmark-tool-neo4j/src/main/java/hu/bme/mit/trainbenchmark/benchmark/neo4j/transformations/core/inject/Neo4jCoreTransformationInjectConnectedSegments.java deleted file mode 100644 index 0666997b8..000000000 --- a/trainbenchmark-tool-neo4j/src/main/java/hu/bme/mit/trainbenchmark/benchmark/neo4j/transformations/core/inject/Neo4jCoreTransformationInjectConnectedSegments.java +++ /dev/null @@ -1,60 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2010-2015, Benedek Izso, Gabor Szarnyas, Istvan Rath and Daniel Varro - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Benedek Izso - initial API and implementation - * Gabor Szarnyas - initial API and implementation - *******************************************************************************/ -package hu.bme.mit.trainbenchmark.benchmark.neo4j.transformations.core.inject; - -import java.util.Collection; - -import org.neo4j.graphdb.Direction; -import org.neo4j.graphdb.Node; -import org.neo4j.graphdb.Relationship; - -import hu.bme.mit.trainbenchmark.benchmark.neo4j.driver.Neo4jDriver; -import hu.bme.mit.trainbenchmark.benchmark.neo4j.matches.Neo4jConnectedSegmentsInjectMatch; -import hu.bme.mit.trainbenchmark.benchmark.neo4j.transformations.Neo4jCoreTransformation; -import hu.bme.mit.trainbenchmark.constants.ModelConstants; -import hu.bme.mit.trainbenchmark.constants.TrainBenchmarkConstants; -import hu.bme.mit.trainbenchmark.neo4j.Neo4jConstants; - -public class Neo4jCoreTransformationInjectConnectedSegments - extends Neo4jCoreTransformation<Neo4jConnectedSegmentsInjectMatch> { - - public Neo4jCoreTransformationInjectConnectedSegments(final Neo4jDriver driver) { - super(driver); - } - - @Override - public void activate(final Collection<Neo4jConnectedSegmentsInjectMatch> matches) { - for (final Neo4jConnectedSegmentsInjectMatch match : matches) { - // create (segment2) node - final Node segment2 = driver.getGraphDb().createNode(Neo4jConstants.labelSegment); - segment2.setProperty(ModelConstants.LENGTH, TrainBenchmarkConstants.DEFAULT_SEGMENT_LENGTH); - - // (segment2)-[:monitoredBy]->(sensor) - segment2.createRelationshipTo(match.getSensor(), Neo4jConstants.relationshipTypeMonitoredBy); - - // (segment1)-[:connectsTo]->(segment2) - match.getSegment1().createRelationshipTo(segment2, Neo4jConstants.relationshipTypeConnectsTo); - // (segment2)-[:connectsTo]->(segment3) - segment2.createRelationshipTo(match.getSegment3(), Neo4jConstants.relationshipTypeConnectsTo); - - // remove (segment1)-[:connectsTo]->(segment3) - final Iterable<Relationship> connectsToEdges = match.getSegment1().getRelationships(Direction.OUTGOING, - Neo4jConstants.relationshipTypeConnectsTo); - for (final Relationship connectsToEdge : connectsToEdges) { - if (connectsToEdge.getEndNode().equals(match.getSegment3())) { - connectsToEdge.delete(); - } - } - } - } - -} diff --git a/trainbenchmark-tool-neo4j/src/main/java/hu/bme/mit/trainbenchmark/benchmark/neo4j/transformations/core/inject/Neo4jCoreTransformationInjectPosLength.java b/trainbenchmark-tool-neo4j/src/main/java/hu/bme/mit/trainbenchmark/benchmark/neo4j/transformations/core/inject/Neo4jCoreTransformationInjectPosLength.java deleted file mode 100644 index c53c0bb69..000000000 --- a/trainbenchmark-tool-neo4j/src/main/java/hu/bme/mit/trainbenchmark/benchmark/neo4j/transformations/core/inject/Neo4jCoreTransformationInjectPosLength.java +++ /dev/null @@ -1,34 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2010-2015, Benedek Izso, Gabor Szarnyas, Istvan Rath and Daniel Varro - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Benedek Izso - initial API and implementation - * Gabor Szarnyas - initial API and implementation - *******************************************************************************/ -package hu.bme.mit.trainbenchmark.benchmark.neo4j.transformations.core.inject; - -import java.util.Collection; - -import hu.bme.mit.trainbenchmark.benchmark.neo4j.driver.Neo4jDriver; -import hu.bme.mit.trainbenchmark.benchmark.neo4j.matches.Neo4jPosLengthInjectMatch; -import hu.bme.mit.trainbenchmark.benchmark.neo4j.transformations.Neo4jCoreTransformation; -import hu.bme.mit.trainbenchmark.constants.ModelConstants; - -public class Neo4jCoreTransformationInjectPosLength extends Neo4jCoreTransformation<Neo4jPosLengthInjectMatch> { - - public Neo4jCoreTransformationInjectPosLength(final Neo4jDriver driver) { - super(driver); - } - - @Override - public void activate(final Collection<Neo4jPosLengthInjectMatch> matches) { - for (final Neo4jPosLengthInjectMatch match : matches) { - match.getSegment().setProperty(ModelConstants.LENGTH, 0); - } - } - -} diff --git a/trainbenchmark-tool-neo4j/src/main/java/hu/bme/mit/trainbenchmark/benchmark/neo4j/transformations/core/inject/Neo4jCoreTransformationInjectRouteSensor.java b/trainbenchmark-tool-neo4j/src/main/java/hu/bme/mit/trainbenchmark/benchmark/neo4j/transformations/core/inject/Neo4jCoreTransformationInjectRouteSensor.java deleted file mode 100644 index b11e06920..000000000 --- a/trainbenchmark-tool-neo4j/src/main/java/hu/bme/mit/trainbenchmark/benchmark/neo4j/transformations/core/inject/Neo4jCoreTransformationInjectRouteSensor.java +++ /dev/null @@ -1,41 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2010-2015, Benedek Izso, Gabor Szarnyas, Istvan Rath and Daniel Varro - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Benedek Izso - initial API and implementation - * Gabor Szarnyas - initial API and implementation - *******************************************************************************/ -package hu.bme.mit.trainbenchmark.benchmark.neo4j.transformations.core.inject; - -import java.util.Collection; - -import org.neo4j.graphdb.Relationship; - -import hu.bme.mit.trainbenchmark.benchmark.neo4j.driver.Neo4jDriver; -import hu.bme.mit.trainbenchmark.benchmark.neo4j.matches.Neo4jRouteSensorInjectMatch; -import hu.bme.mit.trainbenchmark.benchmark.neo4j.transformations.Neo4jCoreTransformation; -import hu.bme.mit.trainbenchmark.neo4j.Neo4jConstants; - -public class Neo4jCoreTransformationInjectRouteSensor extends Neo4jCoreTransformation<Neo4jRouteSensorInjectMatch> { - - public Neo4jCoreTransformationInjectRouteSensor(final Neo4jDriver driver) { - super(driver); - } - - @Override - public void activate(final Collection<Neo4jRouteSensorInjectMatch> matches) { - for (final Neo4jRouteSensorInjectMatch match : matches) { - final Iterable<Relationship> requiress = match.getRoute().getRelationships(Neo4jConstants.relationshipTypeRequires); - for (final Relationship requires : requiress) { - if (requires.getEndNode().equals(match.getSensor())) { - requires.delete(); - } - } - } - } - -} diff --git a/trainbenchmark-tool-neo4j/src/main/java/hu/bme/mit/trainbenchmark/benchmark/neo4j/transformations/core/inject/Neo4jCoreTransformationInjectSemaphoreNeighbor.java b/trainbenchmark-tool-neo4j/src/main/java/hu/bme/mit/trainbenchmark/benchmark/neo4j/transformations/core/inject/Neo4jCoreTransformationInjectSemaphoreNeighbor.java deleted file mode 100644 index 9abd5f689..000000000 --- a/trainbenchmark-tool-neo4j/src/main/java/hu/bme/mit/trainbenchmark/benchmark/neo4j/transformations/core/inject/Neo4jCoreTransformationInjectSemaphoreNeighbor.java +++ /dev/null @@ -1,41 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2010-2015, Benedek Izso, Gabor Szarnyas, Istvan Rath and Daniel Varro - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Benedek Izso - initial API and implementation - * Gabor Szarnyas - initial API and implementation - *******************************************************************************/ -package hu.bme.mit.trainbenchmark.benchmark.neo4j.transformations.core.inject; - -import java.util.Collection; - -import org.neo4j.graphdb.Relationship; - -import hu.bme.mit.trainbenchmark.benchmark.neo4j.driver.Neo4jDriver; -import hu.bme.mit.trainbenchmark.benchmark.neo4j.matches.Neo4jSemaphoreNeighborInjectMatch; -import hu.bme.mit.trainbenchmark.benchmark.neo4j.transformations.Neo4jCoreTransformation; -import hu.bme.mit.trainbenchmark.neo4j.Neo4jConstants; - -public class Neo4jCoreTransformationInjectSemaphoreNeighbor extends Neo4jCoreTransformation<Neo4jSemaphoreNeighborInjectMatch> { - - public Neo4jCoreTransformationInjectSemaphoreNeighbor(final Neo4jDriver driver) { - super(driver); - } - - @Override - public void activate(final Collection<Neo4jSemaphoreNeighborInjectMatch> matches) { - for (final Neo4jSemaphoreNeighborInjectMatch match : matches) { - final Iterable<Relationship> entries = match.getRoute().getRelationships(Neo4jConstants.relationshipTypeEntry); - for (final Relationship entry : entries) { - if (entry.getEndNode().equals(match.getSemaphore())) { - entry.delete(); - } - } - } - } - -} diff --git a/trainbenchmark-tool-neo4j/src/main/java/hu/bme/mit/trainbenchmark/benchmark/neo4j/transformations/core/inject/Neo4jCoreTransformationInjectSwitchMonitored.java b/trainbenchmark-tool-neo4j/src/main/java/hu/bme/mit/trainbenchmark/benchmark/neo4j/transformations/core/inject/Neo4jCoreTransformationInjectSwitchMonitored.java deleted file mode 100644 index efaf57f60..000000000 --- a/trainbenchmark-tool-neo4j/src/main/java/hu/bme/mit/trainbenchmark/benchmark/neo4j/transformations/core/inject/Neo4jCoreTransformationInjectSwitchMonitored.java +++ /dev/null @@ -1,41 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2010-2015, Benedek Izso, Gabor Szarnyas, Istvan Rath and Daniel Varro - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Benedek Izso - initial API and implementation - * Gabor Szarnyas - initial API and implementation - *******************************************************************************/ -package hu.bme.mit.trainbenchmark.benchmark.neo4j.transformations.core.inject; - -import java.util.Collection; - -import org.neo4j.graphdb.Relationship; - -import hu.bme.mit.trainbenchmark.benchmark.neo4j.driver.Neo4jDriver; -import hu.bme.mit.trainbenchmark.benchmark.neo4j.matches.Neo4jSwitchMonitoredInjectMatch; -import hu.bme.mit.trainbenchmark.benchmark.neo4j.transformations.Neo4jCoreTransformation; -import hu.bme.mit.trainbenchmark.neo4j.Neo4jConstants; - -public class Neo4jCoreTransformationInjectSwitchMonitored - extends Neo4jCoreTransformation<Neo4jSwitchMonitoredInjectMatch> { - - public Neo4jCoreTransformationInjectSwitchMonitored(final Neo4jDriver driver) { - super(driver); - } - - @Override - public void activate(final Collection<Neo4jSwitchMonitoredInjectMatch> matches) { - for (final Neo4jSwitchMonitoredInjectMatch match : matches) { - final Iterable<Relationship> monitoredBys = match.getSw() - .getRelationships(Neo4jConstants.relationshipTypeMonitoredBy); - for (final Relationship monitoredBy : monitoredBys) { - monitoredBy.delete(); - } - } - } - -} diff --git a/trainbenchmark-tool-neo4j/src/main/java/hu/bme/mit/trainbenchmark/benchmark/neo4j/transformations/core/inject/Neo4jCoreTransformationInjectSwitchSet.java b/trainbenchmark-tool-neo4j/src/main/java/hu/bme/mit/trainbenchmark/benchmark/neo4j/transformations/core/inject/Neo4jCoreTransformationInjectSwitchSet.java deleted file mode 100644 index b7c61823b..000000000 --- a/trainbenchmark-tool-neo4j/src/main/java/hu/bme/mit/trainbenchmark/benchmark/neo4j/transformations/core/inject/Neo4jCoreTransformationInjectSwitchSet.java +++ /dev/null @@ -1,41 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2010-2015, Benedek Izso, Gabor Szarnyas, Istvan Rath and Daniel Varro - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Benedek Izso - initial API and implementation - * Gabor Szarnyas - initial API and implementation - *******************************************************************************/ -package hu.bme.mit.trainbenchmark.benchmark.neo4j.transformations.core.inject; - -import java.util.Collection; - -import org.neo4j.graphdb.Node; - -import hu.bme.mit.trainbenchmark.benchmark.neo4j.driver.Neo4jDriver; -import hu.bme.mit.trainbenchmark.benchmark.neo4j.matches.Neo4jSwitchSetInjectMatch; -import hu.bme.mit.trainbenchmark.benchmark.neo4j.transformations.Neo4jCoreTransformation; -import hu.bme.mit.trainbenchmark.constants.ModelConstants; -import hu.bme.mit.trainbenchmark.constants.Position; - -public class Neo4jCoreTransformationInjectSwitchSet extends Neo4jCoreTransformation<Neo4jSwitchSetInjectMatch> { - - public Neo4jCoreTransformationInjectSwitchSet(final Neo4jDriver driver) { - super(driver); - } - - @Override - public void activate(final Collection<Neo4jSwitchSetInjectMatch> matches) { - for (final Neo4jSwitchSetInjectMatch match : matches) { - final Node sw = match.getSw(); - final String currentPositionString = (String) sw.getProperty(ModelConstants.CURRENTPOSITION); - final Position currentPosition = Position.valueOf(currentPositionString); - final Position newCurrentPosition = Position.values()[(currentPosition.ordinal() + 1) % Position.values().length]; - sw.setProperty(ModelConstants.CURRENTPOSITION, newCurrentPosition.toString()); - } - } - -} diff --git a/trainbenchmark-tool-neo4j/src/main/java/hu/bme/mit/trainbenchmark/benchmark/neo4j/transformations/core/repair/Neo4jCoreTransformationRepairConnectedSegments.java b/trainbenchmark-tool-neo4j/src/main/java/hu/bme/mit/trainbenchmark/benchmark/neo4j/transformations/core/repair/Neo4jCoreTransformationRepairConnectedSegments.java deleted file mode 100644 index 967635a47..000000000 --- a/trainbenchmark-tool-neo4j/src/main/java/hu/bme/mit/trainbenchmark/benchmark/neo4j/transformations/core/repair/Neo4jCoreTransformationRepairConnectedSegments.java +++ /dev/null @@ -1,44 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2010-2015, Benedek Izso, Gabor Szarnyas, Istvan Rath and Daniel Varro - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Benedek Izso - initial API and implementation - * Gabor Szarnyas - initial API and implementation - *******************************************************************************/ -package hu.bme.mit.trainbenchmark.benchmark.neo4j.transformations.core.repair; - -import java.util.Collection; - -import org.neo4j.graphdb.Node; -import org.neo4j.graphdb.Relationship; - -import hu.bme.mit.trainbenchmark.benchmark.neo4j.driver.Neo4jDriver; -import hu.bme.mit.trainbenchmark.benchmark.neo4j.matches.Neo4jConnectedSegmentsMatch; -import hu.bme.mit.trainbenchmark.benchmark.neo4j.transformations.Neo4jCoreTransformation; -import hu.bme.mit.trainbenchmark.neo4j.Neo4jConstants; - -public class Neo4jCoreTransformationRepairConnectedSegments extends Neo4jCoreTransformation<Neo4jConnectedSegmentsMatch> { - - public Neo4jCoreTransformationRepairConnectedSegments(final Neo4jDriver driver) { - super(driver); - } - - @Override - public void activate(final Collection<Neo4jConnectedSegmentsMatch> matches) { - for (final Neo4jConnectedSegmentsMatch csm : matches) { - // delete segment2 with all its relationships - final Node segment2 = csm.getSegment2(); - for (final Relationship relationship : segment2.getRelationships()) { - relationship.delete(); - } - segment2.delete(); - // (segment1)-[:connectsTo]->(segment3) - csm.getSegment1().createRelationshipTo(csm.getSegment3(), Neo4jConstants.relationshipTypeConnectsTo); - } - } - -} diff --git a/trainbenchmark-tool-neo4j/src/main/java/hu/bme/mit/trainbenchmark/benchmark/neo4j/transformations/core/repair/Neo4jCoreTransformationRepairPosLength.java b/trainbenchmark-tool-neo4j/src/main/java/hu/bme/mit/trainbenchmark/benchmark/neo4j/transformations/core/repair/Neo4jCoreTransformationRepairPosLength.java deleted file mode 100644 index 1055a49f8..000000000 --- a/trainbenchmark-tool-neo4j/src/main/java/hu/bme/mit/trainbenchmark/benchmark/neo4j/transformations/core/repair/Neo4jCoreTransformationRepairPosLength.java +++ /dev/null @@ -1,43 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2010-2015, Benedek Izso, Gabor Szarnyas, Istvan Rath and Daniel Varro - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Benedek Izso - initial API and implementation - * Gabor Szarnyas - initial API and implementation - *******************************************************************************/ -package hu.bme.mit.trainbenchmark.benchmark.neo4j.transformations.core.repair; - -import java.util.Collection; - -import org.neo4j.graphdb.Node; -import org.neo4j.graphdb.NotFoundException; - -import hu.bme.mit.trainbenchmark.benchmark.neo4j.driver.Neo4jDriver; -import hu.bme.mit.trainbenchmark.benchmark.neo4j.matches.Neo4jPosLengthMatch; -import hu.bme.mit.trainbenchmark.benchmark.neo4j.transformations.Neo4jCoreTransformation; -import hu.bme.mit.trainbenchmark.constants.ModelConstants; - -public class Neo4jCoreTransformationRepairPosLength extends Neo4jCoreTransformation<Neo4jPosLengthMatch> { - - public Neo4jCoreTransformationRepairPosLength(final Neo4jDriver driver) { - super(driver); - } - - @Override - public void activate(final Collection<Neo4jPosLengthMatch> matches) { - for (final Neo4jPosLengthMatch plm : matches) { - final Node segment = plm.getSegment(); - try { - final Integer length = (Integer) segment.getProperty(ModelConstants.LENGTH); - segment.setProperty(ModelConstants.LENGTH, -length + 1); - } catch (final NotFoundException e) { - // do nothing (node has been removed) - } - } - } - -} diff --git a/trainbenchmark-tool-neo4j/src/main/java/hu/bme/mit/trainbenchmark/benchmark/neo4j/transformations/core/repair/Neo4jCoreTransformationRepairRouteSensor.java b/trainbenchmark-tool-neo4j/src/main/java/hu/bme/mit/trainbenchmark/benchmark/neo4j/transformations/core/repair/Neo4jCoreTransformationRepairRouteSensor.java deleted file mode 100644 index 52bfac5e0..000000000 --- a/trainbenchmark-tool-neo4j/src/main/java/hu/bme/mit/trainbenchmark/benchmark/neo4j/transformations/core/repair/Neo4jCoreTransformationRepairRouteSensor.java +++ /dev/null @@ -1,38 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2010-2015, Benedek Izso, Gabor Szarnyas, Istvan Rath and Daniel Varro - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Benedek Izso - initial API and implementation - * Gabor Szarnyas - initial API and implementation - *******************************************************************************/ -package hu.bme.mit.trainbenchmark.benchmark.neo4j.transformations.core.repair; - -import java.util.Collection; - -import org.neo4j.graphdb.Node; - -import hu.bme.mit.trainbenchmark.benchmark.neo4j.driver.Neo4jDriver; -import hu.bme.mit.trainbenchmark.benchmark.neo4j.matches.Neo4jRouteSensorMatch; -import hu.bme.mit.trainbenchmark.benchmark.neo4j.transformations.Neo4jCoreTransformation; -import hu.bme.mit.trainbenchmark.neo4j.Neo4jConstants; - -public class Neo4jCoreTransformationRepairRouteSensor extends Neo4jCoreTransformation<Neo4jRouteSensorMatch> { - - public Neo4jCoreTransformationRepairRouteSensor(final Neo4jDriver driver) { - super(driver); - } - - @Override - public void activate(final Collection<Neo4jRouteSensorMatch> matches) { - for (final Neo4jRouteSensorMatch rsm : matches) { - final Node route = rsm.getRoute(); - final Node sensor = rsm.getSensor(); - route.createRelationshipTo(sensor, Neo4jConstants.relationshipTypeRequires); - } - } - -} diff --git a/trainbenchmark-tool-neo4j/src/main/java/hu/bme/mit/trainbenchmark/benchmark/neo4j/transformations/core/repair/Neo4jCoreTransformationRepairSemaphoreNeighbor.java b/trainbenchmark-tool-neo4j/src/main/java/hu/bme/mit/trainbenchmark/benchmark/neo4j/transformations/core/repair/Neo4jCoreTransformationRepairSemaphoreNeighbor.java deleted file mode 100644 index c7aa0de2b..000000000 --- a/trainbenchmark-tool-neo4j/src/main/java/hu/bme/mit/trainbenchmark/benchmark/neo4j/transformations/core/repair/Neo4jCoreTransformationRepairSemaphoreNeighbor.java +++ /dev/null @@ -1,38 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2010-2015, Benedek Izso, Gabor Szarnyas, Istvan Rath and Daniel Varro - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Benedek Izso - initial API and implementation - * Gabor Szarnyas - initial API and implementation - *******************************************************************************/ -package hu.bme.mit.trainbenchmark.benchmark.neo4j.transformations.core.repair; - -import java.util.Collection; - -import org.neo4j.graphdb.Node; - -import hu.bme.mit.trainbenchmark.benchmark.neo4j.driver.Neo4jDriver; -import hu.bme.mit.trainbenchmark.benchmark.neo4j.matches.Neo4jSemaphoreNeighborMatch; -import hu.bme.mit.trainbenchmark.benchmark.neo4j.transformations.Neo4jCoreTransformation; -import hu.bme.mit.trainbenchmark.neo4j.Neo4jConstants; - -public class Neo4jCoreTransformationRepairSemaphoreNeighbor extends Neo4jCoreTransformation<Neo4jSemaphoreNeighborMatch> { - - public Neo4jCoreTransformationRepairSemaphoreNeighbor(final Neo4jDriver driver) { - super(driver); - } - - @Override - public void activate(final Collection<Neo4jSemaphoreNeighborMatch> matches) { - for (final Neo4jSemaphoreNeighborMatch snm : matches) { - final Node semaphore = snm.getSemaphore(); - final Node route2 = snm.getRoute2(); - route2.createRelationshipTo(semaphore, Neo4jConstants.relationshipTypeEntry); - } - } - -} diff --git a/trainbenchmark-tool-neo4j/src/main/java/hu/bme/mit/trainbenchmark/benchmark/neo4j/transformations/core/repair/Neo4jCoreTransformationRepairSwitchMonitored.java b/trainbenchmark-tool-neo4j/src/main/java/hu/bme/mit/trainbenchmark/benchmark/neo4j/transformations/core/repair/Neo4jCoreTransformationRepairSwitchMonitored.java deleted file mode 100644 index 4e4aa2719..000000000 --- a/trainbenchmark-tool-neo4j/src/main/java/hu/bme/mit/trainbenchmark/benchmark/neo4j/transformations/core/repair/Neo4jCoreTransformationRepairSwitchMonitored.java +++ /dev/null @@ -1,38 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2010-2015, Benedek Izso, Gabor Szarnyas, Istvan Rath and Daniel Varro - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Benedek Izso - initial API and implementation - * Gabor Szarnyas - initial API and implementation - *******************************************************************************/ -package hu.bme.mit.trainbenchmark.benchmark.neo4j.transformations.core.repair; - -import java.util.Collection; - -import org.neo4j.graphdb.Node; - -import hu.bme.mit.trainbenchmark.benchmark.neo4j.driver.Neo4jDriver; -import hu.bme.mit.trainbenchmark.benchmark.neo4j.matches.Neo4jSwitchMonitoredMatch; -import hu.bme.mit.trainbenchmark.benchmark.neo4j.transformations.Neo4jCoreTransformation; -import hu.bme.mit.trainbenchmark.neo4j.Neo4jConstants; - -public class Neo4jCoreTransformationRepairSwitchMonitored extends Neo4jCoreTransformation<Neo4jSwitchMonitoredMatch> { - - public Neo4jCoreTransformationRepairSwitchMonitored(final Neo4jDriver driver) { - super(driver); - } - - @Override - public void activate(final Collection<Neo4jSwitchMonitoredMatch> matches) { - for (final Neo4jSwitchMonitoredMatch ssnm : matches) { - final Node sw = ssnm.getSw(); - final Node sensor = driver.getGraphDb().createNode(Neo4jConstants.labelSensor); - sw.createRelationshipTo(sensor, Neo4jConstants.relationshipTypeMonitoredBy); - } - } - -} diff --git a/trainbenchmark-tool-neo4j/src/main/java/hu/bme/mit/trainbenchmark/benchmark/neo4j/transformations/core/repair/Neo4jCoreTransformationRepairSwitchSet.java b/trainbenchmark-tool-neo4j/src/main/java/hu/bme/mit/trainbenchmark/benchmark/neo4j/transformations/core/repair/Neo4jCoreTransformationRepairSwitchSet.java deleted file mode 100644 index 79ec054df..000000000 --- a/trainbenchmark-tool-neo4j/src/main/java/hu/bme/mit/trainbenchmark/benchmark/neo4j/transformations/core/repair/Neo4jCoreTransformationRepairSwitchSet.java +++ /dev/null @@ -1,39 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2010-2015, Benedek Izso, Gabor Szarnyas, Istvan Rath and Daniel Varro - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Benedek Izso - initial API and implementation - * Gabor Szarnyas - initial API and implementation - *******************************************************************************/ -package hu.bme.mit.trainbenchmark.benchmark.neo4j.transformations.core.repair; - -import static hu.bme.mit.trainbenchmark.constants.ModelConstants.CURRENTPOSITION; - -import java.util.Collection; - -import org.neo4j.graphdb.Node; - -import hu.bme.mit.trainbenchmark.benchmark.neo4j.driver.Neo4jDriver; -import hu.bme.mit.trainbenchmark.benchmark.neo4j.matches.Neo4jSwitchSetMatch; -import hu.bme.mit.trainbenchmark.benchmark.neo4j.transformations.Neo4jCoreTransformation; - -public class Neo4jCoreTransformationRepairSwitchSet extends Neo4jCoreTransformation<Neo4jSwitchSetMatch> { - - public Neo4jCoreTransformationRepairSwitchSet(final Neo4jDriver driver) { - super(driver); - } - - @Override - public void activate(final Collection<Neo4jSwitchSetMatch> matches) { - for (final Neo4jSwitchSetMatch sstm : matches) { - final Node sw = sstm.getSw(); - final String position = sstm.getPosition(); - sw.setProperty(CURRENTPOSITION, position); - } - } - -} diff --git a/trainbenchmark-tool-neo4j/src/main/java/hu/bme/mit/trainbenchmark/benchmark/neo4j/transformations/cypher/inject/Neo4jCypherTransformationInjectConnectedSegments.java b/trainbenchmark-tool-neo4j/src/main/java/hu/bme/mit/trainbenchmark/benchmark/neo4j/transformations/cypher/inject/Neo4jCypherTransformationInjectConnectedSegments.java deleted file mode 100644 index b7174ef64..000000000 --- a/trainbenchmark-tool-neo4j/src/main/java/hu/bme/mit/trainbenchmark/benchmark/neo4j/transformations/cypher/inject/Neo4jCypherTransformationInjectConnectedSegments.java +++ /dev/null @@ -1,46 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2010-2015, Benedek Izso, Gabor Szarnyas, Istvan Rath and Daniel Varro - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Benedek Izso - initial API and implementation - * Gabor Szarnyas - initial API and implementation - *******************************************************************************/ -package hu.bme.mit.trainbenchmark.benchmark.neo4j.transformations.cypher.inject; - -import com.google.common.collect.ImmutableMap; -import hu.bme.mit.trainbenchmark.benchmark.neo4j.driver.Neo4jDriver; -import hu.bme.mit.trainbenchmark.benchmark.neo4j.matches.Neo4jConnectedSegmentsInjectMatch; -import hu.bme.mit.trainbenchmark.benchmark.neo4j.transformations.Neo4jCypherTransformation; -import hu.bme.mit.trainbenchmark.constants.QueryConstants; -import hu.bme.mit.trainbenchmark.constants.RailwayOperation; -import hu.bme.mit.trainbenchmark.constants.TrainBenchmarkConstants; -import hu.bme.mit.trainbenchmark.neo4j.Neo4jConstants; - -import java.io.IOException; -import java.util.Collection; -import java.util.Map; - -public class Neo4jCypherTransformationInjectConnectedSegments extends Neo4jCypherTransformation<Neo4jConnectedSegmentsInjectMatch> { - - public Neo4jCypherTransformationInjectConnectedSegments(final Neo4jDriver driver, final String workspaceDir) throws IOException { - super(driver, workspaceDir, RailwayOperation.CONNECTEDSEGMENTS_INJECT); - } - - @Override - public void activate(final Collection<Neo4jConnectedSegmentsInjectMatch> matches) throws IOException { - for (final Neo4jConnectedSegmentsInjectMatch match : matches) { - final Map<String, Object> parameters = ImmutableMap.of( // - QueryConstants.VAR_SENSOR, match.getSensor().getProperty(Neo4jConstants.ID), // - QueryConstants.VAR_SEGMENT1, match.getSegment1().getProperty(Neo4jConstants.ID), // - QueryConstants.VAR_SEGMENT3, match.getSegment3().getProperty(Neo4jConstants.ID), // - QueryConstants.VAR_LENGTH, TrainBenchmarkConstants.DEFAULT_SEGMENT_LENGTH // - ); - driver.runTransformation(transformationDefinition, parameters); - } - } - -} diff --git a/trainbenchmark-tool-neo4j/src/main/java/hu/bme/mit/trainbenchmark/benchmark/neo4j/transformations/cypher/inject/Neo4jCypherTransformationInjectPosLength.java b/trainbenchmark-tool-neo4j/src/main/java/hu/bme/mit/trainbenchmark/benchmark/neo4j/transformations/cypher/inject/Neo4jCypherTransformationInjectPosLength.java deleted file mode 100644 index 590097223..000000000 --- a/trainbenchmark-tool-neo4j/src/main/java/hu/bme/mit/trainbenchmark/benchmark/neo4j/transformations/cypher/inject/Neo4jCypherTransformationInjectPosLength.java +++ /dev/null @@ -1,42 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2010-2015, Benedek Izso, Gabor Szarnyas, Istvan Rath and Daniel Varro - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Benedek Izso - initial API and implementation - * Gabor Szarnyas - initial API and implementation - *******************************************************************************/ -package hu.bme.mit.trainbenchmark.benchmark.neo4j.transformations.cypher.inject; - -import com.google.common.collect.ImmutableMap; -import hu.bme.mit.trainbenchmark.benchmark.neo4j.driver.Neo4jDriver; -import hu.bme.mit.trainbenchmark.benchmark.neo4j.matches.Neo4jPosLengthInjectMatch; -import hu.bme.mit.trainbenchmark.benchmark.neo4j.transformations.Neo4jCypherTransformation; -import hu.bme.mit.trainbenchmark.constants.QueryConstants; -import hu.bme.mit.trainbenchmark.constants.RailwayOperation; -import hu.bme.mit.trainbenchmark.neo4j.Neo4jConstants; - -import java.io.IOException; -import java.util.Collection; -import java.util.Map; - -public class Neo4jCypherTransformationInjectPosLength extends Neo4jCypherTransformation<Neo4jPosLengthInjectMatch> { - - public Neo4jCypherTransformationInjectPosLength(final Neo4jDriver driver, final String workspaceDir) throws IOException { - super(driver, workspaceDir, RailwayOperation.POSLENGTH_INJECT); - } - - @Override - public void activate(final Collection<Neo4jPosLengthInjectMatch> matches) throws IOException { - for (final Neo4jPosLengthInjectMatch match : matches) { - final Map<String, Object> parameters = ImmutableMap.of( // - QueryConstants.VAR_SEGMENT, match.getSegment().getProperty(Neo4jConstants.ID) // - ); - driver.runTransformation(transformationDefinition, parameters); - } - } - -} diff --git a/trainbenchmark-tool-neo4j/src/main/java/hu/bme/mit/trainbenchmark/benchmark/neo4j/transformations/cypher/inject/Neo4jCypherTransformationInjectRouteSensor.java b/trainbenchmark-tool-neo4j/src/main/java/hu/bme/mit/trainbenchmark/benchmark/neo4j/transformations/cypher/inject/Neo4jCypherTransformationInjectRouteSensor.java deleted file mode 100644 index 5b41bd7a9..000000000 --- a/trainbenchmark-tool-neo4j/src/main/java/hu/bme/mit/trainbenchmark/benchmark/neo4j/transformations/cypher/inject/Neo4jCypherTransformationInjectRouteSensor.java +++ /dev/null @@ -1,43 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2010-2015, Benedek Izso, Gabor Szarnyas, Istvan Rath and Daniel Varro - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Benedek Izso - initial API and implementation - * Gabor Szarnyas - initial API and implementation - *******************************************************************************/ -package hu.bme.mit.trainbenchmark.benchmark.neo4j.transformations.cypher.inject; - -import com.google.common.collect.ImmutableMap; -import hu.bme.mit.trainbenchmark.benchmark.neo4j.driver.Neo4jDriver; -import hu.bme.mit.trainbenchmark.benchmark.neo4j.matches.Neo4jRouteSensorInjectMatch; -import hu.bme.mit.trainbenchmark.benchmark.neo4j.transformations.Neo4jCypherTransformation; -import hu.bme.mit.trainbenchmark.constants.QueryConstants; -import hu.bme.mit.trainbenchmark.constants.RailwayOperation; -import hu.bme.mit.trainbenchmark.neo4j.Neo4jConstants; - -import java.io.IOException; -import java.util.Collection; -import java.util.Map; - -public class Neo4jCypherTransformationInjectRouteSensor extends Neo4jCypherTransformation<Neo4jRouteSensorInjectMatch> { - - public Neo4jCypherTransformationInjectRouteSensor(final Neo4jDriver driver, final String workspaceDir) throws IOException { - super(driver, workspaceDir, RailwayOperation.ROUTESENSOR_INJECT); - } - - @Override - public void activate(final Collection<Neo4jRouteSensorInjectMatch> matches) throws IOException { - for (final Neo4jRouteSensorInjectMatch match : matches) { - final Map<String, Object> parameters = ImmutableMap.of( // - QueryConstants.VAR_ROUTE, match.getRoute().getProperty(Neo4jConstants.ID), // - QueryConstants.VAR_SENSOR, match.getSensor().getProperty(Neo4jConstants.ID) // - ); - driver.runTransformation(transformationDefinition, parameters); - } - } - -} diff --git a/trainbenchmark-tool-neo4j/src/main/java/hu/bme/mit/trainbenchmark/benchmark/neo4j/transformations/cypher/inject/Neo4jCypherTransformationInjectSemaphoreNeighbor.java b/trainbenchmark-tool-neo4j/src/main/java/hu/bme/mit/trainbenchmark/benchmark/neo4j/transformations/cypher/inject/Neo4jCypherTransformationInjectSemaphoreNeighbor.java deleted file mode 100644 index 3bd8499ec..000000000 --- a/trainbenchmark-tool-neo4j/src/main/java/hu/bme/mit/trainbenchmark/benchmark/neo4j/transformations/cypher/inject/Neo4jCypherTransformationInjectSemaphoreNeighbor.java +++ /dev/null @@ -1,46 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2010-2015, Benedek Izso, Gabor Szarnyas, Istvan Rath and Daniel Varro - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Benedek Izso - initial API and implementation - * Gabor Szarnyas - initial API and implementation - *******************************************************************************/ -package hu.bme.mit.trainbenchmark.benchmark.neo4j.transformations.cypher.inject; - -import com.google.common.collect.ImmutableMap; -import hu.bme.mit.trainbenchmark.benchmark.neo4j.driver.Neo4jDriver; -import hu.bme.mit.trainbenchmark.benchmark.neo4j.matches.Neo4jSemaphoreNeighborInjectMatch; -import hu.bme.mit.trainbenchmark.benchmark.neo4j.transformations.Neo4jCypherTransformation; -import hu.bme.mit.trainbenchmark.constants.QueryConstants; -import hu.bme.mit.trainbenchmark.constants.RailwayOperation; -import hu.bme.mit.trainbenchmark.neo4j.Neo4jConstants; - -import java.io.IOException; -import java.util.Collection; -import java.util.Map; - -public class Neo4jCypherTransformationInjectSemaphoreNeighbor - extends Neo4jCypherTransformation<Neo4jSemaphoreNeighborInjectMatch> { - - public Neo4jCypherTransformationInjectSemaphoreNeighbor(final Neo4jDriver driver, final String workspaceDir) - throws IOException { - super(driver, workspaceDir, RailwayOperation.SEMAPHORENEIGHBOR_INJECT); - } - - @Override - public void activate(final Collection<Neo4jSemaphoreNeighborInjectMatch> matches) throws IOException { - for (final Neo4jSemaphoreNeighborInjectMatch match : matches) { - final Map<String, Object> parameters = ImmutableMap.of( // - QueryConstants.VAR_ROUTE, match.getRoute().getProperty(Neo4jConstants.ID), // - QueryConstants.VAR_SEMAPHORE, match.getSemaphore().getProperty(Neo4jConstants.ID) // - ); - - driver.runTransformation(transformationDefinition, parameters); - } - } - -} diff --git a/trainbenchmark-tool-neo4j/src/main/java/hu/bme/mit/trainbenchmark/benchmark/neo4j/transformations/cypher/inject/Neo4jCypherTransformationInjectSwitchMonitored.java b/trainbenchmark-tool-neo4j/src/main/java/hu/bme/mit/trainbenchmark/benchmark/neo4j/transformations/cypher/inject/Neo4jCypherTransformationInjectSwitchMonitored.java deleted file mode 100644 index cba03fc7f..000000000 --- a/trainbenchmark-tool-neo4j/src/main/java/hu/bme/mit/trainbenchmark/benchmark/neo4j/transformations/cypher/inject/Neo4jCypherTransformationInjectSwitchMonitored.java +++ /dev/null @@ -1,44 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2010-2015, Benedek Izso, Gabor Szarnyas, Istvan Rath and Daniel Varro - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Benedek Izso - initial API and implementation - * Gabor Szarnyas - initial API and implementation - *******************************************************************************/ -package hu.bme.mit.trainbenchmark.benchmark.neo4j.transformations.cypher.inject; - -import com.google.common.collect.ImmutableMap; -import hu.bme.mit.trainbenchmark.benchmark.neo4j.driver.Neo4jDriver; -import hu.bme.mit.trainbenchmark.benchmark.neo4j.matches.Neo4jSwitchMonitoredInjectMatch; -import hu.bme.mit.trainbenchmark.benchmark.neo4j.transformations.Neo4jCypherTransformation; -import hu.bme.mit.trainbenchmark.constants.QueryConstants; -import hu.bme.mit.trainbenchmark.constants.RailwayOperation; -import hu.bme.mit.trainbenchmark.neo4j.Neo4jConstants; - -import java.io.IOException; -import java.util.Collection; -import java.util.Map; - -public class Neo4jCypherTransformationInjectSwitchMonitored - extends Neo4jCypherTransformation<Neo4jSwitchMonitoredInjectMatch> { - - public Neo4jCypherTransformationInjectSwitchMonitored(final Neo4jDriver driver, final String workspaceDir) - throws IOException { - super(driver, workspaceDir, RailwayOperation.SWITCHMONITORED_INJECT); - } - - @Override - public void activate(final Collection<Neo4jSwitchMonitoredInjectMatch> matches) throws IOException { - for (final Neo4jSwitchMonitoredInjectMatch match : matches) { - final Map<String, Object> parameters = ImmutableMap.of( // - QueryConstants.VAR_SW, match.getSw().getProperty(Neo4jConstants.ID) // - ); - driver.runTransformation(transformationDefinition, parameters); - } - } - -} diff --git a/trainbenchmark-tool-neo4j/src/main/java/hu/bme/mit/trainbenchmark/benchmark/neo4j/transformations/cypher/inject/Neo4jCypherTransformationInjectSwitchSet.java b/trainbenchmark-tool-neo4j/src/main/java/hu/bme/mit/trainbenchmark/benchmark/neo4j/transformations/cypher/inject/Neo4jCypherTransformationInjectSwitchSet.java deleted file mode 100644 index d15ea121b..000000000 --- a/trainbenchmark-tool-neo4j/src/main/java/hu/bme/mit/trainbenchmark/benchmark/neo4j/transformations/cypher/inject/Neo4jCypherTransformationInjectSwitchSet.java +++ /dev/null @@ -1,49 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2010-2015, Benedek Izso, Gabor Szarnyas, Istvan Rath and Daniel Varro - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Benedek Izso - initial API and implementation - * Gabor Szarnyas - initial API and implementation - *******************************************************************************/ -package hu.bme.mit.trainbenchmark.benchmark.neo4j.transformations.cypher.inject; - -import com.google.common.collect.ImmutableMap; -import hu.bme.mit.trainbenchmark.benchmark.neo4j.driver.Neo4jDriver; -import hu.bme.mit.trainbenchmark.benchmark.neo4j.matches.Neo4jSwitchSetInjectMatch; -import hu.bme.mit.trainbenchmark.benchmark.neo4j.transformations.Neo4jCypherTransformation; -import hu.bme.mit.trainbenchmark.constants.ModelConstants; -import hu.bme.mit.trainbenchmark.constants.Position; -import hu.bme.mit.trainbenchmark.constants.QueryConstants; -import hu.bme.mit.trainbenchmark.constants.RailwayOperation; -import hu.bme.mit.trainbenchmark.neo4j.Neo4jConstants; - -import java.io.IOException; -import java.util.Collection; -import java.util.Map; - -public class Neo4jCypherTransformationInjectSwitchSet extends Neo4jCypherTransformation<Neo4jSwitchSetInjectMatch> { - - public Neo4jCypherTransformationInjectSwitchSet(final Neo4jDriver driver, final String workspaceDir) throws IOException { - super(driver, workspaceDir, RailwayOperation.SWITCHSET_INJECT); - } - - @Override - public void activate(final Collection<Neo4jSwitchSetInjectMatch> matches) throws IOException { - for (final Neo4jSwitchSetInjectMatch match : matches) { - final String currentPositionString = (String) match.getSw().getProperty(ModelConstants.CURRENTPOSITION); - final Position currentPosition = Position.valueOf(currentPositionString); - final Position newCurrentPosition = Position.values()[(currentPosition.ordinal() + 1) % Position.values().length]; - - final Map<String, Object> parameters = ImmutableMap.of( // - QueryConstants.VAR_SW, match.getSw().getProperty(Neo4jConstants.ID), // - QueryConstants.VAR_CURRENTPOSITION, newCurrentPosition.toString() - ); - driver.runTransformation(transformationDefinition, parameters); - } - } - -} diff --git a/trainbenchmark-tool-neo4j/src/main/java/hu/bme/mit/trainbenchmark/benchmark/neo4j/transformations/cypher/repair/Neo4jCypherTransformationRepairConnectedSegments.java b/trainbenchmark-tool-neo4j/src/main/java/hu/bme/mit/trainbenchmark/benchmark/neo4j/transformations/cypher/repair/Neo4jCypherTransformationRepairConnectedSegments.java deleted file mode 100644 index 3b5706756..000000000 --- a/trainbenchmark-tool-neo4j/src/main/java/hu/bme/mit/trainbenchmark/benchmark/neo4j/transformations/cypher/repair/Neo4jCypherTransformationRepairConnectedSegments.java +++ /dev/null @@ -1,42 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2010-2015, Benedek Izso, Gabor Szarnyas, Istvan Rath and Daniel Varro - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Benedek Izso - initial API and implementation - * Gabor Szarnyas - initial API and implementation - *******************************************************************************/ -package hu.bme.mit.trainbenchmark.benchmark.neo4j.transformations.cypher.repair; - -import com.google.common.collect.ImmutableMap; -import hu.bme.mit.trainbenchmark.benchmark.neo4j.driver.Neo4jDriver; -import hu.bme.mit.trainbenchmark.benchmark.neo4j.matches.Neo4jConnectedSegmentsMatch; -import hu.bme.mit.trainbenchmark.benchmark.neo4j.transformations.Neo4jCypherTransformation; -import hu.bme.mit.trainbenchmark.constants.QueryConstants; -import hu.bme.mit.trainbenchmark.constants.RailwayOperation; -import hu.bme.mit.trainbenchmark.neo4j.Neo4jConstants; - -import java.io.IOException; -import java.util.Collection; -import java.util.Map; - -public class Neo4jCypherTransformationRepairConnectedSegments extends Neo4jCypherTransformation<Neo4jConnectedSegmentsMatch> { - - public Neo4jCypherTransformationRepairConnectedSegments(final Neo4jDriver driver, final String workspaceDir) throws IOException { - super(driver, workspaceDir, RailwayOperation.CONNECTEDSEGMENTS_REPAIR); - } - - @Override - public void activate(final Collection<Neo4jConnectedSegmentsMatch> matches) throws IOException { - for (final Neo4jConnectedSegmentsMatch match : matches) { - final Map<String, Object> parameters = ImmutableMap.of( // - QueryConstants.VAR_SEGMENT2, match.getSegment2().getProperty(Neo4jConstants.ID) // - ); - driver.runTransformation(transformationDefinition, parameters); - } - } - -} diff --git a/trainbenchmark-tool-neo4j/src/main/java/hu/bme/mit/trainbenchmark/benchmark/neo4j/transformations/cypher/repair/Neo4jCypherTransformationRepairPosLength.java b/trainbenchmark-tool-neo4j/src/main/java/hu/bme/mit/trainbenchmark/benchmark/neo4j/transformations/cypher/repair/Neo4jCypherTransformationRepairPosLength.java deleted file mode 100644 index baa86ec4d..000000000 --- a/trainbenchmark-tool-neo4j/src/main/java/hu/bme/mit/trainbenchmark/benchmark/neo4j/transformations/cypher/repair/Neo4jCypherTransformationRepairPosLength.java +++ /dev/null @@ -1,47 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2010-2015, Benedek Izso, Gabor Szarnyas, Istvan Rath and Daniel Varro - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Benedek Izso - initial API and implementation - * Gabor Szarnyas - initial API and implementation - *******************************************************************************/ -package hu.bme.mit.trainbenchmark.benchmark.neo4j.transformations.cypher.repair; - -import com.google.common.collect.ImmutableMap; -import hu.bme.mit.trainbenchmark.benchmark.neo4j.driver.Neo4jDriver; -import hu.bme.mit.trainbenchmark.benchmark.neo4j.matches.Neo4jPosLengthMatch; -import hu.bme.mit.trainbenchmark.benchmark.neo4j.transformations.Neo4jCypherTransformation; -import hu.bme.mit.trainbenchmark.constants.QueryConstants; -import hu.bme.mit.trainbenchmark.constants.RailwayOperation; -import hu.bme.mit.trainbenchmark.neo4j.Neo4jConstants; -import org.neo4j.graphdb.NotFoundException; - -import java.io.IOException; -import java.util.Collection; -import java.util.Map; - -public class Neo4jCypherTransformationRepairPosLength extends Neo4jCypherTransformation<Neo4jPosLengthMatch> { - - public Neo4jCypherTransformationRepairPosLength(final Neo4jDriver driver, final String workspaceDir) throws IOException { - super(driver, workspaceDir, RailwayOperation.POSLENGTH_REPAIR); - } - - @Override - public void activate(final Collection<Neo4jPosLengthMatch> matches) throws IOException { - for (final Neo4jPosLengthMatch match : matches) { - try { - final Map<String, Object> parameters = ImmutableMap.of( // - QueryConstants.VAR_SEGMENT, match.getSegment().getProperty(Neo4jConstants.ID) // - ); - driver.runTransformation(transformationDefinition, parameters); - } catch (final NotFoundException e) { - // do nothing (node has been removed) - } - } - } - -} diff --git a/trainbenchmark-tool-neo4j/src/main/java/hu/bme/mit/trainbenchmark/benchmark/neo4j/transformations/cypher/repair/Neo4jCypherTransformationRepairRouteSensor.java b/trainbenchmark-tool-neo4j/src/main/java/hu/bme/mit/trainbenchmark/benchmark/neo4j/transformations/cypher/repair/Neo4jCypherTransformationRepairRouteSensor.java deleted file mode 100644 index e44c31076..000000000 --- a/trainbenchmark-tool-neo4j/src/main/java/hu/bme/mit/trainbenchmark/benchmark/neo4j/transformations/cypher/repair/Neo4jCypherTransformationRepairRouteSensor.java +++ /dev/null @@ -1,43 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2010-2015, Benedek Izso, Gabor Szarnyas, Istvan Rath and Daniel Varro - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Benedek Izso - initial API and implementation - * Gabor Szarnyas - initial API and implementation - *******************************************************************************/ -package hu.bme.mit.trainbenchmark.benchmark.neo4j.transformations.cypher.repair; - -import com.google.common.collect.ImmutableMap; -import hu.bme.mit.trainbenchmark.benchmark.neo4j.driver.Neo4jDriver; -import hu.bme.mit.trainbenchmark.benchmark.neo4j.matches.Neo4jRouteSensorMatch; -import hu.bme.mit.trainbenchmark.benchmark.neo4j.transformations.Neo4jCypherTransformation; -import hu.bme.mit.trainbenchmark.constants.QueryConstants; -import hu.bme.mit.trainbenchmark.constants.RailwayOperation; -import hu.bme.mit.trainbenchmark.neo4j.Neo4jConstants; - -import java.io.IOException; -import java.util.Collection; -import java.util.Map; - -public class Neo4jCypherTransformationRepairRouteSensor extends Neo4jCypherTransformation<Neo4jRouteSensorMatch> { - - public Neo4jCypherTransformationRepairRouteSensor(final Neo4jDriver driver, final String workspaceDir) throws IOException { - super(driver, workspaceDir, RailwayOperation.ROUTESENSOR_REPAIR); - } - - @Override - public void activate(final Collection<Neo4jRouteSensorMatch> matches) throws IOException { - for (final Neo4jRouteSensorMatch match : matches) { - final Map<String, Object> parameters = ImmutableMap.of(// - QueryConstants.VAR_ROUTE, match.getRoute().getProperty(Neo4jConstants.ID), // - QueryConstants.VAR_SENSOR, match.getSensor().getProperty(Neo4jConstants.ID) // - ); - driver.runTransformation(transformationDefinition, parameters); - } - } - -} diff --git a/trainbenchmark-tool-neo4j/src/main/java/hu/bme/mit/trainbenchmark/benchmark/neo4j/transformations/cypher/repair/Neo4jCypherTransformationRepairSemaphoreNeighbor.java b/trainbenchmark-tool-neo4j/src/main/java/hu/bme/mit/trainbenchmark/benchmark/neo4j/transformations/cypher/repair/Neo4jCypherTransformationRepairSemaphoreNeighbor.java deleted file mode 100644 index 04ee2cd56..000000000 --- a/trainbenchmark-tool-neo4j/src/main/java/hu/bme/mit/trainbenchmark/benchmark/neo4j/transformations/cypher/repair/Neo4jCypherTransformationRepairSemaphoreNeighbor.java +++ /dev/null @@ -1,43 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2010-2015, Benedek Izso, Gabor Szarnyas, Istvan Rath and Daniel Varro - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Benedek Izso - initial API and implementation - * Gabor Szarnyas - initial API and implementation - *******************************************************************************/ -package hu.bme.mit.trainbenchmark.benchmark.neo4j.transformations.cypher.repair; - -import com.google.common.collect.ImmutableMap; -import hu.bme.mit.trainbenchmark.benchmark.neo4j.driver.Neo4jDriver; -import hu.bme.mit.trainbenchmark.benchmark.neo4j.matches.Neo4jSemaphoreNeighborMatch; -import hu.bme.mit.trainbenchmark.benchmark.neo4j.transformations.Neo4jCypherTransformation; -import hu.bme.mit.trainbenchmark.constants.QueryConstants; -import hu.bme.mit.trainbenchmark.constants.RailwayOperation; -import hu.bme.mit.trainbenchmark.neo4j.Neo4jConstants; - -import java.io.IOException; -import java.util.Collection; -import java.util.Map; - -public class Neo4jCypherTransformationRepairSemaphoreNeighbor extends Neo4jCypherTransformation<Neo4jSemaphoreNeighborMatch> { - - public Neo4jCypherTransformationRepairSemaphoreNeighbor(final Neo4jDriver driver, final String workspaceDir) throws IOException { - super(driver, workspaceDir, RailwayOperation.SEMAPHORENEIGHBOR_REPAIR); - } - - @Override - public void activate(final Collection<Neo4jSemaphoreNeighborMatch> matches) throws IOException { - for (final Neo4jSemaphoreNeighborMatch match : matches) { - final Map<String, Object> parameters = ImmutableMap.of(// - QueryConstants.VAR_ROUTE2, match.getRoute2().getProperty(Neo4jConstants.ID), // - QueryConstants.VAR_SEMAPHORE, match.getSemaphore().getProperty(Neo4jConstants.ID) // - ); - driver.runTransformation(transformationDefinition, parameters); - } - } - -} diff --git a/trainbenchmark-tool-neo4j/src/main/java/hu/bme/mit/trainbenchmark/benchmark/neo4j/transformations/cypher/repair/Neo4jCypherTransformationRepairSwitchMonitored.java b/trainbenchmark-tool-neo4j/src/main/java/hu/bme/mit/trainbenchmark/benchmark/neo4j/transformations/cypher/repair/Neo4jCypherTransformationRepairSwitchMonitored.java deleted file mode 100644 index 454f566f4..000000000 --- a/trainbenchmark-tool-neo4j/src/main/java/hu/bme/mit/trainbenchmark/benchmark/neo4j/transformations/cypher/repair/Neo4jCypherTransformationRepairSwitchMonitored.java +++ /dev/null @@ -1,42 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2010-2015, Benedek Izso, Gabor Szarnyas, Istvan Rath and Daniel Varro - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Benedek Izso - initial API and implementation - * Gabor Szarnyas - initial API and implementation - *******************************************************************************/ -package hu.bme.mit.trainbenchmark.benchmark.neo4j.transformations.cypher.repair; - -import com.google.common.collect.ImmutableMap; -import hu.bme.mit.trainbenchmark.benchmark.neo4j.driver.Neo4jDriver; -import hu.bme.mit.trainbenchmark.benchmark.neo4j.matches.Neo4jSwitchMonitoredMatch; -import hu.bme.mit.trainbenchmark.benchmark.neo4j.transformations.Neo4jCypherTransformation; -import hu.bme.mit.trainbenchmark.constants.QueryConstants; -import hu.bme.mit.trainbenchmark.constants.RailwayOperation; -import hu.bme.mit.trainbenchmark.neo4j.Neo4jConstants; - -import java.io.IOException; -import java.util.Collection; -import java.util.Map; - -public class Neo4jCypherTransformationRepairSwitchMonitored extends Neo4jCypherTransformation<Neo4jSwitchMonitoredMatch> { - - public Neo4jCypherTransformationRepairSwitchMonitored(final Neo4jDriver driver, final String workspaceDir) throws IOException { - super(driver, workspaceDir, RailwayOperation.SWITCHMONITORED_REPAIR); - } - - @Override - public void activate(final Collection<Neo4jSwitchMonitoredMatch> matches) throws IOException { - for (final Neo4jSwitchMonitoredMatch match : matches) { - final Map<String, Object> parameters = ImmutableMap.of( // - QueryConstants.VAR_SW, match.getSw().getProperty(Neo4jConstants.ID) // - ); - driver.runTransformation(transformationDefinition, parameters); - } - } - -} diff --git a/trainbenchmark-tool-neo4j/src/main/java/hu/bme/mit/trainbenchmark/benchmark/neo4j/transformations/cypher/repair/Neo4jCypherTransformationRepairSwitchSet.java b/trainbenchmark-tool-neo4j/src/main/java/hu/bme/mit/trainbenchmark/benchmark/neo4j/transformations/cypher/repair/Neo4jCypherTransformationRepairSwitchSet.java deleted file mode 100644 index 9cf2c68f1..000000000 --- a/trainbenchmark-tool-neo4j/src/main/java/hu/bme/mit/trainbenchmark/benchmark/neo4j/transformations/cypher/repair/Neo4jCypherTransformationRepairSwitchSet.java +++ /dev/null @@ -1,43 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2010-2015, Benedek Izso, Gabor Szarnyas, Istvan Rath and Daniel Varro - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Benedek Izso - initial API and implementation - * Gabor Szarnyas - initial API and implementation - *******************************************************************************/ -package hu.bme.mit.trainbenchmark.benchmark.neo4j.transformations.cypher.repair; - -import com.google.common.collect.ImmutableMap; -import hu.bme.mit.trainbenchmark.benchmark.neo4j.driver.Neo4jDriver; -import hu.bme.mit.trainbenchmark.benchmark.neo4j.matches.Neo4jSwitchSetMatch; -import hu.bme.mit.trainbenchmark.benchmark.neo4j.transformations.Neo4jCypherTransformation; -import hu.bme.mit.trainbenchmark.constants.QueryConstants; -import hu.bme.mit.trainbenchmark.constants.RailwayOperation; -import hu.bme.mit.trainbenchmark.neo4j.Neo4jConstants; - -import java.io.IOException; -import java.util.Collection; -import java.util.Map; - -public class Neo4jCypherTransformationRepairSwitchSet extends Neo4jCypherTransformation<Neo4jSwitchSetMatch> { - - public Neo4jCypherTransformationRepairSwitchSet(final Neo4jDriver driver, final String workspaceDir) throws IOException { - super(driver, workspaceDir, RailwayOperation.SWITCHSET_REPAIR); - } - - @Override - public void activate(final Collection<Neo4jSwitchSetMatch> matches) throws IOException { - for (final Neo4jSwitchSetMatch match : matches) { - final Map<String, Object> parameters = ImmutableMap.of( // - QueryConstants.VAR_SW, match.getSw().getProperty(Neo4jConstants.ID), // - QueryConstants.VAR_SWP, match.getSwP().getProperty(Neo4jConstants.ID) // - ); - driver.runTransformation(transformationDefinition, parameters); - } - } - -} diff --git a/trainbenchmark-tool-neo4j/src/main/java/hu/bme/mit/trainbenchmark/benchmark/neo4j/util/Neo4jUtil.java b/trainbenchmark-tool-neo4j/src/main/java/hu/bme/mit/trainbenchmark/benchmark/neo4j/util/Neo4jUtil.java deleted file mode 100644 index a8f32f8fb..000000000 --- a/trainbenchmark-tool-neo4j/src/main/java/hu/bme/mit/trainbenchmark/benchmark/neo4j/util/Neo4jUtil.java +++ /dev/null @@ -1,68 +0,0 @@ -package hu.bme.mit.trainbenchmark.benchmark.neo4j.util; - -import java.util.ArrayList; -import java.util.Collection; -import java.util.Iterator; - -import org.neo4j.graphdb.Direction; -import org.neo4j.graphdb.Label; -import org.neo4j.graphdb.Node; -import org.neo4j.graphdb.Relationship; -import org.neo4j.graphdb.RelationshipType; - -public class Neo4jUtil { - - public static boolean isConnected(final Node source, final Node target, final RelationshipType relationshipType) { - final int sourceDegree = source.getDegree(relationshipType, Direction.OUTGOING); - final int targetDegree = target.getDegree(relationshipType, Direction.INCOMING); - - final Direction searchDirection; - final Node searchSource; - final Node searchTarget; - if (sourceDegree <= targetDegree) { - searchDirection = Direction.OUTGOING; - searchSource = source; - searchTarget = target; - } else { - searchDirection = Direction.INCOMING; - searchSource = target; - searchTarget = source; - } - - final Iterator<Relationship> edges = searchSource.getRelationships(searchDirection, relationshipType).iterator(); - while (edges.hasNext()) { - final Relationship edge = edges.next(); - final Node otherNode = edge.getOtherNode(searchSource); - if (searchTarget.equals(otherNode)) { - return true; - } - } - - return false; - } - - public static Iterable<Node> getAdjacentNodes(final Node sourceNode, final RelationshipType relationshipType, final Direction direction, final Label targetNodeLabel) { - final Collection<Node> nodes = new ArrayList<>(); - - final Iterable<Relationship> relationships = sourceNode.getRelationships(relationshipType, direction); - for (final Relationship relationship : relationships) { - final Node candidate; - switch (direction) { - case INCOMING: - candidate = relationship.getStartNode(); - break; - case OUTGOING: - candidate = relationship.getEndNode(); - break; - default: - throw new UnsupportedOperationException("Direction: " + direction + " not supported."); - } - if (!candidate.hasLabel(targetNodeLabel)) { - continue; - } - nodes.add(candidate); - } - return nodes; - } - -} diff --git a/trainbenchmark-tool-neo4j/src/main/resources/queries/ConnectedSegments.cypher b/trainbenchmark-tool-neo4j/src/main/resources/queries/ConnectedSegments.cypher deleted file mode 100644 index c27f5af37..000000000 --- a/trainbenchmark-tool-neo4j/src/main/resources/queries/ConnectedSegments.cypher +++ /dev/null @@ -1,13 +0,0 @@ -MATCH - (sensor:Sensor)<-[:monitoredBy]-(segment1:Segment), - (segment1:Segment)-[:connectsTo]-> - (segment2:Segment)-[:connectsTo]-> - (segment3:Segment)-[:connectsTo]-> - (segment4:Segment)-[:connectsTo]-> - (segment5:Segment)-[:connectsTo]->(segment6:Segment), - (segment2:Segment)-[:monitoredBy]->(sensor:Sensor), - (segment3:Segment)-[:monitoredBy]->(sensor:Sensor), - (segment4:Segment)-[:monitoredBy]->(sensor:Sensor), - (segment5:Segment)-[:monitoredBy]->(sensor:Sensor), - (segment6:Segment)-[:monitoredBy]->(sensor:Sensor) -RETURN sensor, segment1, segment2, segment3, segment4, segment5, segment6 diff --git a/trainbenchmark-tool-neo4j/src/main/resources/queries/ConnectedSegmentsInject.cypher b/trainbenchmark-tool-neo4j/src/main/resources/queries/ConnectedSegmentsInject.cypher deleted file mode 100644 index bd6498083..000000000 --- a/trainbenchmark-tool-neo4j/src/main/resources/queries/ConnectedSegmentsInject.cypher +++ /dev/null @@ -1,5 +0,0 @@ -MATCH - (segment1:Segment)-[:connectsTo]->(segment3:Segment), - (segment1)-[:monitoredBy]->(sensor:Sensor), - (segment3)-[:monitoredBy]->(sensor) -RETURN sensor, segment1, segment3 diff --git a/trainbenchmark-tool-neo4j/src/main/resources/queries/PosLength.cypher b/trainbenchmark-tool-neo4j/src/main/resources/queries/PosLength.cypher deleted file mode 100644 index 881b12d7f..000000000 --- a/trainbenchmark-tool-neo4j/src/main/resources/queries/PosLength.cypher +++ /dev/null @@ -1,3 +0,0 @@ -MATCH (segment:Segment) -WHERE segment.length <= 0 -RETURN segment, segment.length AS length diff --git a/trainbenchmark-tool-neo4j/src/main/resources/queries/PosLengthInject.cypher b/trainbenchmark-tool-neo4j/src/main/resources/queries/PosLengthInject.cypher deleted file mode 100644 index 367256121..000000000 --- a/trainbenchmark-tool-neo4j/src/main/resources/queries/PosLengthInject.cypher +++ /dev/null @@ -1,2 +0,0 @@ -MATCH (segment:Segment) -RETURN segment diff --git a/trainbenchmark-tool-neo4j/src/main/resources/queries/RouteSensor.cypher b/trainbenchmark-tool-neo4j/src/main/resources/queries/RouteSensor.cypher deleted file mode 100644 index 9fc4bc63d..000000000 --- a/trainbenchmark-tool-neo4j/src/main/resources/queries/RouteSensor.cypher +++ /dev/null @@ -1,3 +0,0 @@ -MATCH (route:Route)-[:follows]->(swP:SwitchPosition)-[:target]->(sw:Switch)-[:monitoredBy]->(sensor:Sensor) -WHERE NOT (route)-[:requires]->(sensor) -RETURN route, sensor, swP, sw diff --git a/trainbenchmark-tool-neo4j/src/main/resources/queries/RouteSensorInject.cypher b/trainbenchmark-tool-neo4j/src/main/resources/queries/RouteSensorInject.cypher deleted file mode 100644 index b748ecb16..000000000 --- a/trainbenchmark-tool-neo4j/src/main/resources/queries/RouteSensorInject.cypher +++ /dev/null @@ -1,2 +0,0 @@ -MATCH (route)-[:requires]->(sensor) -RETURN route, sensor diff --git a/trainbenchmark-tool-neo4j/src/main/resources/queries/SemaphoreNeighbor.cypher b/trainbenchmark-tool-neo4j/src/main/resources/queries/SemaphoreNeighbor.cypher deleted file mode 100644 index a30da4ed8..000000000 --- a/trainbenchmark-tool-neo4j/src/main/resources/queries/SemaphoreNeighbor.cypher +++ /dev/null @@ -1,6 +0,0 @@ -MATCH - (semaphore:Semaphore)<-[:exit]-(route1:Route)-[:requires]->(sensor1:Sensor), - (sensor1)<-[:monitoredBy]-(te1)-[:connectsTo]->(te2)-[:monitoredBy]->(sensor2:Sensor)<-[:requires]-(route2:Route) -WHERE NOT (semaphore)<-[:entry]-(route2) - AND route1 <> route2 -RETURN DISTINCT semaphore, route1, route2, sensor1, sensor2, te1, te2 diff --git a/trainbenchmark-tool-neo4j/src/main/resources/queries/SemaphoreNeighborInject.cypher b/trainbenchmark-tool-neo4j/src/main/resources/queries/SemaphoreNeighborInject.cypher deleted file mode 100644 index 924deff9d..000000000 --- a/trainbenchmark-tool-neo4j/src/main/resources/queries/SemaphoreNeighborInject.cypher +++ /dev/null @@ -1,2 +0,0 @@ -MATCH (route:Route)-[:entry]->(semaphore:Semaphore) -RETURN route, semaphore diff --git a/trainbenchmark-tool-neo4j/src/main/resources/queries/SwitchMonitored.cypher b/trainbenchmark-tool-neo4j/src/main/resources/queries/SwitchMonitored.cypher deleted file mode 100644 index 1f4bc193c..000000000 --- a/trainbenchmark-tool-neo4j/src/main/resources/queries/SwitchMonitored.cypher +++ /dev/null @@ -1,3 +0,0 @@ -MATCH (sw:Switch) -WHERE NOT (sw)-[:monitoredBy]->() -RETURN sw diff --git a/trainbenchmark-tool-neo4j/src/main/resources/queries/SwitchMonitoredInject.cypher b/trainbenchmark-tool-neo4j/src/main/resources/queries/SwitchMonitoredInject.cypher deleted file mode 100644 index 6d0618746..000000000 --- a/trainbenchmark-tool-neo4j/src/main/resources/queries/SwitchMonitoredInject.cypher +++ /dev/null @@ -1,2 +0,0 @@ -MATCH (sw:Switch) -RETURN sw diff --git a/trainbenchmark-tool-neo4j/src/main/resources/queries/SwitchSet.cypher b/trainbenchmark-tool-neo4j/src/main/resources/queries/SwitchSet.cypher deleted file mode 100644 index 6fc1b38a9..000000000 --- a/trainbenchmark-tool-neo4j/src/main/resources/queries/SwitchSet.cypher +++ /dev/null @@ -1,5 +0,0 @@ -MATCH (semaphore:Semaphore)<-[:entry]-(route:Route)-[:follows]->(swP:SwitchPosition)-[:target]->(sw:Switch) -WHERE semaphore.signal = "GO" - AND route.active = true - AND sw.currentPosition <> swP.position -RETURN semaphore, route, swP, sw, sw.currentPosition AS currentPosition, swP.position AS position diff --git a/trainbenchmark-tool-neo4j/src/main/resources/queries/SwitchSetInject.cypher b/trainbenchmark-tool-neo4j/src/main/resources/queries/SwitchSetInject.cypher deleted file mode 100644 index 6d0618746..000000000 --- a/trainbenchmark-tool-neo4j/src/main/resources/queries/SwitchSetInject.cypher +++ /dev/null @@ -1,2 +0,0 @@ -MATCH (sw:Switch) -RETURN sw diff --git a/trainbenchmark-tool-neo4j/src/main/resources/transformations/ConnectedSegmentsInjectRhs.cypher b/trainbenchmark-tool-neo4j/src/main/resources/transformations/ConnectedSegmentsInjectRhs.cypher deleted file mode 100644 index d44f5e7ed..000000000 --- a/trainbenchmark-tool-neo4j/src/main/resources/transformations/ConnectedSegmentsInjectRhs.cypher +++ /dev/null @@ -1,8 +0,0 @@ -MATCH - (sensor {id: $sensor}), - (segment1 {id: $segment1})-[c:connectsTo]->(segment3 {id: $segment3}) -CREATE - (segment2:Segment {length: $length})-[:monitoredBy]->(sensor), - (segment1)-[:connectsTo]->(segment2), - (segment2)-[:connectsTo]->(segment3) -DELETE c diff --git a/trainbenchmark-tool-neo4j/src/main/resources/transformations/ConnectedSegmentsRepairRhs.cypher b/trainbenchmark-tool-neo4j/src/main/resources/transformations/ConnectedSegmentsRepairRhs.cypher deleted file mode 100644 index 64c763072..000000000 --- a/trainbenchmark-tool-neo4j/src/main/resources/transformations/ConnectedSegmentsRepairRhs.cypher +++ /dev/null @@ -1,2 +0,0 @@ -MATCH (segment2 {id: $segment2}) -DETACH DELETE segment2 diff --git a/trainbenchmark-tool-neo4j/src/main/resources/transformations/PosLengthInjectRhs.cypher b/trainbenchmark-tool-neo4j/src/main/resources/transformations/PosLengthInjectRhs.cypher deleted file mode 100644 index 9f0e83df5..000000000 --- a/trainbenchmark-tool-neo4j/src/main/resources/transformations/PosLengthInjectRhs.cypher +++ /dev/null @@ -1,2 +0,0 @@ -MATCH (segment {id: $segment}) -SET segment.length = 0 diff --git a/trainbenchmark-tool-neo4j/src/main/resources/transformations/PosLengthRepairRhs.cypher b/trainbenchmark-tool-neo4j/src/main/resources/transformations/PosLengthRepairRhs.cypher deleted file mode 100644 index aa30069b6..000000000 --- a/trainbenchmark-tool-neo4j/src/main/resources/transformations/PosLengthRepairRhs.cypher +++ /dev/null @@ -1,2 +0,0 @@ -MATCH (segment {id: $segment}) -SET segment.length = -segment.length + 1 diff --git a/trainbenchmark-tool-neo4j/src/main/resources/transformations/RouteSensorInjectRhs.cypher b/trainbenchmark-tool-neo4j/src/main/resources/transformations/RouteSensorInjectRhs.cypher deleted file mode 100644 index 1891e0851..000000000 --- a/trainbenchmark-tool-neo4j/src/main/resources/transformations/RouteSensorInjectRhs.cypher +++ /dev/null @@ -1,2 +0,0 @@ -MATCH (route {id: $route})-[g:requires]->(sensor {id: $sensor}) -DELETE g diff --git a/trainbenchmark-tool-neo4j/src/main/resources/transformations/RouteSensorRepairRhs.cypher b/trainbenchmark-tool-neo4j/src/main/resources/transformations/RouteSensorRepairRhs.cypher deleted file mode 100644 index d6a68aaa6..000000000 --- a/trainbenchmark-tool-neo4j/src/main/resources/transformations/RouteSensorRepairRhs.cypher +++ /dev/null @@ -1,2 +0,0 @@ -MATCH (route {id: $route}), (sensor {id: $sensor}) -CREATE (route)-[:requires]->(sensor) diff --git a/trainbenchmark-tool-neo4j/src/main/resources/transformations/SemaphoreNeighborInjectRhs.cypher b/trainbenchmark-tool-neo4j/src/main/resources/transformations/SemaphoreNeighborInjectRhs.cypher deleted file mode 100644 index cdcb4fba4..000000000 --- a/trainbenchmark-tool-neo4j/src/main/resources/transformations/SemaphoreNeighborInjectRhs.cypher +++ /dev/null @@ -1,2 +0,0 @@ -MATCH (route {id: $route})-[e:entry]->(semaphore {id: $semaphore}) -DELETE e diff --git a/trainbenchmark-tool-neo4j/src/main/resources/transformations/SemaphoreNeighborRepairRhs.cypher b/trainbenchmark-tool-neo4j/src/main/resources/transformations/SemaphoreNeighborRepairRhs.cypher deleted file mode 100644 index 8398f1dd4..000000000 --- a/trainbenchmark-tool-neo4j/src/main/resources/transformations/SemaphoreNeighborRepairRhs.cypher +++ /dev/null @@ -1,2 +0,0 @@ -MATCH (route2 {id: $route2}), (semaphore {id: $semaphore}) -CREATE (route2)-[:entry]->(semaphore) diff --git a/trainbenchmark-tool-neo4j/src/main/resources/transformations/SwitchMonitoredInjectRhs.cypher b/trainbenchmark-tool-neo4j/src/main/resources/transformations/SwitchMonitoredInjectRhs.cypher deleted file mode 100644 index dfcffbe75..000000000 --- a/trainbenchmark-tool-neo4j/src/main/resources/transformations/SwitchMonitoredInjectRhs.cypher +++ /dev/null @@ -1,2 +0,0 @@ -MATCH (sw {id: $sw})-[m:monitoredBy]->(:Sensor) -DELETE m diff --git a/trainbenchmark-tool-neo4j/src/main/resources/transformations/SwitchMonitoredRepairRhs.cypher b/trainbenchmark-tool-neo4j/src/main/resources/transformations/SwitchMonitoredRepairRhs.cypher deleted file mode 100644 index 02241915f..000000000 --- a/trainbenchmark-tool-neo4j/src/main/resources/transformations/SwitchMonitoredRepairRhs.cypher +++ /dev/null @@ -1,2 +0,0 @@ -MATCH (sw {id: $sw}) -CREATE (sw)-[:monitoredBy]->(:Sensor) diff --git a/trainbenchmark-tool-neo4j/src/main/resources/transformations/SwitchSetInjectRhs.cypher b/trainbenchmark-tool-neo4j/src/main/resources/transformations/SwitchSetInjectRhs.cypher deleted file mode 100644 index 183eaecef..000000000 --- a/trainbenchmark-tool-neo4j/src/main/resources/transformations/SwitchSetInjectRhs.cypher +++ /dev/null @@ -1,2 +0,0 @@ -MATCH (sw {id: $sw}) -SET sw.currentPosition = $currentPosition diff --git a/trainbenchmark-tool-neo4j/src/main/resources/transformations/SwitchSetRepairRhs.cypher b/trainbenchmark-tool-neo4j/src/main/resources/transformations/SwitchSetRepairRhs.cypher deleted file mode 100644 index 30b234d38..000000000 --- a/trainbenchmark-tool-neo4j/src/main/resources/transformations/SwitchSetRepairRhs.cypher +++ /dev/null @@ -1,2 +0,0 @@ -MATCH (sw {id: $sw}), (swP {id: $swP}) -SET sw.currentPosition = swP.position diff --git a/trainbenchmark-tool-neo4j/src/test/java/hu/bme/mit/trainbenchmark/benchmark/neo4j/test/Neo4jTest.java b/trainbenchmark-tool-neo4j/src/test/java/hu/bme/mit/trainbenchmark/benchmark/neo4j/test/Neo4jTest.java deleted file mode 100644 index c36748f68..000000000 --- a/trainbenchmark-tool-neo4j/src/test/java/hu/bme/mit/trainbenchmark/benchmark/neo4j/test/Neo4jTest.java +++ /dev/null @@ -1,60 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2010-2015, Benedek Izso, Gabor Szarnyas, Istvan Rath and Daniel Varro - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Benedek Izso - initial API and implementation - * Gabor Szarnyas - initial API and implementation - *******************************************************************************/ - -package hu.bme.mit.trainbenchmark.benchmark.neo4j.test; - -import hu.bme.mit.trainbenchmark.benchmark.config.BenchmarkConfigBase; -import hu.bme.mit.trainbenchmark.benchmark.neo4j.Neo4jBenchmarkScenario; -import hu.bme.mit.trainbenchmark.benchmark.neo4j.config.Neo4jBenchmarkConfig; -import hu.bme.mit.trainbenchmark.benchmark.neo4j.config.Neo4jBenchmarkConfigBuilder; -import hu.bme.mit.trainbenchmark.benchmark.neo4j.config.Neo4jEngine; -import hu.bme.mit.trainbenchmark.benchmark.runcomponents.BenchmarkResult; -import hu.bme.mit.trainbenchmark.benchmark.test.TrainBenchmarkTest; -import hu.bme.mit.trainbenchmark.neo4j.config.Neo4jGraphFormat; -import org.junit.runner.RunWith; -import org.junit.runners.Parameterized; -import org.junit.runners.Parameterized.Parameter; -import org.junit.runners.Parameterized.Parameters; - -import java.util.Arrays; - -@RunWith(Parameterized.class) -public class Neo4jTest extends TrainBenchmarkTest { - - @Parameters(name = "engine={0}, format={1}") - public static Iterable<? extends Object[]> data() { - return Arrays.asList(new Object[][]{ // - { Neo4jEngine.CYPHER, Neo4jGraphFormat.CSV }, // -// { Neo4jEngine.COREAPI, Neo4jGraphFormat.CSV }, // -// { Neo4jEngine.CYPHER, Neo4jGraphFormat.GRAPHML }, // -// { Neo4jEngine.COREAPI, Neo4jGraphFormat.GRAPHML }, // -// { Neo4jEngine.CYPHER, Neo4jGraphFormat.CYPHER }, // -// { Neo4jEngine.COREAPI, Neo4jGraphFormat.CYPHER }, // - }); - } - - @Parameter(value = 0) - public Neo4jEngine engine; - - @Parameter(value = 1) - public Neo4jGraphFormat graphFormat; - - @Override - protected BenchmarkResult runTest(final BenchmarkConfigBase bcb) throws Exception { - final Neo4jBenchmarkConfig bc = new Neo4jBenchmarkConfigBuilder().setConfigBase(bcb).setEngine(engine) - .setGraphFormat(graphFormat).createConfig(); - final Neo4jBenchmarkScenario scenario = new Neo4jBenchmarkScenario(bc); - final BenchmarkResult result = scenario.performBenchmark(); - return result; - } - -} diff --git a/trainbenchmark-tool-neo4j/src/test/resources/.gitignore b/trainbenchmark-tool-neo4j/src/test/resources/.gitignore deleted file mode 100644 index e69de29bb..000000000 diff --git a/trainbenchmark-tool-racr-cpp/build.gradle b/trainbenchmark-tool-racr-cpp/build.gradle deleted file mode 100644 index c7a1ed8f3..000000000 --- a/trainbenchmark-tool-racr-cpp/build.gradle +++ /dev/null @@ -1,31 +0,0 @@ -plugins { id "com.github.johnrengelman.shadow" version "1.2.3" } - -shadowJar { - classifier = 'fat' - manifest { attributes 'Main-Class': 'de.tudresden.inf.st.train.racr.cpp.RacrCppBenchmarkMain' } - dependsOn ":trainbenchmark-tool-racr:shadowJar" -} - -dependencies { - compile project(':trainbenchmark-tool') - compile project(':trainbenchmark-tool-racr') -} - -task build_cpp(type: Exec) { - group "build" - workingDir '../racr-cpp/Release' - commandLine './build.sh' -} - -task startRacrCppServer(type: Exec) { - workingDir '../racr-cpp/Release' - commandLine './trainbenchmark-main' - dependsOn build_cpp -} - -task killPracrServers(type: Exec) { - // send system exit event to cpp server - commandLine 'bash', '-c', 'echo \'{"class_name": "SystemExitEvent"}\' | nc localhost 9999' -} - -test.outputs.upToDateWhen {false} diff --git a/trainbenchmark-tool-racr-cpp/src/main/java/de/tudresden/inf/st/train/racr/cpp/RacrCppBenchmarkMain.java b/trainbenchmark-tool-racr-cpp/src/main/java/de/tudresden/inf/st/train/racr/cpp/RacrCppBenchmarkMain.java deleted file mode 100644 index 8486e5d6c..000000000 --- a/trainbenchmark-tool-racr-cpp/src/main/java/de/tudresden/inf/st/train/racr/cpp/RacrCppBenchmarkMain.java +++ /dev/null @@ -1,13 +0,0 @@ -package de.tudresden.inf.st.train.racr.cpp; - -import de.tudresden.inf.st.train.racr.config.RacrBenchmarkConfig; -import hu.bme.mit.trainbenchmark.benchmark.config.BenchmarkConfig; - -public class RacrCppBenchmarkMain { - - public static void main(String[] args) throws Exception { - final RacrBenchmarkConfig bc = BenchmarkConfig.fromFile(args[0], RacrBenchmarkConfig.class); - final RacrCppBenchmarkScenario scenario = new RacrCppBenchmarkScenario(bc); - scenario.performBenchmark(); - } -} diff --git a/trainbenchmark-tool-racr-cpp/src/main/java/de/tudresden/inf/st/train/racr/cpp/RacrCppBenchmarkScenario.java b/trainbenchmark-tool-racr-cpp/src/main/java/de/tudresden/inf/st/train/racr/cpp/RacrCppBenchmarkScenario.java deleted file mode 100644 index 1e8b8e793..000000000 --- a/trainbenchmark-tool-racr-cpp/src/main/java/de/tudresden/inf/st/train/racr/cpp/RacrCppBenchmarkScenario.java +++ /dev/null @@ -1,18 +0,0 @@ -package de.tudresden.inf.st.train.racr.cpp; - -import de.tudresden.inf.st.train.racr.comparators.RacrMatchComparator; -import de.tudresden.inf.st.train.racr.config.RacrBenchmarkConfig; -import de.tudresden.inf.st.train.racr.cpp.driver.RacrCppDriver; -import de.tudresden.inf.st.train.racr.cpp.driver.RacrCppDriverFactory; -import de.tudresden.inf.st.train.racr.cpp.operations.RacrCppModelOperationFactory; -import de.tudresden.inf.st.train.racr.matches.RacrMatch; -import hu.bme.mit.trainbenchmark.benchmark.phases.BenchmarkScenario; - -public class RacrCppBenchmarkScenario extends - BenchmarkScenario<RacrMatch, RacrCppDriver, RacrBenchmarkConfig> { - - public RacrCppBenchmarkScenario(final RacrBenchmarkConfig bc) throws Exception { - super(new RacrCppDriverFactory(bc.config), new RacrCppModelOperationFactory(), new RacrMatchComparator(), bc); - } - -} diff --git a/trainbenchmark-tool-racr-cpp/src/main/java/de/tudresden/inf/st/train/racr/cpp/driver/RacrCppDriver.java b/trainbenchmark-tool-racr-cpp/src/main/java/de/tudresden/inf/st/train/racr/cpp/driver/RacrCppDriver.java deleted file mode 100644 index 56103d3ac..000000000 --- a/trainbenchmark-tool-racr-cpp/src/main/java/de/tudresden/inf/st/train/racr/cpp/driver/RacrCppDriver.java +++ /dev/null @@ -1,80 +0,0 @@ -package de.tudresden.inf.st.train.racr.cpp.driver; - -import de.tudresden.inf.st.train.racr.driver.RacrDriver; -import de.tudresden.inf.st.train.racr.util.RacrConfig; -import de.tudresden.inf.st.train.racr.util.RacrUtils; - -import java.io.*; - - -public class RacrCppDriver extends RacrDriver { - - private final File workDir; - private final File stopFile; - - public RacrCppDriver(RacrConfig config) { - super(config); - workDir = new File("../racr-cpp/Release/"); - stopFile = new File(workDir, "stop"); - } - - public static RacrCppDriver create(RacrConfig config) { - return new RacrCppDriver(config); - } - - private boolean removeStopFile() { - return stopFile.delete(); - } - - private boolean createStopFile() throws IOException { - return stopFile.createNewFile(); - } - - @Override - public void initialize() throws Exception { - super.initialize(); - if (!config.startStopOwnServer) return; - - makeCleanState(); - -// PrintStream realOut = new PrintStream(new FileOutputStream(FileDescriptor.out)); - PrintStream realOut = System.out; - realOut.println("Starting racr-cpp server"); - - ProcessBuilder pb = new ProcessBuilder("./serve-forever.sh", "-n"); - pb.directory(workDir); - pb.start(); - - // and wait for first successful query - realOut.println("Attempting to connect to racr-cpp"); - while (true) { - try { - if (RacrUtils.connectToPracr(5, config).callServerTime().isPresent()) { - break; - } - } catch (Exception e) { /* empty */ } - try { Thread.sleep(200); } catch (InterruptedException e) { /* empty */ } - realOut.println("..."); - } - } - - /** - * Tries to terminate any server that might be running currently - * @throws IOException if the stopFile could not be created, or upon any other I/O Error - */ - private void makeCleanState() throws IOException { - createStopFile(); - try { - RacrUtils.connectToPracr(5, config ).callSystemExit(); - } catch (Exception e) { /* empty */ } - removeStopFile(); - } - - @Override - public void destroy() throws Exception { - super.destroy(); - if (!config.startStopOwnServer) return; - System.out.println("Shutting down racr-cpp server"); - makeCleanState(); - } -} diff --git a/trainbenchmark-tool-racr-cpp/src/main/java/de/tudresden/inf/st/train/racr/cpp/driver/RacrCppDriverFactory.java b/trainbenchmark-tool-racr-cpp/src/main/java/de/tudresden/inf/st/train/racr/cpp/driver/RacrCppDriverFactory.java deleted file mode 100644 index 192318d73..000000000 --- a/trainbenchmark-tool-racr-cpp/src/main/java/de/tudresden/inf/st/train/racr/cpp/driver/RacrCppDriverFactory.java +++ /dev/null @@ -1,20 +0,0 @@ -package de.tudresden.inf.st.train.racr.cpp.driver; - -import de.tudresden.inf.st.train.racr.util.RacrConfig; -import hu.bme.mit.trainbenchmark.benchmark.driver.DriverFactory; - -public class RacrCppDriverFactory extends DriverFactory<RacrCppDriver> { - - public final RacrConfig config; - - public RacrCppDriverFactory(RacrConfig config) { - super(); - this.config = config; - } - - @Override - public RacrCppDriver createInstance() throws Exception { - return RacrCppDriver.create(config); - } - -} diff --git a/trainbenchmark-tool-racr-cpp/src/main/java/de/tudresden/inf/st/train/racr/cpp/operations/RacrCppModelOperationFactory.java b/trainbenchmark-tool-racr-cpp/src/main/java/de/tudresden/inf/st/train/racr/cpp/operations/RacrCppModelOperationFactory.java deleted file mode 100644 index d343e3abd..000000000 --- a/trainbenchmark-tool-racr-cpp/src/main/java/de/tudresden/inf/st/train/racr/cpp/operations/RacrCppModelOperationFactory.java +++ /dev/null @@ -1,63 +0,0 @@ -package de.tudresden.inf.st.train.racr.cpp.operations; - -import de.tudresden.inf.st.train.racr.cpp.driver.RacrCppDriver; -import de.tudresden.inf.st.train.racr.driver.RacrDriver; -import de.tudresden.inf.st.train.racr.matches.*; -import de.tudresden.inf.st.train.racr.operations.RacrModelOperationFactory; -import de.tudresden.inf.st.train.racr.queries.*; -import de.tudresden.inf.st.train.racr.transformations.RacrTransformation; -import de.tudresden.inf.st.train.racr.transformations.inject.*; -import de.tudresden.inf.st.train.racr.transformations.repair.*; -import hu.bme.mit.trainbenchmark.benchmark.operations.ModelOperation; -import hu.bme.mit.trainbenchmark.benchmark.operations.ModelOperationFactory; -import hu.bme.mit.trainbenchmark.benchmark.operations.ModelQuery; -import hu.bme.mit.trainbenchmark.benchmark.operations.ModelTransformation; -import hu.bme.mit.trainbenchmark.constants.RailwayOperation; - -import java.util.Collection; - -public class RacrCppModelOperationFactory extends ModelOperationFactory<RacrMatch, RacrCppDriver> { - - private final RacrModelOperationFactory delegate; - - public RacrCppModelOperationFactory() { - this.delegate = new RacrModelOperationFactory(); - } - - private static <TMatch extends RacrMatch> ModelOperation<? extends RacrMatch, RacrCppDriver> reshape( - ModelOperation<TMatch, RacrDriver> operation, - RacrCppDriver new_driver) { - RacrQuery<TMatch, RacrDriver> oldQuery = (RacrQuery<TMatch, RacrDriver>) operation.getQuery(); - ModelQuery<TMatch, RacrCppDriver> newQuery = new ModelQuery<TMatch, RacrCppDriver>(oldQuery.getQuery(), new_driver) { - public Collection<TMatch> evaluate() throws Exception { - return RacrQuery.evaluate_shared(oldQuery.getTimeout(), new_driver, - oldQuery::getResponse, - oldQuery::constructMatches, - oldQuery.getClass().getSimpleName()); - } - }; - if (operation.getTransformation().isPresent()) { - RacrTransformation<TMatch, RacrDriver> oldTransformation = (RacrTransformation<TMatch, RacrDriver>) operation.getTransformation().get(); - ModelTransformation<TMatch, RacrCppDriver> newTansformation = new ModelTransformation<TMatch, RacrCppDriver>(new_driver) { - @Override - public void activate(Collection<TMatch> tMatches) throws Exception { - RacrTransformation.activate_shared(tMatches, oldTransformation.getTimeout(), new_driver, - oldTransformation::handleResponse, oldTransformation::handleEmptyResponse, - oldTransformation::getResponse, oldTransformation.getClass().getSimpleName()); - } - }; - return ModelOperation.of(newQuery, newTansformation); - } else { - return ModelOperation.of(newQuery); - } - } - - @Override - public ModelOperation<? extends RacrMatch, RacrCppDriver> createOperation( - final RailwayOperation operationEnum, final String workspaceDir, - final RacrCppDriver driver) throws Exception { - ModelOperation<? extends RacrMatch, RacrDriver> result = this.delegate.createOperation(operationEnum, workspaceDir, driver); - return reshape(result, driver); - } - -} diff --git a/trainbenchmark-tool-racr-cpp/src/test/java/de/tudresden/inf/st/train/racr/test/RacrCppTest.java b/trainbenchmark-tool-racr-cpp/src/test/java/de/tudresden/inf/st/train/racr/test/RacrCppTest.java deleted file mode 100644 index 368e2a924..000000000 --- a/trainbenchmark-tool-racr-cpp/src/test/java/de/tudresden/inf/st/train/racr/test/RacrCppTest.java +++ /dev/null @@ -1,87 +0,0 @@ -package de.tudresden.inf.st.train.racr.test; - -import de.tudresden.inf.st.train.racr.config.RacrBenchmarkConfig; -import de.tudresden.inf.st.train.racr.config.RacrBenchmarkConfigBuilder; -import de.tudresden.inf.st.train.racr.cpp.RacrCppBenchmarkScenario; -import de.tudresden.inf.st.train.racr.cpp.driver.RacrCppDriver; -import de.tudresden.inf.st.train.racr.util.RacrConfig; -import de.tudresden.inf.st.train.racr.util.RacrUtils; -import de.tudresden.inf.st.train.racr.util.TestUtils; -import hu.bme.mit.trainbenchmark.benchmark.config.BenchmarkConfigBase; -import hu.bme.mit.trainbenchmark.benchmark.runcomponents.BenchmarkResult; -import hu.bme.mit.trainbenchmark.benchmark.test.TrainBenchmarkTest; -import org.junit.AfterClass; -import org.junit.Assume; -import org.junit.Before; -import org.junit.BeforeClass; - -import java.io.File; -import java.io.IOException; - -/** - * This class instantiate the Test for the TrainBenchmark applied for RACR-CPP. - * - * The initialize and destroy method of the used RacrCppDriver is not used in the normal way. - * Instead, initialize is called upon the invocation of the first test. This is needed, - * because a normal @BeforeClass method does not have a proper BenchmarkConfig object. - * However, at the end of the whole test, the server is shut down. - * - * In both cases, the methods of a new driver is used, because the configuration needs - * to set {@link RacrBenchmarkConfigBuilder#useExternalServer()}. Otherwise a new server would - * be started upon each test. This is done only for the benchmark. - */ -public class RacrCppTest extends TrainBenchmarkTest { - - private static RacrCppDriver s_driver; - - @Override - protected BenchmarkResult runTest(final BenchmarkConfigBase bcb) throws Exception { - maybe_start_cpp_server(bcb); - return TestUtils.runTest(bcb, RacrBenchmarkConfigBuilder::useCpp, RacrCppBenchmarkScenario::new); - } - - private static void maybe_start_cpp_server(final BenchmarkConfigBase bcb) throws Exception { - if (s_driver != null) { - // server is already presumed to be running - return; - } - final RacrBenchmarkConfigBuilder builder = new RacrBenchmarkConfigBuilder().useCpp();//.useInternalServer(); - final RacrBenchmarkConfig bc = builder.setConfigBase(bcb).createConfig(); - s_driver = new RacrCppDriver(new RacrConfig(bc.config)); - // this change is only local - s_driver.config.startStopOwnServer = true; - - s_driver.initialize(); - } - - @AfterClass - public static void exit_cpp_server() throws Exception { - if (s_driver != null) { - s_driver.destroy(); - } - } - - private void no() { Assume.assumeTrue(false); } - - @Override public void batchTest() throws Exception { no(); } - @Override public void injectTest() throws Exception { no(); } - @Override public void repairTest() throws Exception { no(); } - -// @Override public void posLengthInjectTest() throws Exception { no(); } -// @Override public void posLengthRepairTest() throws Exception { no(); } -// -// @Override public void connectedSegmentsInjectTest() throws Exception { no(); } -// @Override public void connectedSegmentsRepairTest() throws Exception { no(); } -// -// @Override public void routeSensorInjectTest() throws Exception { no(); } -// @Override public void routeSensorRepairTest() throws Exception { no(); } -// -// @Override public void semaphoreNeighborInjectTest() throws Exception { no(); } -// @Override public void semaphoreNeighborRepairTest() throws Exception { no(); } -// -// @Override public void switchMonitoredInjectTest() throws Exception { no(); } -// @Override public void switchMonitoredRepairTest() throws Exception { no(); } -// -// @Override public void switchSetInjectTest() throws Exception { no(); } -// @Override public void switchSetRepairTest() throws Exception { no(); } -} diff --git a/trainbenchmark-tool-racr-python/build.gradle b/trainbenchmark-tool-racr-python/build.gradle deleted file mode 100644 index d9ed9cb93..000000000 --- a/trainbenchmark-tool-racr-python/build.gradle +++ /dev/null @@ -1,19 +0,0 @@ -plugins { id "com.github.johnrengelman.shadow" version "1.2.3" } - -shadowJar { - classifier = 'fat' - manifest { attributes 'Main-Class': 'de.tudresden.inf.st.train.racr.python.RacrPythonBenchmarkMain' } - dependsOn ":trainbenchmark-tool-racr:shadowJar" -} - -dependencies { - compile project(':trainbenchmark-tool') - compile project(':trainbenchmark-tool-racr') -} - -task startPracrPythonServer(type: Exec) { - workingDir '../pracr-python/pracr/' - commandLine 'bash', 'tools/build-and-server.sh', 'trainbenchmark python' -} - -test.outputs.upToDateWhen {false} diff --git a/trainbenchmark-tool-racr-python/src/main/java/de/tudresden/inf/st/train/racr/python/RacrPythonBenchmarkMain.java b/trainbenchmark-tool-racr-python/src/main/java/de/tudresden/inf/st/train/racr/python/RacrPythonBenchmarkMain.java deleted file mode 100644 index 062e7e5b8..000000000 --- a/trainbenchmark-tool-racr-python/src/main/java/de/tudresden/inf/st/train/racr/python/RacrPythonBenchmarkMain.java +++ /dev/null @@ -1,15 +0,0 @@ -package de.tudresden.inf.st.train.racr.python; - -import de.tudresden.inf.st.train.racr.RacrBenchmarkScenario; -import de.tudresden.inf.st.train.racr.config.RacrBenchmarkConfig; -import de.tudresden.inf.st.train.racr.util.RacrConfig; -import hu.bme.mit.trainbenchmark.benchmark.config.BenchmarkConfig; - -public class RacrPythonBenchmarkMain { - - public static void main(String[] args) throws Exception { - final RacrBenchmarkConfig bc = BenchmarkConfig.fromFile(args[0], RacrBenchmarkConfig.class); - final RacrBenchmarkScenario scenario = new RacrBenchmarkScenario(bc); - scenario.performBenchmark(); - } -} diff --git a/trainbenchmark-tool-racr-python/src/test/java/de/tudresden/inf/st/train/racr/python/test/RacrPythonTest.java b/trainbenchmark-tool-racr-python/src/test/java/de/tudresden/inf/st/train/racr/python/test/RacrPythonTest.java deleted file mode 100644 index fd87e185c..000000000 --- a/trainbenchmark-tool-racr-python/src/test/java/de/tudresden/inf/st/train/racr/python/test/RacrPythonTest.java +++ /dev/null @@ -1,42 +0,0 @@ -package de.tudresden.inf.st.train.racr.python.test; - -import de.tudresden.inf.st.train.racr.RacrBenchmarkScenario; -import de.tudresden.inf.st.train.racr.config.RacrBenchmarkConfigBuilder; -import de.tudresden.inf.st.train.racr.util.TestUtils; -import hu.bme.mit.trainbenchmark.benchmark.config.BenchmarkConfigBase; -import hu.bme.mit.trainbenchmark.benchmark.runcomponents.BenchmarkResult; -import hu.bme.mit.trainbenchmark.benchmark.test.TrainBenchmarkTest; -import org.junit.Assume; - -public class RacrPythonTest extends TrainBenchmarkTest { - - @Override - protected BenchmarkResult runTest(final BenchmarkConfigBase bcb) throws Exception { - Assume.assumeTrue(TestUtils.pracrServerReachable(bcb, RacrBenchmarkConfigBuilder::usePython)); - return TestUtils.runTest(bcb, RacrBenchmarkConfigBuilder::usePython, RacrBenchmarkScenario::new); - } - - private void no() { Assume.assumeTrue(false); } - - @Override public void batchTest() throws Exception { no(); } - @Override public void injectTest() throws Exception { no(); } - @Override public void repairTest() throws Exception { no(); } - -// @Override public void posLengthInjectTest() throws Exception { no(); } -// @Override public void posLengthRepairTest() throws Exception { no(); } -// -// @Override public void connectedSegmentsInjectTest() throws Exception { no(); } -// @Override public void connectedSegmentsRepairTest() throws Exception { no(); } -// -// @Override public void routeSensorInjectTest() throws Exception { no(); } -// @Override public void routeSensorRepairTest() throws Exception { no(); } -// -// @Override public void semaphoreNeighborInjectTest() throws Exception { no(); } -// @Override public void semaphoreNeighborRepairTest() throws Exception { no(); } -// -// @Override public void switchMonitoredInjectTest() throws Exception { no(); } -// @Override public void switchMonitoredRepairTest() throws Exception { no(); } -// -// @Override public void switchSetInjectTest() throws Exception { no(); } -// @Override public void switchSetRepairTest() throws Exception { no(); } -} diff --git a/trainbenchmark-tool-racr-scheme/build.gradle b/trainbenchmark-tool-racr-scheme/build.gradle deleted file mode 100644 index 2f3bc8e92..000000000 --- a/trainbenchmark-tool-racr-scheme/build.gradle +++ /dev/null @@ -1,19 +0,0 @@ -plugins { id "com.github.johnrengelman.shadow" version "1.2.3" } - -shadowJar { - classifier = 'fat' - manifest { attributes 'Main-Class': 'de.tudresden.inf.st.train.racr.scheme.RacrSchemeBenchmarkMain' } - dependsOn ":trainbenchmark-tool-racr:shadowJar" -} - -dependencies { - compile project(':trainbenchmark-tool') - compile project(':trainbenchmark-tool-racr') -} - -task startPracrSchemeServer(type: Exec) { - workingDir '../pracr-scheme/pracr/' - commandLine 'bash', 'tools/build-and-server.sh', 'trainbenchmark scheme' -} - -test.outputs.upToDateWhen {false} diff --git a/trainbenchmark-tool-racr-scheme/src/main/java/de/tudresden/inf/st/train/racr/scheme/RacrSchemeBenchmarkMain.java b/trainbenchmark-tool-racr-scheme/src/main/java/de/tudresden/inf/st/train/racr/scheme/RacrSchemeBenchmarkMain.java deleted file mode 100644 index cf13e4bac..000000000 --- a/trainbenchmark-tool-racr-scheme/src/main/java/de/tudresden/inf/st/train/racr/scheme/RacrSchemeBenchmarkMain.java +++ /dev/null @@ -1,15 +0,0 @@ -package de.tudresden.inf.st.train.racr.scheme; - -import de.tudresden.inf.st.train.racr.RacrBenchmarkScenario; -import de.tudresden.inf.st.train.racr.config.RacrBenchmarkConfig; -import de.tudresden.inf.st.train.racr.util.RacrConfig; -import hu.bme.mit.trainbenchmark.benchmark.config.BenchmarkConfig; - -public class RacrSchemeBenchmarkMain { - - public static void main(String[] args) throws Exception { - final RacrBenchmarkConfig bc = BenchmarkConfig.fromFile(args[0], RacrBenchmarkConfig.class); - final RacrBenchmarkScenario scenario = new RacrBenchmarkScenario(bc); - scenario.performBenchmark(); - } -} diff --git a/trainbenchmark-tool-racr-scheme/src/test/java/de/tudresden/inf/st/train/racr/test/RacrSchemeTest.java b/trainbenchmark-tool-racr-scheme/src/test/java/de/tudresden/inf/st/train/racr/test/RacrSchemeTest.java deleted file mode 100644 index d8ea846b1..000000000 --- a/trainbenchmark-tool-racr-scheme/src/test/java/de/tudresden/inf/st/train/racr/test/RacrSchemeTest.java +++ /dev/null @@ -1,43 +0,0 @@ -package de.tudresden.inf.st.train.racr.test; - -import de.tudresden.inf.st.train.racr.RacrBenchmarkScenario; -import de.tudresden.inf.st.train.racr.config.RacrBenchmarkConfigBuilder; -import de.tudresden.inf.st.train.racr.util.TestUtils; -import hu.bme.mit.trainbenchmark.benchmark.config.BenchmarkConfigBase; -import hu.bme.mit.trainbenchmark.benchmark.runcomponents.BenchmarkResult; -import hu.bme.mit.trainbenchmark.benchmark.test.TrainBenchmarkTest; -import org.junit.Assume; -import org.junit.Ignore; - -public class RacrSchemeTest extends TrainBenchmarkTest { - - @Override - protected BenchmarkResult runTest(final BenchmarkConfigBase bcb) throws Exception { - Assume.assumeTrue(TestUtils.pracrServerReachable(bcb, RacrBenchmarkConfigBuilder::useScheme)); - return TestUtils.runTest(bcb, RacrBenchmarkConfigBuilder::useScheme, RacrBenchmarkScenario::new); - } - - private void no() { Assume.assumeTrue(false); } - - @Override public void batchTest() throws Exception { no(); } - @Override public void injectTest() throws Exception { no(); } - @Override public void repairTest() throws Exception { no(); } - -// @Override public void posLengthInjectTest() throws Exception { no(); } -// @Override public void posLengthRepairTest() throws Exception { no(); } -// -// @Override public void connectedSegmentsInjectTest() throws Exception { no(); } -// @Override public void connectedSegmentsRepairTest() throws Exception { no(); } -// -// @Override public void routeSensorInjectTest() throws Exception { no(); } -// @Override public void routeSensorRepairTest() throws Exception { no(); } -// -// @Override public void semaphoreNeighborInjectTest() throws Exception { no(); } -// @Override public void semaphoreNeighborRepairTest() throws Exception { no(); } -// -// @Override public void switchMonitoredInjectTest() throws Exception { no(); } -// @Override public void switchMonitoredRepairTest() throws Exception { no(); } -// -// @Override public void switchSetInjectTest() throws Exception { no(); } -// @Override public void switchSetRepairTest() throws Exception { no(); } -} diff --git a/trainbenchmark-tool-racr/build.gradle b/trainbenchmark-tool-racr/build.gradle deleted file mode 100644 index 514f0120c..000000000 --- a/trainbenchmark-tool-racr/build.gradle +++ /dev/null @@ -1,17 +0,0 @@ -plugins { id "com.github.johnrengelman.shadow" version "1.2.3" } - -shadowJar { - classifier = 'fat' - manifest { attributes 'Main-Class': 'de.tudresden.inf.st.train.racr.RacrBenchmarkMain' } -} - -dependencies { - compile project(':trainbenchmark-tool') - compile group: 'com.google.http-client', name: 'google-http-client', version: '1.22.0' - compile group: 'com.googlecode.json-simple', name: 'json-simple', version: '1.1.1' -} - -task killPracrServers(type: Exec) { - // send ctrl+c (SIGINT) to running servers - commandLine 'pkill', '--signal', 'SIGINT', '-f', 'main.py' -} diff --git a/trainbenchmark-tool-racr/src/main/java/de/tudresden/inf/st/train/racr/RacrBenchmarkMain.java b/trainbenchmark-tool-racr/src/main/java/de/tudresden/inf/st/train/racr/RacrBenchmarkMain.java deleted file mode 100644 index 8009bad8f..000000000 --- a/trainbenchmark-tool-racr/src/main/java/de/tudresden/inf/st/train/racr/RacrBenchmarkMain.java +++ /dev/null @@ -1,119 +0,0 @@ -package de.tudresden.inf.st.train.racr; - -import com.google.common.collect.ImmutableMap; -import de.tudresden.inf.st.train.racr.config.RacrBenchmarkConfig; -import de.tudresden.inf.st.train.racr.driver.RacrDriver; -import de.tudresden.inf.st.train.racr.matches.RacrConnectedSegmentsInjectMatch; -import de.tudresden.inf.st.train.racr.matches.RacrRouteSensorInjectMatch; -import de.tudresden.inf.st.train.racr.queries.RacrQueryConnectedSegmentsInject; -import de.tudresden.inf.st.train.racr.queries.RacrQueryRouteSensorInject; -import de.tudresden.inf.st.train.racr.util.*; -import hu.bme.mit.trainbenchmark.benchmark.config.BenchmarkConfig; - -import java.io.IOException; -import java.net.ConnectException; -import java.util.Collection; - -public class RacrBenchmarkMain { - - public static void main(String[] args) throws Exception { -// testSocketPosLength(); -// testHttpClient(); -// testHttpSystemTime(); -// testHttpPosLength(); -// testHttpRouteSensor(); - normal_main(args); - } - - private static void normal_main(String[] args) throws Exception { - System.out.println("Start"); - final RacrBenchmarkConfig bc = BenchmarkConfig.fromFile(args[0], RacrBenchmarkConfig.class); - int tries = 5; - boolean dead = true; - while (dead && --tries >= 0) { - try (AbstractClient client = RacrUtils.connectToPracr(1, bc.config)) { - dead = !client.callServerTime().isPresent(); - } catch (Exception e) { - if (!(e.getCause() instanceof ConnectException)) { - System.err.println("Got an error, but not ConnectException"); - e.printStackTrace(); - } - // not ready yet, wait a second - System.out.println("Waiting for pracr " + System.currentTimeMillis()); - Thread.sleep(1000); - } - } - if (dead) { - throw new IllegalStateException("Server at " + bc.config.host + ":" + - bc.config.port + " is not reachable!"); - } - final RacrBenchmarkScenario scenario = new RacrBenchmarkScenario(bc); - scenario.performBenchmark(); - try (AbstractClient client = RacrUtils.connectToPracr(5, bc.config)) { - client.callSystemExit(); - } - System.out.println("End"); - } - - private static void testSocketPosLength() throws IOException { - RacrConfig config = new RacrConfig(); - config.host = "localhost"; - config.port = 9999; - config.verbose = true; - try (SocketClient client = new SocketClient(30, config)) { - client.callInitModel("../models/railway-inject-2-ag.json"); - } - RacrQueryConnectedSegmentsInject<RacrDriver> query = new RacrQueryConnectedSegmentsInject<>(new RacrDriver(config)); - Collection<RacrConnectedSegmentsInjectMatch> matches = query.evaluate(); - System.out.println(matches); - System.out.println("Size: " + matches.size()); - } - - private static void testHttpClient() { - RacrConfig config = new RacrConfig(); - config.host = "httpbin.org"; - config.port = 80; - config.verbose = true; - try (RacrHttpClient client = new RacrHttpClient("post", 5, config)) { - Event event = new Event("testClassName", ImmutableMap.of("attribute", "value")); - String response = client.call(event, true); - System.out.println(response); - } - } - - private static void testHttpSystemTime() { - RacrConfig config = new RacrConfig(); - config.verbose = true; - try (RacrHttpClient client = RacrHttpClient.connectToPracr(5, config)) { - Event event = new Event("pracr.event", "ServerTimeEvent"); - String response = client.call(event, true); - System.out.println(response); - } - } - - private static void testHttpPosLength() throws IOException { - RacrConfig config = new RacrConfig(); - config.verbose = true; - config.loadUsingScheme = false; - config.port = 9444; - config.clientType = RacrConfig.ClientType.HTTP; - try (RacrHttpClient client = RacrHttpClient.connectToPracr(5, config)) { - client.callInitModel("../models/railway-inject-2-ag.json"); - } - RacrQueryConnectedSegmentsInject<RacrDriver> query = new RacrQueryConnectedSegmentsInject<>(new RacrDriver(config)); - Collection<RacrConnectedSegmentsInjectMatch> matches = query.evaluate(); - System.out.println(matches); - System.out.println("Size: " + matches.size()); - } - - private static void testHttpRouteSensor() throws IOException { - RacrConfig config = new RacrConfig(); - try (RacrHttpClient client = RacrHttpClient.connectToPracr(5, config)) { - client.callInitModel("../models/railway-inject-1-ag.json"); - } - RacrQueryRouteSensorInject<RacrDriver> query = new RacrQueryRouteSensorInject<>(new RacrDriver(config)); - Collection<RacrRouteSensorInjectMatch> matches = query.evaluate(); - System.out.println(matches); - System.out.println("Size: " + matches.size()); - } -} diff --git a/trainbenchmark-tool-racr/src/main/java/de/tudresden/inf/st/train/racr/RacrBenchmarkScenario.java b/trainbenchmark-tool-racr/src/main/java/de/tudresden/inf/st/train/racr/RacrBenchmarkScenario.java deleted file mode 100644 index 10d4a3c3d..000000000 --- a/trainbenchmark-tool-racr/src/main/java/de/tudresden/inf/st/train/racr/RacrBenchmarkScenario.java +++ /dev/null @@ -1,18 +0,0 @@ -package de.tudresden.inf.st.train.racr; - -import de.tudresden.inf.st.train.racr.comparators.RacrMatchComparator; -import de.tudresden.inf.st.train.racr.config.RacrBenchmarkConfig; -import de.tudresden.inf.st.train.racr.driver.RacrDriver; -import de.tudresden.inf.st.train.racr.driver.RacrDriverFactory; -import de.tudresden.inf.st.train.racr.matches.RacrMatch; -import de.tudresden.inf.st.train.racr.operations.RacrModelOperationFactory; -import hu.bme.mit.trainbenchmark.benchmark.phases.BenchmarkScenario; - -public class RacrBenchmarkScenario extends - BenchmarkScenario<RacrMatch, RacrDriver, RacrBenchmarkConfig> { - - public RacrBenchmarkScenario(final RacrBenchmarkConfig bc) throws Exception { - super(new RacrDriverFactory(bc.config), new RacrModelOperationFactory(), new RacrMatchComparator(), bc); - } - -} diff --git a/trainbenchmark-tool-racr/src/main/java/de/tudresden/inf/st/train/racr/SocketTestMain.java b/trainbenchmark-tool-racr/src/main/java/de/tudresden/inf/st/train/racr/SocketTestMain.java deleted file mode 100644 index cf10e42ed..000000000 --- a/trainbenchmark-tool-racr/src/main/java/de/tudresden/inf/st/train/racr/SocketTestMain.java +++ /dev/null @@ -1,53 +0,0 @@ -package de.tudresden.inf.st.train.racr; - -import de.tudresden.inf.st.train.racr.driver.RacrDriver; -import de.tudresden.inf.st.train.racr.matches.RacrConnectedSegmentsInjectMatch; -import de.tudresden.inf.st.train.racr.matches.RacrMatch; -import de.tudresden.inf.st.train.racr.matches.RacrRouteSensorMatch; -import de.tudresden.inf.st.train.racr.queries.RacrQuery; -import de.tudresden.inf.st.train.racr.queries.RacrQueryConnectedSegmentsInject; -import de.tudresden.inf.st.train.racr.queries.RacrQueryPosLength; -import de.tudresden.inf.st.train.racr.queries.RacrQueryRouteSensor; -import de.tudresden.inf.st.train.racr.util.AbstractClient; -import de.tudresden.inf.st.train.racr.util.Event; -import de.tudresden.inf.st.train.racr.util.RacrConfig; -import de.tudresden.inf.st.train.racr.util.SocketClient; - -import java.io.IOException; -import java.util.Collection; - -/** - * Testing the SocketClient with racr-c++ - * Created by rschoene on 8/18/17. - */ -public class SocketTestMain { - - private static <T extends RacrMatch, TRacrDriver extends RacrDriver> void run(RacrQuery<T, TRacrDriver> query) { - Collection<T> matches; - try { - matches = query.evaluate(); - } catch (Exception e) { - e.printStackTrace(); - return; - } - System.out.println(matches); - System.out.println("Size: " + matches.size()); - } - - public static void main(String[] args) throws IOException { - RacrConfig config = new RacrConfig(); - config.host = "localhost"; - config.port = 9999; - config.verbose = true; - config.clientType = RacrConfig.ClientType.SOCKET; - try (AbstractClient client = SocketClient.connectToPracr(10, config)) { - client.callInitModel("../models/railway-inject-2-ag.json"); - } - RacrDriver driver = new RacrDriver(config); - run(new RacrQueryRouteSensor<>(driver)); - run(new RacrQueryPosLength<>(driver)); - try (AbstractClient client = SocketClient.connectToPracr(10, config)) { - client.call(new Event("SystemExitEvent")); - } - } -} diff --git a/trainbenchmark-tool-racr/src/main/java/de/tudresden/inf/st/train/racr/comparators/RacrMatchComparator.java b/trainbenchmark-tool-racr/src/main/java/de/tudresden/inf/st/train/racr/comparators/RacrMatchComparator.java deleted file mode 100644 index 83f32be0a..000000000 --- a/trainbenchmark-tool-racr/src/main/java/de/tudresden/inf/st/train/racr/comparators/RacrMatchComparator.java +++ /dev/null @@ -1,12 +0,0 @@ -package de.tudresden.inf.st.train.racr.comparators; - -import de.tudresden.inf.st.train.racr.matches.RacrMatch; -import hu.bme.mit.trainbenchmark.benchmark.comparators.LongMatchComparator; - -public class RacrMatchComparator extends LongMatchComparator<RacrMatch> { - -// public RacrMatchComparator() { -// super(new ASTNodeComparator()); -// } - -} diff --git a/trainbenchmark-tool-racr/src/main/java/de/tudresden/inf/st/train/racr/config/RacrBenchmarkConfig.java b/trainbenchmark-tool-racr/src/main/java/de/tudresden/inf/st/train/racr/config/RacrBenchmarkConfig.java deleted file mode 100644 index 342ac0bf6..000000000 --- a/trainbenchmark-tool-racr/src/main/java/de/tudresden/inf/st/train/racr/config/RacrBenchmarkConfig.java +++ /dev/null @@ -1,26 +0,0 @@ -package de.tudresden.inf.st.train.racr.config; - -import de.tudresden.inf.st.train.racr.util.RacrConfig; -import hu.bme.mit.trainbenchmark.benchmark.config.BenchmarkConfig; -import hu.bme.mit.trainbenchmark.benchmark.config.BenchmarkConfigBase; - -public class RacrBenchmarkConfig extends BenchmarkConfig { - - public final RacrConfig config; - - RacrBenchmarkConfig(final BenchmarkConfigBase configBase, RacrConfig config) { - super(configBase); - this.config = config; - } - - @Override - public String getToolName() { - return "Racr (" + config.flavor + ")"; - } - - @Override - public String getProjectName() { - return "racr-" + config.projectNameSuffix; - } - -} diff --git a/trainbenchmark-tool-racr/src/main/java/de/tudresden/inf/st/train/racr/config/RacrBenchmarkConfigBuilder.java b/trainbenchmark-tool-racr/src/main/java/de/tudresden/inf/st/train/racr/config/RacrBenchmarkConfigBuilder.java deleted file mode 100644 index 937030fa2..000000000 --- a/trainbenchmark-tool-racr/src/main/java/de/tudresden/inf/st/train/racr/config/RacrBenchmarkConfigBuilder.java +++ /dev/null @@ -1,71 +0,0 @@ -package de.tudresden.inf.st.train.racr.config; - -import de.tudresden.inf.st.train.racr.util.RacrConfig; -import hu.bme.mit.trainbenchmark.benchmark.config.BenchmarkConfigBuilder; - -public class RacrBenchmarkConfigBuilder extends BenchmarkConfigBuilder<RacrBenchmarkConfig, RacrBenchmarkConfigBuilder> { - - private RacrConfig config = new RacrConfig(); - - @Override - public RacrBenchmarkConfig createConfig() { - checkNotNulls(); - return new RacrBenchmarkConfig(configBase, config); - } - - public RacrBenchmarkConfigBuilder setVerbose(boolean verbose) { - this.config.verbose = verbose; - return this; - } - - @Deprecated - public RacrBenchmarkConfigBuilder setUseScheme(boolean useScheme) { - if (useScheme) { - config.loadUsingScheme = true; - config.port = 9567; - } else { - config.loadUsingScheme = false; - config.port = 9444; - } - return this; - } - - public RacrBenchmarkConfigBuilder usePython() { - config.loadUsingScheme = false; - config.port = 9567; - config.flavor = "Python"; - config.projectNameSuffix = "python"; - return this; - } - - public RacrBenchmarkConfigBuilder useScheme() { - config.loadUsingScheme = true; - config.port = 9444; - config.flavor = "Scheme"; - config.projectNameSuffix = "scheme"; - return this; - } - - public RacrBenchmarkConfigBuilder useCpp() { - config.loadUsingScheme = false; - config.port = 9999; - config.flavor = "CPP"; - config.projectNameSuffix = "cpp"; - return setClientType(RacrConfig.ClientType.SOCKET); - } - - public RacrBenchmarkConfigBuilder useExternalServer() { - config.startStopOwnServer = false; - return this; - } - - public RacrBenchmarkConfigBuilder useInternalServer() { - config.startStopOwnServer = true; - return this; - } - - public RacrBenchmarkConfigBuilder setClientType(RacrConfig.ClientType new_type) { - config.clientType = new_type; - return this; - } -} diff --git a/trainbenchmark-tool-racr/src/main/java/de/tudresden/inf/st/train/racr/driver/RacrDriver.java b/trainbenchmark-tool-racr/src/main/java/de/tudresden/inf/st/train/racr/driver/RacrDriver.java deleted file mode 100644 index dc0d28bc0..000000000 --- a/trainbenchmark-tool-racr/src/main/java/de/tudresden/inf/st/train/racr/driver/RacrDriver.java +++ /dev/null @@ -1,35 +0,0 @@ -package de.tudresden.inf.st.train.racr.driver; - -import de.tudresden.inf.st.train.racr.util.AbstractClient; -import de.tudresden.inf.st.train.racr.util.RacrConfig; -import de.tudresden.inf.st.train.racr.util.RacrUtils; -import hu.bme.mit.trainbenchmark.benchmark.driver.Driver; - -import java.io.IOException; - - -public class RacrDriver extends Driver { - - public final RacrConfig config; - - public RacrDriver(RacrConfig config) { - super(); - this.config = config; - } - - public static RacrDriver create(RacrConfig config) { - return new RacrDriver(config); - } - - @Override - public void read(final String modelPath) throws IOException { - try (AbstractClient client = RacrUtils.connectToPracr(10, this)) { - client.callInitModel(modelPath); - } - } - - @Override - public String getPostfix() { - return "-ag.json"; - } -} diff --git a/trainbenchmark-tool-racr/src/main/java/de/tudresden/inf/st/train/racr/driver/RacrDriverFactory.java b/trainbenchmark-tool-racr/src/main/java/de/tudresden/inf/st/train/racr/driver/RacrDriverFactory.java deleted file mode 100644 index db3044118..000000000 --- a/trainbenchmark-tool-racr/src/main/java/de/tudresden/inf/st/train/racr/driver/RacrDriverFactory.java +++ /dev/null @@ -1,20 +0,0 @@ -package de.tudresden.inf.st.train.racr.driver; - -import de.tudresden.inf.st.train.racr.util.RacrConfig; -import hu.bme.mit.trainbenchmark.benchmark.driver.DriverFactory; - -public class RacrDriverFactory extends DriverFactory<RacrDriver> { - - public final RacrConfig config; - - public RacrDriverFactory(RacrConfig config) { - super(); - this.config = config; - } - - @Override - public RacrDriver createInstance() throws Exception { - return RacrDriver.create(config); - } - -} diff --git a/trainbenchmark-tool-racr/src/main/java/de/tudresden/inf/st/train/racr/matches/RacrConnectedSegmentsInjectMatch.java b/trainbenchmark-tool-racr/src/main/java/de/tudresden/inf/st/train/racr/matches/RacrConnectedSegmentsInjectMatch.java deleted file mode 100644 index eb1916040..000000000 --- a/trainbenchmark-tool-racr/src/main/java/de/tudresden/inf/st/train/racr/matches/RacrConnectedSegmentsInjectMatch.java +++ /dev/null @@ -1,48 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2010-2015, Benedek Izso, Gabor Szarnyas, Istvan Rath and Daniel Varro - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Benedek Izso - initial API and implementation - * Gabor Szarnyas - initial API and implementation - *******************************************************************************/ -package de.tudresden.inf.st.train.racr.matches; - -import hu.bme.mit.trainbenchmark.benchmark.matches.ConnectedSegmentsInjectMatch; - -public class RacrConnectedSegmentsInjectMatch extends RacrMatch implements ConnectedSegmentsInjectMatch { - - protected final Long sensor; - protected final Long segment1; - protected final Long segment3; - - public RacrConnectedSegmentsInjectMatch(final Long sensor, final Long segment1, final Long segment3) { - super(sensor, segment1, segment3); - this.sensor = sensor; - this.segment1 = segment1; - this.segment3 = segment3; - } - - public RacrConnectedSegmentsInjectMatch(Object[] objects) { - this((Long) objects[0], (Long) objects[1], (Long) objects[2]); - } - - @Override - public Long getSensor() { - return sensor; - } - - @Override - public Long getSegment1() { - return segment1; - } - - @Override - public Long getSegment3() { - return segment3; - } - -} diff --git a/trainbenchmark-tool-racr/src/main/java/de/tudresden/inf/st/train/racr/matches/RacrConnectedSegmentsMatch.java b/trainbenchmark-tool-racr/src/main/java/de/tudresden/inf/st/train/racr/matches/RacrConnectedSegmentsMatch.java deleted file mode 100644 index 5b764cbdf..000000000 --- a/trainbenchmark-tool-racr/src/main/java/de/tudresden/inf/st/train/racr/matches/RacrConnectedSegmentsMatch.java +++ /dev/null @@ -1,77 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2010-2015, Benedek Izso, Gabor Szarnyas, Istvan Rath and Daniel Varro - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Benedek Izso - initial API and implementation - * Gabor Szarnyas - initial API and implementation - *******************************************************************************/ -package de.tudresden.inf.st.train.racr.matches; - -import hu.bme.mit.trainbenchmark.benchmark.matches.ConnectedSegmentsMatch; - -public class RacrConnectedSegmentsMatch extends RacrMatch implements ConnectedSegmentsMatch { - - protected final Long sensor; - protected final Long segment1; - protected final Long segment2; - protected final Long segment3; - protected final Long segment4; - protected final Long segment5; - protected final Long segment6; - - public RacrConnectedSegmentsMatch(final Long sensor, final Long segment1, final Long segment2, - final Long segment3, final Long segment4, final Long segment5, final Long segment6) { - super(sensor, segment1, segment2, segment3, segment4, segment5, segment6); - this.sensor = sensor; - this.segment1 = segment1; - this.segment2 = segment2; - this.segment3 = segment3; - this.segment4 = segment4; - this.segment5 = segment5; - this.segment6 = segment6; - } - - public RacrConnectedSegmentsMatch(Object[] objects) { - this((Long) objects[0], (Long) objects[1], (Long) objects[2], (Long) objects[3], (Long) objects[4], (Long) objects[5], (Long) objects[6]); - } - - @Override - public Long getSensor() { - return sensor; - } - - @Override - public Long getSegment1() { - return segment1; - } - - @Override - public Long getSegment2() { - return segment2; - } - - @Override - public Long getSegment3() { - return segment3; - } - - @Override - public Long getSegment4() { - return segment4; - } - - @Override - public Long getSegment5() { - return segment5; - } - - @Override - public Long getSegment6() { - return segment6; - } - -} diff --git a/trainbenchmark-tool-racr/src/main/java/de/tudresden/inf/st/train/racr/matches/RacrMatch.java b/trainbenchmark-tool-racr/src/main/java/de/tudresden/inf/st/train/racr/matches/RacrMatch.java deleted file mode 100644 index 90c40644c..000000000 --- a/trainbenchmark-tool-racr/src/main/java/de/tudresden/inf/st/train/racr/matches/RacrMatch.java +++ /dev/null @@ -1,12 +0,0 @@ -package de.tudresden.inf.st.train.racr.matches; - -import hu.bme.mit.trainbenchmark.benchmark.matches.LongMatch; - -public abstract class RacrMatch extends LongMatch { - - RacrMatch(Long... ids) { - super(); - this.match = ids; - } - -} diff --git a/trainbenchmark-tool-racr/src/main/java/de/tudresden/inf/st/train/racr/matches/RacrPosLengthInjectMatch.java b/trainbenchmark-tool-racr/src/main/java/de/tudresden/inf/st/train/racr/matches/RacrPosLengthInjectMatch.java deleted file mode 100644 index f57a9048a..000000000 --- a/trainbenchmark-tool-racr/src/main/java/de/tudresden/inf/st/train/racr/matches/RacrPosLengthInjectMatch.java +++ /dev/null @@ -1,19 +0,0 @@ -package de.tudresden.inf.st.train.racr.matches; - -import hu.bme.mit.trainbenchmark.benchmark.matches.PosLengthInjectMatch; - -public class RacrPosLengthInjectMatch extends RacrMatch implements PosLengthInjectMatch { - - protected final Long segment_id; - - public RacrPosLengthInjectMatch(final Long segment_id) { - super(segment_id); - this.segment_id = segment_id; - } - - @Override - public Long getSegment() { - return segment_id; - } - -} diff --git a/trainbenchmark-tool-racr/src/main/java/de/tudresden/inf/st/train/racr/matches/RacrPosLengthMatch.java b/trainbenchmark-tool-racr/src/main/java/de/tudresden/inf/st/train/racr/matches/RacrPosLengthMatch.java deleted file mode 100644 index c400b5386..000000000 --- a/trainbenchmark-tool-racr/src/main/java/de/tudresden/inf/st/train/racr/matches/RacrPosLengthMatch.java +++ /dev/null @@ -1,19 +0,0 @@ -package de.tudresden.inf.st.train.racr.matches; - -import hu.bme.mit.trainbenchmark.benchmark.matches.PosLengthMatch; - -public class RacrPosLengthMatch extends RacrMatch implements PosLengthMatch { - - protected final Long segment_id; - - public RacrPosLengthMatch(final Long segment_id) { - super(segment_id); - this.segment_id = segment_id; - } - - @Override - public Long getSegment() { - return segment_id; - } - -} diff --git a/trainbenchmark-tool-racr/src/main/java/de/tudresden/inf/st/train/racr/matches/RacrRouteSensorInjectMatch.java b/trainbenchmark-tool-racr/src/main/java/de/tudresden/inf/st/train/racr/matches/RacrRouteSensorInjectMatch.java deleted file mode 100644 index 56aea5619..000000000 --- a/trainbenchmark-tool-racr/src/main/java/de/tudresden/inf/st/train/racr/matches/RacrRouteSensorInjectMatch.java +++ /dev/null @@ -1,41 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2010-2015, Benedek Izso, Gabor Szarnyas, Istvan Rath and Daniel Varro - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Benedek Izso - initial API and implementation - * Gabor Szarnyas - initial API and implementation - *******************************************************************************/ -package de.tudresden.inf.st.train.racr.matches; - -import hu.bme.mit.trainbenchmark.benchmark.matches.RouteSensorInjectMatch; - -public class RacrRouteSensorInjectMatch extends RacrMatch implements RouteSensorInjectMatch { - - protected final Long route; - protected final Long sensor; - - public RacrRouteSensorInjectMatch(final Long route, final Long sensor) { - super(); - this.route = route; - this.sensor = sensor; - } - - public RacrRouteSensorInjectMatch(Object[] objects) { - this((Long) objects[0], (Long) objects[1]); - } - - @Override - public Long getRoute() { - return route; - } - - @Override - public Long getSensor() { - return sensor; - } - -} diff --git a/trainbenchmark-tool-racr/src/main/java/de/tudresden/inf/st/train/racr/matches/RacrRouteSensorMatch.java b/trainbenchmark-tool-racr/src/main/java/de/tudresden/inf/st/train/racr/matches/RacrRouteSensorMatch.java deleted file mode 100644 index 0c26c3434..000000000 --- a/trainbenchmark-tool-racr/src/main/java/de/tudresden/inf/st/train/racr/matches/RacrRouteSensorMatch.java +++ /dev/null @@ -1,55 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2010-2015, Benedek Izso, Gabor Szarnyas, Istvan Rath and Daniel Varro - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Benedek Izso - initial API and implementation - * Gabor Szarnyas - initial API and implementation - *******************************************************************************/ -package de.tudresden.inf.st.train.racr.matches; - -import hu.bme.mit.trainbenchmark.benchmark.matches.RouteSensorMatch; - -public class RacrRouteSensorMatch extends RacrMatch implements RouteSensorMatch { - - protected final Long route; - protected final Long sensor; - protected final Long swP; - protected final Long sw; - - public RacrRouteSensorMatch(final Long route, final Long sensor, final Long swP, final Long sw) { - super(route, sensor, swP, sw); - this.route = route; - this.sensor = sensor; - this.swP = swP; - this.sw = sw; - } - - public RacrRouteSensorMatch(Object[] objects) { - this((Long) objects[0], (Long) objects[1], (Long) objects[2], (Long) objects[3]); - } - - @Override - public Long getRoute() { - return route; - } - - @Override - public Long getSensor() { - return sensor; - } - - @Override - public Long getSwP() { - return swP; - } - - @Override - public Long getSw() { - return sw; - } - -} diff --git a/trainbenchmark-tool-racr/src/main/java/de/tudresden/inf/st/train/racr/matches/RacrSemaphoreNeighborInjectMatch.java b/trainbenchmark-tool-racr/src/main/java/de/tudresden/inf/st/train/racr/matches/RacrSemaphoreNeighborInjectMatch.java deleted file mode 100644 index 15d3ee72a..000000000 --- a/trainbenchmark-tool-racr/src/main/java/de/tudresden/inf/st/train/racr/matches/RacrSemaphoreNeighborInjectMatch.java +++ /dev/null @@ -1,41 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2010-2015, Benedek Izso, Gabor Szarnyas, Istvan Rath and Daniel Varro - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Benedek Izso - initial API and implementation - * Gabor Szarnyas - initial API and implementation - *******************************************************************************/ -package de.tudresden.inf.st.train.racr.matches; - -import hu.bme.mit.trainbenchmark.benchmark.matches.SemaphoreNeighborInjectMatch; - -public class RacrSemaphoreNeighborInjectMatch extends RacrMatch implements SemaphoreNeighborInjectMatch { - - protected final Long route; - protected final Long semaphore; - - public RacrSemaphoreNeighborInjectMatch(final Long route, final Long semaphore) { - super(route, semaphore); - this.route = route; - this.semaphore = semaphore; - } - - public RacrSemaphoreNeighborInjectMatch(Object[] objects) { - this((Long) objects[0], (Long) objects[1]); - } - - @Override - public Long getRoute() { - return route; - } - - @Override - public Long getSemaphore() { - return semaphore; - } - -} diff --git a/trainbenchmark-tool-racr/src/main/java/de/tudresden/inf/st/train/racr/matches/RacrSemaphoreNeighborMatch.java b/trainbenchmark-tool-racr/src/main/java/de/tudresden/inf/st/train/racr/matches/RacrSemaphoreNeighborMatch.java deleted file mode 100644 index a8ae42091..000000000 --- a/trainbenchmark-tool-racr/src/main/java/de/tudresden/inf/st/train/racr/matches/RacrSemaphoreNeighborMatch.java +++ /dev/null @@ -1,77 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2010-2015, Benedek Izso, Gabor Szarnyas, Istvan Rath and Daniel Varro - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Benedek Izso - initial API and implementation - * Gabor Szarnyas - initial API and implementation - *******************************************************************************/ -package de.tudresden.inf.st.train.racr.matches; - -import hu.bme.mit.trainbenchmark.benchmark.matches.SemaphoreNeighborMatch; - -public class RacrSemaphoreNeighborMatch extends RacrMatch implements SemaphoreNeighborMatch { - - protected final Long semaphore; - protected final Long route1; - protected final Long route2; - protected final Long sensor1; - protected final Long sensor2; - protected final Long te1; - protected final Long te2; - - public RacrSemaphoreNeighborMatch(final Long semaphore, final Long route1, final Long route2, final Long sensor1, final Long sensor2, - final Long te1, final Long te2) { - super(semaphore, route1, route2, sensor1, sensor2, te1, te2); - this.semaphore = semaphore; - this.route1 = route1; - this.route2 = route2; - this.sensor1 = sensor1; - this.sensor2 = sensor2; - this.te1 = te1; - this.te2 = te2; - } - - public RacrSemaphoreNeighborMatch(Object[] objects) { - this((Long) objects[0], (Long) objects[1], (Long) objects[2], (Long) objects[3], (Long) objects[4], (Long) objects[5], (Long) objects[6]); - } - - @Override - public Long getSemaphore() { - return semaphore; - } - - @Override - public Long getRoute1() { - return route1; - } - - @Override - public Long getRoute2() { - return route2; - } - - @Override - public Long getSensor1() { - return sensor1; - } - - @Override - public Long getSensor2() { - return sensor2; - } - - @Override - public Long getTe1() { - return te1; - } - - @Override - public Long getTe2() { - return te2; - } - -} diff --git a/trainbenchmark-tool-racr/src/main/java/de/tudresden/inf/st/train/racr/matches/RacrSwitchMonitoredInjectMatch.java b/trainbenchmark-tool-racr/src/main/java/de/tudresden/inf/st/train/racr/matches/RacrSwitchMonitoredInjectMatch.java deleted file mode 100644 index 50d5da513..000000000 --- a/trainbenchmark-tool-racr/src/main/java/de/tudresden/inf/st/train/racr/matches/RacrSwitchMonitoredInjectMatch.java +++ /dev/null @@ -1,34 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2010-2015, Benedek Izso, Gabor Szarnyas, Istvan Rath and Daniel Varro - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Benedek Izso - initial API and implementation - * Gabor Szarnyas - initial API and implementation - *******************************************************************************/ -package de.tudresden.inf.st.train.racr.matches; - -import hu.bme.mit.trainbenchmark.benchmark.matches.SwitchMonitoredInjectMatch; - -public class RacrSwitchMonitoredInjectMatch extends RacrMatch implements SwitchMonitoredInjectMatch { - - protected final Long sw; - - public RacrSwitchMonitoredInjectMatch(final Long sw) { - super(sw); - this.sw = sw; - } - - public RacrSwitchMonitoredInjectMatch(Object[] objects) { - this((Long) objects[0]); - } - - @Override - public Long getSw() { - return sw; - } - -} diff --git a/trainbenchmark-tool-racr/src/main/java/de/tudresden/inf/st/train/racr/matches/RacrSwitchMonitoredMatch.java b/trainbenchmark-tool-racr/src/main/java/de/tudresden/inf/st/train/racr/matches/RacrSwitchMonitoredMatch.java deleted file mode 100644 index 31918b5b9..000000000 --- a/trainbenchmark-tool-racr/src/main/java/de/tudresden/inf/st/train/racr/matches/RacrSwitchMonitoredMatch.java +++ /dev/null @@ -1,34 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2010-2015, Benedek Izso, Gabor Szarnyas, Istvan Rath and Daniel Varro - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Benedek Izso - initial API and implementation - * Gabor Szarnyas - initial API and implementation - *******************************************************************************/ -package de.tudresden.inf.st.train.racr.matches; - -import hu.bme.mit.trainbenchmark.benchmark.matches.SwitchMonitoredMatch; - -public class RacrSwitchMonitoredMatch extends RacrMatch implements SwitchMonitoredMatch { - - protected final Long sw; - - public RacrSwitchMonitoredMatch(final Long sw) { - super(sw); - this.sw = sw; - } - - public RacrSwitchMonitoredMatch(Object[] objects) { - this((Long) objects[0]); - } - - @Override - public Long getSw() { - return sw; - } - -} diff --git a/trainbenchmark-tool-racr/src/main/java/de/tudresden/inf/st/train/racr/matches/RacrSwitchSetInjectMatch.java b/trainbenchmark-tool-racr/src/main/java/de/tudresden/inf/st/train/racr/matches/RacrSwitchSetInjectMatch.java deleted file mode 100644 index 7162d92c7..000000000 --- a/trainbenchmark-tool-racr/src/main/java/de/tudresden/inf/st/train/racr/matches/RacrSwitchSetInjectMatch.java +++ /dev/null @@ -1,34 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2010-2015, Benedek Izso, Gabor Szarnyas, Istvan Rath and Daniel Varro - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Benedek Izso - initial API and implementation - * Gabor Szarnyas - initial API and implementation - *******************************************************************************/ -package de.tudresden.inf.st.train.racr.matches; - -import hu.bme.mit.trainbenchmark.benchmark.matches.SwitchSetInjectMatch; - -public class RacrSwitchSetInjectMatch extends RacrMatch implements SwitchSetInjectMatch { - - protected final Long sw; - - public RacrSwitchSetInjectMatch(final Long sw) { - super(sw); - this.sw = sw; - } - - public RacrSwitchSetInjectMatch(Object[] objects) { - this((Long) objects[0]); - } - - @Override - public Long getSw() { - return sw; - } - -} diff --git a/trainbenchmark-tool-racr/src/main/java/de/tudresden/inf/st/train/racr/matches/RacrSwitchSetMatch.java b/trainbenchmark-tool-racr/src/main/java/de/tudresden/inf/st/train/racr/matches/RacrSwitchSetMatch.java deleted file mode 100644 index 396e74ae9..000000000 --- a/trainbenchmark-tool-racr/src/main/java/de/tudresden/inf/st/train/racr/matches/RacrSwitchSetMatch.java +++ /dev/null @@ -1,55 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2010-2015, Benedek Izso, Gabor Szarnyas, Istvan Rath and Daniel Varro - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Benedek Izso - initial API and implementation - * Gabor Szarnyas - initial API and implementation - *******************************************************************************/ -package de.tudresden.inf.st.train.racr.matches; - -import hu.bme.mit.trainbenchmark.benchmark.matches.SwitchSetMatch; - -public class RacrSwitchSetMatch extends RacrMatch implements SwitchSetMatch { - - private final Long semaphore; - private final Long route; - private final Long swP; - private final Long sw; - - public RacrSwitchSetMatch(final Long semaphore, final Long route, final Long swP, final Long sw) { - super(semaphore, route, swP, sw); - this.semaphore = semaphore; - this.route = route; - this.swP = swP; - this.sw = sw; - } - - public RacrSwitchSetMatch(Object[] objects) { - this((Long) objects[0], (Long) objects[1], (Long) objects[2], (Long) objects[3]); - } - - @Override - public Long getSemaphore() { - return semaphore; - } - - @Override - public Long getRoute() { - return route; - } - - @Override - public Long getSwP() { - return swP; - } - - @Override - public Long getSw() { - return sw; - } - -} diff --git a/trainbenchmark-tool-racr/src/main/java/de/tudresden/inf/st/train/racr/operations/RacrModelOperationFactory.java b/trainbenchmark-tool-racr/src/main/java/de/tudresden/inf/st/train/racr/operations/RacrModelOperationFactory.java deleted file mode 100644 index 88941d2af..000000000 --- a/trainbenchmark-tool-racr/src/main/java/de/tudresden/inf/st/train/racr/operations/RacrModelOperationFactory.java +++ /dev/null @@ -1,127 +0,0 @@ -package de.tudresden.inf.st.train.racr.operations; - -import de.tudresden.inf.st.train.racr.driver.RacrDriver; -import de.tudresden.inf.st.train.racr.matches.*; -import de.tudresden.inf.st.train.racr.queries.*; -import de.tudresden.inf.st.train.racr.transformations.RacrTransformation; -import de.tudresden.inf.st.train.racr.transformations.inject.*; -import de.tudresden.inf.st.train.racr.transformations.repair.*; -import de.tudresden.inf.st.train.racr.util.RacrConfig; -import hu.bme.mit.trainbenchmark.benchmark.operations.ModelOperation; -import hu.bme.mit.trainbenchmark.benchmark.operations.ModelOperationFactory; -import hu.bme.mit.trainbenchmark.constants.RailwayOperation; - -public class RacrModelOperationFactory extends ModelOperationFactory<RacrMatch, RacrDriver> { - - public RacrModelOperationFactory() { - } - - @Override - public ModelOperation<? extends RacrMatch, RacrDriver> createOperation( - final RailwayOperation operationEnum, final String workspaceDir, - final RacrDriver driver) throws Exception { - - switch (operationEnum) { - - // ConnectedSegments - case CONNECTEDSEGMENTS: { - final RacrQuery<RacrConnectedSegmentsMatch, RacrDriver> query = new RacrQueryConnectedSegments<>(driver); - return ModelOperation.of(query); - } - case CONNECTEDSEGMENTS_INJECT: { - final RacrQuery<RacrConnectedSegmentsInjectMatch, RacrDriver> query = new RacrQueryConnectedSegmentsInject<>(driver); - final RacrTransformation<RacrConnectedSegmentsInjectMatch, RacrDriver> transformation = new RacrTransformationInjectConnectedSegments<>(driver); - return ModelOperation.of(query, transformation); - } - case CONNECTEDSEGMENTS_REPAIR: { - final RacrQuery<RacrConnectedSegmentsMatch, RacrDriver> query = new RacrQueryConnectedSegments<>(driver); - final RacrTransformation<RacrConnectedSegmentsMatch, RacrDriver> transformation = new RacrTransformationRepairConnectedSegments<>(driver); - return ModelOperation.of(query, transformation); - } - - // PosLength - case POSLENGTH: { - final RacrQuery<RacrPosLengthMatch, RacrDriver> query = new RacrQueryPosLength<>(driver); - return ModelOperation.of(query); - } - case POSLENGTH_INJECT: { - final RacrQuery<RacrPosLengthInjectMatch, RacrDriver> query = new RacrQueryPosLengthInject<>(driver); - final RacrTransformation<RacrPosLengthInjectMatch, RacrDriver> transformation = new RacrTransformationInjectPosLength<>(driver); - return ModelOperation.of(query, transformation); - } - case POSLENGTH_REPAIR: { - final RacrQuery<RacrPosLengthMatch, RacrDriver> query = new RacrQueryPosLength<>(driver); - final RacrTransformation<RacrPosLengthMatch, RacrDriver> transformation = new RacrTransformationRepairPosLength<>(driver); - return ModelOperation.of(query, transformation); - } - - // RouteSensor - case ROUTESENSOR: { - final RacrQuery<RacrRouteSensorMatch, RacrDriver> query = new RacrQueryRouteSensor<>(driver); - return ModelOperation.of(query); - } - case ROUTESENSOR_INJECT: { - final RacrQuery<RacrRouteSensorInjectMatch, RacrDriver> query = new RacrQueryRouteSensorInject<>(driver); - final RacrTransformation<RacrRouteSensorInjectMatch, RacrDriver> transformation = new RacrTransformationInjectRouteSensor<>(driver); - return ModelOperation.of(query, transformation); - } - case ROUTESENSOR_REPAIR: { - final RacrQuery<RacrRouteSensorMatch, RacrDriver> query = new RacrQueryRouteSensor<>(driver); - final RacrTransformation<RacrRouteSensorMatch, RacrDriver> transformation = new RacrTransformationRepairRouteSensor<>(driver); - return ModelOperation.of(query, transformation); - } - - // SemaphoreNeighbor - case SEMAPHORENEIGHBOR: { - final RacrQuery<RacrSemaphoreNeighborMatch, RacrDriver> query = new RacrQuerySemaphoreNeighbor<>(driver); - return ModelOperation.of(query); - } - case SEMAPHORENEIGHBOR_INJECT: { - final RacrQuery<RacrSemaphoreNeighborInjectMatch, RacrDriver> query = new RacrQuerySemaphoreNeighborInject<>(driver); - final RacrTransformation<RacrSemaphoreNeighborInjectMatch, RacrDriver> transformation = new RacrTransformationInjectSemaphoreNeighbor<>(driver); - return ModelOperation.of(query, transformation); - } - case SEMAPHORENEIGHBOR_REPAIR: { - final RacrQuery<RacrSemaphoreNeighborMatch, RacrDriver> query = new RacrQuerySemaphoreNeighbor<>(driver); - final RacrTransformation<RacrSemaphoreNeighborMatch, RacrDriver> transformation = new RacrTransformationRepairSemaphoreNeighbor<>(driver); - return ModelOperation.of(query, transformation); - } - - // SwitchMonitored - case SWITCHMONITORED: { - final RacrQuery<RacrSwitchMonitoredMatch, RacrDriver> query = new RacrQuerySwitchMonitored<>(driver); - return ModelOperation.of(query); - } - case SWITCHMONITORED_INJECT: { - final RacrQuery<RacrSwitchMonitoredInjectMatch, RacrDriver> query = new RacrQuerySwitchMonitoredInject<>(driver); - final RacrTransformation<RacrSwitchMonitoredInjectMatch, RacrDriver> transformation = new RacrTransformationInjectSwitchMonitored<>(driver); - return ModelOperation.of(query, transformation); - } - case SWITCHMONITORED_REPAIR: { - final RacrQuery<RacrSwitchMonitoredMatch, RacrDriver> query = new RacrQuerySwitchMonitored<>(driver); - final RacrTransformation<RacrSwitchMonitoredMatch, RacrDriver> transformation = new RacrTransformationRepairSwitchMonitored<>(driver); - return ModelOperation.of(query, transformation); - } - - // SwitchSet - case SWITCHSET: { - final RacrQuery<RacrSwitchSetMatch, RacrDriver> query = new RacrQuerySwitchSet<>(driver); - return ModelOperation.of(query); - } - case SWITCHSET_INJECT: { - final RacrQuery<RacrSwitchSetInjectMatch, RacrDriver> query = new RacrQuerySwitchSetInject<>(driver); - final RacrTransformation<RacrSwitchSetInjectMatch, RacrDriver> transformation = new RacrTransformationInjectSwitchSet<>(driver); - return ModelOperation.of(query, transformation); - } - case SWITCHSET_REPAIR: { - final RacrQuery<RacrSwitchSetMatch, RacrDriver> query = new RacrQuerySwitchSet<>(driver); - final RacrTransformation<RacrSwitchSetMatch, RacrDriver> transformation = new RacrTransformationRepairSwitchSet<>(driver); - return ModelOperation.of(query, transformation); - } - - default: - throw new UnsupportedOperationException("Operation " + operationEnum + " not supported."); - } - } - -} diff --git a/trainbenchmark-tool-racr/src/main/java/de/tudresden/inf/st/train/racr/queries/ConstructMatches.java b/trainbenchmark-tool-racr/src/main/java/de/tudresden/inf/st/train/racr/queries/ConstructMatches.java deleted file mode 100644 index f3e6bfe4b..000000000 --- a/trainbenchmark-tool-racr/src/main/java/de/tudresden/inf/st/train/racr/queries/ConstructMatches.java +++ /dev/null @@ -1,10 +0,0 @@ -package de.tudresden.inf.st.train.racr.queries; - -import java.util.Collection; - -/** - * Created by rschoene on 10/4/17. - */ -public interface ConstructMatches<TPatternMatch> { - Collection<TPatternMatch> op(String response); -} diff --git a/trainbenchmark-tool-racr/src/main/java/de/tudresden/inf/st/train/racr/queries/GetResponseQuery.java b/trainbenchmark-tool-racr/src/main/java/de/tudresden/inf/st/train/racr/queries/GetResponseQuery.java deleted file mode 100644 index 2e0a47f59..000000000 --- a/trainbenchmark-tool-racr/src/main/java/de/tudresden/inf/st/train/racr/queries/GetResponseQuery.java +++ /dev/null @@ -1,12 +0,0 @@ -package de.tudresden.inf.st.train.racr.queries; - -import de.tudresden.inf.st.train.racr.util.AbstractClient; - -import java.util.Optional; - -/** - * Created by rschoene on 10/4/17. - */ -public interface GetResponseQuery { - Optional<String> op(AbstractClient client); -} diff --git a/trainbenchmark-tool-racr/src/main/java/de/tudresden/inf/st/train/racr/queries/RacrQuery.java b/trainbenchmark-tool-racr/src/main/java/de/tudresden/inf/st/train/racr/queries/RacrQuery.java deleted file mode 100644 index 5da6850b9..000000000 --- a/trainbenchmark-tool-racr/src/main/java/de/tudresden/inf/st/train/racr/queries/RacrQuery.java +++ /dev/null @@ -1,67 +0,0 @@ -package de.tudresden.inf.st.train.racr.queries; - -import de.tudresden.inf.st.train.racr.driver.RacrDriver; -import de.tudresden.inf.st.train.racr.matches.RacrMatch; -import de.tudresden.inf.st.train.racr.util.AbstractClient; -import de.tudresden.inf.st.train.racr.util.RacrUtils; -import hu.bme.mit.trainbenchmark.benchmark.operations.ModelQuery; -import hu.bme.mit.trainbenchmark.constants.RailwayQuery; - -import java.io.IOException; -import java.util.Collection; -import java.util.Collections; -import java.util.Optional; - -public abstract class RacrQuery<TPatternMatch extends RacrMatch, TRacrDriver extends RacrDriver> extends - ModelQuery<TPatternMatch, TRacrDriver> { - - public RacrQuery(final RailwayQuery query, final TRacrDriver driver) { - super(query, driver); - } - - public static <TPatternMatch> Collection<TPatternMatch> evaluate_shared(int timeout, RacrDriver driver, GetResponseQuery gr, ConstructMatches<TPatternMatch> cm, String name) throws IOException { - try (AbstractClient client = RacrUtils.connectToPracr(timeout, driver)) { - Optional<String> resonse = gr.op(client); - if (!resonse.isPresent()) { - if (driver.config.verbose) { - System.err.println("Did not get answer from pracr!"); - } - return Collections.emptyList(); - } - String responseString = resonse.get(); - if (driver.config.verbose) { - System.out.println(name + "-Response: " + responseString); - } - return cm.op(responseString); - } - } - - @Override - public Collection<TPatternMatch> evaluate() throws IOException { - return evaluate_shared(this.getTimeout(), this.getDriver(), - this::getResponse, this::constructMatches, this.getClass().getSimpleName()); - } - - /** - * Default implementation for timeout with 30 seconds - * @return the number of seconds to wait for calls to pracr - */ - public int getTimeout() { - return 30; - } - - /** - * Retrieve a response, usually be constructing an event and awaiting an answer - * @param client the socket client to use for a connection - * @return the retrieved answer - */ - public abstract Optional<String> getResponse(AbstractClient client); - - /** - * Process the response and construct the matches - * @param response the retrieved response, always non-<code>null</code> - * @return the matches - */ - public abstract Collection<TPatternMatch> constructMatches(String response); - -} diff --git a/trainbenchmark-tool-racr/src/main/java/de/tudresden/inf/st/train/racr/queries/RacrQueryConnectedSegments.java b/trainbenchmark-tool-racr/src/main/java/de/tudresden/inf/st/train/racr/queries/RacrQueryConnectedSegments.java deleted file mode 100644 index d2c0c07b9..000000000 --- a/trainbenchmark-tool-racr/src/main/java/de/tudresden/inf/st/train/racr/queries/RacrQueryConnectedSegments.java +++ /dev/null @@ -1,32 +0,0 @@ -package de.tudresden.inf.st.train.racr.queries; - -import de.tudresden.inf.st.train.racr.driver.RacrDriver; -import de.tudresden.inf.st.train.racr.matches.RacrConnectedSegmentsMatch; -import de.tudresden.inf.st.train.racr.util.AbstractClient; -import de.tudresden.inf.st.train.racr.util.RacrUtils; -import hu.bme.mit.trainbenchmark.constants.RailwayQuery; - -import java.util.Collection; -import java.util.Optional; - -public class RacrQueryConnectedSegments<TRacrDriver extends RacrDriver> extends RacrQuery<RacrConnectedSegmentsMatch, TRacrDriver> { - - public RacrQueryConnectedSegments(final TRacrDriver driver) { - super(RailwayQuery.CONNECTEDSEGMENTS, driver); - } - - @Override - public Optional<String> getResponse(AbstractClient client) { - return client.callConnectedSegmentsQuery(); - } - - @Override - public Collection<RacrConnectedSegmentsMatch> constructMatches(String response) { - return RacrUtils.parseNestedLists(response, RacrConnectedSegmentsMatch::new); - } - - @Override - public int getTimeout() { - return 8; - } -} diff --git a/trainbenchmark-tool-racr/src/main/java/de/tudresden/inf/st/train/racr/queries/RacrQueryConnectedSegmentsInject.java b/trainbenchmark-tool-racr/src/main/java/de/tudresden/inf/st/train/racr/queries/RacrQueryConnectedSegmentsInject.java deleted file mode 100644 index ac7d5b683..000000000 --- a/trainbenchmark-tool-racr/src/main/java/de/tudresden/inf/st/train/racr/queries/RacrQueryConnectedSegmentsInject.java +++ /dev/null @@ -1,32 +0,0 @@ -package de.tudresden.inf.st.train.racr.queries; - -import de.tudresden.inf.st.train.racr.driver.RacrDriver; -import de.tudresden.inf.st.train.racr.matches.RacrConnectedSegmentsInjectMatch; -import de.tudresden.inf.st.train.racr.util.AbstractClient; -import de.tudresden.inf.st.train.racr.util.RacrUtils; -import hu.bme.mit.trainbenchmark.constants.RailwayQuery; - -import java.util.Collection; -import java.util.Optional; - -public class RacrQueryConnectedSegmentsInject<TRacrDriver extends RacrDriver> extends RacrQuery<RacrConnectedSegmentsInjectMatch, TRacrDriver> { - - public RacrQueryConnectedSegmentsInject(final TRacrDriver driver) { - super(RailwayQuery.CONNECTEDSEGMENTS_INJECT, driver); - } - - @Override - public Optional<String> getResponse(AbstractClient client) { - return client.callConnectedSegmentsInjectQuery(); - } - - @Override - public Collection<RacrConnectedSegmentsInjectMatch> constructMatches(String response) { - return RacrUtils.parseNestedLists(response, RacrConnectedSegmentsInjectMatch::new); - } - - @Override - public int getTimeout() { - return 8; - } -} diff --git a/trainbenchmark-tool-racr/src/main/java/de/tudresden/inf/st/train/racr/queries/RacrQueryPosLength.java b/trainbenchmark-tool-racr/src/main/java/de/tudresden/inf/st/train/racr/queries/RacrQueryPosLength.java deleted file mode 100644 index f0e834d61..000000000 --- a/trainbenchmark-tool-racr/src/main/java/de/tudresden/inf/st/train/racr/queries/RacrQueryPosLength.java +++ /dev/null @@ -1,32 +0,0 @@ -package de.tudresden.inf.st.train.racr.queries; - -import de.tudresden.inf.st.train.racr.driver.RacrDriver; -import de.tudresden.inf.st.train.racr.matches.RacrPosLengthMatch; -import de.tudresden.inf.st.train.racr.util.AbstractClient; -import de.tudresden.inf.st.train.racr.util.RacrUtils; -import hu.bme.mit.trainbenchmark.constants.RailwayQuery; - -import java.util.Collection; -import java.util.Optional; - -public class RacrQueryPosLength<TRacrDriver extends RacrDriver> extends RacrQuery<RacrPosLengthMatch, TRacrDriver> { - - public RacrQueryPosLength(final TRacrDriver driver) { - super(RailwayQuery.POSLENGTH, driver); - } - - @Override - public Optional<String> getResponse(AbstractClient client) { - return client.callPosLengthQuery(); - } - - @Override - public Collection<RacrPosLengthMatch> constructMatches(String response) { - return RacrUtils.parseAsList(response, s -> new RacrPosLengthMatch(Long.valueOf(s.trim()))); - } - - @Override - public int getTimeout() { - return 8; - } -} diff --git a/trainbenchmark-tool-racr/src/main/java/de/tudresden/inf/st/train/racr/queries/RacrQueryPosLengthInject.java b/trainbenchmark-tool-racr/src/main/java/de/tudresden/inf/st/train/racr/queries/RacrQueryPosLengthInject.java deleted file mode 100644 index 453beb0d8..000000000 --- a/trainbenchmark-tool-racr/src/main/java/de/tudresden/inf/st/train/racr/queries/RacrQueryPosLengthInject.java +++ /dev/null @@ -1,32 +0,0 @@ -package de.tudresden.inf.st.train.racr.queries; - -import de.tudresden.inf.st.train.racr.driver.RacrDriver; -import de.tudresden.inf.st.train.racr.matches.RacrPosLengthInjectMatch; -import de.tudresden.inf.st.train.racr.util.AbstractClient; -import de.tudresden.inf.st.train.racr.util.RacrUtils; -import hu.bme.mit.trainbenchmark.constants.RailwayQuery; - -import java.util.Collection; -import java.util.Optional; - -public class RacrQueryPosLengthInject<TRacrDriver extends RacrDriver> extends RacrQuery<RacrPosLengthInjectMatch, TRacrDriver> { - - public RacrQueryPosLengthInject(final TRacrDriver driver) { - super(RailwayQuery.POSLENGTH_INJECT, driver); - } - - @Override - public Optional<String> getResponse(AbstractClient client) { - return client.callAllSegmentsQuery(); - } - - @Override - public Collection<RacrPosLengthInjectMatch> constructMatches(String response) { - return RacrUtils.parseAsList(response, s -> new RacrPosLengthInjectMatch(Long.valueOf(s.trim()))); - } - - @Override - public int getTimeout() { - return 8; - } -} diff --git a/trainbenchmark-tool-racr/src/main/java/de/tudresden/inf/st/train/racr/queries/RacrQueryRouteSensor.java b/trainbenchmark-tool-racr/src/main/java/de/tudresden/inf/st/train/racr/queries/RacrQueryRouteSensor.java deleted file mode 100644 index c53e28862..000000000 --- a/trainbenchmark-tool-racr/src/main/java/de/tudresden/inf/st/train/racr/queries/RacrQueryRouteSensor.java +++ /dev/null @@ -1,32 +0,0 @@ -package de.tudresden.inf.st.train.racr.queries; - -import de.tudresden.inf.st.train.racr.driver.RacrDriver; -import de.tudresden.inf.st.train.racr.matches.RacrRouteSensorMatch; -import de.tudresden.inf.st.train.racr.util.AbstractClient; -import de.tudresden.inf.st.train.racr.util.RacrUtils; -import hu.bme.mit.trainbenchmark.constants.RailwayQuery; - -import java.util.Collection; -import java.util.Optional; - -public class RacrQueryRouteSensor<TRacrDriver extends RacrDriver> extends RacrQuery<RacrRouteSensorMatch, TRacrDriver> { - - public RacrQueryRouteSensor(final TRacrDriver driver) { - super(RailwayQuery.ROUTESENSOR, driver); - } - - @Override - public Optional<String> getResponse(AbstractClient client) { - return client.callRouteSensorQuery(); - } - - @Override - public Collection<RacrRouteSensorMatch> constructMatches(String response) { - return RacrUtils.parseNestedLists(response, RacrRouteSensorMatch::new); - } - - @Override - public int getTimeout() { - return 300; - } -} diff --git a/trainbenchmark-tool-racr/src/main/java/de/tudresden/inf/st/train/racr/queries/RacrQueryRouteSensorInject.java b/trainbenchmark-tool-racr/src/main/java/de/tudresden/inf/st/train/racr/queries/RacrQueryRouteSensorInject.java deleted file mode 100644 index e363ebee4..000000000 --- a/trainbenchmark-tool-racr/src/main/java/de/tudresden/inf/st/train/racr/queries/RacrQueryRouteSensorInject.java +++ /dev/null @@ -1,32 +0,0 @@ -package de.tudresden.inf.st.train.racr.queries; - -import de.tudresden.inf.st.train.racr.driver.RacrDriver; -import de.tudresden.inf.st.train.racr.matches.RacrRouteSensorInjectMatch; -import de.tudresden.inf.st.train.racr.util.AbstractClient; -import de.tudresden.inf.st.train.racr.util.RacrUtils; -import hu.bme.mit.trainbenchmark.constants.RailwayQuery; - -import java.util.Collection; -import java.util.Optional; - -public class RacrQueryRouteSensorInject<TRacrDriver extends RacrDriver> extends RacrQuery<RacrRouteSensorInjectMatch, TRacrDriver> { - - public RacrQueryRouteSensorInject(final TRacrDriver driver) { - super(RailwayQuery.ROUTESENSOR_INJECT, driver); - } - - @Override - public Optional<String> getResponse(AbstractClient client) { - return client.callRouteSensorInjectQuery(); - } - - @Override - public Collection<RacrRouteSensorInjectMatch> constructMatches(String response) { - return RacrUtils.parseNestedLists(response, RacrRouteSensorInjectMatch::new); - } - - @Override - public int getTimeout() { - return 300; - } -} diff --git a/trainbenchmark-tool-racr/src/main/java/de/tudresden/inf/st/train/racr/queries/RacrQuerySemaphoreNeighbor.java b/trainbenchmark-tool-racr/src/main/java/de/tudresden/inf/st/train/racr/queries/RacrQuerySemaphoreNeighbor.java deleted file mode 100644 index 8a3a9370f..000000000 --- a/trainbenchmark-tool-racr/src/main/java/de/tudresden/inf/st/train/racr/queries/RacrQuerySemaphoreNeighbor.java +++ /dev/null @@ -1,35 +0,0 @@ -package de.tudresden.inf.st.train.racr.queries; - -import de.tudresden.inf.st.train.racr.driver.RacrDriver; -import de.tudresden.inf.st.train.racr.matches.RacrSemaphoreNeighborMatch; -import de.tudresden.inf.st.train.racr.util.AbstractClient; -import de.tudresden.inf.st.train.racr.util.RacrUtils; -import hu.bme.mit.trainbenchmark.constants.RailwayQuery; - -import java.util.Collection; -import java.util.Optional; - -public class RacrQuerySemaphoreNeighbor<TRacrDriver extends RacrDriver> extends RacrQuery<RacrSemaphoreNeighborMatch, TRacrDriver> { - - public RacrQuerySemaphoreNeighbor(final TRacrDriver driver) { - super(RailwayQuery.SEMAPHORENEIGHBOR, driver); - } - - @Override - public Optional<String> getResponse(AbstractClient client) { - if (driver.config.loadUsingScheme) { - throw new RuntimeException("Semaphore Neighbor not working with Scheme"); - } - return client.callSemaphoreNeighborQuery(); - } - - @Override - public Collection<RacrSemaphoreNeighborMatch> constructMatches(String response) { - return RacrUtils.parseNestedLists(response, RacrSemaphoreNeighborMatch::new); - } - - @Override - public int getTimeout() { - return 30; - } -} diff --git a/trainbenchmark-tool-racr/src/main/java/de/tudresden/inf/st/train/racr/queries/RacrQuerySemaphoreNeighborInject.java b/trainbenchmark-tool-racr/src/main/java/de/tudresden/inf/st/train/racr/queries/RacrQuerySemaphoreNeighborInject.java deleted file mode 100644 index 46d036903..000000000 --- a/trainbenchmark-tool-racr/src/main/java/de/tudresden/inf/st/train/racr/queries/RacrQuerySemaphoreNeighborInject.java +++ /dev/null @@ -1,35 +0,0 @@ -package de.tudresden.inf.st.train.racr.queries; - -import de.tudresden.inf.st.train.racr.driver.RacrDriver; -import de.tudresden.inf.st.train.racr.matches.RacrSemaphoreNeighborInjectMatch; -import de.tudresden.inf.st.train.racr.util.AbstractClient; -import de.tudresden.inf.st.train.racr.util.RacrUtils; -import hu.bme.mit.trainbenchmark.constants.RailwayQuery; - -import java.util.Collection; -import java.util.Optional; - -public class RacrQuerySemaphoreNeighborInject<TRacrDriver extends RacrDriver> extends RacrQuery<RacrSemaphoreNeighborInjectMatch, TRacrDriver> { - - public RacrQuerySemaphoreNeighborInject(final TRacrDriver driver) { - super(RailwayQuery.SEMAPHORENEIGHBOR_INJECT, driver); - } - - @Override - public Optional<String> getResponse(AbstractClient client) { - if (driver.config.loadUsingScheme) { - throw new RuntimeException("Semaphore Neighbor not working with Scheme"); - } - return client.callSemaphoreNeighborInjectQuery(); - } - - @Override - public Collection<RacrSemaphoreNeighborInjectMatch> constructMatches(String response) { - return RacrUtils.parseNestedLists(response, RacrSemaphoreNeighborInjectMatch::new); - } - - @Override - public int getTimeout() { - return 30; - } -} diff --git a/trainbenchmark-tool-racr/src/main/java/de/tudresden/inf/st/train/racr/queries/RacrQuerySwitchMonitored.java b/trainbenchmark-tool-racr/src/main/java/de/tudresden/inf/st/train/racr/queries/RacrQuerySwitchMonitored.java deleted file mode 100644 index 09e822324..000000000 --- a/trainbenchmark-tool-racr/src/main/java/de/tudresden/inf/st/train/racr/queries/RacrQuerySwitchMonitored.java +++ /dev/null @@ -1,32 +0,0 @@ -package de.tudresden.inf.st.train.racr.queries; - -import de.tudresden.inf.st.train.racr.driver.RacrDriver; -import de.tudresden.inf.st.train.racr.matches.RacrSwitchMonitoredMatch; -import de.tudresden.inf.st.train.racr.util.AbstractClient; -import de.tudresden.inf.st.train.racr.util.RacrUtils; -import hu.bme.mit.trainbenchmark.constants.RailwayQuery; - -import java.util.Collection; -import java.util.Optional; - -public class RacrQuerySwitchMonitored<TRacrDriver extends RacrDriver> extends RacrQuery<RacrSwitchMonitoredMatch, TRacrDriver> { - - public RacrQuerySwitchMonitored(final TRacrDriver driver) { - super(RailwayQuery.SWITCHMONITORED, driver); - } - - @Override - public Optional<String> getResponse(AbstractClient client) { - return client.callSwitchMonitoredQuery(); - } - - @Override - public Collection<RacrSwitchMonitoredMatch> constructMatches(String response) { - return RacrUtils.parseAsList(response, s -> new RacrSwitchMonitoredMatch(Long.parseLong(s.trim()))); - } - - @Override - public int getTimeout() { - return 8; - } -} diff --git a/trainbenchmark-tool-racr/src/main/java/de/tudresden/inf/st/train/racr/queries/RacrQuerySwitchMonitoredInject.java b/trainbenchmark-tool-racr/src/main/java/de/tudresden/inf/st/train/racr/queries/RacrQuerySwitchMonitoredInject.java deleted file mode 100644 index 20771ce41..000000000 --- a/trainbenchmark-tool-racr/src/main/java/de/tudresden/inf/st/train/racr/queries/RacrQuerySwitchMonitoredInject.java +++ /dev/null @@ -1,32 +0,0 @@ -package de.tudresden.inf.st.train.racr.queries; - -import de.tudresden.inf.st.train.racr.driver.RacrDriver; -import de.tudresden.inf.st.train.racr.matches.RacrSwitchMonitoredInjectMatch; -import de.tudresden.inf.st.train.racr.util.AbstractClient; -import de.tudresden.inf.st.train.racr.util.RacrUtils; -import hu.bme.mit.trainbenchmark.constants.RailwayQuery; - -import java.util.Collection; -import java.util.Optional; - -public class RacrQuerySwitchMonitoredInject<TRacrDriver extends RacrDriver> extends RacrQuery<RacrSwitchMonitoredInjectMatch, TRacrDriver> { - - public RacrQuerySwitchMonitoredInject(final TRacrDriver driver) { - super(RailwayQuery.SWITCHMONITORED_INJECT, driver); - } - - @Override - public Optional<String> getResponse(AbstractClient client) { - return client.callAllSwitchesQuery(); - } - - @Override - public Collection<RacrSwitchMonitoredInjectMatch> constructMatches(String response) { - return RacrUtils.parseAsList(response, s -> new RacrSwitchMonitoredInjectMatch(Long.parseLong(s))); - } - - @Override - public int getTimeout() { - return 8; - } -} diff --git a/trainbenchmark-tool-racr/src/main/java/de/tudresden/inf/st/train/racr/queries/RacrQuerySwitchSet.java b/trainbenchmark-tool-racr/src/main/java/de/tudresden/inf/st/train/racr/queries/RacrQuerySwitchSet.java deleted file mode 100644 index a6feed4bc..000000000 --- a/trainbenchmark-tool-racr/src/main/java/de/tudresden/inf/st/train/racr/queries/RacrQuerySwitchSet.java +++ /dev/null @@ -1,32 +0,0 @@ -package de.tudresden.inf.st.train.racr.queries; - -import de.tudresden.inf.st.train.racr.driver.RacrDriver; -import de.tudresden.inf.st.train.racr.matches.RacrSwitchSetMatch; -import de.tudresden.inf.st.train.racr.util.AbstractClient; -import de.tudresden.inf.st.train.racr.util.RacrUtils; -import hu.bme.mit.trainbenchmark.constants.RailwayQuery; - -import java.util.Collection; -import java.util.Optional; - -public class RacrQuerySwitchSet<TRacrDriver extends RacrDriver> extends RacrQuery<RacrSwitchSetMatch, TRacrDriver> { - - public RacrQuerySwitchSet(final TRacrDriver driver) { - super(RailwayQuery.SWITCHSET, driver); - } - - @Override - public Optional<String> getResponse(AbstractClient client) { - return client.callSwitchSetQuery(); - } - - @Override - public Collection<RacrSwitchSetMatch> constructMatches(String response) { - return RacrUtils.parseNestedLists(response, RacrSwitchSetMatch::new); - } - - @Override - public int getTimeout() { - return 8; - } -} diff --git a/trainbenchmark-tool-racr/src/main/java/de/tudresden/inf/st/train/racr/queries/RacrQuerySwitchSetInject.java b/trainbenchmark-tool-racr/src/main/java/de/tudresden/inf/st/train/racr/queries/RacrQuerySwitchSetInject.java deleted file mode 100644 index c9bf60e2a..000000000 --- a/trainbenchmark-tool-racr/src/main/java/de/tudresden/inf/st/train/racr/queries/RacrQuerySwitchSetInject.java +++ /dev/null @@ -1,32 +0,0 @@ -package de.tudresden.inf.st.train.racr.queries; - -import de.tudresden.inf.st.train.racr.driver.RacrDriver; -import de.tudresden.inf.st.train.racr.matches.RacrSwitchSetInjectMatch; -import de.tudresden.inf.st.train.racr.util.AbstractClient; -import de.tudresden.inf.st.train.racr.util.RacrUtils; -import hu.bme.mit.trainbenchmark.constants.RailwayQuery; - -import java.util.Collection; -import java.util.Optional; - -public class RacrQuerySwitchSetInject<TRacrDriver extends RacrDriver> extends RacrQuery<RacrSwitchSetInjectMatch, TRacrDriver> { - - public RacrQuerySwitchSetInject(final TRacrDriver driver) { - super(RailwayQuery.SWITCHSET_INJECT, driver); - } - - @Override - public Optional<String> getResponse(AbstractClient client) { - return client.callAllSwitchesQuery(); - } - - @Override - public Collection<RacrSwitchSetInjectMatch> constructMatches(String response) { - return RacrUtils.parseAsList(response, s -> new RacrSwitchSetInjectMatch(Long.parseLong(s))); - } - - @Override - public int getTimeout() { - return 8; - } -} diff --git a/trainbenchmark-tool-racr/src/main/java/de/tudresden/inf/st/train/racr/transformations/GetResponseTransformation.java b/trainbenchmark-tool-racr/src/main/java/de/tudresden/inf/st/train/racr/transformations/GetResponseTransformation.java deleted file mode 100644 index 5a03e76aa..000000000 --- a/trainbenchmark-tool-racr/src/main/java/de/tudresden/inf/st/train/racr/transformations/GetResponseTransformation.java +++ /dev/null @@ -1,13 +0,0 @@ -package de.tudresden.inf.st.train.racr.transformations; - -import de.tudresden.inf.st.train.racr.util.AbstractClient; - -import java.util.Collection; -import java.util.Optional; - -/** - * Created by rschoene on 10/4/17. - */ -public interface GetResponseTransformation<TMatch> { - Optional<String> op(AbstractClient client, Collection<TMatch> tMatches); -} diff --git a/trainbenchmark-tool-racr/src/main/java/de/tudresden/inf/st/train/racr/transformations/HandleEmptyResponse.java b/trainbenchmark-tool-racr/src/main/java/de/tudresden/inf/st/train/racr/transformations/HandleEmptyResponse.java deleted file mode 100644 index 593943226..000000000 --- a/trainbenchmark-tool-racr/src/main/java/de/tudresden/inf/st/train/racr/transformations/HandleEmptyResponse.java +++ /dev/null @@ -1,8 +0,0 @@ -package de.tudresden.inf.st.train.racr.transformations; - -/** - * Created by rschoene on 10/4/17. - */ -public interface HandleEmptyResponse { - void op(); -} diff --git a/trainbenchmark-tool-racr/src/main/java/de/tudresden/inf/st/train/racr/transformations/HandleResponse.java b/trainbenchmark-tool-racr/src/main/java/de/tudresden/inf/st/train/racr/transformations/HandleResponse.java deleted file mode 100644 index 4035a52a2..000000000 --- a/trainbenchmark-tool-racr/src/main/java/de/tudresden/inf/st/train/racr/transformations/HandleResponse.java +++ /dev/null @@ -1,8 +0,0 @@ -package de.tudresden.inf.st.train.racr.transformations; - -/** - * Created by rschoene on 10/4/17. - */ -public interface HandleResponse { - void op(String responseString); -} diff --git a/trainbenchmark-tool-racr/src/main/java/de/tudresden/inf/st/train/racr/transformations/RacrTransformation.java b/trainbenchmark-tool-racr/src/main/java/de/tudresden/inf/st/train/racr/transformations/RacrTransformation.java deleted file mode 100644 index 3cb921f7a..000000000 --- a/trainbenchmark-tool-racr/src/main/java/de/tudresden/inf/st/train/racr/transformations/RacrTransformation.java +++ /dev/null @@ -1,60 +0,0 @@ -package de.tudresden.inf.st.train.racr.transformations; - -import de.tudresden.inf.st.train.racr.driver.RacrDriver; -import de.tudresden.inf.st.train.racr.matches.RacrMatch; -import de.tudresden.inf.st.train.racr.util.AbstractClient; -import de.tudresden.inf.st.train.racr.util.RacrUtils; -import hu.bme.mit.trainbenchmark.benchmark.operations.ModelTransformation; - -import java.util.Collection; -import java.util.Optional; - -public abstract class RacrTransformation<TMatch extends RacrMatch, TRacrDriver extends RacrDriver> - extends ModelTransformation<TMatch, TRacrDriver> { - - public RacrTransformation(final TRacrDriver driver) { - super(driver); - } - - public static <TMatch> void activate_shared(Collection<TMatch> matches, int timeout, RacrDriver driver, - HandleResponse hr, HandleEmptyResponse her, - GetResponseTransformation<TMatch> gr, String name) throws Exception { - if (driver.config.verbose) { - System.out.println(name + ", matches" + matches); - } - try (AbstractClient client = RacrUtils.connectToPracr(timeout, driver)) { - Optional<String> resonse = gr.op(client, matches); - if (!resonse.isPresent()) { - her.op(); - return; - } - String responseString = resonse.get(); - hr.op(responseString); - } - } - - @Override - public void activate(Collection<TMatch> matches) throws Exception { - activate_shared(matches, this.getTimeout(), this.getDriver(), - this::handleResponse, this::handleEmptyResponse, this::getResponse, - this.getClass().getSimpleName()); - } - - public abstract Optional<String> getResponse(AbstractClient client, Collection<TMatch> tMatches); - - public void handleResponse(String responseString) { - if (driver.config.verbose) { - System.out.println(String.format("Got reponse %s", responseString)); - } - } - - public void handleEmptyResponse() { - if (driver.config.verbose) { - System.err.println("Did not get an answer from pracr"); - } - } - - public int getTimeout() { - return 10; - } -} diff --git a/trainbenchmark-tool-racr/src/main/java/de/tudresden/inf/st/train/racr/transformations/inject/RacrTransformationInjectConnectedSegments.java b/trainbenchmark-tool-racr/src/main/java/de/tudresden/inf/st/train/racr/transformations/inject/RacrTransformationInjectConnectedSegments.java deleted file mode 100644 index 714a164c5..000000000 --- a/trainbenchmark-tool-racr/src/main/java/de/tudresden/inf/st/train/racr/transformations/inject/RacrTransformationInjectConnectedSegments.java +++ /dev/null @@ -1,23 +0,0 @@ -package de.tudresden.inf.st.train.racr.transformations.inject; - -import de.tudresden.inf.st.train.racr.driver.RacrDriver; -import de.tudresden.inf.st.train.racr.matches.RacrConnectedSegmentsInjectMatch; -import de.tudresden.inf.st.train.racr.transformations.RacrTransformation; -import de.tudresden.inf.st.train.racr.util.AbstractClient; - -import java.util.Collection; -import java.util.Optional; - -public class RacrTransformationInjectConnectedSegments<TRacrDriver extends RacrDriver> - extends RacrTransformation<RacrConnectedSegmentsInjectMatch, TRacrDriver> { - - public RacrTransformationInjectConnectedSegments(final TRacrDriver driver) { - super(driver); - } - - @Override - public Optional<String> getResponse(AbstractClient client, Collection<RacrConnectedSegmentsInjectMatch> matches) { - return client.callConnectedSegmentsInject(matches); - } - -} diff --git a/trainbenchmark-tool-racr/src/main/java/de/tudresden/inf/st/train/racr/transformations/inject/RacrTransformationInjectPosLength.java b/trainbenchmark-tool-racr/src/main/java/de/tudresden/inf/st/train/racr/transformations/inject/RacrTransformationInjectPosLength.java deleted file mode 100644 index 09a616087..000000000 --- a/trainbenchmark-tool-racr/src/main/java/de/tudresden/inf/st/train/racr/transformations/inject/RacrTransformationInjectPosLength.java +++ /dev/null @@ -1,23 +0,0 @@ -package de.tudresden.inf.st.train.racr.transformations.inject; - -import de.tudresden.inf.st.train.racr.driver.RacrDriver; -import de.tudresden.inf.st.train.racr.matches.RacrPosLengthInjectMatch; -import de.tudresden.inf.st.train.racr.transformations.RacrTransformation; -import de.tudresden.inf.st.train.racr.util.AbstractClient; - -import java.util.Collection; -import java.util.Optional; - -public class RacrTransformationInjectPosLength<TRacrDriver extends RacrDriver> - extends RacrTransformation<RacrPosLengthInjectMatch, TRacrDriver> { - - public RacrTransformationInjectPosLength(final TRacrDriver driver) { - super(driver); - } - - @Override - public Optional<String> getResponse(AbstractClient client, Collection<RacrPosLengthInjectMatch> matches) { - return client.callPosLengthInject(matches); - } - -} diff --git a/trainbenchmark-tool-racr/src/main/java/de/tudresden/inf/st/train/racr/transformations/inject/RacrTransformationInjectRouteSensor.java b/trainbenchmark-tool-racr/src/main/java/de/tudresden/inf/st/train/racr/transformations/inject/RacrTransformationInjectRouteSensor.java deleted file mode 100644 index 54fb44c51..000000000 --- a/trainbenchmark-tool-racr/src/main/java/de/tudresden/inf/st/train/racr/transformations/inject/RacrTransformationInjectRouteSensor.java +++ /dev/null @@ -1,23 +0,0 @@ -package de.tudresden.inf.st.train.racr.transformations.inject; - -import de.tudresden.inf.st.train.racr.driver.RacrDriver; -import de.tudresden.inf.st.train.racr.matches.RacrRouteSensorInjectMatch; -import de.tudresden.inf.st.train.racr.transformations.RacrTransformation; -import de.tudresden.inf.st.train.racr.util.AbstractClient; - -import java.util.Collection; -import java.util.Optional; - -public class RacrTransformationInjectRouteSensor<TRacrDriver extends RacrDriver> - extends RacrTransformation<RacrRouteSensorInjectMatch, TRacrDriver> { - - public RacrTransformationInjectRouteSensor(final TRacrDriver driver) { - super(driver); - } - - @Override - public Optional<String> getResponse(AbstractClient client, Collection<RacrRouteSensorInjectMatch> matches) { - return client.callRouteSensorInject(matches); - } - -} diff --git a/trainbenchmark-tool-racr/src/main/java/de/tudresden/inf/st/train/racr/transformations/inject/RacrTransformationInjectSemaphoreNeighbor.java b/trainbenchmark-tool-racr/src/main/java/de/tudresden/inf/st/train/racr/transformations/inject/RacrTransformationInjectSemaphoreNeighbor.java deleted file mode 100644 index d1f512ec0..000000000 --- a/trainbenchmark-tool-racr/src/main/java/de/tudresden/inf/st/train/racr/transformations/inject/RacrTransformationInjectSemaphoreNeighbor.java +++ /dev/null @@ -1,23 +0,0 @@ -package de.tudresden.inf.st.train.racr.transformations.inject; - -import de.tudresden.inf.st.train.racr.driver.RacrDriver; -import de.tudresden.inf.st.train.racr.matches.RacrSemaphoreNeighborInjectMatch; -import de.tudresden.inf.st.train.racr.transformations.RacrTransformation; -import de.tudresden.inf.st.train.racr.util.AbstractClient; - -import java.util.Collection; -import java.util.Optional; - -public class RacrTransformationInjectSemaphoreNeighbor<TRacrDriver extends RacrDriver> - extends RacrTransformation<RacrSemaphoreNeighborInjectMatch, TRacrDriver> { - - public RacrTransformationInjectSemaphoreNeighbor(final TRacrDriver driver) { - super(driver); - } - - @Override - public Optional<String> getResponse(AbstractClient client, Collection<RacrSemaphoreNeighborInjectMatch> matches) { - return client.callSemaphoreNeighborInject(matches); - } - -} diff --git a/trainbenchmark-tool-racr/src/main/java/de/tudresden/inf/st/train/racr/transformations/inject/RacrTransformationInjectSwitchMonitored.java b/trainbenchmark-tool-racr/src/main/java/de/tudresden/inf/st/train/racr/transformations/inject/RacrTransformationInjectSwitchMonitored.java deleted file mode 100644 index 5e79b95ff..000000000 --- a/trainbenchmark-tool-racr/src/main/java/de/tudresden/inf/st/train/racr/transformations/inject/RacrTransformationInjectSwitchMonitored.java +++ /dev/null @@ -1,23 +0,0 @@ -package de.tudresden.inf.st.train.racr.transformations.inject; - -import de.tudresden.inf.st.train.racr.driver.RacrDriver; -import de.tudresden.inf.st.train.racr.matches.RacrSwitchMonitoredInjectMatch; -import de.tudresden.inf.st.train.racr.transformations.RacrTransformation; -import de.tudresden.inf.st.train.racr.util.AbstractClient; - -import java.util.Collection; -import java.util.Optional; - -public class RacrTransformationInjectSwitchMonitored<TRacrDriver extends RacrDriver> - extends RacrTransformation<RacrSwitchMonitoredInjectMatch, TRacrDriver> { - - public RacrTransformationInjectSwitchMonitored(final TRacrDriver driver) { - super(driver); - } - - @Override - public Optional<String> getResponse(AbstractClient client, Collection<RacrSwitchMonitoredInjectMatch> matches) { - return client.callSwitchMonitoredInject(matches); - } - -} diff --git a/trainbenchmark-tool-racr/src/main/java/de/tudresden/inf/st/train/racr/transformations/inject/RacrTransformationInjectSwitchSet.java b/trainbenchmark-tool-racr/src/main/java/de/tudresden/inf/st/train/racr/transformations/inject/RacrTransformationInjectSwitchSet.java deleted file mode 100644 index 25b70152b..000000000 --- a/trainbenchmark-tool-racr/src/main/java/de/tudresden/inf/st/train/racr/transformations/inject/RacrTransformationInjectSwitchSet.java +++ /dev/null @@ -1,23 +0,0 @@ -package de.tudresden.inf.st.train.racr.transformations.inject; - -import de.tudresden.inf.st.train.racr.driver.RacrDriver; -import de.tudresden.inf.st.train.racr.matches.RacrSwitchSetInjectMatch; -import de.tudresden.inf.st.train.racr.transformations.RacrTransformation; -import de.tudresden.inf.st.train.racr.util.AbstractClient; - -import java.util.Collection; -import java.util.Optional; - -public class RacrTransformationInjectSwitchSet<TRacrDriver extends RacrDriver> - extends RacrTransformation<RacrSwitchSetInjectMatch, TRacrDriver> { - - public RacrTransformationInjectSwitchSet(final TRacrDriver driver) { - super(driver); - } - - @Override - public Optional<String> getResponse(AbstractClient client, Collection<RacrSwitchSetInjectMatch> matches) { - return client.callSwitchSetInject(matches); - } - -} diff --git a/trainbenchmark-tool-racr/src/main/java/de/tudresden/inf/st/train/racr/transformations/repair/RacrTransformationRepairConnectedSegments.java b/trainbenchmark-tool-racr/src/main/java/de/tudresden/inf/st/train/racr/transformations/repair/RacrTransformationRepairConnectedSegments.java deleted file mode 100644 index f0672fab7..000000000 --- a/trainbenchmark-tool-racr/src/main/java/de/tudresden/inf/st/train/racr/transformations/repair/RacrTransformationRepairConnectedSegments.java +++ /dev/null @@ -1,23 +0,0 @@ -package de.tudresden.inf.st.train.racr.transformations.repair; - -import de.tudresden.inf.st.train.racr.driver.RacrDriver; -import de.tudresden.inf.st.train.racr.matches.RacrConnectedSegmentsMatch; -import de.tudresden.inf.st.train.racr.transformations.RacrTransformation; -import de.tudresden.inf.st.train.racr.util.AbstractClient; - -import java.util.Collection; -import java.util.Optional; - -public class RacrTransformationRepairConnectedSegments<TRacrDriver extends RacrDriver> - extends RacrTransformation<RacrConnectedSegmentsMatch, TRacrDriver> { - - public RacrTransformationRepairConnectedSegments(final TRacrDriver driver) { - super(driver); - } - - @Override - public Optional<String> getResponse(AbstractClient client, Collection<RacrConnectedSegmentsMatch> matches) { - return client.callConnectedSegmentsRepair(matches); - } - -} diff --git a/trainbenchmark-tool-racr/src/main/java/de/tudresden/inf/st/train/racr/transformations/repair/RacrTransformationRepairPosLength.java b/trainbenchmark-tool-racr/src/main/java/de/tudresden/inf/st/train/racr/transformations/repair/RacrTransformationRepairPosLength.java deleted file mode 100644 index 69547ddd1..000000000 --- a/trainbenchmark-tool-racr/src/main/java/de/tudresden/inf/st/train/racr/transformations/repair/RacrTransformationRepairPosLength.java +++ /dev/null @@ -1,23 +0,0 @@ -package de.tudresden.inf.st.train.racr.transformations.repair; - -import de.tudresden.inf.st.train.racr.driver.RacrDriver; -import de.tudresden.inf.st.train.racr.matches.RacrPosLengthMatch; -import de.tudresden.inf.st.train.racr.transformations.RacrTransformation; -import de.tudresden.inf.st.train.racr.util.AbstractClient; - -import java.util.Collection; -import java.util.Optional; - -public class RacrTransformationRepairPosLength<TRacrDriver extends RacrDriver> - extends RacrTransformation<RacrPosLengthMatch, TRacrDriver> { - - public RacrTransformationRepairPosLength(final TRacrDriver driver) { - super(driver); - } - - @Override - public Optional<String> getResponse(AbstractClient client, Collection<RacrPosLengthMatch> matches) { - return client.callPosLengthRepair(matches); - } - -} diff --git a/trainbenchmark-tool-racr/src/main/java/de/tudresden/inf/st/train/racr/transformations/repair/RacrTransformationRepairRouteSensor.java b/trainbenchmark-tool-racr/src/main/java/de/tudresden/inf/st/train/racr/transformations/repair/RacrTransformationRepairRouteSensor.java deleted file mode 100644 index 65bb3e478..000000000 --- a/trainbenchmark-tool-racr/src/main/java/de/tudresden/inf/st/train/racr/transformations/repair/RacrTransformationRepairRouteSensor.java +++ /dev/null @@ -1,23 +0,0 @@ -package de.tudresden.inf.st.train.racr.transformations.repair; - -import de.tudresden.inf.st.train.racr.driver.RacrDriver; -import de.tudresden.inf.st.train.racr.matches.RacrRouteSensorMatch; -import de.tudresden.inf.st.train.racr.transformations.RacrTransformation; -import de.tudresden.inf.st.train.racr.util.AbstractClient; - -import java.util.Collection; -import java.util.Optional; - -public class RacrTransformationRepairRouteSensor<TRacrDriver extends RacrDriver> - extends RacrTransformation<RacrRouteSensorMatch, TRacrDriver> { - - public RacrTransformationRepairRouteSensor(final TRacrDriver driver) { - super(driver); - } - - @Override - public Optional<String> getResponse(AbstractClient client, Collection<RacrRouteSensorMatch> matches) { - return client.callRouteSensorRepair(matches); - } - -} diff --git a/trainbenchmark-tool-racr/src/main/java/de/tudresden/inf/st/train/racr/transformations/repair/RacrTransformationRepairSemaphoreNeighbor.java b/trainbenchmark-tool-racr/src/main/java/de/tudresden/inf/st/train/racr/transformations/repair/RacrTransformationRepairSemaphoreNeighbor.java deleted file mode 100644 index 9769fb643..000000000 --- a/trainbenchmark-tool-racr/src/main/java/de/tudresden/inf/st/train/racr/transformations/repair/RacrTransformationRepairSemaphoreNeighbor.java +++ /dev/null @@ -1,23 +0,0 @@ -package de.tudresden.inf.st.train.racr.transformations.repair; - -import de.tudresden.inf.st.train.racr.driver.RacrDriver; -import de.tudresden.inf.st.train.racr.matches.RacrSemaphoreNeighborMatch; -import de.tudresden.inf.st.train.racr.transformations.RacrTransformation; -import de.tudresden.inf.st.train.racr.util.AbstractClient; - -import java.util.Collection; -import java.util.Optional; - -public class RacrTransformationRepairSemaphoreNeighbor<TRacrDriver extends RacrDriver> - extends RacrTransformation<RacrSemaphoreNeighborMatch, TRacrDriver> { - - public RacrTransformationRepairSemaphoreNeighbor(final TRacrDriver driver) { - super(driver); - } - - @Override - public Optional<String> getResponse(AbstractClient client, Collection<RacrSemaphoreNeighborMatch> matches) { - return client.callSemaphoreNeighborRepair(matches); - } - -} diff --git a/trainbenchmark-tool-racr/src/main/java/de/tudresden/inf/st/train/racr/transformations/repair/RacrTransformationRepairSwitchMonitored.java b/trainbenchmark-tool-racr/src/main/java/de/tudresden/inf/st/train/racr/transformations/repair/RacrTransformationRepairSwitchMonitored.java deleted file mode 100644 index cf85ab9a4..000000000 --- a/trainbenchmark-tool-racr/src/main/java/de/tudresden/inf/st/train/racr/transformations/repair/RacrTransformationRepairSwitchMonitored.java +++ /dev/null @@ -1,23 +0,0 @@ -package de.tudresden.inf.st.train.racr.transformations.repair; - -import de.tudresden.inf.st.train.racr.driver.RacrDriver; -import de.tudresden.inf.st.train.racr.matches.RacrSwitchMonitoredMatch; -import de.tudresden.inf.st.train.racr.transformations.RacrTransformation; -import de.tudresden.inf.st.train.racr.util.AbstractClient; - -import java.util.Collection; -import java.util.Optional; - -public class RacrTransformationRepairSwitchMonitored<TRacrDriver extends RacrDriver> - extends RacrTransformation<RacrSwitchMonitoredMatch, TRacrDriver> { - - public RacrTransformationRepairSwitchMonitored(final TRacrDriver driver) { - super(driver); - } - - @Override - public Optional<String> getResponse(AbstractClient client, Collection<RacrSwitchMonitoredMatch> matches) { - return client.callSwitchMonitoredRepair(matches); - } - -} diff --git a/trainbenchmark-tool-racr/src/main/java/de/tudresden/inf/st/train/racr/transformations/repair/RacrTransformationRepairSwitchSet.java b/trainbenchmark-tool-racr/src/main/java/de/tudresden/inf/st/train/racr/transformations/repair/RacrTransformationRepairSwitchSet.java deleted file mode 100644 index 442a7303f..000000000 --- a/trainbenchmark-tool-racr/src/main/java/de/tudresden/inf/st/train/racr/transformations/repair/RacrTransformationRepairSwitchSet.java +++ /dev/null @@ -1,23 +0,0 @@ -package de.tudresden.inf.st.train.racr.transformations.repair; - -import de.tudresden.inf.st.train.racr.driver.RacrDriver; -import de.tudresden.inf.st.train.racr.matches.RacrSwitchSetMatch; -import de.tudresden.inf.st.train.racr.transformations.RacrTransformation; -import de.tudresden.inf.st.train.racr.util.AbstractClient; - -import java.util.Collection; -import java.util.Optional; - -public class RacrTransformationRepairSwitchSet<TRacrDriver extends RacrDriver> - extends RacrTransformation<RacrSwitchSetMatch, TRacrDriver> { - - public RacrTransformationRepairSwitchSet(final TRacrDriver driver) { - super(driver); - } - - @Override - public Optional<String> getResponse(AbstractClient client, Collection<RacrSwitchSetMatch> matches) { - return client.callSwitchSetRepair(matches); - } - -} diff --git a/trainbenchmark-tool-racr/src/main/java/de/tudresden/inf/st/train/racr/util/AbstractClient.java b/trainbenchmark-tool-racr/src/main/java/de/tudresden/inf/st/train/racr/util/AbstractClient.java deleted file mode 100644 index e86651420..000000000 --- a/trainbenchmark-tool-racr/src/main/java/de/tudresden/inf/st/train/racr/util/AbstractClient.java +++ /dev/null @@ -1,238 +0,0 @@ -package de.tudresden.inf.st.train.racr.util; - -import com.google.common.collect.ImmutableMap; -import de.tudresden.inf.st.train.racr.matches.*; - -import java.io.File; -import java.io.IOException; -import java.util.Collection; -import java.util.Map; -import java.util.Optional; - -/** - * Client to connect to pRacr - * Created by rschoene on 5/26/17. - */ -public abstract class AbstractClient implements AutoCloseable { - - final int timeout; - protected final RacrConfig config; - - AbstractClient(int timeout, RacrConfig config) { - this.timeout = timeout; - this.config = config; - } - - static String getDefaultHost() { - return "localhost"; - } - - public String call(Event event) { - return this.call(event, true); - } - - protected abstract String call(Event event, boolean waitForAnswer); - - /** - * Send InitModel event - * @param modelPath the path to the AST to load - */ - public void callInitModel(String modelPath) { - String absPath = new File(modelPath).getAbsolutePath(); - if (config.verbose) { - System.out.println(String.format("Changing model path from '%s' to '%s", - modelPath, absPath)); - } - this.call(new Event("LoadFromJsonEvent", ImmutableMap.of( - "filename", "\"" + absPath + "\"", - "use_scheme", config.loadUsingScheme ? "true" : "false")), false); -// return response == null ? Optional.empty() : Optional.of("0".equals(response)); - } - - public void callSystemExit() { - this.call(new Event("pracr.event", "SystemExitEvent")); - } - - public Optional<String> callServerTime() { - String response = this.call(new Event("pracr.event", "ServerTimeEvent")); - return Optional.ofNullable(response); - } - - public Optional<String> callAllSegmentsQuery() { - String response = this.call(new Event("AllSegmentIdsEvent")); - return Optional.ofNullable(response); - } - - public Optional<String> callAllRoutesQuery() { - String response = this.call(new Event("AllRouteIdsEvent")); - return Optional.ofNullable(response); - } - - public Optional<String> callAllSwitchesQuery() { - String response = this.call(new Event("AllSwitchIdsEvent")); - return Optional.ofNullable(response); - } - - public Optional<String> callConnectedSegmentsQuery() { - String response = this.call(new Event("ConnectedSegmentsQueryEvent")); - return Optional.ofNullable(response); - } - - public Optional<String> callConnectedSegmentsInjectQuery() { - String response = this.call(new Event("ConnectedSegmentsInjectQueryEvent")); - return Optional.ofNullable(response); - } - - public Optional<String> callConnectedSegmentsInject(Collection<RacrConnectedSegmentsInjectMatch> matches) { - String sensorList = RacrUtils.constructJSONList(matches, m -> m.getSensor().toString()); - String segment1List = RacrUtils.constructJSONList(matches, m -> m.getSegment1().toString()); - String segment3List = RacrUtils.constructJSONList(matches, m -> m.getSegment3().toString()); - String response = this.call(new Event("ConnectedSegmentsInjectEvent", ImmutableMap.of( - "sensor_list", sensorList, - "segment1_list", segment1List, - "segment3_list", segment3List))); - return Optional.ofNullable(response); - } - - public Optional<String> callConnectedSegmentsRepair(Collection<RacrConnectedSegmentsMatch> matches) { - Map<String, String> params = new ImmutableMap.Builder<String, String>() - .put("sensor_list", RacrUtils.constructJSONList(matches, m -> m.getSensor().toString())) - .put("segment1_list", RacrUtils.constructJSONList(matches, m -> m.getSegment1().toString())) - .put("segment2_list", RacrUtils.constructJSONList(matches, m -> m.getSegment2().toString())) - .put("segment3_list", RacrUtils.constructJSONList(matches, m -> m.getSegment3().toString())) - .put("segment4_list", RacrUtils.constructJSONList(matches, m -> m.getSegment4().toString())) - .put("segment5_list", RacrUtils.constructJSONList(matches, m -> m.getSegment5().toString())) - .put("segment6_list", RacrUtils.constructJSONList(matches, m -> m.getSegment6().toString())) - .build(); - String response = this.call(new Event("ConnectedSegmentsRepairEvent", params)); - return Optional.ofNullable(response); - } - - public Optional<String> callPosLengthQuery() { - String response = this.call(new Event("PosLengthQueryEvent")); - return Optional.ofNullable(response); - } - - public Optional<String> callPosLengthInject(Collection<RacrPosLengthInjectMatch> matches) { - String segmentList = RacrUtils.constructJSONList(matches, m -> m.getSegment().toString()); - String response = this.call(new Event("PosLengthInjectEvent", ImmutableMap.of("segment_list", segmentList))); - return Optional.ofNullable(response); - } - - public Optional<String> callPosLengthRepair(Collection<RacrPosLengthMatch> matches) { - String segmentList = RacrUtils.constructJSONList(matches, m -> m.getSegment().toString()); - String response = this.call(new Event("PosLengthRepairEvent", ImmutableMap.of("segment_list", segmentList))); - return Optional.ofNullable(response); - } - - public Optional<String> callRouteSensorQuery() { - String response = this.call(new Event("RouteSensorQueryEvent")); - return Optional.ofNullable(response); - } - - public Optional<String> callRouteSensorInjectQuery() { - String response = this.call(new Event("RouteSensorInjectQueryEvent")); - return Optional.ofNullable(response); - } - - public Optional<String> callRouteSensorInject(Collection<RacrRouteSensorInjectMatch> matches) { - Map<String, String> params = new ImmutableMap.Builder<String, String>() - .put("route_list", RacrUtils.constructJSONList(matches, m -> m.getRoute().toString())) - .put("sensor_list", RacrUtils.constructJSONList(matches, m -> m.getSensor().toString())) - .build(); - String response = this.call(new Event("RouteSensorInjectEvent", params)); - return Optional.ofNullable(response); - } - - public Optional<String> callRouteSensorRepair(Collection<RacrRouteSensorMatch> matches) { - Map<String, String> params = new ImmutableMap.Builder<String, String>() - .put("route_list", RacrUtils.constructJSONList(matches, m -> m.getRoute().toString())) - .put("sensor_list", RacrUtils.constructJSONList(matches, m -> m.getSensor().toString())) - .put("sw_list", RacrUtils.constructJSONList(matches, m -> m.getSw().toString())) - .put("swp_list", RacrUtils.constructJSONList(matches, m -> m.getSwP().toString())) - .build(); - String response = this.call(new Event("RouteSensorRepairEvent", params)); - return Optional.ofNullable(response); - } - - public Optional<String> callSemaphoreNeighborQuery() { - String response = this.call(new Event("SemaphoreNeighborQueryEvent")); - return Optional.ofNullable(response); - } - - public Optional<String> callSemaphoreNeighborInjectQuery() { - String response = this.call(new Event("SemaphoreNeighborInjectQueryEvent")); - return Optional.ofNullable(response); - } - - public Optional<String> callSemaphoreNeighborInject(Collection<RacrSemaphoreNeighborInjectMatch> matches) { - Map<String, String> params = new ImmutableMap.Builder<String, String>() - .put("route_list", RacrUtils.constructJSONList(matches, m -> m.getRoute().toString())) - .put("semaphore_list", RacrUtils.constructJSONList(matches, m -> m.getSemaphore().toString())) - .build(); - String response = this.call(new Event("SemaphoreNeighborInjectEvent", params)); - return Optional.ofNullable(response); - } - - public Optional<String> callSemaphoreNeighborRepair(Collection<RacrSemaphoreNeighborMatch> matches) { - Map<String, String> params = new ImmutableMap.Builder<String, String>() - .put("route1_list", RacrUtils.constructJSONList(matches, m -> m.getRoute1().toString())) - .put("route2_list", RacrUtils.constructJSONList(matches, m -> m.getRoute2().toString())) - .put("semaphore_list", RacrUtils.constructJSONList(matches, m -> m.getSemaphore().toString())) - .put("sensor1_list", RacrUtils.constructJSONList(matches, m -> m.getSensor1().toString())) - .put("sensor2_list", RacrUtils.constructJSONList(matches, m -> m.getSensor2().toString())) - .put("te1_list", RacrUtils.constructJSONList(matches, m -> m.getTe1().toString())) - .put("te2_list", RacrUtils.constructJSONList(matches, m -> m.getTe2().toString())) - .build(); - String response = this.call(new Event("SemaphoreNeighborRepairEvent", params)); - return Optional.ofNullable(response); - } - - public Optional<String> callSwitchMonitoredQuery() { - String response = this.call(new Event("SwitchMonitoredQueryEvent")); - return Optional.ofNullable(response); - } - - public Optional<String> callSwitchMonitoredInject(Collection<RacrSwitchMonitoredInjectMatch> matches) { - Map<String, String> params = new ImmutableMap.Builder<String, String>() - .put("sw_list", RacrUtils.constructJSONList(matches, m -> m.getSw().toString())) - .build(); - String response = this.call(new Event("SwitchMonitoredInjectEvent", params)); - return Optional.ofNullable(response); - } - - public Optional<String> callSwitchMonitoredRepair(Collection<RacrSwitchMonitoredMatch> matches) { - Map<String, String> params = new ImmutableMap.Builder<String, String>() - .put("sw_list", RacrUtils.constructJSONList(matches, m -> m.getSw().toString())) - .build(); - String response = this.call(new Event("SwitchMonitoredRepairEvent", params)); - return Optional.ofNullable(response); - } - - public Optional<String> callSwitchSetQuery() { - String response = this.call(new Event("SwitchSetQueryEvent")); - return Optional.ofNullable(response); - } - - public Optional<String> callSwitchSetInject(Collection<RacrSwitchSetInjectMatch> matches) { - Map<String, String> params = new ImmutableMap.Builder<String, String>() - .put("sw_list", RacrUtils.constructJSONList(matches, m -> m.getSw().toString())) - .build(); - String response = this.call(new Event("SwitchSetInjectEvent", params)); - return Optional.ofNullable(response); - } - - public Optional<String> callSwitchSetRepair(Collection<RacrSwitchSetMatch> matches) { - Map<String, String> params = new ImmutableMap.Builder<String, String>() - .put("route_list", RacrUtils.constructJSONList(matches, m -> m.getRoute().toString())) - .put("semaphore_list", RacrUtils.constructJSONList(matches, m -> m.getSemaphore().toString())) - .put("sw_list", RacrUtils.constructJSONList(matches, m -> m.getSw().toString())) - .put("swp_list", RacrUtils.constructJSONList(matches, m -> m.getSwP().toString())) - .build(); - String response = this.call(new Event("SwitchSetRepairEvent", params)); - return Optional.ofNullable(response); - } - - @Override - public abstract void close() throws IOException; -} diff --git a/trainbenchmark-tool-racr/src/main/java/de/tudresden/inf/st/train/racr/util/AsyncSocketClient.java b/trainbenchmark-tool-racr/src/main/java/de/tudresden/inf/st/train/racr/util/AsyncSocketClient.java deleted file mode 100644 index db5aaef4d..000000000 --- a/trainbenchmark-tool-racr/src/main/java/de/tudresden/inf/st/train/racr/util/AsyncSocketClient.java +++ /dev/null @@ -1,25 +0,0 @@ -package de.tudresden.inf.st.train.racr.util; - -import java.io.IOException; - -/** - * Client using the ticket mechanism. - * TODO Implement this class - * Created by rschoene on 8/18/17. - */ -public class AsyncSocketClient extends SocketClient { - - AsyncSocketClient(int timeout, RacrConfig config) { - super(timeout, config); - } - - @Override - protected String call(Event event, boolean waitForAnswer) { - return null; - } - - @Override - public void close() { - - } -} diff --git a/trainbenchmark-tool-racr/src/main/java/de/tudresden/inf/st/train/racr/util/Event.java b/trainbenchmark-tool-racr/src/main/java/de/tudresden/inf/st/train/racr/util/Event.java deleted file mode 100644 index 6ff646e50..000000000 --- a/trainbenchmark-tool-racr/src/main/java/de/tudresden/inf/st/train/racr/util/Event.java +++ /dev/null @@ -1,71 +0,0 @@ -package de.tudresden.inf.st.train.racr.util; - -import java.util.HashMap; -import java.util.Map; -import java.util.stream.Collectors; - -/** - * General Event to be sent to and handled by pRacr - * Created by rschoene on 5/26/17. - */ -public class Event { - private Map<String, String> params; - private String commandLine; - protected static String defaultModuleName = "pracr.trainbenchmark.tb_event"; - - /** - * Creates a new event with the default module name "pracr.trainbenchmark.tb_even", and no parameters. - * @param className the name of the Python event class - */ - public Event(String className) { - this(null, className); - } - - /** - * Creates a new event with the default module name "pracr.trainbenchmark.tb_even". - * @param className the name of the Python event class - * @param params key-value parameters to pass to the event - */ - public Event(String className, Map<String, String> params) { - this(null, className, params); - } - - /** - * Creates a new event with no parameters. - * @param className the name of the Python event class - * @param moduleName the name of the module the Python event class resides in - */ - public Event(String moduleName, String className) { - this(moduleName, className, null); - } - - /** - * Creates a new event. - * @param className the name of the Python event class - * @param moduleName the name of the module the Python event class resides in, if <code>null</code>, use the {@link Event#defaultModuleName} - * @param params key-value parameters to pass to the event - */ - public Event(String moduleName, String className, Map<String, String> params) { - if (moduleName == null) { - moduleName = defaultModuleName; - } - if (params == null) { - this.params = new HashMap<>(); - } else { - this.params = new HashMap<>(params); - } - this.params.put("module_name", "\"" + moduleName + "\""); - this.params.put("class_name", "\"" + className + "\""); - } - - String getCommandLine() { - if (this.commandLine == null) { - // compute commandline if not done before - String content = params.entrySet().stream() - .map(entry -> String.format("\"%s\": %s", entry.getKey(), entry.getValue())) - .collect(Collectors.joining(", ")); - this.commandLine = "{" + content + "}"; - } - return this.commandLine; - } -} diff --git a/trainbenchmark-tool-racr/src/main/java/de/tudresden/inf/st/train/racr/util/RacrConfig.java b/trainbenchmark-tool-racr/src/main/java/de/tudresden/inf/st/train/racr/util/RacrConfig.java deleted file mode 100644 index a7d7eade4..000000000 --- a/trainbenchmark-tool-racr/src/main/java/de/tudresden/inf/st/train/racr/util/RacrConfig.java +++ /dev/null @@ -1,52 +0,0 @@ -package de.tudresden.inf.st.train.racr.util; - -/** - * Configuration to communicate with RACR. - * Created by rschoene on 6/23/17. - */ -public class RacrConfig { - - public enum ClientType { - SOCKET, - HTTP - } - - public boolean verbose; - - public boolean startStopOwnServer; - - public int port; - - public String host; - - public String flavor; - - public String projectNameSuffix; - - public boolean loadUsingScheme; - - public ClientType clientType; - - public RacrConfig() { - verbose = false; - startStopOwnServer = false; - port = 9432; - host = "localhost"; - flavor = "unset"; - projectNameSuffix = "unset"; - loadUsingScheme = false; - clientType = ClientType.HTTP; - } - - public RacrConfig(RacrConfig other) { - verbose = other.verbose; - startStopOwnServer = other.startStopOwnServer; - port = other.port; - host = other.host; - flavor = other.flavor; - projectNameSuffix = other.projectNameSuffix; - loadUsingScheme = other.loadUsingScheme; - clientType = other.clientType; - } - -} diff --git a/trainbenchmark-tool-racr/src/main/java/de/tudresden/inf/st/train/racr/util/RacrHttpClient.java b/trainbenchmark-tool-racr/src/main/java/de/tudresden/inf/st/train/racr/util/RacrHttpClient.java deleted file mode 100644 index 34f20407f..000000000 --- a/trainbenchmark-tool-racr/src/main/java/de/tudresden/inf/st/train/racr/util/RacrHttpClient.java +++ /dev/null @@ -1,74 +0,0 @@ -package de.tudresden.inf.st.train.racr.util; - -import com.google.api.client.http.*; -import com.google.api.client.http.javanet.NetHttpTransport; - -import java.io.IOException; - -/** - * Client to connect via HTTP. - * Created by rschoene on 5/26/17. - */ -public class RacrHttpClient extends AbstractClient { - - private final HttpRequestFactory requestFactory; - private final String path; - - public RacrHttpClient(String path, int timeout, RacrConfig config) { - super(timeout, config); - if (!path.startsWith("/")) { - path = "/" + path; - } - this.path = path; - HttpTransport httpTransport = new NetHttpTransport(); -// hri = new HttpRequestInitializer() { -// @Override -// public void initialize(HttpRequest httpRequest) throws IOException { -// requestInitializer.initialize(httpRequest); -// httpRequest.setConnectTimeout(3 * 60000); // 3 minutes connect timeout -// httpRequest.setReadTimeout(3 * 60000); // 3 minutes read timeout -// }; - this.requestFactory = httpTransport.createRequestFactory(request -> request.setConnectTimeout(30 * 1000).setReadTimeout(30 * 1000)); // 30 seconds read and connect timeout - } - - /** - * Creates a new RacrHttpClient to connect to a local pRacr server. - * @param timeout Seconds to wait for answers, 0 for blocking - * @return the new RacrHttpClient - */ - public static RacrHttpClient connectToPracr(int timeout, RacrConfig config) { - return new RacrHttpClient("event", timeout, config); - } - - @Override - public String call(Event event, boolean waitForAnswer) { - try { - String path = "http://" + config.host + ":" + config.port + this.path; - HttpRequest request = requestFactory.buildPostRequest( - new GenericUrl(path), - ByteArrayContent.fromString("application/json", event.getCommandLine())); - request.getHeaders().setContentType("application/json"); - HttpResponse response = request.execute(); - return response.parseAsString(); - } catch (IOException e) { - throw new RuntimeException(e); - } - } - -// @Override -// public void callSystemExit() { -// try { -// String path = "http://" + config.host + ":" + config.port + "/exit"; -// HttpRequest request = requestFactory.buildPostRequest( -// new GenericUrl(path), null); -// request.execute(); -// } catch (IOException e) { -// throw new RuntimeException(e); -// } -// } - - @Override - public void close() { - // nothing to do here - } -} diff --git a/trainbenchmark-tool-racr/src/main/java/de/tudresden/inf/st/train/racr/util/RacrUtils.java b/trainbenchmark-tool-racr/src/main/java/de/tudresden/inf/st/train/racr/util/RacrUtils.java deleted file mode 100644 index 7e16934a5..000000000 --- a/trainbenchmark-tool-racr/src/main/java/de/tudresden/inf/st/train/racr/util/RacrUtils.java +++ /dev/null @@ -1,119 +0,0 @@ -package de.tudresden.inf.st.train.racr.util; - -import de.tudresden.inf.st.train.racr.driver.RacrDriver; -import de.tudresden.inf.st.train.racr.matches.RacrMatch; -import de.tudresden.inf.st.train.racr.queries.RacrQuery; -import de.tudresden.inf.st.train.racr.transformations.RacrTransformation; -import hu.bme.mit.trainbenchmark.benchmark.operations.ModelOperation; -import hu.bme.mit.trainbenchmark.benchmark.operations.ModelQuery; -import hu.bme.mit.trainbenchmark.benchmark.operations.ModelTransformation; -import org.json.simple.JSONArray; -import org.json.simple.JSONObject; -import org.json.simple.parser.JSONParser; -import org.json.simple.parser.ParseException; - -import java.util.*; -import java.util.function.Function; -import java.util.function.UnaryOperator; -import java.util.stream.Collectors; - -/** - * Utils for pRacr communication - * Created by rschoene on 5/19/17. - */ -public class RacrUtils { - public static <T> Collection<T> parseAsList(String response, Function<? super String, T> func) { - // parse the list of the from "[1, 42, 8, 15]" - if (response.startsWith("[") && response.endsWith("]")) { - response = response.substring(1, response.length() - 1); - } - if (response.trim().isEmpty()) { - return Collections.emptyList(); - } - String[] tokens = response.split(","); - UnaryOperator<String> trimFunction = String::trim; - return Arrays.stream(tokens) - .map(trimFunction.andThen(func)) - .collect(Collectors.toList()); - } - - public static <T> Collection<T> parseFromMultipeLists(String response, Function<Object[], T> createElement, String... names) { - Map<String, Object[]> map_of_inputs = splitByName(response, names); - Object[] first_input = map_of_inputs.get(names[0]); - Collection<T> result = new ArrayList<>(first_input.length); - for (int i = 0; i < first_input.length; i++) { - Object[] params = new Object[names.length]; - for (int j = 0; j < names.length; j++) { - params[j] = map_of_inputs.get(names[j])[i]; - } - result.add(createElement.apply(params)); - } - return result; - } - - public static <T> Collection<T> parseNestedLists(String response, Function<Object[], T> createElement) { - JSONParser parser = new JSONParser(); - Collection<T> result = new ArrayList<>(); - try { - JSONArray rootObj = (JSONArray) parser.parse(response); - for (Object sublist: rootObj) { - result.add(createElement.apply(((JSONArray) sublist).toArray())); - } - } catch (ParseException e) { - e.printStackTrace(); - } - return result; - } - - private static Map<String, Object[]> splitByName(String content, String... names) { - JSONParser parser = new JSONParser(); - Map<String, Object[]> result = new HashMap<>(names.length); - try { - Object rootObj = parser.parse(content); - if (rootObj instanceof JSONArray) { - if (!((JSONArray) rootObj).isEmpty()) { - System.err.println("Got Array instead of Dict: " + content); - } - return Arrays.stream(names).collect(Collectors.toMap( - Function.identity(), - s -> new Object[0])); - } - JSONObject root = (JSONObject) rootObj; - for (String name : names) { - JSONArray elements = (JSONArray) root.get(name); - result.put(name, elements.toArray()); - } - } catch (ParseException e) { - e.printStackTrace(); - } - return result; - } - - public static <T> String constructJSONList(Collection<T> input, Function<T, String> func) { - return "[" + input.stream().map(func).collect(Collectors.joining(", ")) + "]"; - } - - public static AbstractClient connectToPracr(int timeout, RacrConfig config) { - switch (config.clientType) { - case SOCKET: - return SocketClient.connectToPracr(timeout, config); - case HTTP: - return RacrHttpClient.connectToPracr(timeout, config); - default: - throw new RuntimeException("Invalid clientType in config: " + config.clientType); - } - } - - public static AbstractClient connectToPracr(RacrTransformation<? extends RacrMatch, ? extends RacrDriver> transformation) { - return connectToPracr(transformation.getTimeout(), transformation.getDriver()); - } - - public static AbstractClient connectToPracr(RacrQuery<? extends RacrMatch, ? extends RacrDriver> query) { - return connectToPracr(query.getTimeout(), query.getDriver()); - } - - public static AbstractClient connectToPracr(int timeout, RacrDriver driver) { - return connectToPracr(timeout, driver.config); - } - -} diff --git a/trainbenchmark-tool-racr/src/main/java/de/tudresden/inf/st/train/racr/util/SocketClient.java b/trainbenchmark-tool-racr/src/main/java/de/tudresden/inf/st/train/racr/util/SocketClient.java deleted file mode 100644 index 8baec39b1..000000000 --- a/trainbenchmark-tool-racr/src/main/java/de/tudresden/inf/st/train/racr/util/SocketClient.java +++ /dev/null @@ -1,118 +0,0 @@ -package de.tudresden.inf.st.train.racr.util; - -import de.tudresden.inf.st.train.racr.driver.RacrDriver; - -import java.io.IOException; -import java.io.PrintWriter; -import java.net.Socket; -import java.util.Scanner; -import java.util.concurrent.*; - -/** - * Client to connect via sockets. - * Created by rschoene on 5/19/17. - */ -public class SocketClient extends AbstractClient { - - private class SocketCall implements Callable<String> { - private final String commandLine; - private final Socket server; - private final boolean waitForAnswer; - - SocketCall(Socket server, String commandLine, boolean waitForAnswer) { - this.server = server; - this.commandLine = commandLine; - this.waitForAnswer = waitForAnswer; - } - - @Override - public String call() throws Exception { - String result; -// try { - Scanner in = new Scanner( server.getInputStream() ); - PrintWriter out = new PrintWriter( server.getOutputStream(), true ); - out.println(commandLine); - if (waitForAnswer && in.hasNextLine()) { - if (config.verbose) System.out.println("waiting for an answer"); - result = in.nextLine(); - } else { - result = null; - } - out.println(); -// } catch (IOException e) { -// e.printStackTrace(); -// result = null; -// } - return result; - } - } - - private final ExecutorService pool; - - /** - * Creates a new client which connect upon every call - * @param timeout Seconds to wait for answers, 0 for blocking - */ - public SocketClient(int timeout, RacrConfig config) { - super(timeout, config); - this.pool = Executors.newFixedThreadPool(3); - } - - /** - * Creates a new SocketClient to connect to a local pRacr server. - * @param timeout Seconds to wait for answers, 0 for blocking - * @return the new SocketClient - */ - public static SocketClient connectToPracr(int timeout, RacrConfig config) { - return new SocketClient(timeout, config); - } - - protected String call(Event event, boolean waitForAnswer) { - return this.call(event.getCommandLine(), waitForAnswer); - } - - /** - * Sends the given line and waits for an answer. - * @param commandLine the line to send (a newline is always appended) - * @return the answer, or <code>null</code> if exceptions occurred - */ - private String call(String commandLine) { - return this.call(commandLine, true); - } - - /** - * Sends the given line. - * @param commandLine the line to send (a newline is always appended) - * @param waitForAnswer If the call expects an answer - * @return the answer, or <code>null</code> if exceptions occurred or waitForAnswer is false - */ - private String call(String commandLine, boolean waitForAnswer) { - Socket server; - try { - server = new Socket(config.host, config.port); - } catch (IOException e) { - throw new RuntimeException(e); -// e.printStackTrace(); -// return null; - } - SocketCall sc = new SocketCall(server, commandLine, waitForAnswer); - Future<String> result = this.pool.submit(sc); - try { - return result.get(this.timeout, TimeUnit.SECONDS); - } catch (InterruptedException | ExecutionException | TimeoutException e) { - throw new RuntimeException(e); - } finally { - try { - server.close(); - } catch (IOException e) { - e.printStackTrace(); - } - } -// return null; - } - - @Override - public void close() { - this.pool.shutdownNow(); - } -} diff --git a/trainbenchmark-tool-racr/src/main/java/de/tudresden/inf/st/train/racr/util/TestUtils.java b/trainbenchmark-tool-racr/src/main/java/de/tudresden/inf/st/train/racr/util/TestUtils.java deleted file mode 100644 index 41fb1434f..000000000 --- a/trainbenchmark-tool-racr/src/main/java/de/tudresden/inf/st/train/racr/util/TestUtils.java +++ /dev/null @@ -1,44 +0,0 @@ -package de.tudresden.inf.st.train.racr.util; - -import de.tudresden.inf.st.train.racr.RacrBenchmarkScenario; -import de.tudresden.inf.st.train.racr.config.RacrBenchmarkConfig; -import de.tudresden.inf.st.train.racr.config.RacrBenchmarkConfigBuilder; -import de.tudresden.inf.st.train.racr.util.RacrUtils; -import hu.bme.mit.trainbenchmark.benchmark.config.BenchmarkConfigBase; -import hu.bme.mit.trainbenchmark.benchmark.phases.BenchmarkScenario; -import hu.bme.mit.trainbenchmark.benchmark.runcomponents.BenchmarkResult; - -/** - * Utils to perform a test with RACR. - * Created by rschoene on 6/23/17. - */ -public class TestUtils { - public interface BenchmarkUpdate { - void op(RacrBenchmarkConfigBuilder a); - } - public interface CreateBenchmarkScenario { - BenchmarkScenario op(RacrBenchmarkConfig bc) throws Exception; - } - - public static BenchmarkResult runTest(BenchmarkConfigBase bcb, - BenchmarkUpdate bu, - CreateBenchmarkScenario cbs) throws Exception { - final RacrBenchmarkConfigBuilder builder = new RacrBenchmarkConfigBuilder().setVerbose(true); - bu.op(builder); - final RacrBenchmarkConfig bc = builder.setConfigBase(bcb).createConfig(); -// final RacrBenchmarkScenario scenario = new RacrBenchmarkScenario(bc); - final BenchmarkScenario scenario = cbs.op(bc); - return scenario.performBenchmark(); - } - - public static boolean pracrServerReachable(BenchmarkConfigBase bcb, BenchmarkUpdate bu) { - final RacrBenchmarkConfigBuilder builder = new RacrBenchmarkConfigBuilder(); - bu.op(builder); - final RacrBenchmarkConfig bc = builder.setConfigBase(bcb).createConfig(); - try { - return RacrUtils.connectToPracr(5, bc.config).callServerTime().isPresent(); - } catch (RuntimeException e) { - return false; - } - } -} diff --git a/trainbenchmark-tool-rdf/build.gradle b/trainbenchmark-tool-rdf/build.gradle deleted file mode 100644 index b7ae3f42b..000000000 --- a/trainbenchmark-tool-rdf/build.gradle +++ /dev/null @@ -1,4 +0,0 @@ -dependencies { - compile project(':trainbenchmark-tool') - compile project(':trainbenchmark-format-rdf') -} diff --git a/trainbenchmark-tool-rdf/src/main/java/hu/bme/mit/trainbenchmark/benchmark/rdf/config/RdfBenchmarkConfig.java b/trainbenchmark-tool-rdf/src/main/java/hu/bme/mit/trainbenchmark/benchmark/rdf/config/RdfBenchmarkConfig.java deleted file mode 100644 index cf31574e4..000000000 --- a/trainbenchmark-tool-rdf/src/main/java/hu/bme/mit/trainbenchmark/benchmark/rdf/config/RdfBenchmarkConfig.java +++ /dev/null @@ -1,35 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2010-2015, Benedek Izso, Gabor Szarnyas, Istvan Rath and Daniel Varro - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Benedek Izso - initial API and implementation - * Gabor Szarnyas - initial API and implementation - *******************************************************************************/ - -package hu.bme.mit.trainbenchmark.benchmark.rdf.config; - -import hu.bme.mit.trainbenchmark.benchmark.config.BenchmarkConfig; -import hu.bme.mit.trainbenchmark.benchmark.config.BenchmarkConfigBase; - -public abstract class RdfBenchmarkConfig extends BenchmarkConfig { - - protected boolean inferencing; - - protected RdfBenchmarkConfig(final BenchmarkConfigBase configBase, final boolean inferencing) { - super(configBase); - this.inferencing = inferencing; - } - - public boolean isInferencing() { - return inferencing; - } - - protected String getToolNamePostfix() { - return isInferencing() ? " (Inferencing)" : " (No Inferencing)"; - } - -} diff --git a/trainbenchmark-tool-rdf/src/main/java/hu/bme/mit/trainbenchmark/benchmark/rdf/config/RdfBenchmarkConfigBuilder.java b/trainbenchmark-tool-rdf/src/main/java/hu/bme/mit/trainbenchmark/benchmark/rdf/config/RdfBenchmarkConfigBuilder.java deleted file mode 100644 index e138c326c..000000000 --- a/trainbenchmark-tool-rdf/src/main/java/hu/bme/mit/trainbenchmark/benchmark/rdf/config/RdfBenchmarkConfigBuilder.java +++ /dev/null @@ -1,24 +0,0 @@ -package hu.bme.mit.trainbenchmark.benchmark.rdf.config; - -import com.google.common.base.Preconditions; - -import hu.bme.mit.trainbenchmark.benchmark.config.BenchmarkConfigBuilder; - -public abstract class RdfBenchmarkConfigBuilder<T extends RdfBenchmarkConfig, B extends RdfBenchmarkConfigBuilder<T, ?>> - extends BenchmarkConfigBuilder<T, B> { - - protected Boolean inferencing; - - @SuppressWarnings("unchecked") - public B setInferencing(final boolean inferencing) { - this.inferencing = inferencing; - return (B) this; - } - - @Override - public void checkNotNulls() { - super.checkNotNulls(); - Preconditions.checkNotNull(inferencing); - } - -} diff --git a/trainbenchmark-tool-rdf/src/main/java/hu/bme/mit/trainbenchmark/benchmark/rdf/driver/RdfDriver.java b/trainbenchmark-tool-rdf/src/main/java/hu/bme/mit/trainbenchmark/benchmark/rdf/driver/RdfDriver.java deleted file mode 100644 index e55710f4d..000000000 --- a/trainbenchmark-tool-rdf/src/main/java/hu/bme/mit/trainbenchmark/benchmark/rdf/driver/RdfDriver.java +++ /dev/null @@ -1,68 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2010-2015, Benedek Izso, Gabor Szarnyas, Istvan Rath and Daniel Varro - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Benedek Izso - initial API and implementation - * Gabor Szarnyas - initial API and implementation - *******************************************************************************/ -package hu.bme.mit.trainbenchmark.benchmark.rdf.driver; - -import static hu.bme.mit.trainbenchmark.rdf.RdfConstants.BASE_PREFIX; -import static hu.bme.mit.trainbenchmark.rdf.RdfConstants.ID_PREFIX; -import static hu.bme.mit.trainbenchmark.rdf.RdfConstants.RDF_TYPE; - -import java.io.IOException; - -import hu.bme.mit.trainbenchmark.benchmark.driver.Driver; -import hu.bme.mit.trainbenchmark.rdf.RdfHelper; - -public abstract class RdfDriver extends Driver { - - protected Long newVertexId = null; - protected boolean inferencing; - - public RdfDriver(final boolean inferencing) { - super(); - this.inferencing = inferencing; - } - - protected Long determineInitialNewVertexId() throws Exception { - Long id = 5000L; - - // safety measure to avoid infinite loop in case of a driver bug - int iterationCount = 1; - - final String askQuery = "PREFIX base: <" + BASE_PREFIX + "> " // - + "PREFIX rdf: <" + RDF_TYPE + "> " // - + "ASK { base:" + ID_PREFIX + "%d ?y ?z }"; - while (iterationCount <= 20 && ask(String.format(askQuery, id))) { - id *= 2; - iterationCount++; - } - if (iterationCount > 20) { - throw new IOException("Could not generate new unique id."); - } - - return id; - } - - public Long generateNewVertexId() throws Exception { - if (newVertexId == null) { - newVertexId = determineInitialNewVertexId(); - } - newVertexId++; - return newVertexId; - } - - @Override - public String getPostfix() { - return RdfHelper.getPostfix(inferencing); - } - - protected abstract boolean ask(String askQuery) throws Exception; - -} diff --git a/trainbenchmark-tool-rdf/src/main/java/hu/bme/mit/trainbenchmark/benchmark/rdf/driver/RdfDriverFactory.java b/trainbenchmark-tool-rdf/src/main/java/hu/bme/mit/trainbenchmark/benchmark/rdf/driver/RdfDriverFactory.java deleted file mode 100644 index 1090e15c1..000000000 --- a/trainbenchmark-tool-rdf/src/main/java/hu/bme/mit/trainbenchmark/benchmark/rdf/driver/RdfDriverFactory.java +++ /dev/null @@ -1,13 +0,0 @@ -package hu.bme.mit.trainbenchmark.benchmark.rdf.driver; - -import hu.bme.mit.trainbenchmark.benchmark.driver.DriverFactory; - -public abstract class RdfDriverFactory<TRdfDriver extends RdfDriver> extends DriverFactory<TRdfDriver> { - - protected final boolean inferencing; - - public RdfDriverFactory(final boolean inferencing) { - this.inferencing = inferencing; - } - -} diff --git a/trainbenchmark-tool-rdf/src/main/java/hu/bme/mit/trainbenchmark/benchmark/rdf/queries/RdfModelQuery.java b/trainbenchmark-tool-rdf/src/main/java/hu/bme/mit/trainbenchmark/benchmark/rdf/queries/RdfModelQuery.java deleted file mode 100644 index 1f07281e9..000000000 --- a/trainbenchmark-tool-rdf/src/main/java/hu/bme/mit/trainbenchmark/benchmark/rdf/queries/RdfModelQuery.java +++ /dev/null @@ -1,27 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2010-2015, Benedek Izso, Gabor Szarnyas, Istvan Rath and Daniel Varro - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Benedek Izso - initial API and implementation - * Gabor Szarnyas - initial API and implementation - *******************************************************************************/ -package hu.bme.mit.trainbenchmark.benchmark.rdf.queries; - -import hu.bme.mit.trainbenchmark.benchmark.driver.Driver; -import hu.bme.mit.trainbenchmark.benchmark.operations.ModelQuery; -import hu.bme.mit.trainbenchmark.constants.RailwayQuery; - -public abstract class RdfModelQuery<TMatch, TDriver extends Driver> extends ModelQuery<TMatch, TDriver> { - - protected final String queryPath; - - public RdfModelQuery(final TDriver driver, final String workspaceDir, final RailwayQuery query) { - super(query, driver); - this.queryPath = workspaceDir + "trainbenchmark-tool-rdf/src/main/resources/queries/" + query + ".sparql"; - } - -} diff --git a/trainbenchmark-tool-rdf/src/main/java/hu/bme/mit/trainbenchmark/benchmark/rdf/tests/RdfTest.java b/trainbenchmark-tool-rdf/src/main/java/hu/bme/mit/trainbenchmark/benchmark/rdf/tests/RdfTest.java deleted file mode 100644 index 6b11327d3..000000000 --- a/trainbenchmark-tool-rdf/src/main/java/hu/bme/mit/trainbenchmark/benchmark/rdf/tests/RdfTest.java +++ /dev/null @@ -1,23 +0,0 @@ -package hu.bme.mit.trainbenchmark.benchmark.rdf.tests; - -import java.util.Arrays; - -import org.junit.runner.RunWith; -import org.junit.runners.Parameterized; -import org.junit.runners.Parameterized.Parameter; -import org.junit.runners.Parameterized.Parameters; - -import hu.bme.mit.trainbenchmark.benchmark.test.TrainBenchmarkTest; - -@RunWith(Parameterized.class) -public abstract class RdfTest extends TrainBenchmarkTest { - - @Parameters(name="inferencing={0}") - public static Iterable<? extends Object> data() { - return Arrays.asList(false, true); - } - - @Parameter - public boolean inferencing; - -} diff --git a/trainbenchmark-tool-rdf/src/main/resources/queries/ConnectedSegments.sparql b/trainbenchmark-tool-rdf/src/main/resources/queries/ConnectedSegments.sparql deleted file mode 100644 index 052d4664d..000000000 --- a/trainbenchmark-tool-rdf/src/main/resources/queries/ConnectedSegments.sparql +++ /dev/null @@ -1,30 +0,0 @@ -PREFIX base: <http://www.semanticweb.org/ontologies/2015/trainbenchmark#> -PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> - -SELECT DISTINCT ?sensor ?segment1 ?segment2 ?segment3 ?segment4 ?segment5 ?segment6 -WHERE -{ - ?sensor rdf:type base:Sensor . - ?segment1 base:monitoredBy ?sensor . - ?segment1 rdf:type base:Segment . - - ?segment1 base:connectsTo ?segment2 . - ?segment2 base:monitoredBy ?sensor . - ?segment2 rdf:type base:Segment . - - ?segment2 base:connectsTo ?segment3 . - ?segment3 base:monitoredBy ?sensor . - ?segment3 rdf:type base:Segment . - - ?segment3 base:connectsTo ?segment4 . - ?segment4 rdf:type base:Segment . - ?segment4 base:monitoredBy ?sensor . - - ?segment4 base:connectsTo ?segment5 . - ?segment5 rdf:type base:Segment . - ?segment5 base:monitoredBy ?sensor . - - ?segment5 base:connectsTo ?segment6 . - ?segment6 rdf:type base:Segment . - ?segment6 base:monitoredBy ?sensor . -} diff --git a/trainbenchmark-tool-rdf/src/main/resources/queries/ConnectedSegmentsInject.sparql b/trainbenchmark-tool-rdf/src/main/resources/queries/ConnectedSegmentsInject.sparql deleted file mode 100644 index c439601d9..000000000 --- a/trainbenchmark-tool-rdf/src/main/resources/queries/ConnectedSegmentsInject.sparql +++ /dev/null @@ -1,13 +0,0 @@ -PREFIX base: <http://www.semanticweb.org/ontologies/2015/trainbenchmark#> -PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> - -SELECT DISTINCT ?sensor ?segment1 ?segment3 -WHERE { - ?segment1 base:connectsTo ?segment3 . - ?segment1 base:monitoredBy ?sensor . - ?segment3 base:monitoredBy ?sensor . - - ?sensor rdf:type base:Sensor . - ?segment1 rdf:type base:Segment . - ?segment3 rdf:type base:Segment . -} diff --git a/trainbenchmark-tool-rdf/src/main/resources/queries/PosLength.sparql b/trainbenchmark-tool-rdf/src/main/resources/queries/PosLength.sparql deleted file mode 100644 index 2fd39f38b..000000000 --- a/trainbenchmark-tool-rdf/src/main/resources/queries/PosLength.sparql +++ /dev/null @@ -1,11 +0,0 @@ -PREFIX base: <http://www.semanticweb.org/ontologies/2015/trainbenchmark#> -PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> - -SELECT DISTINCT ?segment ?length -WHERE -{ - ?segment rdf:type base:Segment . - ?segment base:length ?length . - - FILTER (?length <= 0) -} diff --git a/trainbenchmark-tool-rdf/src/main/resources/queries/PosLengthInject.sparql b/trainbenchmark-tool-rdf/src/main/resources/queries/PosLengthInject.sparql deleted file mode 100644 index 5deb0ce42..000000000 --- a/trainbenchmark-tool-rdf/src/main/resources/queries/PosLengthInject.sparql +++ /dev/null @@ -1,7 +0,0 @@ -PREFIX base: <http://www.semanticweb.org/ontologies/2015/trainbenchmark#> -PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> - -SELECT DISTINCT ?segment -WHERE { - ?segment rdf:type base:Segment . -} diff --git a/trainbenchmark-tool-rdf/src/main/resources/queries/RouteSensor.sparql b/trainbenchmark-tool-rdf/src/main/resources/queries/RouteSensor.sparql deleted file mode 100644 index 796e4a452..000000000 --- a/trainbenchmark-tool-rdf/src/main/resources/queries/RouteSensor.sparql +++ /dev/null @@ -1,20 +0,0 @@ -PREFIX base: <http://www.semanticweb.org/ontologies/2015/trainbenchmark#> -PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> - -SELECT DISTINCT ?route ?sensor ?swP ?sw -WHERE -{ - ?route base:follows ?swP . - ?route rdf:type base:Route . - ?swP rdf:type base:SwitchPosition . - - ?swP base:target ?sw . - ?sw rdf:type base:Switch . - - ?sw base:monitoredBy ?sensor . - ?sensor rdf:type base:Sensor . - - FILTER NOT EXISTS { - ?route base:requires ?sensor . - } -} diff --git a/trainbenchmark-tool-rdf/src/main/resources/queries/RouteSensorInject.sparql b/trainbenchmark-tool-rdf/src/main/resources/queries/RouteSensorInject.sparql deleted file mode 100644 index 88d4d7f25..000000000 --- a/trainbenchmark-tool-rdf/src/main/resources/queries/RouteSensorInject.sparql +++ /dev/null @@ -1,9 +0,0 @@ -PREFIX base: <http://www.semanticweb.org/ontologies/2015/trainbenchmark#> -PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> - -SELECT DISTINCT ?route ?sensor -WHERE { - ?route base:requires ?sensor . - ?route rdf:type base:Route . - ?sensor rdf:type base:Sensor . -} diff --git a/trainbenchmark-tool-rdf/src/main/resources/queries/SemaphoreNeighbor.sparql b/trainbenchmark-tool-rdf/src/main/resources/queries/SemaphoreNeighbor.sparql deleted file mode 100644 index 17f3d6006..000000000 --- a/trainbenchmark-tool-rdf/src/main/resources/queries/SemaphoreNeighbor.sparql +++ /dev/null @@ -1,30 +0,0 @@ -PREFIX base: <http://www.semanticweb.org/ontologies/2015/trainbenchmark#> -PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> - -SELECT DISTINCT ?semaphore ?route1 ?route2 ?sensor1 ?sensor2 ?te1 ?te2 -WHERE -{ - ?route1 base:exit ?semaphore . - ?route1 rdf:type base:Route . - ?semaphore rdf:type base:Semaphore . - - ?route1 base:requires ?sensor1 . - ?sensor1 rdf:type base:Sensor . - - ?te1 base:monitoredBy ?sensor1 . - ?te1 rdf:type base:TrackElement . - - ?te1 base:connectsTo ?te2 . - ?te2 rdf:type base:TrackElement . - - ?te2 base:monitoredBy ?sensor2 . - ?sensor2 rdf:type base:Sensor . - - ?route2 base:requires ?sensor2 . - - FILTER (?route1 != ?route2) . - - FILTER NOT EXISTS { - ?route2 base:entry ?semaphore - } -} diff --git a/trainbenchmark-tool-rdf/src/main/resources/queries/SemaphoreNeighborInject.sparql b/trainbenchmark-tool-rdf/src/main/resources/queries/SemaphoreNeighborInject.sparql deleted file mode 100644 index b329af514..000000000 --- a/trainbenchmark-tool-rdf/src/main/resources/queries/SemaphoreNeighborInject.sparql +++ /dev/null @@ -1,9 +0,0 @@ -PREFIX base: <http://www.semanticweb.org/ontologies/2015/trainbenchmark#> -PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> - -SELECT DISTINCT ?route ?semaphore -WHERE { - ?route rdf:type base:Route . - ?route base:entry ?semaphore . - ?semaphore rdf:type base:Semaphore . -} diff --git a/trainbenchmark-tool-rdf/src/main/resources/queries/SwitchMonitored.sparql b/trainbenchmark-tool-rdf/src/main/resources/queries/SwitchMonitored.sparql deleted file mode 100644 index ef7aa4f96..000000000 --- a/trainbenchmark-tool-rdf/src/main/resources/queries/SwitchMonitored.sparql +++ /dev/null @@ -1,13 +0,0 @@ -PREFIX base: <http://www.semanticweb.org/ontologies/2015/trainbenchmark#> -PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> - -SELECT DISTINCT ?sw -WHERE -{ - ?sw rdf:type base:Switch . - - FILTER NOT EXISTS { - ?sw base:monitoredBy ?sensor . - ?sensor rdf:type base:Sensor . - } -} diff --git a/trainbenchmark-tool-rdf/src/main/resources/queries/SwitchMonitoredInject.sparql b/trainbenchmark-tool-rdf/src/main/resources/queries/SwitchMonitoredInject.sparql deleted file mode 100644 index 39f809dd7..000000000 --- a/trainbenchmark-tool-rdf/src/main/resources/queries/SwitchMonitoredInject.sparql +++ /dev/null @@ -1,7 +0,0 @@ -PREFIX base: <http://www.semanticweb.org/ontologies/2015/trainbenchmark#> -PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> - -SELECT DISTINCT ?sw -WHERE { - ?sw rdf:type base:Switch . -} diff --git a/trainbenchmark-tool-rdf/src/main/resources/queries/SwitchSet.sparql b/trainbenchmark-tool-rdf/src/main/resources/queries/SwitchSet.sparql deleted file mode 100644 index c152a611c..000000000 --- a/trainbenchmark-tool-rdf/src/main/resources/queries/SwitchSet.sparql +++ /dev/null @@ -1,25 +0,0 @@ -PREFIX base: <http://www.semanticweb.org/ontologies/2015/trainbenchmark#> -PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> -PREFIX owl: <http://www.w3.org/2002/07/owl#> -PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> - -SELECT DISTINCT ?semaphore ?route ?swP ?sw ?currentPosition ?position -WHERE -{ - ?route base:entry ?semaphore . - ?route rdf:type base:Route . - ?route base:active true . - ?semaphore rdf:type base:Semaphore . - - ?route base:follows ?swP . - ?swP rdf:type base:SwitchPosition . - - ?swP base:target ?sw . - ?sw rdf:type base:Switch . - - ?semaphore base:signal base:SIGNAL_GO . - ?sw base:currentPosition ?currentPosition . - ?swP base:position ?position . - - FILTER (?currentPosition != ?position) -} diff --git a/trainbenchmark-tool-rdf/src/main/resources/queries/SwitchSetInject.sparql b/trainbenchmark-tool-rdf/src/main/resources/queries/SwitchSetInject.sparql deleted file mode 100644 index 39f809dd7..000000000 --- a/trainbenchmark-tool-rdf/src/main/resources/queries/SwitchSetInject.sparql +++ /dev/null @@ -1,7 +0,0 @@ -PREFIX base: <http://www.semanticweb.org/ontologies/2015/trainbenchmark#> -PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> - -SELECT DISTINCT ?sw -WHERE { - ?sw rdf:type base:Switch . -} diff --git a/trainbenchmark-tool-rdf4j/.gitignore b/trainbenchmark-tool-rdf4j/.gitignore deleted file mode 100644 index ea8c4bf7f..000000000 --- a/trainbenchmark-tool-rdf4j/.gitignore +++ /dev/null @@ -1 +0,0 @@ -/target diff --git a/trainbenchmark-tool-rdf4j/build.gradle b/trainbenchmark-tool-rdf4j/build.gradle deleted file mode 100644 index 2d91cfce7..000000000 --- a/trainbenchmark-tool-rdf4j/build.gradle +++ /dev/null @@ -1,22 +0,0 @@ -import java.nio.file.Path; - -plugins { id "com.github.johnrengelman.shadow" version "1.2.3" } - -shadowJar { - classifier = 'fat' - manifest { attributes 'Main-Class': 'hu.bme.mit.trainbenchmark.benchmark.rdf4j.Rdf4jBenchmarkMain' } - mergeServiceFiles() -} - -dependencies { - def rdf4jVersion = '2.1.4' - compile project(':trainbenchmark-tool-rdf') - compile group: 'org.slf4j', name: 'slf4j-nop', version: slf4jVersion - compile group: 'org.eclipse.rdf4j', name: 'rdf4j-model', version: rdf4jVersion - compile group: 'org.eclipse.rdf4j', name: 'rdf4j-repository-sail', version: rdf4jVersion - compile group: 'org.eclipse.rdf4j', name: 'rdf4j-runtime', version: rdf4jVersion - compile group: 'org.eclipse.rdf4j', name: 'rdf4j-sail-memory', version: rdf4jVersion - compile group: 'org.eclipse.rdf4j', name: 'rdf4j-repository-contextaware', version: rdf4jVersion - compile group: 'org.eclipse.rdf4j', name: 'rdf4j-rio-rdfxml', version: rdf4jVersion - compile group: 'org.eclipse.rdf4j', name: 'rdf4j-rio-turtle', version: rdf4jVersion -} diff --git a/trainbenchmark-tool-rdf4j/src/main/java/hu/bme/mit/trainbenchmark/benchmark/rdf4j/Rdf4jBenchmarkMain.java b/trainbenchmark-tool-rdf4j/src/main/java/hu/bme/mit/trainbenchmark/benchmark/rdf4j/Rdf4jBenchmarkMain.java deleted file mode 100644 index 5195422e1..000000000 --- a/trainbenchmark-tool-rdf4j/src/main/java/hu/bme/mit/trainbenchmark/benchmark/rdf4j/Rdf4jBenchmarkMain.java +++ /dev/null @@ -1,26 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2010-2015, Benedek Izso, Gabor Szarnyas, Istvan Rath and Daniel Varro - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Benedek Izso - initial API and implementation - * Gabor Szarnyas - initial API and implementation - *******************************************************************************/ - -package hu.bme.mit.trainbenchmark.benchmark.rdf4j; - -import hu.bme.mit.trainbenchmark.benchmark.config.BenchmarkConfig; -import hu.bme.mit.trainbenchmark.benchmark.rdf4j.config.Rdf4jBenchmarkConfig; - -public class Rdf4jBenchmarkMain { - - public static void main(final String[] args) throws Exception { - final Rdf4jBenchmarkConfig bc = BenchmarkConfig.fromFile(args[0], Rdf4jBenchmarkConfig.class); - final Rdf4jBenchmarkScenario scenario = new Rdf4jBenchmarkScenario(bc); - scenario.performBenchmark(); - } - -} diff --git a/trainbenchmark-tool-rdf4j/src/main/java/hu/bme/mit/trainbenchmark/benchmark/rdf4j/Rdf4jBenchmarkScenario.java b/trainbenchmark-tool-rdf4j/src/main/java/hu/bme/mit/trainbenchmark/benchmark/rdf4j/Rdf4jBenchmarkScenario.java deleted file mode 100644 index 57b291e43..000000000 --- a/trainbenchmark-tool-rdf4j/src/main/java/hu/bme/mit/trainbenchmark/benchmark/rdf4j/Rdf4jBenchmarkScenario.java +++ /dev/null @@ -1,17 +0,0 @@ -package hu.bme.mit.trainbenchmark.benchmark.rdf4j; - -import hu.bme.mit.trainbenchmark.benchmark.phases.BenchmarkScenario; -import hu.bme.mit.trainbenchmark.benchmark.rdf4j.comparators.Rdf4jMatchComparator; -import hu.bme.mit.trainbenchmark.benchmark.rdf4j.config.Rdf4jBenchmarkConfig; -import hu.bme.mit.trainbenchmark.benchmark.rdf4j.driver.Rdf4jDriver; -import hu.bme.mit.trainbenchmark.benchmark.rdf4j.driver.Rdf4jDriverFactory; -import hu.bme.mit.trainbenchmark.benchmark.rdf4j.matches.Rdf4jMatch; -import hu.bme.mit.trainbenchmark.benchmark.rdf4j.operations.Rdf4jModelOperationFactory; - -public class Rdf4jBenchmarkScenario extends BenchmarkScenario<Rdf4jMatch, Rdf4jDriver, Rdf4jBenchmarkConfig> { - - public Rdf4jBenchmarkScenario(final Rdf4jBenchmarkConfig bc) throws Exception { - super(new Rdf4jDriverFactory(bc.isInferencing()), new Rdf4jModelOperationFactory<Rdf4jDriver>(), new Rdf4jMatchComparator(), bc); - } - -} diff --git a/trainbenchmark-tool-rdf4j/src/main/java/hu/bme/mit/trainbenchmark/benchmark/rdf4j/comparators/IriComparator.java b/trainbenchmark-tool-rdf4j/src/main/java/hu/bme/mit/trainbenchmark/benchmark/rdf4j/comparators/IriComparator.java deleted file mode 100644 index d5bb369f8..000000000 --- a/trainbenchmark-tool-rdf4j/src/main/java/hu/bme/mit/trainbenchmark/benchmark/rdf4j/comparators/IriComparator.java +++ /dev/null @@ -1,27 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2010-2015, Benedek Izso, Gabor Szarnyas, Istvan Rath and Daniel Varro - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Benedek Izso - initial API and implementation - * Gabor Szarnyas - initial API and implementation - *******************************************************************************/ -package hu.bme.mit.trainbenchmark.benchmark.rdf4j.comparators; - -import java.util.Comparator; - -import org.eclipse.rdf4j.model.IRI; - -public class IriComparator implements Comparator<IRI> { - - @Override - public int compare(final IRI iri1, final IRI iri2) { - final long id1 = Long.parseLong(iri1.getLocalName().substring(1)); - final long id2 = Long.parseLong(iri2.getLocalName().substring(1)); - return Long.compare(id1, id2); - } - -} diff --git a/trainbenchmark-tool-rdf4j/src/main/java/hu/bme/mit/trainbenchmark/benchmark/rdf4j/comparators/Rdf4jMatchComparator.java b/trainbenchmark-tool-rdf4j/src/main/java/hu/bme/mit/trainbenchmark/benchmark/rdf4j/comparators/Rdf4jMatchComparator.java deleted file mode 100644 index 1b1bd347f..000000000 --- a/trainbenchmark-tool-rdf4j/src/main/java/hu/bme/mit/trainbenchmark/benchmark/rdf4j/comparators/Rdf4jMatchComparator.java +++ /dev/null @@ -1,25 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2010-2015, Benedek Izso, Gabor Szarnyas, Istvan Rath and Daniel Varro - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Benedek Izso - initial API and implementation - * Gabor Szarnyas - initial API and implementation - *******************************************************************************/ -package hu.bme.mit.trainbenchmark.benchmark.rdf4j.comparators; - -import org.eclipse.rdf4j.model.IRI; - -import hu.bme.mit.trainbenchmark.benchmark.matches.comparators.BaseMatchComparator; -import hu.bme.mit.trainbenchmark.benchmark.rdf4j.matches.Rdf4jMatch; - -public class Rdf4jMatchComparator extends BaseMatchComparator<Rdf4jMatch, IRI> { - - public Rdf4jMatchComparator() { - super(new IriComparator()); - } - -} diff --git a/trainbenchmark-tool-rdf4j/src/main/java/hu/bme/mit/trainbenchmark/benchmark/rdf4j/config/Rdf4jBenchmarkConfig.java b/trainbenchmark-tool-rdf4j/src/main/java/hu/bme/mit/trainbenchmark/benchmark/rdf4j/config/Rdf4jBenchmarkConfig.java deleted file mode 100644 index dbc9983e9..000000000 --- a/trainbenchmark-tool-rdf4j/src/main/java/hu/bme/mit/trainbenchmark/benchmark/rdf4j/config/Rdf4jBenchmarkConfig.java +++ /dev/null @@ -1,34 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2010-2015, Benedek Izso, Gabor Szarnyas, Istvan Rath and Daniel Varro - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Benedek Izso - initial API and implementation - * Gabor Szarnyas - initial API and implementation - *******************************************************************************/ - -package hu.bme.mit.trainbenchmark.benchmark.rdf4j.config; - -import hu.bme.mit.trainbenchmark.benchmark.config.BenchmarkConfigBase; -import hu.bme.mit.trainbenchmark.benchmark.rdf.config.RdfBenchmarkConfig; - -public class Rdf4jBenchmarkConfig extends RdfBenchmarkConfig { - - protected Rdf4jBenchmarkConfig(final BenchmarkConfigBase configBase, final boolean inferencing) { - super(configBase, inferencing); - } - - @Override - public String getToolName() { - return "RDF4J" + getToolNamePostfix(); - } - - @Override - public String getProjectName() { - return "rdf4j"; - } - -} diff --git a/trainbenchmark-tool-rdf4j/src/main/java/hu/bme/mit/trainbenchmark/benchmark/rdf4j/config/Rdf4jBenchmarkConfigBuilder.java b/trainbenchmark-tool-rdf4j/src/main/java/hu/bme/mit/trainbenchmark/benchmark/rdf4j/config/Rdf4jBenchmarkConfigBuilder.java deleted file mode 100644 index edbbe74b9..000000000 --- a/trainbenchmark-tool-rdf4j/src/main/java/hu/bme/mit/trainbenchmark/benchmark/rdf4j/config/Rdf4jBenchmarkConfigBuilder.java +++ /dev/null @@ -1,14 +0,0 @@ -package hu.bme.mit.trainbenchmark.benchmark.rdf4j.config; - -import hu.bme.mit.trainbenchmark.benchmark.rdf.config.RdfBenchmarkConfigBuilder; - -public class Rdf4jBenchmarkConfigBuilder - extends RdfBenchmarkConfigBuilder<Rdf4jBenchmarkConfig, Rdf4jBenchmarkConfigBuilder> { - - @Override - public Rdf4jBenchmarkConfig createConfig() { - checkNotNulls(); - return new Rdf4jBenchmarkConfig(configBase, inferencing); - } - -} diff --git a/trainbenchmark-tool-rdf4j/src/main/java/hu/bme/mit/trainbenchmark/benchmark/rdf4j/driver/Rdf4jDriver.java b/trainbenchmark-tool-rdf4j/src/main/java/hu/bme/mit/trainbenchmark/benchmark/rdf4j/driver/Rdf4jDriver.java deleted file mode 100644 index 0289778c8..000000000 --- a/trainbenchmark-tool-rdf4j/src/main/java/hu/bme/mit/trainbenchmark/benchmark/rdf4j/driver/Rdf4jDriver.java +++ /dev/null @@ -1,173 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2010-2015, Benedek Izso, Gabor Szarnyas, Istvan Rath and Daniel Varro - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Benedek Izso - initial API and implementation - * Gabor Szarnyas - initial API and implementation - *******************************************************************************/ -package hu.bme.mit.trainbenchmark.benchmark.rdf4j.driver; - -import static hu.bme.mit.trainbenchmark.rdf.RdfConstants.BASE_PREFIX; - -import java.io.File; -import java.io.IOException; -import java.util.ArrayList; -import java.util.Collection; -import java.util.Comparator; -import java.util.List; - -import org.eclipse.rdf4j.model.IRI; -import org.eclipse.rdf4j.model.Statement; -import org.eclipse.rdf4j.model.ValueFactory; -import org.eclipse.rdf4j.query.BindingSet; -import org.eclipse.rdf4j.query.BooleanQuery; -import org.eclipse.rdf4j.query.MalformedQueryException; -import org.eclipse.rdf4j.query.QueryEvaluationException; -import org.eclipse.rdf4j.query.QueryLanguage; -import org.eclipse.rdf4j.query.TupleQuery; -import org.eclipse.rdf4j.query.TupleQueryResult; -import org.eclipse.rdf4j.repository.Repository; -import org.eclipse.rdf4j.repository.RepositoryConnection; -import org.eclipse.rdf4j.repository.RepositoryException; -import org.eclipse.rdf4j.repository.RepositoryResult; -import org.eclipse.rdf4j.repository.sail.SailRepository; -import org.eclipse.rdf4j.rio.RDFFormat; -import org.eclipse.rdf4j.sail.inferencer.fc.ForwardChainingRDFSInferencer; -import org.eclipse.rdf4j.sail.memory.MemoryStore; - -import hu.bme.mit.trainbenchmark.benchmark.rdf.driver.RdfDriver; -import hu.bme.mit.trainbenchmark.benchmark.rdf4j.comparators.IriComparator; -import hu.bme.mit.trainbenchmark.benchmark.rdf4j.matches.Rdf4jMatch; -import hu.bme.mit.trainbenchmark.constants.RailwayQuery; -import hu.bme.mit.trainbenchmark.rdf.RdfConstants; - -public class Rdf4jDriver extends RdfDriver { - - protected RepositoryConnection connection; - protected Repository repository; - protected ValueFactory vf; - - protected final Comparator<IRI> elementComparator = new IriComparator(); - - public Rdf4jDriver(final boolean inferencing) { - super(inferencing); - } - - @Override - public void beginTransaction() { - } - - @Override - public void finishTransaction() { - connection.commit(); - } - - @Override - public void read(final String modelPath) throws IOException { - if (inferencing) { - repository = new SailRepository(new ForwardChainingRDFSInferencer(new MemoryStore())); - } else { - repository = new SailRepository(new MemoryStore()); - } - - final File modelFile = new File(modelPath); - - repository.initialize(); - vf = repository.getValueFactory(); - connection = repository.getConnection(); - connection.add(modelFile, RdfConstants.BASE_PREFIX, RDFFormat.TURTLE); - } - - public Collection<? extends Rdf4jMatch> runQuery(final RailwayQuery query, final String queryDefinition) { - final Collection<Rdf4jMatch> results = new ArrayList<>(); - - final TupleQuery tupleQuery = connection.prepareTupleQuery(QueryLanguage.SPARQL, queryDefinition); - final TupleQueryResult queryResults = tupleQuery.evaluate(); - try { - while (queryResults.hasNext()) { - final BindingSet bs = queryResults.next(); - final Rdf4jMatch match = Rdf4jMatch.createMatch(query, bs); - results.add(match); - } - } finally { - queryResults.close(); - } - - return results; - } - - @Override - public void destroy() throws Exception { - if (connection != null) { - connection.clear(); - connection.close(); - } - } - - // delete - - public void deleteSingleOutgoingEdge(final Collection<IRI> vertices, final String edgeType) { - deleteEdges(vertices, edgeType, true, false); - } - - public void deleteOutgoingEdges(final Collection<IRI> vertices, final String edgeType) { - deleteEdges(vertices, edgeType, true, true); - } - - protected void deleteEdges(final Collection<IRI> vertices, final String edgeType, final boolean outgoing, - final boolean all) throws RepositoryException { - final List<Statement> itemsToRemove = new ArrayList<>(); - - final IRI edge = vf.createIRI(BASE_PREFIX + edgeType); - - for (final IRI vertex : vertices) { - final RepositoryResult<Statement> statementsToRemove; - if (outgoing) { - statementsToRemove = connection.getStatements(vertex, edge, null, true); - } else { - statementsToRemove = connection.getStatements(null, edge, vertex, true); - } - - while (statementsToRemove.hasNext()) { - final Statement s = statementsToRemove.next(); - itemsToRemove.add(s); - - // break if we only want to delete one edge - if (!all) { - break; - } - } - - for (final Statement s : itemsToRemove) { - connection.remove(s); - } - } - } - - // utility - - @Override - protected boolean ask(final String askQuery) - throws RepositoryException, MalformedQueryException, QueryEvaluationException { - final BooleanQuery q = connection.prepareBooleanQuery(QueryLanguage.SPARQL, askQuery); - final boolean result = q.evaluate(); - return result; - } - - public RepositoryConnection getConnection() { - return connection; - } - - public ValueFactory getValueFactory() { - return vf; - } - - public boolean isInferencing() { - return inferencing; - } - -} diff --git a/trainbenchmark-tool-rdf4j/src/main/java/hu/bme/mit/trainbenchmark/benchmark/rdf4j/driver/Rdf4jDriverFactory.java b/trainbenchmark-tool-rdf4j/src/main/java/hu/bme/mit/trainbenchmark/benchmark/rdf4j/driver/Rdf4jDriverFactory.java deleted file mode 100644 index d0664e196..000000000 --- a/trainbenchmark-tool-rdf4j/src/main/java/hu/bme/mit/trainbenchmark/benchmark/rdf4j/driver/Rdf4jDriverFactory.java +++ /dev/null @@ -1,16 +0,0 @@ -package hu.bme.mit.trainbenchmark.benchmark.rdf4j.driver; - -import hu.bme.mit.trainbenchmark.benchmark.rdf.driver.RdfDriverFactory; - -public class Rdf4jDriverFactory extends RdfDriverFactory<Rdf4jDriver> { - - public Rdf4jDriverFactory(final boolean inferencing) { - super(inferencing); - } - - @Override - public Rdf4jDriver createInstance() throws Exception { - return new Rdf4jDriver(inferencing); - } - -} diff --git a/trainbenchmark-tool-rdf4j/src/main/java/hu/bme/mit/trainbenchmark/benchmark/rdf4j/matches/Rdf4jConnectedSegmentsInjectMatch.java b/trainbenchmark-tool-rdf4j/src/main/java/hu/bme/mit/trainbenchmark/benchmark/rdf4j/matches/Rdf4jConnectedSegmentsInjectMatch.java deleted file mode 100644 index 17d8f3b7e..000000000 --- a/trainbenchmark-tool-rdf4j/src/main/java/hu/bme/mit/trainbenchmark/benchmark/rdf4j/matches/Rdf4jConnectedSegmentsInjectMatch.java +++ /dev/null @@ -1,44 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2010-2015, Benedek Izso, Gabor Szarnyas, Istvan Rath and Daniel Varro - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Benedek Izso - initial API and implementation - * Gabor Szarnyas - initial API and implementation - *******************************************************************************/ -package hu.bme.mit.trainbenchmark.benchmark.rdf4j.matches; - -import static hu.bme.mit.trainbenchmark.constants.QueryConstants.VAR_SEGMENT1; -import static hu.bme.mit.trainbenchmark.constants.QueryConstants.VAR_SEGMENT3; -import static hu.bme.mit.trainbenchmark.constants.QueryConstants.VAR_SENSOR; - -import org.eclipse.rdf4j.model.IRI; -import org.eclipse.rdf4j.query.BindingSet; - -import hu.bme.mit.trainbenchmark.benchmark.matches.ConnectedSegmentsInjectMatch; - -public class Rdf4jConnectedSegmentsInjectMatch extends Rdf4jMatch implements ConnectedSegmentsInjectMatch { - - public Rdf4jConnectedSegmentsInjectMatch(final BindingSet bs) { - super(bs); - } - - @Override - public IRI getSensor() { - return (IRI) bs.getValue(VAR_SENSOR); - } - - @Override - public IRI getSegment1() { - return (IRI) bs.getValue(VAR_SEGMENT1); - } - - @Override - public IRI getSegment3() { - return (IRI) bs.getValue(VAR_SEGMENT3); - } - -} diff --git a/trainbenchmark-tool-rdf4j/src/main/java/hu/bme/mit/trainbenchmark/benchmark/rdf4j/matches/Rdf4jConnectedSegmentsMatch.java b/trainbenchmark-tool-rdf4j/src/main/java/hu/bme/mit/trainbenchmark/benchmark/rdf4j/matches/Rdf4jConnectedSegmentsMatch.java deleted file mode 100644 index 8c852efad..000000000 --- a/trainbenchmark-tool-rdf4j/src/main/java/hu/bme/mit/trainbenchmark/benchmark/rdf4j/matches/Rdf4jConnectedSegmentsMatch.java +++ /dev/null @@ -1,68 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2010-2015, Benedek Izso, Gabor Szarnyas, Istvan Rath and Daniel Varro - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Benedek Izso - initial API and implementation - * Gabor Szarnyas - initial API and implementation - *******************************************************************************/ -package hu.bme.mit.trainbenchmark.benchmark.rdf4j.matches; - -import static hu.bme.mit.trainbenchmark.constants.QueryConstants.VAR_SEGMENT1; -import static hu.bme.mit.trainbenchmark.constants.QueryConstants.VAR_SEGMENT2; -import static hu.bme.mit.trainbenchmark.constants.QueryConstants.VAR_SEGMENT3; -import static hu.bme.mit.trainbenchmark.constants.QueryConstants.VAR_SEGMENT4; -import static hu.bme.mit.trainbenchmark.constants.QueryConstants.VAR_SEGMENT5; -import static hu.bme.mit.trainbenchmark.constants.QueryConstants.VAR_SEGMENT6; -import static hu.bme.mit.trainbenchmark.constants.QueryConstants.VAR_SENSOR; - -import org.eclipse.rdf4j.model.IRI; -import org.eclipse.rdf4j.query.BindingSet; - -import hu.bme.mit.trainbenchmark.benchmark.matches.ConnectedSegmentsMatch; - -public class Rdf4jConnectedSegmentsMatch extends Rdf4jMatch implements ConnectedSegmentsMatch { - - public Rdf4jConnectedSegmentsMatch(final BindingSet bs) { - super(bs); - } - - @Override - public IRI getSensor() { - return (IRI) bs.getValue(VAR_SENSOR); - } - - @Override - public IRI getSegment1() { - return (IRI) bs.getValue(VAR_SEGMENT1); - } - - @Override - public IRI getSegment2() { - return (IRI) bs.getValue(VAR_SEGMENT2); - } - - @Override - public IRI getSegment3() { - return (IRI) bs.getValue(VAR_SEGMENT3); - } - - @Override - public IRI getSegment4() { - return (IRI) bs.getValue(VAR_SEGMENT4); - } - - @Override - public IRI getSegment5() { - return (IRI) bs.getValue(VAR_SEGMENT5); - } - - @Override - public IRI getSegment6() { - return (IRI) bs.getValue(VAR_SEGMENT6); - } - -} diff --git a/trainbenchmark-tool-rdf4j/src/main/java/hu/bme/mit/trainbenchmark/benchmark/rdf4j/matches/Rdf4jMatch.java b/trainbenchmark-tool-rdf4j/src/main/java/hu/bme/mit/trainbenchmark/benchmark/rdf4j/matches/Rdf4jMatch.java deleted file mode 100644 index 3a3237049..000000000 --- a/trainbenchmark-tool-rdf4j/src/main/java/hu/bme/mit/trainbenchmark/benchmark/rdf4j/matches/Rdf4jMatch.java +++ /dev/null @@ -1,58 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2010-2015, Benedek Izso, Gabor Szarnyas, Istvan Rath and Daniel Varro - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Benedek Izso - initial API and implementation - * Gabor Szarnyas - initial API and implementation - *******************************************************************************/ -package hu.bme.mit.trainbenchmark.benchmark.rdf4j.matches; - -import org.eclipse.rdf4j.query.BindingSet; - -import hu.bme.mit.trainbenchmark.benchmark.matches.BaseMatch; -import hu.bme.mit.trainbenchmark.constants.RailwayQuery; - -public abstract class Rdf4jMatch extends BaseMatch { - - protected BindingSet bs; - - public Rdf4jMatch(final BindingSet bs) { - this.bs = bs; - } - - public static Rdf4jMatch createMatch(final RailwayQuery query, final BindingSet bs) { - switch (query) { - case CONNECTEDSEGMENTS: - return new Rdf4jConnectedSegmentsMatch(bs); - case CONNECTEDSEGMENTS_INJECT: - return new Rdf4jConnectedSegmentsInjectMatch(bs); - case POSLENGTH: - return new Rdf4jPosLengthMatch(bs); - case POSLENGTH_INJECT: - return new Rdf4jPosLengthInjectMatch(bs); - case ROUTESENSOR: - return new Rdf4jRouteSensorMatch(bs); - case ROUTESENSOR_INJECT: - return new Rdf4jRouteSensorInjectMatch(bs); - case SEMAPHORENEIGHBOR: - return new Rdf4jSemaphoreNeighborMatch(bs); - case SEMAPHORENEIGHBOR_INJECT: - return new Rdf4jSemaphoreNeighborInjectMatch(bs); - case SWITCHMONITORED: - return new Rdf4jSwitchMonitoredMatch(bs); - case SWITCHMONITORED_INJECT: - return new Rdf4jSwitchMonitoredInjectMatch(bs); - case SWITCHSET: - return new Rdf4jSwitchSetMatch(bs); - case SWITCHSET_INJECT: - return new Rdf4jSwitchSetInjectMatch(bs); - default: - throw new UnsupportedOperationException("Pattern not supported: " + query); - } - } - -} diff --git a/trainbenchmark-tool-rdf4j/src/main/java/hu/bme/mit/trainbenchmark/benchmark/rdf4j/matches/Rdf4jPosLengthInjectMatch.java b/trainbenchmark-tool-rdf4j/src/main/java/hu/bme/mit/trainbenchmark/benchmark/rdf4j/matches/Rdf4jPosLengthInjectMatch.java deleted file mode 100644 index bdea53a9d..000000000 --- a/trainbenchmark-tool-rdf4j/src/main/java/hu/bme/mit/trainbenchmark/benchmark/rdf4j/matches/Rdf4jPosLengthInjectMatch.java +++ /dev/null @@ -1,38 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2010-2015, Benedek Izso, Gabor Szarnyas, Istvan Rath and Daniel Varro - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Benedek Izso - initial API and implementation - * Gabor Szarnyas - initial API and implementation - *******************************************************************************/ -package hu.bme.mit.trainbenchmark.benchmark.rdf4j.matches; - -import static hu.bme.mit.trainbenchmark.constants.QueryConstants.VAR_LENGTH; -import static hu.bme.mit.trainbenchmark.constants.QueryConstants.VAR_SEGMENT; - -import org.eclipse.rdf4j.model.IRI; -import org.eclipse.rdf4j.model.Value; -import org.eclipse.rdf4j.query.BindingSet; - -import hu.bme.mit.trainbenchmark.benchmark.matches.PosLengthMatch; - -public class Rdf4jPosLengthInjectMatch extends Rdf4jMatch implements PosLengthMatch { - - public Rdf4jPosLengthInjectMatch(final BindingSet bs) { - super(bs); - } - - @Override - public IRI getSegment() { - return (IRI) bs.getValue(VAR_SEGMENT); - } - - public Value getLength() { - return bs.getValue(VAR_LENGTH); - } - -} diff --git a/trainbenchmark-tool-rdf4j/src/main/java/hu/bme/mit/trainbenchmark/benchmark/rdf4j/matches/Rdf4jPosLengthMatch.java b/trainbenchmark-tool-rdf4j/src/main/java/hu/bme/mit/trainbenchmark/benchmark/rdf4j/matches/Rdf4jPosLengthMatch.java deleted file mode 100644 index 8aafdf6f5..000000000 --- a/trainbenchmark-tool-rdf4j/src/main/java/hu/bme/mit/trainbenchmark/benchmark/rdf4j/matches/Rdf4jPosLengthMatch.java +++ /dev/null @@ -1,38 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2010-2015, Benedek Izso, Gabor Szarnyas, Istvan Rath and Daniel Varro - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Benedek Izso - initial API and implementation - * Gabor Szarnyas - initial API and implementation - *******************************************************************************/ -package hu.bme.mit.trainbenchmark.benchmark.rdf4j.matches; - -import static hu.bme.mit.trainbenchmark.constants.QueryConstants.VAR_LENGTH; -import static hu.bme.mit.trainbenchmark.constants.QueryConstants.VAR_SEGMENT; - -import org.eclipse.rdf4j.model.IRI; -import org.eclipse.rdf4j.model.Value; -import org.eclipse.rdf4j.query.BindingSet; - -import hu.bme.mit.trainbenchmark.benchmark.matches.PosLengthMatch; - -public class Rdf4jPosLengthMatch extends Rdf4jMatch implements PosLengthMatch { - - public Rdf4jPosLengthMatch(final BindingSet bs) { - super(bs); - } - - @Override - public IRI getSegment() { - return (IRI) bs.getValue(VAR_SEGMENT); - } - - public Value getLength() { - return bs.getValue(VAR_LENGTH); - } - -} diff --git a/trainbenchmark-tool-rdf4j/src/main/java/hu/bme/mit/trainbenchmark/benchmark/rdf4j/matches/Rdf4jRouteSensorInjectMatch.java b/trainbenchmark-tool-rdf4j/src/main/java/hu/bme/mit/trainbenchmark/benchmark/rdf4j/matches/Rdf4jRouteSensorInjectMatch.java deleted file mode 100644 index d90ec9998..000000000 --- a/trainbenchmark-tool-rdf4j/src/main/java/hu/bme/mit/trainbenchmark/benchmark/rdf4j/matches/Rdf4jRouteSensorInjectMatch.java +++ /dev/null @@ -1,38 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2010-2015, Benedek Izso, Gabor Szarnyas, Istvan Rath and Daniel Varro - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Benedek Izso - initial API and implementation - * Gabor Szarnyas - initial API and implementation - *******************************************************************************/ -package hu.bme.mit.trainbenchmark.benchmark.rdf4j.matches; - -import static hu.bme.mit.trainbenchmark.constants.QueryConstants.VAR_ROUTE; -import static hu.bme.mit.trainbenchmark.constants.QueryConstants.VAR_SENSOR; - -import org.eclipse.rdf4j.model.IRI; -import org.eclipse.rdf4j.query.BindingSet; - -import hu.bme.mit.trainbenchmark.benchmark.matches.RouteSensorInjectMatch; - -public class Rdf4jRouteSensorInjectMatch extends Rdf4jMatch implements RouteSensorInjectMatch { - - public Rdf4jRouteSensorInjectMatch(final BindingSet bs) { - super(bs); - } - - @Override - public IRI getRoute() { - return (IRI) bs.getValue(VAR_ROUTE); - } - - @Override - public IRI getSensor() { - return (IRI) bs.getValue(VAR_SENSOR); - } - -} diff --git a/trainbenchmark-tool-rdf4j/src/main/java/hu/bme/mit/trainbenchmark/benchmark/rdf4j/matches/Rdf4jRouteSensorMatch.java b/trainbenchmark-tool-rdf4j/src/main/java/hu/bme/mit/trainbenchmark/benchmark/rdf4j/matches/Rdf4jRouteSensorMatch.java deleted file mode 100644 index 600aa89e2..000000000 --- a/trainbenchmark-tool-rdf4j/src/main/java/hu/bme/mit/trainbenchmark/benchmark/rdf4j/matches/Rdf4jRouteSensorMatch.java +++ /dev/null @@ -1,50 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2010-2015, Benedek Izso, Gabor Szarnyas, Istvan Rath and Daniel Varro - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Benedek Izso - initial API and implementation - * Gabor Szarnyas - initial API and implementation - *******************************************************************************/ -package hu.bme.mit.trainbenchmark.benchmark.rdf4j.matches; - -import static hu.bme.mit.trainbenchmark.constants.QueryConstants.VAR_ROUTE; -import static hu.bme.mit.trainbenchmark.constants.QueryConstants.VAR_SENSOR; -import static hu.bme.mit.trainbenchmark.constants.QueryConstants.VAR_SW; -import static hu.bme.mit.trainbenchmark.constants.QueryConstants.VAR_SWP; - -import org.eclipse.rdf4j.model.IRI; -import org.eclipse.rdf4j.query.BindingSet; - -import hu.bme.mit.trainbenchmark.benchmark.matches.RouteSensorMatch; - -public class Rdf4jRouteSensorMatch extends Rdf4jMatch implements RouteSensorMatch { - - public Rdf4jRouteSensorMatch(final BindingSet bs) { - super(bs); - } - - @Override - public IRI getRoute() { - return (IRI) bs.getValue(VAR_ROUTE); - } - - @Override - public IRI getSensor() { - return (IRI) bs.getValue(VAR_SENSOR); - } - - @Override - public IRI getSwP() { - return (IRI) bs.getValue(VAR_SWP); - } - - @Override - public IRI getSw() { - return (IRI) bs.getValue(VAR_SW); - } - -} diff --git a/trainbenchmark-tool-rdf4j/src/main/java/hu/bme/mit/trainbenchmark/benchmark/rdf4j/matches/Rdf4jSemaphoreNeighborInjectMatch.java b/trainbenchmark-tool-rdf4j/src/main/java/hu/bme/mit/trainbenchmark/benchmark/rdf4j/matches/Rdf4jSemaphoreNeighborInjectMatch.java deleted file mode 100644 index 19ec04089..000000000 --- a/trainbenchmark-tool-rdf4j/src/main/java/hu/bme/mit/trainbenchmark/benchmark/rdf4j/matches/Rdf4jSemaphoreNeighborInjectMatch.java +++ /dev/null @@ -1,38 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2010-2015, Benedek Izso, Gabor Szarnyas, Istvan Rath and Daniel Varro - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Benedek Izso - initial API and implementation - * Gabor Szarnyas - initial API and implementation - *******************************************************************************/ -package hu.bme.mit.trainbenchmark.benchmark.rdf4j.matches; - -import static hu.bme.mit.trainbenchmark.constants.QueryConstants.VAR_ROUTE; -import static hu.bme.mit.trainbenchmark.constants.QueryConstants.VAR_SEMAPHORE; - -import org.eclipse.rdf4j.model.IRI; -import org.eclipse.rdf4j.query.BindingSet; - -import hu.bme.mit.trainbenchmark.benchmark.matches.SemaphoreNeighborInjectMatch; - -public class Rdf4jSemaphoreNeighborInjectMatch extends Rdf4jMatch implements SemaphoreNeighborInjectMatch { - - public Rdf4jSemaphoreNeighborInjectMatch(final BindingSet bs) { - super(bs); - } - - @Override - public IRI getRoute() { - return (IRI) bs.getValue(VAR_ROUTE); - } - - @Override - public IRI getSemaphore() { - return (IRI) bs.getValue(VAR_SEMAPHORE); - } - -} diff --git a/trainbenchmark-tool-rdf4j/src/main/java/hu/bme/mit/trainbenchmark/benchmark/rdf4j/matches/Rdf4jSemaphoreNeighborMatch.java b/trainbenchmark-tool-rdf4j/src/main/java/hu/bme/mit/trainbenchmark/benchmark/rdf4j/matches/Rdf4jSemaphoreNeighborMatch.java deleted file mode 100644 index 6fb6e9180..000000000 --- a/trainbenchmark-tool-rdf4j/src/main/java/hu/bme/mit/trainbenchmark/benchmark/rdf4j/matches/Rdf4jSemaphoreNeighborMatch.java +++ /dev/null @@ -1,68 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2010-2015, Benedek Izso, Gabor Szarnyas, Istvan Rath and Daniel Varro - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Benedek Izso - initial API and implementation - * Gabor Szarnyas - initial API and implementation - *******************************************************************************/ -package hu.bme.mit.trainbenchmark.benchmark.rdf4j.matches; - -import static hu.bme.mit.trainbenchmark.constants.QueryConstants.VAR_ROUTE1; -import static hu.bme.mit.trainbenchmark.constants.QueryConstants.VAR_ROUTE2; -import static hu.bme.mit.trainbenchmark.constants.QueryConstants.VAR_SEMAPHORE; -import static hu.bme.mit.trainbenchmark.constants.QueryConstants.VAR_SENSOR1; -import static hu.bme.mit.trainbenchmark.constants.QueryConstants.VAR_SENSOR2; -import static hu.bme.mit.trainbenchmark.constants.QueryConstants.VAR_TE1; -import static hu.bme.mit.trainbenchmark.constants.QueryConstants.VAR_TE2; - -import org.eclipse.rdf4j.model.IRI; -import org.eclipse.rdf4j.query.BindingSet; - -import hu.bme.mit.trainbenchmark.benchmark.matches.SemaphoreNeighborMatch; - -public class Rdf4jSemaphoreNeighborMatch extends Rdf4jMatch implements SemaphoreNeighborMatch { - - public Rdf4jSemaphoreNeighborMatch(final BindingSet bs) { - super(bs); - } - - @Override - public IRI getSemaphore() { - return (IRI) bs.getValue(VAR_SEMAPHORE); - } - - @Override - public IRI getRoute1() { - return (IRI) bs.getValue(VAR_ROUTE1); - } - - @Override - public IRI getRoute2() { - return (IRI) bs.getValue(VAR_ROUTE2); - } - - @Override - public IRI getSensor1() { - return (IRI) bs.getValue(VAR_SENSOR1); - } - - @Override - public IRI getSensor2() { - return (IRI) bs.getValue(VAR_SENSOR2); - } - - @Override - public IRI getTe1() { - return (IRI) bs.getValue(VAR_TE1); - } - - @Override - public IRI getTe2() { - return (IRI) bs.getValue(VAR_TE2); - } - -} diff --git a/trainbenchmark-tool-rdf4j/src/main/java/hu/bme/mit/trainbenchmark/benchmark/rdf4j/matches/Rdf4jSwitchMonitoredInjectMatch.java b/trainbenchmark-tool-rdf4j/src/main/java/hu/bme/mit/trainbenchmark/benchmark/rdf4j/matches/Rdf4jSwitchMonitoredInjectMatch.java deleted file mode 100644 index 60af0254c..000000000 --- a/trainbenchmark-tool-rdf4j/src/main/java/hu/bme/mit/trainbenchmark/benchmark/rdf4j/matches/Rdf4jSwitchMonitoredInjectMatch.java +++ /dev/null @@ -1,32 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2010-2015, Benedek Izso, Gabor Szarnyas, Istvan Rath and Daniel Varro - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Benedek Izso - initial API and implementation - * Gabor Szarnyas - initial API and implementation - *******************************************************************************/ -package hu.bme.mit.trainbenchmark.benchmark.rdf4j.matches; - -import static hu.bme.mit.trainbenchmark.constants.QueryConstants.VAR_SW; - -import org.eclipse.rdf4j.model.IRI; -import org.eclipse.rdf4j.query.BindingSet; - -import hu.bme.mit.trainbenchmark.benchmark.matches.SwitchMonitoredInjectMatch; - -public class Rdf4jSwitchMonitoredInjectMatch extends Rdf4jMatch implements SwitchMonitoredInjectMatch { - - public Rdf4jSwitchMonitoredInjectMatch(final BindingSet bs) { - super(bs); - } - - @Override - public IRI getSw() { - return (IRI) bs.getValue(VAR_SW); - } - -} diff --git a/trainbenchmark-tool-rdf4j/src/main/java/hu/bme/mit/trainbenchmark/benchmark/rdf4j/matches/Rdf4jSwitchMonitoredMatch.java b/trainbenchmark-tool-rdf4j/src/main/java/hu/bme/mit/trainbenchmark/benchmark/rdf4j/matches/Rdf4jSwitchMonitoredMatch.java deleted file mode 100644 index 9617f3be3..000000000 --- a/trainbenchmark-tool-rdf4j/src/main/java/hu/bme/mit/trainbenchmark/benchmark/rdf4j/matches/Rdf4jSwitchMonitoredMatch.java +++ /dev/null @@ -1,32 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2010-2015, Benedek Izso, Gabor Szarnyas, Istvan Rath and Daniel Varro - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Benedek Izso - initial API and implementation - * Gabor Szarnyas - initial API and implementation - *******************************************************************************/ -package hu.bme.mit.trainbenchmark.benchmark.rdf4j.matches; - -import static hu.bme.mit.trainbenchmark.constants.QueryConstants.VAR_SW; - -import org.eclipse.rdf4j.model.IRI; -import org.eclipse.rdf4j.query.BindingSet; - -import hu.bme.mit.trainbenchmark.benchmark.matches.SwitchMonitoredMatch; - -public class Rdf4jSwitchMonitoredMatch extends Rdf4jMatch implements SwitchMonitoredMatch { - - public Rdf4jSwitchMonitoredMatch(final BindingSet bs) { - super(bs); - } - - @Override - public IRI getSw() { - return (IRI) bs.getValue(VAR_SW); - } - -} diff --git a/trainbenchmark-tool-rdf4j/src/main/java/hu/bme/mit/trainbenchmark/benchmark/rdf4j/matches/Rdf4jSwitchSetInjectMatch.java b/trainbenchmark-tool-rdf4j/src/main/java/hu/bme/mit/trainbenchmark/benchmark/rdf4j/matches/Rdf4jSwitchSetInjectMatch.java deleted file mode 100644 index 0feed6cc8..000000000 --- a/trainbenchmark-tool-rdf4j/src/main/java/hu/bme/mit/trainbenchmark/benchmark/rdf4j/matches/Rdf4jSwitchSetInjectMatch.java +++ /dev/null @@ -1,43 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2010-2015, Benedek Izso, Gabor Szarnyas, Istvan Rath and Daniel Varro - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Benedek Izso - initial API and implementation - * Gabor Szarnyas - initial API and implementation - *******************************************************************************/ -package hu.bme.mit.trainbenchmark.benchmark.rdf4j.matches; - -import static hu.bme.mit.trainbenchmark.constants.QueryConstants.VAR_CURRENTPOSITION; -import static hu.bme.mit.trainbenchmark.constants.QueryConstants.VAR_POSITION; -import static hu.bme.mit.trainbenchmark.constants.QueryConstants.VAR_SW; - -import org.eclipse.rdf4j.model.IRI; -import org.eclipse.rdf4j.model.Value; -import org.eclipse.rdf4j.query.BindingSet; - -import hu.bme.mit.trainbenchmark.benchmark.matches.SwitchSetInjectMatch; - -public class Rdf4jSwitchSetInjectMatch extends Rdf4jMatch implements SwitchSetInjectMatch { - - public Rdf4jSwitchSetInjectMatch(final BindingSet bs) { - super(bs); - } - - @Override - public IRI getSw() { - return (IRI) bs.getValue(VAR_SW); - } - - public Value getPosition() { - return bs.getValue(VAR_POSITION); - } - - public Value getCurrentPosition() { - return bs.getValue(VAR_CURRENTPOSITION); - } - -} diff --git a/trainbenchmark-tool-rdf4j/src/main/java/hu/bme/mit/trainbenchmark/benchmark/rdf4j/matches/Rdf4jSwitchSetMatch.java b/trainbenchmark-tool-rdf4j/src/main/java/hu/bme/mit/trainbenchmark/benchmark/rdf4j/matches/Rdf4jSwitchSetMatch.java deleted file mode 100644 index 03c311979..000000000 --- a/trainbenchmark-tool-rdf4j/src/main/java/hu/bme/mit/trainbenchmark/benchmark/rdf4j/matches/Rdf4jSwitchSetMatch.java +++ /dev/null @@ -1,61 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2010-2015, Benedek Izso, Gabor Szarnyas, Istvan Rath and Daniel Varro - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Benedek Izso - initial API and implementation - * Gabor Szarnyas - initial API and implementation - *******************************************************************************/ -package hu.bme.mit.trainbenchmark.benchmark.rdf4j.matches; - -import static hu.bme.mit.trainbenchmark.constants.QueryConstants.VAR_CURRENTPOSITION; -import static hu.bme.mit.trainbenchmark.constants.QueryConstants.VAR_POSITION; -import static hu.bme.mit.trainbenchmark.constants.QueryConstants.VAR_ROUTE; -import static hu.bme.mit.trainbenchmark.constants.QueryConstants.VAR_SEMAPHORE; -import static hu.bme.mit.trainbenchmark.constants.QueryConstants.VAR_SW; -import static hu.bme.mit.trainbenchmark.constants.QueryConstants.VAR_SWP; - -import org.eclipse.rdf4j.model.IRI; -import org.eclipse.rdf4j.model.Value; -import org.eclipse.rdf4j.query.BindingSet; - -import hu.bme.mit.trainbenchmark.benchmark.matches.SwitchSetMatch; - -public class Rdf4jSwitchSetMatch extends Rdf4jMatch implements SwitchSetMatch { - - public Rdf4jSwitchSetMatch(final BindingSet bs) { - super(bs); - } - - @Override - public IRI getSemaphore() { - return (IRI) bs.getValue(VAR_SEMAPHORE); - } - - @Override - public IRI getRoute() { - return (IRI) bs.getValue(VAR_ROUTE); - } - - @Override - public IRI getSwP() { - return (IRI) bs.getValue(VAR_SWP); - } - - @Override - public IRI getSw() { - return (IRI) bs.getValue(VAR_SW); - } - - public Value getPosition() { - return bs.getValue(VAR_POSITION); - } - - public Value getCurrentPosition() { - return bs.getValue(VAR_CURRENTPOSITION); - } - -} diff --git a/trainbenchmark-tool-rdf4j/src/main/java/hu/bme/mit/trainbenchmark/benchmark/rdf4j/operations/Rdf4jModelOperationFactory.java b/trainbenchmark-tool-rdf4j/src/main/java/hu/bme/mit/trainbenchmark/benchmark/rdf4j/operations/Rdf4jModelOperationFactory.java deleted file mode 100644 index 0914600d4..000000000 --- a/trainbenchmark-tool-rdf4j/src/main/java/hu/bme/mit/trainbenchmark/benchmark/rdf4j/operations/Rdf4jModelOperationFactory.java +++ /dev/null @@ -1,206 +0,0 @@ -package hu.bme.mit.trainbenchmark.benchmark.rdf4j.operations; - -import hu.bme.mit.trainbenchmark.benchmark.operations.ModelOperation; -import hu.bme.mit.trainbenchmark.benchmark.operations.ModelOperationFactory; -import hu.bme.mit.trainbenchmark.benchmark.rdf4j.driver.Rdf4jDriver; -import hu.bme.mit.trainbenchmark.benchmark.rdf4j.matches.Rdf4jConnectedSegmentsInjectMatch; -import hu.bme.mit.trainbenchmark.benchmark.rdf4j.matches.Rdf4jConnectedSegmentsMatch; -import hu.bme.mit.trainbenchmark.benchmark.rdf4j.matches.Rdf4jMatch; -import hu.bme.mit.trainbenchmark.benchmark.rdf4j.matches.Rdf4jPosLengthInjectMatch; -import hu.bme.mit.trainbenchmark.benchmark.rdf4j.matches.Rdf4jPosLengthMatch; -import hu.bme.mit.trainbenchmark.benchmark.rdf4j.matches.Rdf4jRouteSensorInjectMatch; -import hu.bme.mit.trainbenchmark.benchmark.rdf4j.matches.Rdf4jRouteSensorMatch; -import hu.bme.mit.trainbenchmark.benchmark.rdf4j.matches.Rdf4jSemaphoreNeighborInjectMatch; -import hu.bme.mit.trainbenchmark.benchmark.rdf4j.matches.Rdf4jSemaphoreNeighborMatch; -import hu.bme.mit.trainbenchmark.benchmark.rdf4j.matches.Rdf4jSwitchMonitoredInjectMatch; -import hu.bme.mit.trainbenchmark.benchmark.rdf4j.matches.Rdf4jSwitchMonitoredMatch; -import hu.bme.mit.trainbenchmark.benchmark.rdf4j.matches.Rdf4jSwitchSetInjectMatch; -import hu.bme.mit.trainbenchmark.benchmark.rdf4j.matches.Rdf4jSwitchSetMatch; -import hu.bme.mit.trainbenchmark.benchmark.rdf4j.queries.Rdf4jQuery; -import hu.bme.mit.trainbenchmark.benchmark.rdf4j.transformations.Rdf4jTransformation; -import hu.bme.mit.trainbenchmark.benchmark.rdf4j.transformations.inject.Rdf4jTransformationInjectConnectedSegments; -import hu.bme.mit.trainbenchmark.benchmark.rdf4j.transformations.inject.Rdf4jTransformationInjectPosLength; -import hu.bme.mit.trainbenchmark.benchmark.rdf4j.transformations.inject.Rdf4jTransformationInjectRouteSensor; -import hu.bme.mit.trainbenchmark.benchmark.rdf4j.transformations.inject.Rdf4jTransformationInjectSemaphoreNeighbor; -import hu.bme.mit.trainbenchmark.benchmark.rdf4j.transformations.inject.Rdf4jTransformationInjectSwitchMonitored; -import hu.bme.mit.trainbenchmark.benchmark.rdf4j.transformations.inject.Rdf4jTransformationInjectSwitchSet; -import hu.bme.mit.trainbenchmark.benchmark.rdf4j.transformations.repair.Rdf4jTransformationRepairConnectedSegments; -import hu.bme.mit.trainbenchmark.benchmark.rdf4j.transformations.repair.Rdf4jTransformationRepairPosLength; -import hu.bme.mit.trainbenchmark.benchmark.rdf4j.transformations.repair.Rdf4jTransformationRepairRouteSensor; -import hu.bme.mit.trainbenchmark.benchmark.rdf4j.transformations.repair.Rdf4jTransformationRepairSemaphoreNeighbor; -import hu.bme.mit.trainbenchmark.benchmark.rdf4j.transformations.repair.Rdf4jTransformationRepairSwitchMonitored; -import hu.bme.mit.trainbenchmark.benchmark.rdf4j.transformations.repair.Rdf4jTransformationRepairSwitchSet; -import hu.bme.mit.trainbenchmark.constants.RailwayOperation; -import hu.bme.mit.trainbenchmark.constants.RailwayQuery; - -public class Rdf4jModelOperationFactory<TRdf4jDriver extends Rdf4jDriver> - extends ModelOperationFactory<Rdf4jMatch, TRdf4jDriver> { - - @Override - public ModelOperation<? extends Rdf4jMatch, TRdf4jDriver> createOperation(final RailwayOperation operationEnum, - final String workspaceDir, final TRdf4jDriver driver) throws Exception { - switch (operationEnum) { - // ConnectedSegments - case CONNECTEDSEGMENTS: { - final Rdf4jQuery<Rdf4jConnectedSegmentsMatch, TRdf4jDriver> query = Rdf4jQuery.create(driver, workspaceDir, - RailwayQuery.CONNECTEDSEGMENTS); - final ModelOperation<Rdf4jConnectedSegmentsMatch, TRdf4jDriver> operation = ModelOperation.of(query); - return operation; - } - case CONNECTEDSEGMENTS_INJECT: { - final Rdf4jQuery<Rdf4jConnectedSegmentsInjectMatch, TRdf4jDriver> query = Rdf4jQuery.create(driver, - workspaceDir, RailwayQuery.CONNECTEDSEGMENTS_INJECT); - final Rdf4jTransformation<Rdf4jConnectedSegmentsInjectMatch, TRdf4jDriver> transformation = new Rdf4jTransformationInjectConnectedSegments<TRdf4jDriver>( - driver); - final ModelOperation<Rdf4jConnectedSegmentsInjectMatch, TRdf4jDriver> operation = ModelOperation.of(query, - transformation); - return operation; - - } - case CONNECTEDSEGMENTS_REPAIR: { - final Rdf4jQuery<Rdf4jConnectedSegmentsMatch, TRdf4jDriver> query = Rdf4jQuery.create(driver, workspaceDir, - RailwayQuery.CONNECTEDSEGMENTS); - final Rdf4jTransformation<Rdf4jConnectedSegmentsMatch, TRdf4jDriver> transformation = new Rdf4jTransformationRepairConnectedSegments<TRdf4jDriver>( - driver); - final ModelOperation<Rdf4jConnectedSegmentsMatch, TRdf4jDriver> operation = ModelOperation.of(query, - transformation); - return operation; - } - - // PosLength - case POSLENGTH: { - final Rdf4jQuery<Rdf4jPosLengthMatch, TRdf4jDriver> query = Rdf4jQuery.create(driver, workspaceDir, - RailwayQuery.POSLENGTH); - final ModelOperation<Rdf4jPosLengthMatch, TRdf4jDriver> operation = ModelOperation.of(query); - return operation; - } - case POSLENGTH_INJECT: { - final Rdf4jQuery<Rdf4jPosLengthInjectMatch, TRdf4jDriver> query = Rdf4jQuery.create(driver, workspaceDir, - RailwayQuery.POSLENGTH_INJECT); - final Rdf4jTransformation<Rdf4jPosLengthInjectMatch, TRdf4jDriver> transformation = new Rdf4jTransformationInjectPosLength<TRdf4jDriver>( - driver); - final ModelOperation<Rdf4jPosLengthInjectMatch, TRdf4jDriver> operation = ModelOperation.of(query, - transformation); - return operation; - } - case POSLENGTH_REPAIR: { - final Rdf4jQuery<Rdf4jPosLengthMatch, TRdf4jDriver> query = Rdf4jQuery.create(driver, workspaceDir, - RailwayQuery.POSLENGTH); - final Rdf4jTransformation<Rdf4jPosLengthMatch, TRdf4jDriver> transformation = new Rdf4jTransformationRepairPosLength<TRdf4jDriver>( - driver); - final ModelOperation<Rdf4jPosLengthMatch, TRdf4jDriver> operation = ModelOperation.of(query, - transformation); - return operation; - } - - // RouteSensor - case ROUTESENSOR: { - final Rdf4jQuery<Rdf4jRouteSensorMatch, TRdf4jDriver> query = Rdf4jQuery.create(driver, workspaceDir, - RailwayQuery.ROUTESENSOR); - final ModelOperation<Rdf4jRouteSensorMatch, TRdf4jDriver> operation = ModelOperation.of(query); - return operation; - } - case ROUTESENSOR_INJECT: { - final Rdf4jQuery<Rdf4jRouteSensorInjectMatch, TRdf4jDriver> query = Rdf4jQuery.create(driver, workspaceDir, - RailwayQuery.ROUTESENSOR_INJECT); - final Rdf4jTransformation<Rdf4jRouteSensorInjectMatch, TRdf4jDriver> transformation = new Rdf4jTransformationInjectRouteSensor<TRdf4jDriver>( - driver); - final ModelOperation<Rdf4jRouteSensorInjectMatch, TRdf4jDriver> operation = ModelOperation.of(query, - transformation); - return operation; - } - case ROUTESENSOR_REPAIR: { - final Rdf4jQuery<Rdf4jRouteSensorMatch, TRdf4jDriver> query = Rdf4jQuery.create(driver, workspaceDir, - RailwayQuery.ROUTESENSOR); - final Rdf4jTransformation<Rdf4jRouteSensorMatch, TRdf4jDriver> transformation = new Rdf4jTransformationRepairRouteSensor<TRdf4jDriver>( - driver); - final ModelOperation<Rdf4jRouteSensorMatch, TRdf4jDriver> operation = ModelOperation.of(query, - transformation); - return operation; - } - - // SemaphoreNeighbor - case SEMAPHORENEIGHBOR: { - final Rdf4jQuery<Rdf4jSemaphoreNeighborMatch, TRdf4jDriver> query = Rdf4jQuery.create(driver, workspaceDir, - RailwayQuery.SEMAPHORENEIGHBOR); - final ModelOperation<Rdf4jSemaphoreNeighborMatch, TRdf4jDriver> operation = ModelOperation.of(query); - return operation; - } - case SEMAPHORENEIGHBOR_INJECT: { - final Rdf4jQuery<Rdf4jSemaphoreNeighborInjectMatch, TRdf4jDriver> query = Rdf4jQuery.create(driver, - workspaceDir, RailwayQuery.SEMAPHORENEIGHBOR_INJECT); - final Rdf4jTransformation<Rdf4jSemaphoreNeighborInjectMatch, TRdf4jDriver> transformation = new Rdf4jTransformationInjectSemaphoreNeighbor<TRdf4jDriver>( - driver); - final ModelOperation<Rdf4jSemaphoreNeighborInjectMatch, TRdf4jDriver> operation = ModelOperation.of(query, - transformation); - return operation; - } - case SEMAPHORENEIGHBOR_REPAIR: { - final Rdf4jQuery<Rdf4jSemaphoreNeighborMatch, TRdf4jDriver> query = Rdf4jQuery.create(driver, workspaceDir, - RailwayQuery.SEMAPHORENEIGHBOR); - final Rdf4jTransformation<Rdf4jSemaphoreNeighborMatch, TRdf4jDriver> transformation = new Rdf4jTransformationRepairSemaphoreNeighbor<TRdf4jDriver>( - driver); - final ModelOperation<Rdf4jSemaphoreNeighborMatch, TRdf4jDriver> operation = ModelOperation.of(query, - transformation); - return operation; - } - - // SwitchMonitored - case SWITCHMONITORED: { - final Rdf4jQuery<Rdf4jSwitchMonitoredMatch, TRdf4jDriver> query = Rdf4jQuery.create(driver, workspaceDir, - RailwayQuery.SWITCHMONITORED); - final ModelOperation<Rdf4jSwitchMonitoredMatch, TRdf4jDriver> operation = ModelOperation.of(query); - return operation; - } - case SWITCHMONITORED_INJECT: { - final Rdf4jQuery<Rdf4jSwitchMonitoredInjectMatch, TRdf4jDriver> query = Rdf4jQuery.create(driver, - workspaceDir, RailwayQuery.SWITCHMONITORED_INJECT); - final Rdf4jTransformation<Rdf4jSwitchMonitoredInjectMatch, TRdf4jDriver> transformation = new Rdf4jTransformationInjectSwitchMonitored<TRdf4jDriver>( - driver); - final ModelOperation<Rdf4jSwitchMonitoredInjectMatch, TRdf4jDriver> operation = ModelOperation.of(query, - transformation); - return operation; - } - case SWITCHMONITORED_REPAIR: { - final Rdf4jQuery<Rdf4jSwitchMonitoredMatch, TRdf4jDriver> query = Rdf4jQuery.create(driver, workspaceDir, - RailwayQuery.SWITCHMONITORED); - final Rdf4jTransformation<Rdf4jSwitchMonitoredMatch, TRdf4jDriver> transformation = new Rdf4jTransformationRepairSwitchMonitored<TRdf4jDriver>( - driver); - final ModelOperation<Rdf4jSwitchMonitoredMatch, TRdf4jDriver> operation = ModelOperation.of(query, - transformation); - return operation; - } - - // SwitchSet - case SWITCHSET: { - final Rdf4jQuery<Rdf4jSwitchSetMatch, TRdf4jDriver> query = Rdf4jQuery.create(driver, workspaceDir, - RailwayQuery.SWITCHSET); - final ModelOperation<Rdf4jSwitchSetMatch, TRdf4jDriver> operation = ModelOperation.of(query); - return operation; - } - case SWITCHSET_INJECT: { - final Rdf4jQuery<Rdf4jSwitchSetInjectMatch, TRdf4jDriver> query = Rdf4jQuery.create(driver, workspaceDir, - RailwayQuery.SWITCHSET_INJECT); - final Rdf4jTransformation<Rdf4jSwitchSetInjectMatch, TRdf4jDriver> transformation = new Rdf4jTransformationInjectSwitchSet<TRdf4jDriver>( - driver); - final ModelOperation<Rdf4jSwitchSetInjectMatch, TRdf4jDriver> operation = ModelOperation.of(query, - transformation); - return operation; - } - case SWITCHSET_REPAIR: { - final Rdf4jQuery<Rdf4jSwitchSetMatch, TRdf4jDriver> query = Rdf4jQuery.create(driver, workspaceDir, - RailwayQuery.SWITCHSET); - final Rdf4jTransformation<Rdf4jSwitchSetMatch, TRdf4jDriver> transformation = new Rdf4jTransformationRepairSwitchSet<TRdf4jDriver>( - driver); - final ModelOperation<Rdf4jSwitchSetMatch, TRdf4jDriver> operation = ModelOperation.of(query, - transformation); - return operation; - } - - default: - break; - } - throw new UnsupportedOperationException("Operation " + operationEnum + " not supported."); - } - -} diff --git a/trainbenchmark-tool-rdf4j/src/main/java/hu/bme/mit/trainbenchmark/benchmark/rdf4j/queries/Rdf4jQuery.java b/trainbenchmark-tool-rdf4j/src/main/java/hu/bme/mit/trainbenchmark/benchmark/rdf4j/queries/Rdf4jQuery.java deleted file mode 100644 index 875d28d36..000000000 --- a/trainbenchmark-tool-rdf4j/src/main/java/hu/bme/mit/trainbenchmark/benchmark/rdf4j/queries/Rdf4jQuery.java +++ /dev/null @@ -1,45 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2010-2015, Benedek Izso, Gabor Szarnyas, Istvan Rath and Daniel Varro - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Benedek Izso - initial API and implementation - * Gabor Szarnyas - initial API and implementation - *******************************************************************************/ -package hu.bme.mit.trainbenchmark.benchmark.rdf4j.queries; - -import java.io.File; -import java.io.IOException; -import java.nio.charset.Charset; -import java.util.Collection; - -import org.apache.commons.io.FileUtils; - -import hu.bme.mit.trainbenchmark.benchmark.rdf.queries.RdfModelQuery; -import hu.bme.mit.trainbenchmark.benchmark.rdf4j.driver.Rdf4jDriver; -import hu.bme.mit.trainbenchmark.constants.RailwayQuery; - -public class Rdf4jQuery<TPatternMatch, TRdf4jDriver extends Rdf4jDriver> extends RdfModelQuery<TPatternMatch, TRdf4jDriver> { - - protected final String queryDefinition; - - public Rdf4jQuery(final TRdf4jDriver driver, final String workspaceDir, final RailwayQuery query) throws IOException { - super(driver, workspaceDir, query); - this.queryDefinition = FileUtils.readFileToString(new File(queryPath), Charset.forName("UTF-8")); - } - - public static <TPatternMatch, TRdf4jDriver extends Rdf4jDriver> Rdf4jQuery<TPatternMatch, TRdf4jDriver> create(final TRdf4jDriver driver, - final String workspaceDir, final RailwayQuery query) throws IOException { - return new Rdf4jQuery<TPatternMatch, TRdf4jDriver>(driver, workspaceDir, query); - } - - @SuppressWarnings("unchecked") - @Override - public Collection<TPatternMatch> evaluate() { - return (Collection<TPatternMatch>) driver.runQuery(query, queryDefinition); - } - -} diff --git a/trainbenchmark-tool-rdf4j/src/main/java/hu/bme/mit/trainbenchmark/benchmark/rdf4j/transformations/Rdf4jTransformation.java b/trainbenchmark-tool-rdf4j/src/main/java/hu/bme/mit/trainbenchmark/benchmark/rdf4j/transformations/Rdf4jTransformation.java deleted file mode 100644 index 6029b5960..000000000 --- a/trainbenchmark-tool-rdf4j/src/main/java/hu/bme/mit/trainbenchmark/benchmark/rdf4j/transformations/Rdf4jTransformation.java +++ /dev/null @@ -1,24 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2010-2015, Benedek Izso, Gabor Szarnyas, Istvan Rath and Daniel Varro - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Benedek Izso - initial API and implementation - * Gabor Szarnyas - initial API and implementation - *******************************************************************************/ -package hu.bme.mit.trainbenchmark.benchmark.rdf4j.transformations; - -import hu.bme.mit.trainbenchmark.benchmark.operations.ModelTransformation; -import hu.bme.mit.trainbenchmark.benchmark.rdf4j.driver.Rdf4jDriver; -import hu.bme.mit.trainbenchmark.benchmark.rdf4j.matches.Rdf4jMatch; - -public abstract class Rdf4jTransformation<TRdf4jMatch extends Rdf4jMatch, TRdf4jDriver extends Rdf4jDriver> - extends ModelTransformation<TRdf4jMatch, TRdf4jDriver> { - - protected Rdf4jTransformation(final TRdf4jDriver driver) { - super(driver); - } -} diff --git a/trainbenchmark-tool-rdf4j/src/main/java/hu/bme/mit/trainbenchmark/benchmark/rdf4j/transformations/inject/Rdf4jTransformationInjectConnectedSegments.java b/trainbenchmark-tool-rdf4j/src/main/java/hu/bme/mit/trainbenchmark/benchmark/rdf4j/transformations/inject/Rdf4jTransformationInjectConnectedSegments.java deleted file mode 100644 index 22ed69b8d..000000000 --- a/trainbenchmark-tool-rdf4j/src/main/java/hu/bme/mit/trainbenchmark/benchmark/rdf4j/transformations/inject/Rdf4jTransformationInjectConnectedSegments.java +++ /dev/null @@ -1,70 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2010-2015, Benedek Izso, Gabor Szarnyas, Istvan Rath and Daniel Varro - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Benedek Izso - initial API and implementation - * Gabor Szarnyas - initial API and implementation - *******************************************************************************/ -package hu.bme.mit.trainbenchmark.benchmark.rdf4j.transformations.inject; - -import static hu.bme.mit.trainbenchmark.constants.ModelConstants.CONNECTS_TO; -import static hu.bme.mit.trainbenchmark.constants.ModelConstants.LENGTH; -import static hu.bme.mit.trainbenchmark.constants.ModelConstants.MONITORED_BY; -import static hu.bme.mit.trainbenchmark.constants.ModelConstants.SEGMENT; -import static hu.bme.mit.trainbenchmark.rdf.RdfConstants.BASE_PREFIX; -import static hu.bme.mit.trainbenchmark.rdf.RdfConstants.ID_PREFIX; - -import java.util.Collection; - -import org.eclipse.rdf4j.model.IRI; -import org.eclipse.rdf4j.model.Literal; -import org.eclipse.rdf4j.model.ValueFactory; -import org.eclipse.rdf4j.model.vocabulary.RDF; -import org.eclipse.rdf4j.repository.RepositoryConnection; - -import hu.bme.mit.trainbenchmark.benchmark.rdf4j.driver.Rdf4jDriver; -import hu.bme.mit.trainbenchmark.benchmark.rdf4j.matches.Rdf4jConnectedSegmentsInjectMatch; -import hu.bme.mit.trainbenchmark.benchmark.rdf4j.transformations.Rdf4jTransformation; -import hu.bme.mit.trainbenchmark.constants.TrainBenchmarkConstants; - -public class Rdf4jTransformationInjectConnectedSegments<TRdf4jDriver extends Rdf4jDriver> extends Rdf4jTransformation<Rdf4jConnectedSegmentsInjectMatch, TRdf4jDriver> { - - public Rdf4jTransformationInjectConnectedSegments(final TRdf4jDriver driver) { - super(driver); - } - - @Override - public void activate(final Collection<Rdf4jConnectedSegmentsInjectMatch> matches) throws Exception { - final RepositoryConnection connection = driver.getConnection(); - final ValueFactory vf = driver.getValueFactory(); - - final IRI length = vf.createIRI(BASE_PREFIX + LENGTH); - final IRI connectsTo = vf.createIRI(BASE_PREFIX + CONNECTS_TO); - final IRI monitoredBy = vf.createIRI(BASE_PREFIX + MONITORED_BY); - final IRI segmentType = vf.createIRI(BASE_PREFIX + SEGMENT); - final Literal lengthLiteral = vf.createLiteral(TrainBenchmarkConstants.DEFAULT_SEGMENT_LENGTH); - - for (final Rdf4jConnectedSegmentsInjectMatch csim : matches) { - // create (segment2) node - final Long newVertexId = driver.generateNewVertexId(); - final IRI segment2 = vf.createIRI(BASE_PREFIX + ID_PREFIX + newVertexId); - connection.add(segment2, RDF.TYPE, segmentType); - - // (segment1)-[:connectsTo]->(segment2) - connection.add(csim.getSegment1(), connectsTo, segment2); - // (segment2)-[:connectsTo]->(segment3) - connection.add(segment2, connectsTo, csim.getSegment3()); - - // (segment2)-[:monitoredBy]->(sensor) - connection.add(segment2, monitoredBy, csim.getSensor()); - - // remove (segment1)-[:connectsTo]->(segment3) - connection.remove(csim.getSegment1(), connectsTo, csim.getSegment3()); - } - } - -} diff --git a/trainbenchmark-tool-rdf4j/src/main/java/hu/bme/mit/trainbenchmark/benchmark/rdf4j/transformations/inject/Rdf4jTransformationInjectPosLength.java b/trainbenchmark-tool-rdf4j/src/main/java/hu/bme/mit/trainbenchmark/benchmark/rdf4j/transformations/inject/Rdf4jTransformationInjectPosLength.java deleted file mode 100644 index c8d4f9474..000000000 --- a/trainbenchmark-tool-rdf4j/src/main/java/hu/bme/mit/trainbenchmark/benchmark/rdf4j/transformations/inject/Rdf4jTransformationInjectPosLength.java +++ /dev/null @@ -1,54 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2010-2015, Benedek Izso, Gabor Szarnyas, Istvan Rath and Daniel Varro - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Benedek Izso - initial API and implementation - * Gabor Szarnyas - initial API and implementation - *******************************************************************************/ -package hu.bme.mit.trainbenchmark.benchmark.rdf4j.transformations.inject; - -import static hu.bme.mit.trainbenchmark.rdf.RdfConstants.BASE_PREFIX; - -import java.util.Collection; - -import org.eclipse.rdf4j.model.IRI; -import org.eclipse.rdf4j.model.Literal; -import org.eclipse.rdf4j.model.Statement; -import org.eclipse.rdf4j.model.ValueFactory; -import org.eclipse.rdf4j.repository.RepositoryConnection; -import org.eclipse.rdf4j.repository.RepositoryResult; - -import hu.bme.mit.trainbenchmark.benchmark.rdf4j.driver.Rdf4jDriver; -import hu.bme.mit.trainbenchmark.benchmark.rdf4j.matches.Rdf4jPosLengthInjectMatch; -import hu.bme.mit.trainbenchmark.benchmark.rdf4j.transformations.Rdf4jTransformation; -import hu.bme.mit.trainbenchmark.constants.ModelConstants; - -public class Rdf4jTransformationInjectPosLength<TRdf4jDriver extends Rdf4jDriver> extends Rdf4jTransformation<Rdf4jPosLengthInjectMatch, TRdf4jDriver> { - - public Rdf4jTransformationInjectPosLength(final TRdf4jDriver driver) { - super(driver); - } - - @Override - public void activate(final Collection<Rdf4jPosLengthInjectMatch> matches) { - final RepositoryConnection con = driver.getConnection(); - final ValueFactory vf = driver.getValueFactory(); - - final IRI typeIri = vf.createIRI(BASE_PREFIX + ModelConstants.LENGTH); - final Literal zeroLiteral = vf.createLiteral(0); - - for (final Rdf4jPosLengthInjectMatch match : matches) { - final IRI segment = match.getSegment(); - - final RepositoryResult<Statement> statementsToRemove = con.getStatements(segment, typeIri, null, true); - con.remove(statementsToRemove); - - con.add(segment, typeIri, zeroLiteral); - } - } - -} diff --git a/trainbenchmark-tool-rdf4j/src/main/java/hu/bme/mit/trainbenchmark/benchmark/rdf4j/transformations/inject/Rdf4jTransformationInjectRouteSensor.java b/trainbenchmark-tool-rdf4j/src/main/java/hu/bme/mit/trainbenchmark/benchmark/rdf4j/transformations/inject/Rdf4jTransformationInjectRouteSensor.java deleted file mode 100644 index cbc8a1989..000000000 --- a/trainbenchmark-tool-rdf4j/src/main/java/hu/bme/mit/trainbenchmark/benchmark/rdf4j/transformations/inject/Rdf4jTransformationInjectRouteSensor.java +++ /dev/null @@ -1,50 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2010-2015, Benedek Izso, Gabor Szarnyas, Istvan Rath and Daniel Varro - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Benedek Izso - initial API and implementation - * Gabor Szarnyas - initial API and implementation - *******************************************************************************/ -package hu.bme.mit.trainbenchmark.benchmark.rdf4j.transformations.inject; - -import static hu.bme.mit.trainbenchmark.rdf.RdfConstants.BASE_PREFIX; - -import java.util.ArrayList; -import java.util.Collection; -import java.util.List; - -import org.eclipse.rdf4j.model.IRI; -import org.eclipse.rdf4j.model.Statement; -import org.eclipse.rdf4j.model.ValueFactory; -import org.eclipse.rdf4j.repository.RepositoryConnection; - -import hu.bme.mit.trainbenchmark.benchmark.rdf4j.driver.Rdf4jDriver; -import hu.bme.mit.trainbenchmark.benchmark.rdf4j.matches.Rdf4jRouteSensorInjectMatch; -import hu.bme.mit.trainbenchmark.benchmark.rdf4j.transformations.Rdf4jTransformation; -import hu.bme.mit.trainbenchmark.constants.ModelConstants; - -public class Rdf4jTransformationInjectRouteSensor<TRdf4jDriver extends Rdf4jDriver> extends Rdf4jTransformation<Rdf4jRouteSensorInjectMatch, TRdf4jDriver> { - - public Rdf4jTransformationInjectRouteSensor(final TRdf4jDriver driver) { - super(driver); - } - - @Override - public void activate(final Collection<Rdf4jRouteSensorInjectMatch> matches) { - final RepositoryConnection connection = driver.getConnection(); - final ValueFactory vf = connection.getValueFactory(); - - final List<Statement> statementsToRemove = new ArrayList<>(matches.size()); - final IRI requires = vf.createIRI(BASE_PREFIX + ModelConstants.REQUIRES); - for (final Rdf4jRouteSensorInjectMatch m : matches) { - final Statement statement = vf.createStatement(m.getRoute(), requires, m.getSensor()); - statementsToRemove.add(statement); - } - connection.remove(statementsToRemove); - } - -} diff --git a/trainbenchmark-tool-rdf4j/src/main/java/hu/bme/mit/trainbenchmark/benchmark/rdf4j/transformations/inject/Rdf4jTransformationInjectSemaphoreNeighbor.java b/trainbenchmark-tool-rdf4j/src/main/java/hu/bme/mit/trainbenchmark/benchmark/rdf4j/transformations/inject/Rdf4jTransformationInjectSemaphoreNeighbor.java deleted file mode 100644 index 8615a9cdc..000000000 --- a/trainbenchmark-tool-rdf4j/src/main/java/hu/bme/mit/trainbenchmark/benchmark/rdf4j/transformations/inject/Rdf4jTransformationInjectSemaphoreNeighbor.java +++ /dev/null @@ -1,40 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2010-2015, Benedek Izso, Gabor Szarnyas, Istvan Rath and Daniel Varro - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Benedek Izso - initial API and implementation - * Gabor Szarnyas - initial API and implementation - *******************************************************************************/ -package hu.bme.mit.trainbenchmark.benchmark.rdf4j.transformations.inject; - -import java.util.Collection; - -import org.eclipse.rdf4j.model.IRI; - -import hu.bme.mit.trainbenchmark.benchmark.rdf4j.driver.Rdf4jDriver; -import hu.bme.mit.trainbenchmark.benchmark.rdf4j.matches.Rdf4jSemaphoreNeighborInjectMatch; -import hu.bme.mit.trainbenchmark.benchmark.rdf4j.transformations.Rdf4jTransformation; -import hu.bme.mit.trainbenchmark.constants.ModelConstants; -import hu.bme.mit.trainbenchmark.rdf.RdfConstants; - -public class Rdf4jTransformationInjectSemaphoreNeighbor<TRdf4jDriver extends Rdf4jDriver> - extends Rdf4jTransformation<Rdf4jSemaphoreNeighborInjectMatch, TRdf4jDriver> { - - public Rdf4jTransformationInjectSemaphoreNeighbor(final TRdf4jDriver driver) { - super(driver); - } - - @Override - public void activate(final Collection<Rdf4jSemaphoreNeighborInjectMatch> matches) { - final IRI entry = driver.getValueFactory().createIRI(RdfConstants.BASE_PREFIX + ModelConstants.ENTRY); - - for (Rdf4jSemaphoreNeighborInjectMatch match : matches) { - driver.getConnection().remove(match.getRoute(), entry, match.getSemaphore()); - } - } - -} diff --git a/trainbenchmark-tool-rdf4j/src/main/java/hu/bme/mit/trainbenchmark/benchmark/rdf4j/transformations/inject/Rdf4jTransformationInjectSwitchMonitored.java b/trainbenchmark-tool-rdf4j/src/main/java/hu/bme/mit/trainbenchmark/benchmark/rdf4j/transformations/inject/Rdf4jTransformationInjectSwitchMonitored.java deleted file mode 100644 index 8f9bde31c..000000000 --- a/trainbenchmark-tool-rdf4j/src/main/java/hu/bme/mit/trainbenchmark/benchmark/rdf4j/transformations/inject/Rdf4jTransformationInjectSwitchMonitored.java +++ /dev/null @@ -1,37 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2010-2015, Benedek Izso, Gabor Szarnyas, Istvan Rath and Daniel Varro - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Benedek Izso - initial API and implementation - * Gabor Szarnyas - initial API and implementation - *******************************************************************************/ -package hu.bme.mit.trainbenchmark.benchmark.rdf4j.transformations.inject; - -import java.util.Collection; -import java.util.List; -import java.util.stream.Collectors; - -import org.eclipse.rdf4j.model.IRI; - -import hu.bme.mit.trainbenchmark.benchmark.rdf4j.driver.Rdf4jDriver; -import hu.bme.mit.trainbenchmark.benchmark.rdf4j.matches.Rdf4jSwitchMonitoredInjectMatch; -import hu.bme.mit.trainbenchmark.benchmark.rdf4j.transformations.Rdf4jTransformation; -import hu.bme.mit.trainbenchmark.constants.ModelConstants; - -public class Rdf4jTransformationInjectSwitchMonitored<TRdf4jDriver extends Rdf4jDriver> extends Rdf4jTransformation<Rdf4jSwitchMonitoredInjectMatch, TRdf4jDriver> { - - public Rdf4jTransformationInjectSwitchMonitored(final TRdf4jDriver driver) { - super(driver); - } - - @Override - public void activate(final Collection<Rdf4jSwitchMonitoredInjectMatch> matches) { - final List<IRI> switches = matches.stream().map(it -> it.getSw()).collect(Collectors.toList()); - driver.deleteOutgoingEdges(switches, ModelConstants.MONITORED_BY); - } - -} diff --git a/trainbenchmark-tool-rdf4j/src/main/java/hu/bme/mit/trainbenchmark/benchmark/rdf4j/transformations/inject/Rdf4jTransformationInjectSwitchSet.java b/trainbenchmark-tool-rdf4j/src/main/java/hu/bme/mit/trainbenchmark/benchmark/rdf4j/transformations/inject/Rdf4jTransformationInjectSwitchSet.java deleted file mode 100644 index dea4806c8..000000000 --- a/trainbenchmark-tool-rdf4j/src/main/java/hu/bme/mit/trainbenchmark/benchmark/rdf4j/transformations/inject/Rdf4jTransformationInjectSwitchSet.java +++ /dev/null @@ -1,70 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2010-2015, Benedek Izso, Gabor Szarnyas, Istvan Rath and Daniel Varro - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Benedek Izso - initial API and implementation - * Gabor Szarnyas - initial API and implementation - *******************************************************************************/ -package hu.bme.mit.trainbenchmark.benchmark.rdf4j.transformations.inject; - -import static hu.bme.mit.trainbenchmark.constants.ModelConstants.CURRENTPOSITION; -import static hu.bme.mit.trainbenchmark.rdf.RdfConstants.BASE_PREFIX; - -import java.util.Collection; - -import org.eclipse.rdf4j.model.IRI; -import org.eclipse.rdf4j.model.Statement; -import org.eclipse.rdf4j.model.ValueFactory; -import org.eclipse.rdf4j.repository.RepositoryConnection; -import org.eclipse.rdf4j.repository.RepositoryResult; - -import hu.bme.mit.trainbenchmark.benchmark.rdf4j.driver.Rdf4jDriver; -import hu.bme.mit.trainbenchmark.benchmark.rdf4j.matches.Rdf4jSwitchSetInjectMatch; -import hu.bme.mit.trainbenchmark.benchmark.rdf4j.transformations.Rdf4jTransformation; -import hu.bme.mit.trainbenchmark.constants.Position; -import hu.bme.mit.trainbenchmark.rdf.RdfHelper; - -public class Rdf4jTransformationInjectSwitchSet<TRdf4jDriver extends Rdf4jDriver> extends Rdf4jTransformation<Rdf4jSwitchSetInjectMatch, TRdf4jDriver> { - - public Rdf4jTransformationInjectSwitchSet(final TRdf4jDriver driver) { - super(driver); - } - - @Override - public void activate(final Collection<Rdf4jSwitchSetInjectMatch> matches) { - final RepositoryConnection con = driver.getConnection(); - final ValueFactory vf = driver.getValueFactory(); - - final IRI currentPositionProperty = vf.createIRI(BASE_PREFIX + CURRENTPOSITION); - - for (final Rdf4jSwitchSetInjectMatch match : matches) { - final IRI sw = match.getSw(); - final RepositoryResult<Statement> statements = con.getStatements(sw, currentPositionProperty, null, true); - if (!statements.hasNext()) { - continue; - } - - final Statement oldStatement = statements.next(); - - // delete old statement - con.remove(oldStatement); - - // get next enum value - final IRI currentPositionIri = (IRI) oldStatement.getObject(); - final String currentPositionRDFString = currentPositionIri.getLocalName(); - final String currentPositionString = RdfHelper.removePrefix(Position.class, currentPositionRDFString); - final Position currentPosition = Position.valueOf(currentPositionString); - final Position newCurrentPosition = Position.values()[(currentPosition.ordinal() + 1) % Position.values().length]; - final String newCurrentPositionString = RdfHelper.addEnumPrefix(newCurrentPosition); - final IRI newCurrentPositionIri = vf.createIRI(BASE_PREFIX + newCurrentPositionString); - - // set new value - con.add(sw, currentPositionProperty, newCurrentPositionIri); - } - } - -} diff --git a/trainbenchmark-tool-rdf4j/src/main/java/hu/bme/mit/trainbenchmark/benchmark/rdf4j/transformations/repair/Rdf4jTransformationRepairConnectedSegments.java b/trainbenchmark-tool-rdf4j/src/main/java/hu/bme/mit/trainbenchmark/benchmark/rdf4j/transformations/repair/Rdf4jTransformationRepairConnectedSegments.java deleted file mode 100644 index efd54ef79..000000000 --- a/trainbenchmark-tool-rdf4j/src/main/java/hu/bme/mit/trainbenchmark/benchmark/rdf4j/transformations/repair/Rdf4jTransformationRepairConnectedSegments.java +++ /dev/null @@ -1,56 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2010-2015, Benedek Izso, Gabor Szarnyas, Istvan Rath and Daniel Varro - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Benedek Izso - initial API and implementation - * Gabor Szarnyas - initial API and implementation - *******************************************************************************/ -package hu.bme.mit.trainbenchmark.benchmark.rdf4j.transformations.repair; - -import static hu.bme.mit.trainbenchmark.constants.ModelConstants.CONNECTS_TO; -import static hu.bme.mit.trainbenchmark.rdf.RdfConstants.BASE_PREFIX; - -import java.util.Collection; - -import org.eclipse.rdf4j.model.IRI; -import org.eclipse.rdf4j.model.Statement; -import org.eclipse.rdf4j.model.ValueFactory; -import org.eclipse.rdf4j.repository.RepositoryConnection; -import org.eclipse.rdf4j.repository.RepositoryResult; - -import hu.bme.mit.trainbenchmark.benchmark.rdf4j.driver.Rdf4jDriver; -import hu.bme.mit.trainbenchmark.benchmark.rdf4j.matches.Rdf4jConnectedSegmentsMatch; -import hu.bme.mit.trainbenchmark.benchmark.rdf4j.transformations.Rdf4jTransformation; - -public class Rdf4jTransformationRepairConnectedSegments<TRdf4jDriver extends Rdf4jDriver> extends Rdf4jTransformation<Rdf4jConnectedSegmentsMatch, TRdf4jDriver> { - - public Rdf4jTransformationRepairConnectedSegments(final TRdf4jDriver driver) { - super(driver); - } - - @Override - public void activate(final Collection<Rdf4jConnectedSegmentsMatch> matches) { - final RepositoryConnection con = driver.getConnection(); - final ValueFactory vf = driver.getValueFactory(); - - final IRI connectsTo = vf.createIRI(BASE_PREFIX + CONNECTS_TO); - for (final Rdf4jConnectedSegmentsMatch match : matches) { - // delete segment2 by removing all (segment2, _, _) and (_, _, segment2) triples - final RepositoryResult<Statement> outgoingEdges = con.getStatements(match.getSegment2(), null, null, true); - while (outgoingEdges.hasNext()) { - con.remove(outgoingEdges.next()); - } - final RepositoryResult<Statement> incomingEdges = con.getStatements(null, null, match.getSegment2(), true); - while (incomingEdges.hasNext()) { - con.remove(incomingEdges.next()); - } - - // insert (segment1)-[:connectsTo]->(segment3) edge - con.add(match.getSegment1(), connectsTo, match.getSegment3()); - } - } -} diff --git a/trainbenchmark-tool-rdf4j/src/main/java/hu/bme/mit/trainbenchmark/benchmark/rdf4j/transformations/repair/Rdf4jTransformationRepairPosLength.java b/trainbenchmark-tool-rdf4j/src/main/java/hu/bme/mit/trainbenchmark/benchmark/rdf4j/transformations/repair/Rdf4jTransformationRepairPosLength.java deleted file mode 100644 index c3c72a258..000000000 --- a/trainbenchmark-tool-rdf4j/src/main/java/hu/bme/mit/trainbenchmark/benchmark/rdf4j/transformations/repair/Rdf4jTransformationRepairPosLength.java +++ /dev/null @@ -1,62 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2010-2015, Benedek Izso, Gabor Szarnyas, Istvan Rath and Daniel Varro - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Benedek Izso - initial API and implementation - * Gabor Szarnyas - initial API and implementation - *******************************************************************************/ -package hu.bme.mit.trainbenchmark.benchmark.rdf4j.transformations.repair; - -import static hu.bme.mit.trainbenchmark.constants.ModelConstants.LENGTH; -import static hu.bme.mit.trainbenchmark.rdf.RdfConstants.BASE_PREFIX; - -import java.util.Collection; - -import org.eclipse.rdf4j.model.IRI; -import org.eclipse.rdf4j.model.Literal; -import org.eclipse.rdf4j.model.Resource; -import org.eclipse.rdf4j.model.Statement; -import org.eclipse.rdf4j.model.Value; -import org.eclipse.rdf4j.model.ValueFactory; -import org.eclipse.rdf4j.repository.RepositoryConnection; -import org.eclipse.rdf4j.repository.RepositoryResult; - -import hu.bme.mit.trainbenchmark.benchmark.rdf4j.driver.Rdf4jDriver; -import hu.bme.mit.trainbenchmark.benchmark.rdf4j.matches.Rdf4jPosLengthMatch; -import hu.bme.mit.trainbenchmark.benchmark.rdf4j.transformations.Rdf4jTransformation; - -public class Rdf4jTransformationRepairPosLength<TRdf4jDriver extends Rdf4jDriver> extends Rdf4jTransformation<Rdf4jPosLengthMatch, TRdf4jDriver> { - - public Rdf4jTransformationRepairPosLength(final TRdf4jDriver driver) { - super(driver); - } - - @Override - public void activate(final Collection<Rdf4jPosLengthMatch> matches) { - final RepositoryConnection con = driver.getConnection(); - final ValueFactory vf = driver.getValueFactory(); - - final IRI lengthProperty = vf.createIRI(BASE_PREFIX + LENGTH); - - for (final Rdf4jPosLengthMatch match : matches) { - final Resource segment = match.getSegment(); - final Value length = match.getLength(); - - final RepositoryResult<Statement> statementsToRemove = con.getStatements(segment, lengthProperty, length, true); - while (statementsToRemove.hasNext()) { - final Statement oldStatement = statementsToRemove.next(); - con.remove(oldStatement); - } - - final Integer lengthInteger = new Integer(length.stringValue()); - final Integer newLengthInteger = -lengthInteger + 1; - final Literal newLength = vf.createLiteral(newLengthInteger); - final Statement newStatement = vf.createStatement(segment, lengthProperty, newLength); - con.add(newStatement); - } - } -} diff --git a/trainbenchmark-tool-rdf4j/src/main/java/hu/bme/mit/trainbenchmark/benchmark/rdf4j/transformations/repair/Rdf4jTransformationRepairRouteSensor.java b/trainbenchmark-tool-rdf4j/src/main/java/hu/bme/mit/trainbenchmark/benchmark/rdf4j/transformations/repair/Rdf4jTransformationRepairRouteSensor.java deleted file mode 100644 index 592987180..000000000 --- a/trainbenchmark-tool-rdf4j/src/main/java/hu/bme/mit/trainbenchmark/benchmark/rdf4j/transformations/repair/Rdf4jTransformationRepairRouteSensor.java +++ /dev/null @@ -1,49 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2010-2015, Benedek Izso, Gabor Szarnyas, Istvan Rath and Daniel Varro - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Benedek Izso - initial API and implementation - * Gabor Szarnyas - initial API and implementation - *******************************************************************************/ -package hu.bme.mit.trainbenchmark.benchmark.rdf4j.transformations.repair; - -import static hu.bme.mit.trainbenchmark.constants.ModelConstants.REQUIRES; -import static hu.bme.mit.trainbenchmark.rdf.RdfConstants.BASE_PREFIX; - -import java.util.Collection; - -import org.eclipse.rdf4j.model.IRI; -import org.eclipse.rdf4j.model.Resource; -import org.eclipse.rdf4j.model.ValueFactory; -import org.eclipse.rdf4j.repository.RepositoryConnection; - -import hu.bme.mit.trainbenchmark.benchmark.rdf4j.driver.Rdf4jDriver; -import hu.bme.mit.trainbenchmark.benchmark.rdf4j.matches.Rdf4jRouteSensorMatch; -import hu.bme.mit.trainbenchmark.benchmark.rdf4j.transformations.Rdf4jTransformation; - -public class Rdf4jTransformationRepairRouteSensor<TRdf4jDriver extends Rdf4jDriver> extends Rdf4jTransformation<Rdf4jRouteSensorMatch, TRdf4jDriver> { - - public Rdf4jTransformationRepairRouteSensor(final TRdf4jDriver driver) { - super(driver); - } - - @Override - public void activate(final Collection<Rdf4jRouteSensorMatch> matches) { - final RepositoryConnection con = driver.getConnection(); - final ValueFactory vf = driver.getValueFactory(); - - final IRI requires = vf.createIRI(BASE_PREFIX + REQUIRES); - - for (final Rdf4jRouteSensorMatch match : matches) { - final Resource route = match.getRoute(); - final Resource sensor = match.getSensor(); - - con.add(route, requires, sensor); - } - } - -} diff --git a/trainbenchmark-tool-rdf4j/src/main/java/hu/bme/mit/trainbenchmark/benchmark/rdf4j/transformations/repair/Rdf4jTransformationRepairSemaphoreNeighbor.java b/trainbenchmark-tool-rdf4j/src/main/java/hu/bme/mit/trainbenchmark/benchmark/rdf4j/transformations/repair/Rdf4jTransformationRepairSemaphoreNeighbor.java deleted file mode 100644 index 2d756734a..000000000 --- a/trainbenchmark-tool-rdf4j/src/main/java/hu/bme/mit/trainbenchmark/benchmark/rdf4j/transformations/repair/Rdf4jTransformationRepairSemaphoreNeighbor.java +++ /dev/null @@ -1,48 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2010-2015, Benedek Izso, Gabor Szarnyas, Istvan Rath and Daniel Varro - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Benedek Izso - initial API and implementation - * Gabor Szarnyas - initial API and implementation - *******************************************************************************/ -package hu.bme.mit.trainbenchmark.benchmark.rdf4j.transformations.repair; - -import static hu.bme.mit.trainbenchmark.constants.ModelConstants.ENTRY; -import static hu.bme.mit.trainbenchmark.rdf.RdfConstants.BASE_PREFIX; - -import java.util.Collection; - -import org.eclipse.rdf4j.model.IRI; -import org.eclipse.rdf4j.model.Resource; -import org.eclipse.rdf4j.model.ValueFactory; -import org.eclipse.rdf4j.repository.RepositoryConnection; - -import hu.bme.mit.trainbenchmark.benchmark.rdf4j.driver.Rdf4jDriver; -import hu.bme.mit.trainbenchmark.benchmark.rdf4j.matches.Rdf4jSemaphoreNeighborMatch; -import hu.bme.mit.trainbenchmark.benchmark.rdf4j.transformations.Rdf4jTransformation; - -public class Rdf4jTransformationRepairSemaphoreNeighbor<TRdf4jDriver extends Rdf4jDriver> extends Rdf4jTransformation<Rdf4jSemaphoreNeighborMatch, TRdf4jDriver> { - - public Rdf4jTransformationRepairSemaphoreNeighbor(final TRdf4jDriver driver) { - super(driver); - } - - @Override - public void activate(final Collection<Rdf4jSemaphoreNeighborMatch> matches) { - final RepositoryConnection con = driver.getConnection(); - final ValueFactory vf = driver.getValueFactory(); - - final IRI entry = vf.createIRI(BASE_PREFIX + ENTRY); - - for (final Rdf4jSemaphoreNeighborMatch match : matches) { - final Resource route2 = match.getRoute2(); - final Resource semaphore = match.getSemaphore(); - con.add(route2, entry, semaphore); - } - } - -} diff --git a/trainbenchmark-tool-rdf4j/src/main/java/hu/bme/mit/trainbenchmark/benchmark/rdf4j/transformations/repair/Rdf4jTransformationRepairSwitchMonitored.java b/trainbenchmark-tool-rdf4j/src/main/java/hu/bme/mit/trainbenchmark/benchmark/rdf4j/transformations/repair/Rdf4jTransformationRepairSwitchMonitored.java deleted file mode 100644 index 065e806c1..000000000 --- a/trainbenchmark-tool-rdf4j/src/main/java/hu/bme/mit/trainbenchmark/benchmark/rdf4j/transformations/repair/Rdf4jTransformationRepairSwitchMonitored.java +++ /dev/null @@ -1,65 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2010-2015, Benedek Izso, Gabor Szarnyas, Istvan Rath and Daniel Varro - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Benedek Izso - initial API and implementation - * Gabor Szarnyas - initial API and implementation - *******************************************************************************/ -package hu.bme.mit.trainbenchmark.benchmark.rdf4j.transformations.repair; - -import static hu.bme.mit.trainbenchmark.constants.ModelConstants.MONITORED_BY; -import static hu.bme.mit.trainbenchmark.constants.ModelConstants.SENSOR; -import static hu.bme.mit.trainbenchmark.constants.ModelConstants.TRACKELEMENT; -import static hu.bme.mit.trainbenchmark.rdf.RdfConstants.BASE_PREFIX; -import static hu.bme.mit.trainbenchmark.rdf.RdfConstants.ID_PREFIX; - -import java.util.Collection; - -import org.eclipse.rdf4j.model.IRI; -import org.eclipse.rdf4j.model.Resource; -import org.eclipse.rdf4j.model.ValueFactory; -import org.eclipse.rdf4j.model.vocabulary.RDF; -import org.eclipse.rdf4j.repository.RepositoryConnection; - -import hu.bme.mit.trainbenchmark.benchmark.rdf4j.driver.Rdf4jDriver; -import hu.bme.mit.trainbenchmark.benchmark.rdf4j.matches.Rdf4jSwitchMonitoredMatch; -import hu.bme.mit.trainbenchmark.benchmark.rdf4j.transformations.Rdf4jTransformation; - -public class Rdf4jTransformationRepairSwitchMonitored<TRdf4jDriver extends Rdf4jDriver> extends Rdf4jTransformation<Rdf4jSwitchMonitoredMatch, TRdf4jDriver> { - - public Rdf4jTransformationRepairSwitchMonitored(final TRdf4jDriver driver) { - super(driver); - } - - @Override - public void activate(final Collection<Rdf4jSwitchMonitoredMatch> matches) throws Exception { - final RepositoryConnection con = driver.getConnection(); - final ValueFactory vf = driver.getValueFactory(); - - final IRI sensorEdgeType = vf.createIRI(BASE_PREFIX + MONITORED_BY); - final IRI sensorType = vf.createIRI(BASE_PREFIX + SENSOR); - final IRI trackElementType = vf.createIRI(BASE_PREFIX + TRACKELEMENT); - - for (final Rdf4jSwitchMonitoredMatch match : matches) { - final Resource sw = match.getSw(); - - final IRI sensor = vf.createIRI(BASE_PREFIX + ID_PREFIX + driver.generateNewVertexId()); - - // set vertex type - con.add(sensor, RDF.TYPE, sensorType); - - // insert the supertype as well - if (!driver.isInferencing()) { - con.add(sensor, RDF.TYPE, trackElementType); - } - - // insert edge - con.add(sw, sensorEdgeType, sensor); - } - } - -} diff --git a/trainbenchmark-tool-rdf4j/src/main/java/hu/bme/mit/trainbenchmark/benchmark/rdf4j/transformations/repair/Rdf4jTransformationRepairSwitchSet.java b/trainbenchmark-tool-rdf4j/src/main/java/hu/bme/mit/trainbenchmark/benchmark/rdf4j/transformations/repair/Rdf4jTransformationRepairSwitchSet.java deleted file mode 100644 index a05694799..000000000 --- a/trainbenchmark-tool-rdf4j/src/main/java/hu/bme/mit/trainbenchmark/benchmark/rdf4j/transformations/repair/Rdf4jTransformationRepairSwitchSet.java +++ /dev/null @@ -1,58 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2010-2015, Benedek Izso, Gabor Szarnyas, Istvan Rath and Daniel Varro - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Benedek Izso - initial API and implementation - * Gabor Szarnyas - initial API and implementation - *******************************************************************************/ -package hu.bme.mit.trainbenchmark.benchmark.rdf4j.transformations.repair; - -import static hu.bme.mit.trainbenchmark.constants.ModelConstants.CURRENTPOSITION; -import static hu.bme.mit.trainbenchmark.rdf.RdfConstants.BASE_PREFIX; - -import java.util.Collection; - -import org.eclipse.rdf4j.model.IRI; -import org.eclipse.rdf4j.model.Resource; -import org.eclipse.rdf4j.model.Statement; -import org.eclipse.rdf4j.model.Value; -import org.eclipse.rdf4j.model.ValueFactory; -import org.eclipse.rdf4j.repository.RepositoryConnection; -import org.eclipse.rdf4j.repository.RepositoryResult; - -import hu.bme.mit.trainbenchmark.benchmark.rdf4j.driver.Rdf4jDriver; -import hu.bme.mit.trainbenchmark.benchmark.rdf4j.matches.Rdf4jSwitchSetMatch; -import hu.bme.mit.trainbenchmark.benchmark.rdf4j.transformations.Rdf4jTransformation; - -public class Rdf4jTransformationRepairSwitchSet<TRdf4jDriver extends Rdf4jDriver> extends Rdf4jTransformation<Rdf4jSwitchSetMatch, TRdf4jDriver> { - - public Rdf4jTransformationRepairSwitchSet(final TRdf4jDriver driver) { - super(driver); - } - - @Override - public void activate(final Collection<Rdf4jSwitchSetMatch> matches) { - final RepositoryConnection con = driver.getConnection(); - final ValueFactory vf = driver.getValueFactory(); - - final IRI currentPositionProperty = vf.createIRI(BASE_PREFIX + CURRENTPOSITION); - - for (final Rdf4jSwitchSetMatch match : matches) { - final Resource sw = match.getSw(); - final Value position = match.getPosition(); - final Value currentPosition = match.getCurrentPosition(); - - final RepositoryResult<Statement> statementsToRemove = con.getStatements(sw, currentPositionProperty, currentPosition, false); - while (statementsToRemove.hasNext()) { - con.remove(statementsToRemove.next()); - } - - con.add(sw, currentPositionProperty, position); - } - } - -} diff --git a/trainbenchmark-tool-rdf4j/src/main/resources/.gitignore b/trainbenchmark-tool-rdf4j/src/main/resources/.gitignore deleted file mode 100644 index e69de29bb..000000000 diff --git a/trainbenchmark-tool-rdf4j/src/test/java/hu/bme/mit/trainbenchmark/benchmark/rdf4j/test/Rdf4jTest.java b/trainbenchmark-tool-rdf4j/src/test/java/hu/bme/mit/trainbenchmark/benchmark/rdf4j/test/Rdf4jTest.java deleted file mode 100644 index de2745f27..000000000 --- a/trainbenchmark-tool-rdf4j/src/test/java/hu/bme/mit/trainbenchmark/benchmark/rdf4j/test/Rdf4jTest.java +++ /dev/null @@ -1,25 +0,0 @@ -package hu.bme.mit.trainbenchmark.benchmark.rdf4j.test; - -import org.junit.runner.RunWith; -import org.junit.runners.Parameterized; - -import hu.bme.mit.trainbenchmark.benchmark.config.BenchmarkConfigBase; -import hu.bme.mit.trainbenchmark.benchmark.rdf.tests.RdfTest; -import hu.bme.mit.trainbenchmark.benchmark.rdf4j.Rdf4jBenchmarkScenario; -import hu.bme.mit.trainbenchmark.benchmark.rdf4j.config.Rdf4jBenchmarkConfig; -import hu.bme.mit.trainbenchmark.benchmark.rdf4j.config.Rdf4jBenchmarkConfigBuilder; -import hu.bme.mit.trainbenchmark.benchmark.runcomponents.BenchmarkResult; - -@RunWith(Parameterized.class) -public class Rdf4jTest extends RdfTest { - - @Override - protected BenchmarkResult runTest(final BenchmarkConfigBase bcb) throws Exception { - final Rdf4jBenchmarkConfig bc = new Rdf4jBenchmarkConfigBuilder().setConfigBase(bcb).setInferencing(inferencing) - .createConfig(); - final Rdf4jBenchmarkScenario scenario = new Rdf4jBenchmarkScenario(bc); - final BenchmarkResult result = scenario.performBenchmark(); - return result; - } - -} diff --git a/trainbenchmark-tool-sesame/.gitignore b/trainbenchmark-tool-sesame/.gitignore deleted file mode 100644 index ea8c4bf7f..000000000 --- a/trainbenchmark-tool-sesame/.gitignore +++ /dev/null @@ -1 +0,0 @@ -/target diff --git a/trainbenchmark-tool-sesame/build.gradle b/trainbenchmark-tool-sesame/build.gradle deleted file mode 100644 index 328d55eb6..000000000 --- a/trainbenchmark-tool-sesame/build.gradle +++ /dev/null @@ -1,19 +0,0 @@ -plugins { id "com.github.johnrengelman.shadow" version "1.2.3" } - -shadowJar { - classifier = 'fat' - manifest { attributes 'Main-Class': 'hu.bme.mit.trainbenchmark.benchmark.sesame.SesameBenchmarkMain' } - mergeServiceFiles() -} - -dependencies { - def sesameVersion = '2.7.10' - compile project(':trainbenchmark-tool-rdf') - compile group: 'org.openrdf.sesame', name: 'sesame-model', version: sesameVersion - compile group: 'org.openrdf.sesame', name: 'sesame-repository-sail', version: sesameVersion - compile group: 'org.openrdf.sesame', name: 'sesame-runtime', version: sesameVersion - compile group: 'org.openrdf.sesame', name: 'sesame-sail-memory', version: sesameVersion - compile group: 'org.openrdf.sesame', name: 'sesame-repository-contextaware', version: sesameVersion - compile group: 'org.openrdf.sesame', name: 'sesame-rio-rdfxml', version: sesameVersion - compile group: 'org.openrdf.sesame', name: 'sesame-rio-turtle', version: sesameVersion -} diff --git a/trainbenchmark-tool-sesame/src/main/java/hu/bme/mit/trainbenchmark/benchmark/sesame/SesameBenchmarkMain.java b/trainbenchmark-tool-sesame/src/main/java/hu/bme/mit/trainbenchmark/benchmark/sesame/SesameBenchmarkMain.java deleted file mode 100644 index 13164e602..000000000 --- a/trainbenchmark-tool-sesame/src/main/java/hu/bme/mit/trainbenchmark/benchmark/sesame/SesameBenchmarkMain.java +++ /dev/null @@ -1,26 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2010-2015, Benedek Izso, Gabor Szarnyas, Istvan Rath and Daniel Varro - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Benedek Izso - initial API and implementation - * Gabor Szarnyas - initial API and implementation - *******************************************************************************/ - -package hu.bme.mit.trainbenchmark.benchmark.sesame; - -import hu.bme.mit.trainbenchmark.benchmark.config.BenchmarkConfig; -import hu.bme.mit.trainbenchmark.benchmark.sesame.config.SesameBenchmarkConfig; - -public class SesameBenchmarkMain { - - public static void main(final String[] args) throws Exception { - final SesameBenchmarkConfig sbc = BenchmarkConfig.fromFile(args[0], SesameBenchmarkConfig.class); - final SesameBenchmarkScenario scenario = new SesameBenchmarkScenario(sbc); - scenario.performBenchmark(); - } - -} diff --git a/trainbenchmark-tool-sesame/src/main/java/hu/bme/mit/trainbenchmark/benchmark/sesame/SesameBenchmarkScenario.java b/trainbenchmark-tool-sesame/src/main/java/hu/bme/mit/trainbenchmark/benchmark/sesame/SesameBenchmarkScenario.java deleted file mode 100644 index ae38bc64a..000000000 --- a/trainbenchmark-tool-sesame/src/main/java/hu/bme/mit/trainbenchmark/benchmark/sesame/SesameBenchmarkScenario.java +++ /dev/null @@ -1,18 +0,0 @@ -package hu.bme.mit.trainbenchmark.benchmark.sesame; - -import hu.bme.mit.trainbenchmark.benchmark.phases.BenchmarkScenario; -import hu.bme.mit.trainbenchmark.benchmark.sesame.comparators.SesameMatchComparator; -import hu.bme.mit.trainbenchmark.benchmark.sesame.config.SesameBenchmarkConfig; -import hu.bme.mit.trainbenchmark.benchmark.sesame.driver.SesameDriver; -import hu.bme.mit.trainbenchmark.benchmark.sesame.driver.SesameDriverFactory; -import hu.bme.mit.trainbenchmark.benchmark.sesame.matches.SesameMatch; -import hu.bme.mit.trainbenchmark.benchmark.sesame.operations.SesameModelOperationFactory; - -public class SesameBenchmarkScenario - extends BenchmarkScenario<SesameMatch, SesameDriver, SesameBenchmarkConfig> { - - public SesameBenchmarkScenario(final SesameBenchmarkConfig sbc) throws Exception { - super(new SesameDriverFactory(sbc.isInferencing()), new SesameModelOperationFactory<SesameDriver>(), new SesameMatchComparator(), sbc); - } - -} diff --git a/trainbenchmark-tool-sesame/src/main/java/hu/bme/mit/trainbenchmark/benchmark/sesame/comparators/SesameMatchComparator.java b/trainbenchmark-tool-sesame/src/main/java/hu/bme/mit/trainbenchmark/benchmark/sesame/comparators/SesameMatchComparator.java deleted file mode 100644 index b0efd9487..000000000 --- a/trainbenchmark-tool-sesame/src/main/java/hu/bme/mit/trainbenchmark/benchmark/sesame/comparators/SesameMatchComparator.java +++ /dev/null @@ -1,25 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2010-2015, Benedek Izso, Gabor Szarnyas, Istvan Rath and Daniel Varro - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Benedek Izso - initial API and implementation - * Gabor Szarnyas - initial API and implementation - *******************************************************************************/ -package hu.bme.mit.trainbenchmark.benchmark.sesame.comparators; - -import org.openrdf.model.URI; - -import hu.bme.mit.trainbenchmark.benchmark.matches.comparators.BaseMatchComparator; -import hu.bme.mit.trainbenchmark.benchmark.sesame.matches.SesameMatch; - -public class SesameMatchComparator extends BaseMatchComparator<SesameMatch, URI> { - - public SesameMatchComparator() { - super(new UriComparator()); - } - -} diff --git a/trainbenchmark-tool-sesame/src/main/java/hu/bme/mit/trainbenchmark/benchmark/sesame/comparators/UriComparator.java b/trainbenchmark-tool-sesame/src/main/java/hu/bme/mit/trainbenchmark/benchmark/sesame/comparators/UriComparator.java deleted file mode 100644 index 87ade7df6..000000000 --- a/trainbenchmark-tool-sesame/src/main/java/hu/bme/mit/trainbenchmark/benchmark/sesame/comparators/UriComparator.java +++ /dev/null @@ -1,27 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2010-2015, Benedek Izso, Gabor Szarnyas, Istvan Rath and Daniel Varro - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Benedek Izso - initial API and implementation - * Gabor Szarnyas - initial API and implementation - *******************************************************************************/ -package hu.bme.mit.trainbenchmark.benchmark.sesame.comparators; - -import java.util.Comparator; - -import org.openrdf.model.URI; - -public class UriComparator implements Comparator<URI> { - - @Override - public int compare(final URI uri1, final URI uri2) { - final long id1 = Long.parseLong(uri1.getLocalName().substring(1)); - final long id2 = Long.parseLong(uri2.getLocalName().substring(1)); - return Long.compare(id1, id2); - } - -} diff --git a/trainbenchmark-tool-sesame/src/main/java/hu/bme/mit/trainbenchmark/benchmark/sesame/config/SesameBenchmarkConfig.java b/trainbenchmark-tool-sesame/src/main/java/hu/bme/mit/trainbenchmark/benchmark/sesame/config/SesameBenchmarkConfig.java deleted file mode 100644 index 78d0aa7a5..000000000 --- a/trainbenchmark-tool-sesame/src/main/java/hu/bme/mit/trainbenchmark/benchmark/sesame/config/SesameBenchmarkConfig.java +++ /dev/null @@ -1,34 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2010-2015, Benedek Izso, Gabor Szarnyas, Istvan Rath and Daniel Varro - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Benedek Izso - initial API and implementation - * Gabor Szarnyas - initial API and implementation - *******************************************************************************/ - -package hu.bme.mit.trainbenchmark.benchmark.sesame.config; - -import hu.bme.mit.trainbenchmark.benchmark.config.BenchmarkConfigBase; -import hu.bme.mit.trainbenchmark.benchmark.rdf.config.RdfBenchmarkConfig; - -public class SesameBenchmarkConfig extends RdfBenchmarkConfig { - - protected SesameBenchmarkConfig(final BenchmarkConfigBase configBase, final boolean inferencing) { - super(configBase, inferencing); - } - - @Override - public String getToolName() { - return "Sesame" + getToolNamePostfix(); - } - - @Override - public String getProjectName() { - return "sesame"; - } - -} diff --git a/trainbenchmark-tool-sesame/src/main/java/hu/bme/mit/trainbenchmark/benchmark/sesame/config/SesameBenchmarkConfigBuilder.java b/trainbenchmark-tool-sesame/src/main/java/hu/bme/mit/trainbenchmark/benchmark/sesame/config/SesameBenchmarkConfigBuilder.java deleted file mode 100644 index 3fd39b1d6..000000000 --- a/trainbenchmark-tool-sesame/src/main/java/hu/bme/mit/trainbenchmark/benchmark/sesame/config/SesameBenchmarkConfigBuilder.java +++ /dev/null @@ -1,14 +0,0 @@ -package hu.bme.mit.trainbenchmark.benchmark.sesame.config; - -import hu.bme.mit.trainbenchmark.benchmark.rdf.config.RdfBenchmarkConfigBuilder; - -public class SesameBenchmarkConfigBuilder - extends RdfBenchmarkConfigBuilder<SesameBenchmarkConfig, SesameBenchmarkConfigBuilder> { - - @Override - public SesameBenchmarkConfig createConfig() { - checkNotNulls(); - return new SesameBenchmarkConfig(configBase, inferencing); - } - -} diff --git a/trainbenchmark-tool-sesame/src/main/java/hu/bme/mit/trainbenchmark/benchmark/sesame/driver/SesameDriver.java b/trainbenchmark-tool-sesame/src/main/java/hu/bme/mit/trainbenchmark/benchmark/sesame/driver/SesameDriver.java deleted file mode 100644 index af76f4e52..000000000 --- a/trainbenchmark-tool-sesame/src/main/java/hu/bme/mit/trainbenchmark/benchmark/sesame/driver/SesameDriver.java +++ /dev/null @@ -1,179 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2010-2015, Benedek Izso, Gabor Szarnyas, Istvan Rath and Daniel Varro - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Benedek Izso - initial API and implementation - * Gabor Szarnyas - initial API and implementation - *******************************************************************************/ -package hu.bme.mit.trainbenchmark.benchmark.sesame.driver; - -import static hu.bme.mit.trainbenchmark.rdf.RdfConstants.BASE_PREFIX; - -import java.io.File; -import java.io.IOException; -import java.util.ArrayList; -import java.util.Collection; -import java.util.Comparator; -import java.util.List; - -import org.openrdf.OpenRDFException; -import org.openrdf.model.Statement; -import org.openrdf.model.URI; -import org.openrdf.model.ValueFactory; -import org.openrdf.query.BindingSet; -import org.openrdf.query.BooleanQuery; -import org.openrdf.query.MalformedQueryException; -import org.openrdf.query.QueryEvaluationException; -import org.openrdf.query.QueryLanguage; -import org.openrdf.query.TupleQuery; -import org.openrdf.query.TupleQueryResult; -import org.openrdf.repository.Repository; -import org.openrdf.repository.RepositoryConnection; -import org.openrdf.repository.RepositoryException; -import org.openrdf.repository.RepositoryResult; -import org.openrdf.repository.sail.SailRepository; -import org.openrdf.rio.RDFFormat; -import org.openrdf.rio.RDFParseException; -import org.openrdf.sail.inferencer.fc.ForwardChainingRDFSInferencer; -import org.openrdf.sail.memory.MemoryStore; - -import hu.bme.mit.trainbenchmark.benchmark.rdf.driver.RdfDriver; -import hu.bme.mit.trainbenchmark.benchmark.sesame.comparators.UriComparator; -import hu.bme.mit.trainbenchmark.benchmark.sesame.matches.SesameMatch; -import hu.bme.mit.trainbenchmark.constants.RailwayQuery; -import hu.bme.mit.trainbenchmark.rdf.RdfConstants; - -public class SesameDriver extends RdfDriver { - - protected RepositoryConnection connection; - protected Repository repository; - protected ValueFactory vf; - - protected final Comparator<URI> elementComparator = new UriComparator(); - - public SesameDriver(final boolean inferencing) { - super(inferencing); - } - - @Override - public void beginTransaction() { - } - - @Override - public void finishTransaction() throws RepositoryException { - connection.commit(); - } - - @Override - public void read(final String modelPath) - throws RepositoryException, RDFParseException, IOException, OpenRDFException { - if (inferencing) { - repository = new SailRepository(new ForwardChainingRDFSInferencer(new MemoryStore())); - } else { - repository = new SailRepository(new MemoryStore()); - } - - final File modelFile = new File(modelPath); - - repository.initialize(); - vf = repository.getValueFactory(); - connection = repository.getConnection(); - connection.add(modelFile, RdfConstants.BASE_PREFIX, RDFFormat.TURTLE); - } - - public Collection<? extends SesameMatch> runQuery(final RailwayQuery query, final String queryDefinition) - throws RepositoryException, MalformedQueryException, QueryEvaluationException { - final Collection<SesameMatch> results = new ArrayList<>(); - - final TupleQuery tupleQuery = connection.prepareTupleQuery(QueryLanguage.SPARQL, queryDefinition); - final TupleQueryResult queryResults = tupleQuery.evaluate(); - try { - while (queryResults.hasNext()) { - final BindingSet bs = queryResults.next(); - final SesameMatch match = SesameMatch.createMatch(query, bs); - results.add(match); - } - } finally { - queryResults.close(); - } - - return results; - } - - @Override - public void destroy() throws Exception { - if (connection != null) { - connection.clear(); - connection.close(); - } - } - - // delete - - public void deleteSingleOutgoingEdge(final Collection<URI> vertices, final String vertexType, final String edgeType) - throws RepositoryException { - deleteEdges(vertices, edgeType, true, false); - } - - public void deleteOutgoingEdges(final Collection<URI> vertices, final String vertexType, final String edgeType) - throws RepositoryException { - deleteEdges(vertices, edgeType, true, true); - } - - protected void deleteEdges(final Collection<URI> vertices, final String edgeType, final boolean outgoing, - final boolean all) throws RepositoryException { - final List<Statement> itemsToRemove = new ArrayList<>(); - - final URI edge = vf.createURI(BASE_PREFIX + edgeType); - - for (final URI vertex : vertices) { - final RepositoryResult<Statement> statementsToRemove; - if (outgoing) { - statementsToRemove = connection.getStatements(vertex, edge, null, true); - } else { - statementsToRemove = connection.getStatements(null, edge, vertex, true); - } - - while (statementsToRemove.hasNext()) { - final Statement s = statementsToRemove.next(); - itemsToRemove.add(s); - - // break if we only want to delete one edge - if (!all) { - break; - } - } - - for (final Statement s : itemsToRemove) { - connection.remove(s); - } - } - } - - // utility - - @Override - protected boolean ask(final String askQuery) - throws RepositoryException, MalformedQueryException, QueryEvaluationException { - final BooleanQuery q = connection.prepareBooleanQuery(QueryLanguage.SPARQL, askQuery); - final boolean result = q.evaluate(); - return result; - } - - public RepositoryConnection getConnection() { - return connection; - } - - public ValueFactory getValueFactory() { - return vf; - } - - public boolean isInferencing() { - return inferencing; - } - -} diff --git a/trainbenchmark-tool-sesame/src/main/java/hu/bme/mit/trainbenchmark/benchmark/sesame/driver/SesameDriverFactory.java b/trainbenchmark-tool-sesame/src/main/java/hu/bme/mit/trainbenchmark/benchmark/sesame/driver/SesameDriverFactory.java deleted file mode 100644 index c6e28c3fe..000000000 --- a/trainbenchmark-tool-sesame/src/main/java/hu/bme/mit/trainbenchmark/benchmark/sesame/driver/SesameDriverFactory.java +++ /dev/null @@ -1,16 +0,0 @@ -package hu.bme.mit.trainbenchmark.benchmark.sesame.driver; - -import hu.bme.mit.trainbenchmark.benchmark.rdf.driver.RdfDriverFactory; - -public class SesameDriverFactory extends RdfDriverFactory<SesameDriver> { - - public SesameDriverFactory(final boolean inferencing) { - super(inferencing); - } - - @Override - public SesameDriver createInstance() throws Exception { - return new SesameDriver(inferencing); - } - -} diff --git a/trainbenchmark-tool-sesame/src/main/java/hu/bme/mit/trainbenchmark/benchmark/sesame/matches/SesameConnectedSegmentsInjectMatch.java b/trainbenchmark-tool-sesame/src/main/java/hu/bme/mit/trainbenchmark/benchmark/sesame/matches/SesameConnectedSegmentsInjectMatch.java deleted file mode 100644 index 7b8ab792f..000000000 --- a/trainbenchmark-tool-sesame/src/main/java/hu/bme/mit/trainbenchmark/benchmark/sesame/matches/SesameConnectedSegmentsInjectMatch.java +++ /dev/null @@ -1,44 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2010-2015, Benedek Izso, Gabor Szarnyas, Istvan Rath and Daniel Varro - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Benedek Izso - initial API and implementation - * Gabor Szarnyas - initial API and implementation - *******************************************************************************/ -package hu.bme.mit.trainbenchmark.benchmark.sesame.matches; - -import static hu.bme.mit.trainbenchmark.constants.QueryConstants.VAR_SEGMENT1; -import static hu.bme.mit.trainbenchmark.constants.QueryConstants.VAR_SEGMENT3; -import static hu.bme.mit.trainbenchmark.constants.QueryConstants.VAR_SENSOR; - -import org.openrdf.model.URI; -import org.openrdf.query.BindingSet; - -import hu.bme.mit.trainbenchmark.benchmark.matches.ConnectedSegmentsInjectMatch; - -public class SesameConnectedSegmentsInjectMatch extends SesameMatch implements ConnectedSegmentsInjectMatch { - - public SesameConnectedSegmentsInjectMatch(final BindingSet bs) { - super(bs); - } - - @Override - public URI getSensor() { - return (URI) bs.getValue(VAR_SENSOR); - } - - @Override - public URI getSegment1() { - return (URI) bs.getValue(VAR_SEGMENT1); - } - - @Override - public URI getSegment3() { - return (URI) bs.getValue(VAR_SEGMENT3); - } - -} diff --git a/trainbenchmark-tool-sesame/src/main/java/hu/bme/mit/trainbenchmark/benchmark/sesame/matches/SesameConnectedSegmentsMatch.java b/trainbenchmark-tool-sesame/src/main/java/hu/bme/mit/trainbenchmark/benchmark/sesame/matches/SesameConnectedSegmentsMatch.java deleted file mode 100644 index 771e5bd09..000000000 --- a/trainbenchmark-tool-sesame/src/main/java/hu/bme/mit/trainbenchmark/benchmark/sesame/matches/SesameConnectedSegmentsMatch.java +++ /dev/null @@ -1,68 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2010-2015, Benedek Izso, Gabor Szarnyas, Istvan Rath and Daniel Varro - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Benedek Izso - initial API and implementation - * Gabor Szarnyas - initial API and implementation - *******************************************************************************/ -package hu.bme.mit.trainbenchmark.benchmark.sesame.matches; - -import static hu.bme.mit.trainbenchmark.constants.QueryConstants.VAR_SEGMENT1; -import static hu.bme.mit.trainbenchmark.constants.QueryConstants.VAR_SEGMENT2; -import static hu.bme.mit.trainbenchmark.constants.QueryConstants.VAR_SEGMENT3; -import static hu.bme.mit.trainbenchmark.constants.QueryConstants.VAR_SEGMENT4; -import static hu.bme.mit.trainbenchmark.constants.QueryConstants.VAR_SEGMENT5; -import static hu.bme.mit.trainbenchmark.constants.QueryConstants.VAR_SEGMENT6; -import static hu.bme.mit.trainbenchmark.constants.QueryConstants.VAR_SENSOR; - -import org.openrdf.model.URI; -import org.openrdf.query.BindingSet; - -import hu.bme.mit.trainbenchmark.benchmark.matches.ConnectedSegmentsMatch; - -public class SesameConnectedSegmentsMatch extends SesameMatch implements ConnectedSegmentsMatch { - - public SesameConnectedSegmentsMatch(final BindingSet bs) { - super(bs); - } - - @Override - public URI getSensor() { - return (URI) bs.getValue(VAR_SENSOR); - } - - @Override - public URI getSegment1() { - return (URI) bs.getValue(VAR_SEGMENT1); - } - - @Override - public URI getSegment2() { - return (URI) bs.getValue(VAR_SEGMENT2); - } - - @Override - public URI getSegment3() { - return (URI) bs.getValue(VAR_SEGMENT3); - } - - @Override - public URI getSegment4() { - return (URI) bs.getValue(VAR_SEGMENT4); - } - - @Override - public URI getSegment5() { - return (URI) bs.getValue(VAR_SEGMENT5); - } - - @Override - public URI getSegment6() { - return (URI) bs.getValue(VAR_SEGMENT6); - } - -} diff --git a/trainbenchmark-tool-sesame/src/main/java/hu/bme/mit/trainbenchmark/benchmark/sesame/matches/SesameMatch.java b/trainbenchmark-tool-sesame/src/main/java/hu/bme/mit/trainbenchmark/benchmark/sesame/matches/SesameMatch.java deleted file mode 100644 index c4ce17a6c..000000000 --- a/trainbenchmark-tool-sesame/src/main/java/hu/bme/mit/trainbenchmark/benchmark/sesame/matches/SesameMatch.java +++ /dev/null @@ -1,58 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2010-2015, Benedek Izso, Gabor Szarnyas, Istvan Rath and Daniel Varro - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Benedek Izso - initial API and implementation - * Gabor Szarnyas - initial API and implementation - *******************************************************************************/ -package hu.bme.mit.trainbenchmark.benchmark.sesame.matches; - -import org.openrdf.query.BindingSet; - -import hu.bme.mit.trainbenchmark.benchmark.matches.BaseMatch; -import hu.bme.mit.trainbenchmark.constants.RailwayQuery; - -public abstract class SesameMatch extends BaseMatch { - - protected BindingSet bs; - - public SesameMatch(final BindingSet bs) { - this.bs = bs; - } - - public static SesameMatch createMatch(final RailwayQuery query, final BindingSet bs) { - switch (query) { - case CONNECTEDSEGMENTS: - return new SesameConnectedSegmentsMatch(bs); - case CONNECTEDSEGMENTS_INJECT: - return new SesameConnectedSegmentsInjectMatch(bs); - case POSLENGTH: - return new SesamePosLengthMatch(bs); - case POSLENGTH_INJECT: - return new SesamePosLengthInjectMatch(bs); - case ROUTESENSOR: - return new SesameRouteSensorMatch(bs); - case ROUTESENSOR_INJECT: - return new SesameRouteSensorInjectMatch(bs); - case SEMAPHORENEIGHBOR: - return new SesameSemaphoreNeighborMatch(bs); - case SEMAPHORENEIGHBOR_INJECT: - return new SesameSemaphoreNeighborInjectMatch(bs); - case SWITCHMONITORED: - return new SesameSwitchMonitoredMatch(bs); - case SWITCHMONITORED_INJECT: - return new SesameSwitchMonitoredInjectMatch(bs); - case SWITCHSET: - return new SesameSwitchSetMatch(bs); - case SWITCHSET_INJECT: - return new SesameSwitchSetInjectMatch(bs); - default: - throw new UnsupportedOperationException("Pattern not supported: " + query); - } - } - -} diff --git a/trainbenchmark-tool-sesame/src/main/java/hu/bme/mit/trainbenchmark/benchmark/sesame/matches/SesamePosLengthInjectMatch.java b/trainbenchmark-tool-sesame/src/main/java/hu/bme/mit/trainbenchmark/benchmark/sesame/matches/SesamePosLengthInjectMatch.java deleted file mode 100644 index b9643f447..000000000 --- a/trainbenchmark-tool-sesame/src/main/java/hu/bme/mit/trainbenchmark/benchmark/sesame/matches/SesamePosLengthInjectMatch.java +++ /dev/null @@ -1,38 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2010-2015, Benedek Izso, Gabor Szarnyas, Istvan Rath and Daniel Varro - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Benedek Izso - initial API and implementation - * Gabor Szarnyas - initial API and implementation - *******************************************************************************/ -package hu.bme.mit.trainbenchmark.benchmark.sesame.matches; - -import static hu.bme.mit.trainbenchmark.constants.QueryConstants.VAR_LENGTH; -import static hu.bme.mit.trainbenchmark.constants.QueryConstants.VAR_SEGMENT; - -import org.openrdf.model.URI; -import org.openrdf.model.Value; -import org.openrdf.query.BindingSet; - -import hu.bme.mit.trainbenchmark.benchmark.matches.PosLengthMatch; - -public class SesamePosLengthInjectMatch extends SesameMatch implements PosLengthMatch { - - public SesamePosLengthInjectMatch(final BindingSet bs) { - super(bs); - } - - @Override - public URI getSegment() { - return (URI) bs.getValue(VAR_SEGMENT); - } - - public Value getLength() { - return bs.getValue(VAR_LENGTH); - } - -} diff --git a/trainbenchmark-tool-sesame/src/main/java/hu/bme/mit/trainbenchmark/benchmark/sesame/matches/SesamePosLengthMatch.java b/trainbenchmark-tool-sesame/src/main/java/hu/bme/mit/trainbenchmark/benchmark/sesame/matches/SesamePosLengthMatch.java deleted file mode 100644 index ba52727ef..000000000 --- a/trainbenchmark-tool-sesame/src/main/java/hu/bme/mit/trainbenchmark/benchmark/sesame/matches/SesamePosLengthMatch.java +++ /dev/null @@ -1,38 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2010-2015, Benedek Izso, Gabor Szarnyas, Istvan Rath and Daniel Varro - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Benedek Izso - initial API and implementation - * Gabor Szarnyas - initial API and implementation - *******************************************************************************/ -package hu.bme.mit.trainbenchmark.benchmark.sesame.matches; - -import static hu.bme.mit.trainbenchmark.constants.QueryConstants.VAR_LENGTH; -import static hu.bme.mit.trainbenchmark.constants.QueryConstants.VAR_SEGMENT; - -import org.openrdf.model.URI; -import org.openrdf.model.Value; -import org.openrdf.query.BindingSet; - -import hu.bme.mit.trainbenchmark.benchmark.matches.PosLengthMatch; - -public class SesamePosLengthMatch extends SesameMatch implements PosLengthMatch { - - public SesamePosLengthMatch(final BindingSet bs) { - super(bs); - } - - @Override - public URI getSegment() { - return (URI) bs.getValue(VAR_SEGMENT); - } - - public Value getLength() { - return bs.getValue(VAR_LENGTH); - } - -} diff --git a/trainbenchmark-tool-sesame/src/main/java/hu/bme/mit/trainbenchmark/benchmark/sesame/matches/SesameRouteSensorInjectMatch.java b/trainbenchmark-tool-sesame/src/main/java/hu/bme/mit/trainbenchmark/benchmark/sesame/matches/SesameRouteSensorInjectMatch.java deleted file mode 100644 index 3b83c1c26..000000000 --- a/trainbenchmark-tool-sesame/src/main/java/hu/bme/mit/trainbenchmark/benchmark/sesame/matches/SesameRouteSensorInjectMatch.java +++ /dev/null @@ -1,38 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2010-2015, Benedek Izso, Gabor Szarnyas, Istvan Rath and Daniel Varro - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Benedek Izso - initial API and implementation - * Gabor Szarnyas - initial API and implementation - *******************************************************************************/ -package hu.bme.mit.trainbenchmark.benchmark.sesame.matches; - -import static hu.bme.mit.trainbenchmark.constants.QueryConstants.VAR_ROUTE; -import static hu.bme.mit.trainbenchmark.constants.QueryConstants.VAR_SENSOR; - -import org.openrdf.model.URI; -import org.openrdf.query.BindingSet; - -import hu.bme.mit.trainbenchmark.benchmark.matches.RouteSensorInjectMatch; - -public class SesameRouteSensorInjectMatch extends SesameMatch implements RouteSensorInjectMatch { - - public SesameRouteSensorInjectMatch(final BindingSet bs) { - super(bs); - } - - @Override - public URI getRoute() { - return (URI) bs.getValue(VAR_ROUTE); - } - - @Override - public URI getSensor() { - return (URI) bs.getValue(VAR_SENSOR); - } - -} diff --git a/trainbenchmark-tool-sesame/src/main/java/hu/bme/mit/trainbenchmark/benchmark/sesame/matches/SesameRouteSensorMatch.java b/trainbenchmark-tool-sesame/src/main/java/hu/bme/mit/trainbenchmark/benchmark/sesame/matches/SesameRouteSensorMatch.java deleted file mode 100644 index 5e01dc5b9..000000000 --- a/trainbenchmark-tool-sesame/src/main/java/hu/bme/mit/trainbenchmark/benchmark/sesame/matches/SesameRouteSensorMatch.java +++ /dev/null @@ -1,50 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2010-2015, Benedek Izso, Gabor Szarnyas, Istvan Rath and Daniel Varro - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Benedek Izso - initial API and implementation - * Gabor Szarnyas - initial API and implementation - *******************************************************************************/ -package hu.bme.mit.trainbenchmark.benchmark.sesame.matches; - -import static hu.bme.mit.trainbenchmark.constants.QueryConstants.VAR_ROUTE; -import static hu.bme.mit.trainbenchmark.constants.QueryConstants.VAR_SENSOR; -import static hu.bme.mit.trainbenchmark.constants.QueryConstants.VAR_SW; -import static hu.bme.mit.trainbenchmark.constants.QueryConstants.VAR_SWP; - -import org.openrdf.model.URI; -import org.openrdf.query.BindingSet; - -import hu.bme.mit.trainbenchmark.benchmark.matches.RouteSensorMatch; - -public class SesameRouteSensorMatch extends SesameMatch implements RouteSensorMatch { - - public SesameRouteSensorMatch(final BindingSet bs) { - super(bs); - } - - @Override - public URI getRoute() { - return (URI) bs.getValue(VAR_ROUTE); - } - - @Override - public URI getSensor() { - return (URI) bs.getValue(VAR_SENSOR); - } - - @Override - public URI getSwP() { - return (URI) bs.getValue(VAR_SWP); - } - - @Override - public URI getSw() { - return (URI) bs.getValue(VAR_SW); - } - -} diff --git a/trainbenchmark-tool-sesame/src/main/java/hu/bme/mit/trainbenchmark/benchmark/sesame/matches/SesameSemaphoreNeighborInjectMatch.java b/trainbenchmark-tool-sesame/src/main/java/hu/bme/mit/trainbenchmark/benchmark/sesame/matches/SesameSemaphoreNeighborInjectMatch.java deleted file mode 100644 index 7cf8e5ff8..000000000 --- a/trainbenchmark-tool-sesame/src/main/java/hu/bme/mit/trainbenchmark/benchmark/sesame/matches/SesameSemaphoreNeighborInjectMatch.java +++ /dev/null @@ -1,38 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2010-2015, Benedek Izso, Gabor Szarnyas, Istvan Rath and Daniel Varro - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Benedek Izso - initial API and implementation - * Gabor Szarnyas - initial API and implementation - *******************************************************************************/ -package hu.bme.mit.trainbenchmark.benchmark.sesame.matches; - -import static hu.bme.mit.trainbenchmark.constants.QueryConstants.VAR_ROUTE; -import static hu.bme.mit.trainbenchmark.constants.QueryConstants.VAR_SEMAPHORE; - -import org.openrdf.model.URI; -import org.openrdf.query.BindingSet; - -import hu.bme.mit.trainbenchmark.benchmark.matches.SemaphoreNeighborInjectMatch; - -public class SesameSemaphoreNeighborInjectMatch extends SesameMatch implements SemaphoreNeighborInjectMatch { - - public SesameSemaphoreNeighborInjectMatch(final BindingSet bs) { - super(bs); - } - - @Override - public URI getRoute() { - return (URI) bs.getValue(VAR_ROUTE); - } - - @Override - public URI getSemaphore() { - return (URI) bs.getValue(VAR_SEMAPHORE); - } - -} diff --git a/trainbenchmark-tool-sesame/src/main/java/hu/bme/mit/trainbenchmark/benchmark/sesame/matches/SesameSemaphoreNeighborMatch.java b/trainbenchmark-tool-sesame/src/main/java/hu/bme/mit/trainbenchmark/benchmark/sesame/matches/SesameSemaphoreNeighborMatch.java deleted file mode 100644 index 7624f9165..000000000 --- a/trainbenchmark-tool-sesame/src/main/java/hu/bme/mit/trainbenchmark/benchmark/sesame/matches/SesameSemaphoreNeighborMatch.java +++ /dev/null @@ -1,68 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2010-2015, Benedek Izso, Gabor Szarnyas, Istvan Rath and Daniel Varro - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Benedek Izso - initial API and implementation - * Gabor Szarnyas - initial API and implementation - *******************************************************************************/ -package hu.bme.mit.trainbenchmark.benchmark.sesame.matches; - -import static hu.bme.mit.trainbenchmark.constants.QueryConstants.VAR_ROUTE1; -import static hu.bme.mit.trainbenchmark.constants.QueryConstants.VAR_ROUTE2; -import static hu.bme.mit.trainbenchmark.constants.QueryConstants.VAR_SEMAPHORE; -import static hu.bme.mit.trainbenchmark.constants.QueryConstants.VAR_SENSOR1; -import static hu.bme.mit.trainbenchmark.constants.QueryConstants.VAR_SENSOR2; -import static hu.bme.mit.trainbenchmark.constants.QueryConstants.VAR_TE1; -import static hu.bme.mit.trainbenchmark.constants.QueryConstants.VAR_TE2; - -import org.openrdf.model.URI; -import org.openrdf.query.BindingSet; - -import hu.bme.mit.trainbenchmark.benchmark.matches.SemaphoreNeighborMatch; - -public class SesameSemaphoreNeighborMatch extends SesameMatch implements SemaphoreNeighborMatch { - - public SesameSemaphoreNeighborMatch(final BindingSet bs) { - super(bs); - } - - @Override - public URI getSemaphore() { - return (URI) bs.getValue(VAR_SEMAPHORE); - } - - @Override - public URI getRoute1() { - return (URI) bs.getValue(VAR_ROUTE1); - } - - @Override - public URI getRoute2() { - return (URI) bs.getValue(VAR_ROUTE2); - } - - @Override - public URI getSensor1() { - return (URI) bs.getValue(VAR_SENSOR1); - } - - @Override - public URI getSensor2() { - return (URI) bs.getValue(VAR_SENSOR2); - } - - @Override - public URI getTe1() { - return (URI) bs.getValue(VAR_TE1); - } - - @Override - public URI getTe2() { - return (URI) bs.getValue(VAR_TE2); - } - -} diff --git a/trainbenchmark-tool-sesame/src/main/java/hu/bme/mit/trainbenchmark/benchmark/sesame/matches/SesameSwitchMonitoredInjectMatch.java b/trainbenchmark-tool-sesame/src/main/java/hu/bme/mit/trainbenchmark/benchmark/sesame/matches/SesameSwitchMonitoredInjectMatch.java deleted file mode 100644 index e09790fbf..000000000 --- a/trainbenchmark-tool-sesame/src/main/java/hu/bme/mit/trainbenchmark/benchmark/sesame/matches/SesameSwitchMonitoredInjectMatch.java +++ /dev/null @@ -1,32 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2010-2015, Benedek Izso, Gabor Szarnyas, Istvan Rath and Daniel Varro - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Benedek Izso - initial API and implementation - * Gabor Szarnyas - initial API and implementation - *******************************************************************************/ -package hu.bme.mit.trainbenchmark.benchmark.sesame.matches; - -import static hu.bme.mit.trainbenchmark.constants.QueryConstants.VAR_SW; - -import org.openrdf.model.URI; -import org.openrdf.query.BindingSet; - -import hu.bme.mit.trainbenchmark.benchmark.matches.SwitchMonitoredInjectMatch; - -public class SesameSwitchMonitoredInjectMatch extends SesameMatch implements SwitchMonitoredInjectMatch { - - public SesameSwitchMonitoredInjectMatch(final BindingSet bs) { - super(bs); - } - - @Override - public URI getSw() { - return (URI) bs.getValue(VAR_SW); - } - -} diff --git a/trainbenchmark-tool-sesame/src/main/java/hu/bme/mit/trainbenchmark/benchmark/sesame/matches/SesameSwitchMonitoredMatch.java b/trainbenchmark-tool-sesame/src/main/java/hu/bme/mit/trainbenchmark/benchmark/sesame/matches/SesameSwitchMonitoredMatch.java deleted file mode 100644 index 6306dcea3..000000000 --- a/trainbenchmark-tool-sesame/src/main/java/hu/bme/mit/trainbenchmark/benchmark/sesame/matches/SesameSwitchMonitoredMatch.java +++ /dev/null @@ -1,32 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2010-2015, Benedek Izso, Gabor Szarnyas, Istvan Rath and Daniel Varro - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Benedek Izso - initial API and implementation - * Gabor Szarnyas - initial API and implementation - *******************************************************************************/ -package hu.bme.mit.trainbenchmark.benchmark.sesame.matches; - -import static hu.bme.mit.trainbenchmark.constants.QueryConstants.VAR_SW; - -import org.openrdf.model.URI; -import org.openrdf.query.BindingSet; - -import hu.bme.mit.trainbenchmark.benchmark.matches.SwitchMonitoredMatch; - -public class SesameSwitchMonitoredMatch extends SesameMatch implements SwitchMonitoredMatch { - - public SesameSwitchMonitoredMatch(final BindingSet bs) { - super(bs); - } - - @Override - public URI getSw() { - return (URI) bs.getValue(VAR_SW); - } - -} diff --git a/trainbenchmark-tool-sesame/src/main/java/hu/bme/mit/trainbenchmark/benchmark/sesame/matches/SesameSwitchSetInjectMatch.java b/trainbenchmark-tool-sesame/src/main/java/hu/bme/mit/trainbenchmark/benchmark/sesame/matches/SesameSwitchSetInjectMatch.java deleted file mode 100644 index 0f0d4a9ae..000000000 --- a/trainbenchmark-tool-sesame/src/main/java/hu/bme/mit/trainbenchmark/benchmark/sesame/matches/SesameSwitchSetInjectMatch.java +++ /dev/null @@ -1,43 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2010-2015, Benedek Izso, Gabor Szarnyas, Istvan Rath and Daniel Varro - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Benedek Izso - initial API and implementation - * Gabor Szarnyas - initial API and implementation - *******************************************************************************/ -package hu.bme.mit.trainbenchmark.benchmark.sesame.matches; - -import static hu.bme.mit.trainbenchmark.constants.QueryConstants.VAR_CURRENTPOSITION; -import static hu.bme.mit.trainbenchmark.constants.QueryConstants.VAR_POSITION; -import static hu.bme.mit.trainbenchmark.constants.QueryConstants.VAR_SW; - -import org.openrdf.model.URI; -import org.openrdf.model.Value; -import org.openrdf.query.BindingSet; - -import hu.bme.mit.trainbenchmark.benchmark.matches.SwitchSetInjectMatch; - -public class SesameSwitchSetInjectMatch extends SesameMatch implements SwitchSetInjectMatch { - - public SesameSwitchSetInjectMatch(final BindingSet bs) { - super(bs); - } - - @Override - public URI getSw() { - return (URI) bs.getValue(VAR_SW); - } - - public Value getPosition() { - return bs.getValue(VAR_POSITION); - } - - public Value getCurrentPosition() { - return bs.getValue(VAR_CURRENTPOSITION); - } - -} diff --git a/trainbenchmark-tool-sesame/src/main/java/hu/bme/mit/trainbenchmark/benchmark/sesame/matches/SesameSwitchSetMatch.java b/trainbenchmark-tool-sesame/src/main/java/hu/bme/mit/trainbenchmark/benchmark/sesame/matches/SesameSwitchSetMatch.java deleted file mode 100644 index d22c0ed08..000000000 --- a/trainbenchmark-tool-sesame/src/main/java/hu/bme/mit/trainbenchmark/benchmark/sesame/matches/SesameSwitchSetMatch.java +++ /dev/null @@ -1,61 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2010-2015, Benedek Izso, Gabor Szarnyas, Istvan Rath and Daniel Varro - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Benedek Izso - initial API and implementation - * Gabor Szarnyas - initial API and implementation - *******************************************************************************/ -package hu.bme.mit.trainbenchmark.benchmark.sesame.matches; - -import static hu.bme.mit.trainbenchmark.constants.QueryConstants.VAR_CURRENTPOSITION; -import static hu.bme.mit.trainbenchmark.constants.QueryConstants.VAR_POSITION; -import static hu.bme.mit.trainbenchmark.constants.QueryConstants.VAR_ROUTE; -import static hu.bme.mit.trainbenchmark.constants.QueryConstants.VAR_SEMAPHORE; -import static hu.bme.mit.trainbenchmark.constants.QueryConstants.VAR_SW; -import static hu.bme.mit.trainbenchmark.constants.QueryConstants.VAR_SWP; - -import org.openrdf.model.URI; -import org.openrdf.model.Value; -import org.openrdf.query.BindingSet; - -import hu.bme.mit.trainbenchmark.benchmark.matches.SwitchSetMatch; - -public class SesameSwitchSetMatch extends SesameMatch implements SwitchSetMatch { - - public SesameSwitchSetMatch(final BindingSet bs) { - super(bs); - } - - @Override - public URI getSemaphore() { - return (URI) bs.getValue(VAR_SEMAPHORE); - } - - @Override - public URI getRoute() { - return (URI) bs.getValue(VAR_ROUTE); - } - - @Override - public URI getSwP() { - return (URI) bs.getValue(VAR_SWP); - } - - @Override - public URI getSw() { - return (URI) bs.getValue(VAR_SW); - } - - public Value getPosition() { - return bs.getValue(VAR_POSITION); - } - - public Value getCurrentPosition() { - return bs.getValue(VAR_CURRENTPOSITION); - } - -} diff --git a/trainbenchmark-tool-sesame/src/main/java/hu/bme/mit/trainbenchmark/benchmark/sesame/operations/SesameModelOperationFactory.java b/trainbenchmark-tool-sesame/src/main/java/hu/bme/mit/trainbenchmark/benchmark/sesame/operations/SesameModelOperationFactory.java deleted file mode 100644 index 30e675d27..000000000 --- a/trainbenchmark-tool-sesame/src/main/java/hu/bme/mit/trainbenchmark/benchmark/sesame/operations/SesameModelOperationFactory.java +++ /dev/null @@ -1,205 +0,0 @@ -package hu.bme.mit.trainbenchmark.benchmark.sesame.operations; - -import hu.bme.mit.trainbenchmark.benchmark.operations.ModelOperation; -import hu.bme.mit.trainbenchmark.benchmark.operations.ModelOperationFactory; -import hu.bme.mit.trainbenchmark.benchmark.sesame.driver.SesameDriver; -import hu.bme.mit.trainbenchmark.benchmark.sesame.matches.SesameConnectedSegmentsInjectMatch; -import hu.bme.mit.trainbenchmark.benchmark.sesame.matches.SesameConnectedSegmentsMatch; -import hu.bme.mit.trainbenchmark.benchmark.sesame.matches.SesameMatch; -import hu.bme.mit.trainbenchmark.benchmark.sesame.matches.SesamePosLengthInjectMatch; -import hu.bme.mit.trainbenchmark.benchmark.sesame.matches.SesamePosLengthMatch; -import hu.bme.mit.trainbenchmark.benchmark.sesame.matches.SesameRouteSensorInjectMatch; -import hu.bme.mit.trainbenchmark.benchmark.sesame.matches.SesameRouteSensorMatch; -import hu.bme.mit.trainbenchmark.benchmark.sesame.matches.SesameSemaphoreNeighborInjectMatch; -import hu.bme.mit.trainbenchmark.benchmark.sesame.matches.SesameSemaphoreNeighborMatch; -import hu.bme.mit.trainbenchmark.benchmark.sesame.matches.SesameSwitchMonitoredInjectMatch; -import hu.bme.mit.trainbenchmark.benchmark.sesame.matches.SesameSwitchMonitoredMatch; -import hu.bme.mit.trainbenchmark.benchmark.sesame.matches.SesameSwitchSetInjectMatch; -import hu.bme.mit.trainbenchmark.benchmark.sesame.matches.SesameSwitchSetMatch; -import hu.bme.mit.trainbenchmark.benchmark.sesame.queries.SesameQuery; -import hu.bme.mit.trainbenchmark.benchmark.sesame.transformations.SesameTransformation; -import hu.bme.mit.trainbenchmark.benchmark.sesame.transformations.inject.SesameTransformationInjectConnectedSegments; -import hu.bme.mit.trainbenchmark.benchmark.sesame.transformations.inject.SesameTransformationInjectPosLength; -import hu.bme.mit.trainbenchmark.benchmark.sesame.transformations.inject.SesameTransformationInjectRouteSensor; -import hu.bme.mit.trainbenchmark.benchmark.sesame.transformations.inject.SesameTransformationInjectSemaphoreNeighbor; -import hu.bme.mit.trainbenchmark.benchmark.sesame.transformations.inject.SesameTransformationInjectSwitchMonitored; -import hu.bme.mit.trainbenchmark.benchmark.sesame.transformations.inject.SesameTransformationInjectSwitchSet; -import hu.bme.mit.trainbenchmark.benchmark.sesame.transformations.repair.SesameTransformationRepairConnectedSegments; -import hu.bme.mit.trainbenchmark.benchmark.sesame.transformations.repair.SesameTransformationRepairPosLength; -import hu.bme.mit.trainbenchmark.benchmark.sesame.transformations.repair.SesameTransformationRepairRouteSensor; -import hu.bme.mit.trainbenchmark.benchmark.sesame.transformations.repair.SesameTransformationRepairSemaphoreNeighbor; -import hu.bme.mit.trainbenchmark.benchmark.sesame.transformations.repair.SesameTransformationRepairSwitchMonitored; -import hu.bme.mit.trainbenchmark.benchmark.sesame.transformations.repair.SesameTransformationRepairSwitchSet; -import hu.bme.mit.trainbenchmark.constants.RailwayOperation; -import hu.bme.mit.trainbenchmark.constants.RailwayQuery; - -public class SesameModelOperationFactory<TSesameDriver extends SesameDriver> - extends ModelOperationFactory<SesameMatch, TSesameDriver> { - - @Override - public ModelOperation<? extends SesameMatch, TSesameDriver> createOperation(final RailwayOperation operationEnum, - final String workspaceDir, final TSesameDriver driver) throws Exception { - switch (operationEnum) { - // ConnectedSegments - case CONNECTEDSEGMENTS: { - final SesameQuery<SesameConnectedSegmentsMatch, TSesameDriver> query = SesameQuery.create(driver, - workspaceDir, RailwayQuery.CONNECTEDSEGMENTS); - final ModelOperation<SesameConnectedSegmentsMatch, TSesameDriver> operation = ModelOperation.of(query); - return operation; - } - case CONNECTEDSEGMENTS_INJECT: { - final SesameQuery<SesameConnectedSegmentsInjectMatch, TSesameDriver> query = SesameQuery.create(driver, - workspaceDir, RailwayQuery.CONNECTEDSEGMENTS_INJECT); - final SesameTransformation<SesameConnectedSegmentsInjectMatch, TSesameDriver> transformation = new SesameTransformationInjectConnectedSegments<>( - driver); - final ModelOperation<SesameConnectedSegmentsInjectMatch, TSesameDriver> operation = ModelOperation.of(query, - transformation); - return operation; - - } - case CONNECTEDSEGMENTS_REPAIR: { - final SesameQuery<SesameConnectedSegmentsMatch, TSesameDriver> query = SesameQuery.create(driver, - workspaceDir, RailwayQuery.CONNECTEDSEGMENTS); - final SesameTransformation<SesameConnectedSegmentsMatch, TSesameDriver> transformation = new SesameTransformationRepairConnectedSegments<>( - driver); - final ModelOperation<SesameConnectedSegmentsMatch, TSesameDriver> operation = ModelOperation.of(query, - transformation); - return operation; - } - - // PosLength - case POSLENGTH: { - final SesameQuery<SesamePosLengthMatch, TSesameDriver> query = SesameQuery.create(driver, workspaceDir, - RailwayQuery.POSLENGTH); - final ModelOperation<SesamePosLengthMatch, TSesameDriver> operation = ModelOperation.of(query); - return operation; - } - case POSLENGTH_INJECT: { - final SesameQuery<SesamePosLengthInjectMatch, TSesameDriver> query = SesameQuery.create(driver, - workspaceDir, RailwayQuery.POSLENGTH_INJECT); - final SesameTransformation<SesamePosLengthInjectMatch, TSesameDriver> transformation = new SesameTransformationInjectPosLength<>( - driver); - final ModelOperation<SesamePosLengthInjectMatch, TSesameDriver> operation = ModelOperation.of(query, - transformation); - return operation; - } - case POSLENGTH_REPAIR: { - final SesameQuery<SesamePosLengthMatch, TSesameDriver> query = SesameQuery.create(driver, workspaceDir, - RailwayQuery.POSLENGTH); - final SesameTransformation<SesamePosLengthMatch, TSesameDriver> transformation = new SesameTransformationRepairPosLength<>( - driver); - final ModelOperation<SesamePosLengthMatch, TSesameDriver> operation = ModelOperation.of(query, - transformation); - return operation; - } - - // RouteSensor - case ROUTESENSOR: { - final SesameQuery<SesameRouteSensorMatch, TSesameDriver> query = SesameQuery.create(driver, workspaceDir, - RailwayQuery.ROUTESENSOR); - final ModelOperation<SesameRouteSensorMatch, TSesameDriver> operation = ModelOperation.of(query); - return operation; - } - case ROUTESENSOR_INJECT: { - final SesameQuery<SesameRouteSensorInjectMatch, TSesameDriver> query = SesameQuery.create(driver, - workspaceDir, RailwayQuery.ROUTESENSOR_INJECT); - final SesameTransformation<SesameRouteSensorInjectMatch, TSesameDriver> transformation = new SesameTransformationInjectRouteSensor<>( - driver); - final ModelOperation<SesameRouteSensorInjectMatch, TSesameDriver> operation = ModelOperation.of(query, - transformation); - return operation; - } - case ROUTESENSOR_REPAIR: { - final SesameQuery<SesameRouteSensorMatch, TSesameDriver> query = SesameQuery.create(driver, workspaceDir, - RailwayQuery.ROUTESENSOR); - final SesameTransformation<SesameRouteSensorMatch, TSesameDriver> transformation = new SesameTransformationRepairRouteSensor<>( - driver); - final ModelOperation<SesameRouteSensorMatch, TSesameDriver> operation = ModelOperation.of(query, - transformation); - return operation; - } - - // SemaphoreNeighbor - case SEMAPHORENEIGHBOR: { - final SesameQuery<SesameSemaphoreNeighborMatch, TSesameDriver> query = SesameQuery.create(driver, - workspaceDir, RailwayQuery.SEMAPHORENEIGHBOR); - final ModelOperation<SesameSemaphoreNeighborMatch, TSesameDriver> operation = ModelOperation.of(query); - return operation; - } - case SEMAPHORENEIGHBOR_INJECT: { - final SesameQuery<SesameSemaphoreNeighborInjectMatch, TSesameDriver> query = SesameQuery.create(driver, - workspaceDir, RailwayQuery.SEMAPHORENEIGHBOR_INJECT); - final SesameTransformation<SesameSemaphoreNeighborInjectMatch, TSesameDriver> transformation = new SesameTransformationInjectSemaphoreNeighbor<>( - driver); - final ModelOperation<SesameSemaphoreNeighborInjectMatch, TSesameDriver> operation = ModelOperation.of(query, - transformation); - return operation; - } - case SEMAPHORENEIGHBOR_REPAIR: { - final SesameQuery<SesameSemaphoreNeighborMatch, TSesameDriver> query = SesameQuery.create(driver, - workspaceDir, RailwayQuery.SEMAPHORENEIGHBOR); - final SesameTransformation<SesameSemaphoreNeighborMatch, TSesameDriver> transformation = new SesameTransformationRepairSemaphoreNeighbor<>( - driver); - final ModelOperation<SesameSemaphoreNeighborMatch, TSesameDriver> operation = ModelOperation.of(query, - transformation); - return operation; - } - - // SwitchMonitored - case SWITCHMONITORED: { - final SesameQuery<SesameSwitchMonitoredMatch, TSesameDriver> query = SesameQuery.create(driver, - workspaceDir, RailwayQuery.SWITCHMONITORED); - final ModelOperation<SesameSwitchMonitoredMatch, TSesameDriver> operation = ModelOperation.of(query); - return operation; - } - case SWITCHMONITORED_INJECT: { - final SesameQuery<SesameSwitchMonitoredInjectMatch, TSesameDriver> query = SesameQuery.create(driver, - workspaceDir, RailwayQuery.SWITCHMONITORED_INJECT); - final SesameTransformation<SesameSwitchMonitoredInjectMatch, TSesameDriver> transformation = new SesameTransformationInjectSwitchMonitored<>( - driver); - final ModelOperation<SesameSwitchMonitoredInjectMatch, TSesameDriver> operation = ModelOperation.of(query, - transformation); - return operation; - } - case SWITCHMONITORED_REPAIR: { - final SesameQuery<SesameSwitchMonitoredMatch, TSesameDriver> query = SesameQuery.create(driver, - workspaceDir, RailwayQuery.SWITCHMONITORED); - final SesameTransformation<SesameSwitchMonitoredMatch, TSesameDriver> transformation = new SesameTransformationRepairSwitchMonitored<>( - driver); - final ModelOperation<SesameSwitchMonitoredMatch, TSesameDriver> operation = ModelOperation.of(query, - transformation); - return operation; - } - - // SwitchSet - case SWITCHSET: { - final SesameQuery<SesameSwitchSetMatch, TSesameDriver> query = SesameQuery.create(driver, workspaceDir, - RailwayQuery.SWITCHSET); - final ModelOperation<SesameSwitchSetMatch, TSesameDriver> operation = ModelOperation.of(query); - return operation; - } - case SWITCHSET_INJECT: { - final SesameQuery<SesameSwitchSetInjectMatch, TSesameDriver> query = SesameQuery.create(driver, - workspaceDir, RailwayQuery.SWITCHSET_INJECT); - final SesameTransformation<SesameSwitchSetInjectMatch, TSesameDriver> transformation = new SesameTransformationInjectSwitchSet<>( - driver); - final ModelOperation<SesameSwitchSetInjectMatch, TSesameDriver> operation = ModelOperation.of(query, - transformation); - return operation; - } - case SWITCHSET_REPAIR: { - final SesameQuery<SesameSwitchSetMatch, TSesameDriver> query = SesameQuery.create(driver, workspaceDir, - RailwayQuery.SWITCHSET); - final SesameTransformation<SesameSwitchSetMatch, TSesameDriver> transformation = new SesameTransformationRepairSwitchSet<>( - driver); - final ModelOperation<SesameSwitchSetMatch, TSesameDriver> operation = ModelOperation.of(query, - transformation); - return operation; - } - - default: - throw new UnsupportedOperationException("Operation " + operationEnum + " not supported."); - } - } - -} diff --git a/trainbenchmark-tool-sesame/src/main/java/hu/bme/mit/trainbenchmark/benchmark/sesame/queries/SesameQuery.java b/trainbenchmark-tool-sesame/src/main/java/hu/bme/mit/trainbenchmark/benchmark/sesame/queries/SesameQuery.java deleted file mode 100644 index 4da69264d..000000000 --- a/trainbenchmark-tool-sesame/src/main/java/hu/bme/mit/trainbenchmark/benchmark/sesame/queries/SesameQuery.java +++ /dev/null @@ -1,50 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2010-2015, Benedek Izso, Gabor Szarnyas, Istvan Rath and Daniel Varro - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Benedek Izso - initial API and implementation - * Gabor Szarnyas - initial API and implementation - *******************************************************************************/ -package hu.bme.mit.trainbenchmark.benchmark.sesame.queries; - -import java.io.File; -import java.io.IOException; -import java.util.Collection; - -import org.apache.commons.io.FileUtils; -import org.openrdf.query.MalformedQueryException; -import org.openrdf.query.QueryEvaluationException; -import org.openrdf.repository.RepositoryException; - -import hu.bme.mit.trainbenchmark.benchmark.rdf.queries.RdfModelQuery; -import hu.bme.mit.trainbenchmark.benchmark.sesame.driver.SesameDriver; -import hu.bme.mit.trainbenchmark.constants.RailwayQuery; - -public class SesameQuery<TPatternMatch, TSesameDriver extends SesameDriver> - extends RdfModelQuery<TPatternMatch, TSesameDriver> { - - protected final String queryDefinition; - - public SesameQuery(final TSesameDriver driver, final String workspaceDir, final RailwayQuery query) - throws IOException { - super(driver, workspaceDir, query); - this.queryDefinition = FileUtils.readFileToString(new File(queryPath)); - } - - public static <TPatternMatch, TSesameDriver extends SesameDriver> SesameQuery<TPatternMatch, TSesameDriver> create( - final TSesameDriver driver, final String workspaceDir, final RailwayQuery query) throws IOException { - return new SesameQuery<TPatternMatch, TSesameDriver>(driver, workspaceDir, query); - } - - @SuppressWarnings("unchecked") - @Override - public Collection<TPatternMatch> evaluate() - throws RepositoryException, MalformedQueryException, QueryEvaluationException { - return (Collection<TPatternMatch>) driver.runQuery(query, queryDefinition); - } - -} diff --git a/trainbenchmark-tool-sesame/src/main/java/hu/bme/mit/trainbenchmark/benchmark/sesame/transformations/SesameTransformation.java b/trainbenchmark-tool-sesame/src/main/java/hu/bme/mit/trainbenchmark/benchmark/sesame/transformations/SesameTransformation.java deleted file mode 100644 index f5ea9f16a..000000000 --- a/trainbenchmark-tool-sesame/src/main/java/hu/bme/mit/trainbenchmark/benchmark/sesame/transformations/SesameTransformation.java +++ /dev/null @@ -1,25 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2010-2015, Benedek Izso, Gabor Szarnyas, Istvan Rath and Daniel Varro - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Benedek Izso - initial API and implementation - * Gabor Szarnyas - initial API and implementation - *******************************************************************************/ -package hu.bme.mit.trainbenchmark.benchmark.sesame.transformations; - -import hu.bme.mit.trainbenchmark.benchmark.operations.ModelTransformation; -import hu.bme.mit.trainbenchmark.benchmark.sesame.driver.SesameDriver; -import hu.bme.mit.trainbenchmark.benchmark.sesame.matches.SesameMatch; - -public abstract class SesameTransformation<TSesameMatch extends SesameMatch, TSesameDriver extends SesameDriver> - extends ModelTransformation<TSesameMatch, TSesameDriver> { - - protected SesameTransformation(final TSesameDriver driver) { - super(driver); - } - -} diff --git a/trainbenchmark-tool-sesame/src/main/java/hu/bme/mit/trainbenchmark/benchmark/sesame/transformations/inject/SesameTransformationInjectConnectedSegments.java b/trainbenchmark-tool-sesame/src/main/java/hu/bme/mit/trainbenchmark/benchmark/sesame/transformations/inject/SesameTransformationInjectConnectedSegments.java deleted file mode 100644 index ec8c98698..000000000 --- a/trainbenchmark-tool-sesame/src/main/java/hu/bme/mit/trainbenchmark/benchmark/sesame/transformations/inject/SesameTransformationInjectConnectedSegments.java +++ /dev/null @@ -1,71 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2010-2015, Benedek Izso, Gabor Szarnyas, Istvan Rath and Daniel Varro - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Benedek Izso - initial API and implementation - * Gabor Szarnyas - initial API and implementation - *******************************************************************************/ -package hu.bme.mit.trainbenchmark.benchmark.sesame.transformations.inject; - -import static hu.bme.mit.trainbenchmark.constants.ModelConstants.CONNECTS_TO; -import static hu.bme.mit.trainbenchmark.constants.ModelConstants.LENGTH; -import static hu.bme.mit.trainbenchmark.constants.ModelConstants.MONITORED_BY; -import static hu.bme.mit.trainbenchmark.constants.ModelConstants.SEGMENT; -import static hu.bme.mit.trainbenchmark.rdf.RdfConstants.BASE_PREFIX; -import static hu.bme.mit.trainbenchmark.rdf.RdfConstants.ID_PREFIX; - -import java.util.Collection; - -import org.openrdf.model.Literal; -import org.openrdf.model.URI; -import org.openrdf.model.ValueFactory; -import org.openrdf.model.vocabulary.RDF; -import org.openrdf.repository.RepositoryConnection; - -import hu.bme.mit.trainbenchmark.benchmark.sesame.driver.SesameDriver; -import hu.bme.mit.trainbenchmark.benchmark.sesame.matches.SesameConnectedSegmentsInjectMatch; -import hu.bme.mit.trainbenchmark.benchmark.sesame.transformations.SesameTransformation; -import hu.bme.mit.trainbenchmark.constants.TrainBenchmarkConstants; - -public class SesameTransformationInjectConnectedSegments<TSesameDriver extends SesameDriver> extends SesameTransformation<SesameConnectedSegmentsInjectMatch, TSesameDriver> { - - public SesameTransformationInjectConnectedSegments(final TSesameDriver driver) { - super(driver); - } - - @Override - public void activate(final Collection<SesameConnectedSegmentsInjectMatch> matches) throws Exception { - final RepositoryConnection connection = driver.getConnection(); - final ValueFactory vf = driver.getValueFactory(); - - final URI length = vf.createURI(BASE_PREFIX + LENGTH); - final URI connectsTo = vf.createURI(BASE_PREFIX + CONNECTS_TO); - final URI monitoredBy = vf.createURI(BASE_PREFIX + MONITORED_BY); - final URI segmentType = vf.createURI(BASE_PREFIX + SEGMENT); - final Literal lengthLiteral = vf.createLiteral(TrainBenchmarkConstants.DEFAULT_SEGMENT_LENGTH); - - for (final SesameConnectedSegmentsInjectMatch csim : matches) { - // create (segment2) node - final Long newVertexId = driver.generateNewVertexId(); - final URI segment2 = vf.createURI(BASE_PREFIX + ID_PREFIX + newVertexId); - connection.add(segment2, RDF.TYPE, segmentType); - connection.add(segment2, length, lengthLiteral); - - // (segment1)-[:connectsTo]->(segment2) - connection.add(csim.getSegment1(), connectsTo, segment2); - // (segment2)-[:connectsTo]->(segment3) - connection.add(segment2, connectsTo, csim.getSegment3()); - - // (segment2)-[:monitoredBy]->(sensor) - connection.add(segment2, monitoredBy, csim.getSensor()); - - // remove (segment1)-[:connectsTo]->(segment3) - connection.remove(csim.getSegment1(), connectsTo, csim.getSegment3()); - } - } - -} diff --git a/trainbenchmark-tool-sesame/src/main/java/hu/bme/mit/trainbenchmark/benchmark/sesame/transformations/inject/SesameTransformationInjectPosLength.java b/trainbenchmark-tool-sesame/src/main/java/hu/bme/mit/trainbenchmark/benchmark/sesame/transformations/inject/SesameTransformationInjectPosLength.java deleted file mode 100644 index 6e3269f40..000000000 --- a/trainbenchmark-tool-sesame/src/main/java/hu/bme/mit/trainbenchmark/benchmark/sesame/transformations/inject/SesameTransformationInjectPosLength.java +++ /dev/null @@ -1,55 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2010-2015, Benedek Izso, Gabor Szarnyas, Istvan Rath and Daniel Varro - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Benedek Izso - initial API and implementation - * Gabor Szarnyas - initial API and implementation - *******************************************************************************/ -package hu.bme.mit.trainbenchmark.benchmark.sesame.transformations.inject; - -import static hu.bme.mit.trainbenchmark.rdf.RdfConstants.BASE_PREFIX; - -import java.util.Collection; - -import org.openrdf.model.Literal; -import org.openrdf.model.Statement; -import org.openrdf.model.URI; -import org.openrdf.model.ValueFactory; -import org.openrdf.repository.RepositoryConnection; -import org.openrdf.repository.RepositoryException; -import org.openrdf.repository.RepositoryResult; - -import hu.bme.mit.trainbenchmark.benchmark.sesame.driver.SesameDriver; -import hu.bme.mit.trainbenchmark.benchmark.sesame.matches.SesamePosLengthInjectMatch; -import hu.bme.mit.trainbenchmark.benchmark.sesame.transformations.SesameTransformation; -import hu.bme.mit.trainbenchmark.constants.ModelConstants; - -public class SesameTransformationInjectPosLength<TSesameDriver extends SesameDriver> extends SesameTransformation<SesamePosLengthInjectMatch, TSesameDriver> { - - public SesameTransformationInjectPosLength(final TSesameDriver driver) { - super(driver); - } - - @Override - public void activate(final Collection<SesamePosLengthInjectMatch> matches) throws RepositoryException { - final RepositoryConnection con = driver.getConnection(); - final ValueFactory vf = driver.getValueFactory(); - - final URI typeURI = vf.createURI(BASE_PREFIX + ModelConstants.LENGTH); - final Literal zeroLiteral = vf.createLiteral(0); - - for (final SesamePosLengthInjectMatch match : matches) { - final URI segment = match.getSegment(); - - final RepositoryResult<Statement> statementsToRemove = con.getStatements(segment, typeURI, null, true); - con.remove(statementsToRemove); - - con.add(segment, typeURI, zeroLiteral); - } - } - -} diff --git a/trainbenchmark-tool-sesame/src/main/java/hu/bme/mit/trainbenchmark/benchmark/sesame/transformations/inject/SesameTransformationInjectRouteSensor.java b/trainbenchmark-tool-sesame/src/main/java/hu/bme/mit/trainbenchmark/benchmark/sesame/transformations/inject/SesameTransformationInjectRouteSensor.java deleted file mode 100644 index 1f6c218ee..000000000 --- a/trainbenchmark-tool-sesame/src/main/java/hu/bme/mit/trainbenchmark/benchmark/sesame/transformations/inject/SesameTransformationInjectRouteSensor.java +++ /dev/null @@ -1,51 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2010-2015, Benedek Izso, Gabor Szarnyas, Istvan Rath and Daniel Varro - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Benedek Izso - initial API and implementation - * Gabor Szarnyas - initial API and implementation - *******************************************************************************/ -package hu.bme.mit.trainbenchmark.benchmark.sesame.transformations.inject; - -import static hu.bme.mit.trainbenchmark.rdf.RdfConstants.BASE_PREFIX; - -import java.util.ArrayList; -import java.util.Collection; -import java.util.List; - -import org.openrdf.model.Statement; -import org.openrdf.model.URI; -import org.openrdf.model.ValueFactory; -import org.openrdf.repository.RepositoryConnection; -import org.openrdf.repository.RepositoryException; - -import hu.bme.mit.trainbenchmark.benchmark.sesame.driver.SesameDriver; -import hu.bme.mit.trainbenchmark.benchmark.sesame.matches.SesameRouteSensorInjectMatch; -import hu.bme.mit.trainbenchmark.benchmark.sesame.transformations.SesameTransformation; -import hu.bme.mit.trainbenchmark.constants.ModelConstants; - -public class SesameTransformationInjectRouteSensor<TSesameDriver extends SesameDriver> extends SesameTransformation<SesameRouteSensorInjectMatch, TSesameDriver> { - - public SesameTransformationInjectRouteSensor(final TSesameDriver driver) { - super(driver); - } - - @Override - public void activate(final Collection<SesameRouteSensorInjectMatch> matches) throws RepositoryException { - final RepositoryConnection connection = driver.getConnection(); - final ValueFactory vf = connection.getValueFactory(); - - final List<Statement> statementsToRemove = new ArrayList<>(matches.size()); - final URI requires = vf.createURI(BASE_PREFIX + ModelConstants.REQUIRES); - for (final SesameRouteSensorInjectMatch m : matches) { - final Statement statement = vf.createStatement(m.getRoute(), requires, m.getSensor()); - statementsToRemove.add(statement); - } - connection.remove(statementsToRemove); - } - -} diff --git a/trainbenchmark-tool-sesame/src/main/java/hu/bme/mit/trainbenchmark/benchmark/sesame/transformations/inject/SesameTransformationInjectSemaphoreNeighbor.java b/trainbenchmark-tool-sesame/src/main/java/hu/bme/mit/trainbenchmark/benchmark/sesame/transformations/inject/SesameTransformationInjectSemaphoreNeighbor.java deleted file mode 100644 index 8b5859c9a..000000000 --- a/trainbenchmark-tool-sesame/src/main/java/hu/bme/mit/trainbenchmark/benchmark/sesame/transformations/inject/SesameTransformationInjectSemaphoreNeighbor.java +++ /dev/null @@ -1,40 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2010-2015, Benedek Izso, Gabor Szarnyas, Istvan Rath and Daniel Varro - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Benedek Izso - initial API and implementation - * Gabor Szarnyas - initial API and implementation - *******************************************************************************/ -package hu.bme.mit.trainbenchmark.benchmark.sesame.transformations.inject; - -import java.util.Collection; - -import org.openrdf.model.URI; -import org.openrdf.repository.RepositoryException; - -import hu.bme.mit.trainbenchmark.benchmark.sesame.driver.SesameDriver; -import hu.bme.mit.trainbenchmark.benchmark.sesame.matches.SesameSemaphoreNeighborInjectMatch; -import hu.bme.mit.trainbenchmark.benchmark.sesame.transformations.SesameTransformation; -import hu.bme.mit.trainbenchmark.constants.ModelConstants; -import hu.bme.mit.trainbenchmark.rdf.RdfConstants; - -public class SesameTransformationInjectSemaphoreNeighbor<TSesameDriver extends SesameDriver> extends SesameTransformation<SesameSemaphoreNeighborInjectMatch, TSesameDriver> { - - public SesameTransformationInjectSemaphoreNeighbor(final TSesameDriver driver) { - super(driver); - } - - @Override - public void activate(final Collection<SesameSemaphoreNeighborInjectMatch> matches) throws RepositoryException { - final URI entry = driver.getValueFactory().createURI(RdfConstants.BASE_PREFIX + ModelConstants.ENTRY); - - for (SesameSemaphoreNeighborInjectMatch match : matches) { - driver.getConnection().remove(match.getRoute(), entry, match.getSemaphore()); - } - } - -} diff --git a/trainbenchmark-tool-sesame/src/main/java/hu/bme/mit/trainbenchmark/benchmark/sesame/transformations/inject/SesameTransformationInjectSwitchMonitored.java b/trainbenchmark-tool-sesame/src/main/java/hu/bme/mit/trainbenchmark/benchmark/sesame/transformations/inject/SesameTransformationInjectSwitchMonitored.java deleted file mode 100644 index cbdaaf8ff..000000000 --- a/trainbenchmark-tool-sesame/src/main/java/hu/bme/mit/trainbenchmark/benchmark/sesame/transformations/inject/SesameTransformationInjectSwitchMonitored.java +++ /dev/null @@ -1,38 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2010-2015, Benedek Izso, Gabor Szarnyas, Istvan Rath and Daniel Varro - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Benedek Izso - initial API and implementation - * Gabor Szarnyas - initial API and implementation - *******************************************************************************/ -package hu.bme.mit.trainbenchmark.benchmark.sesame.transformations.inject; - -import java.util.Collection; -import java.util.List; -import java.util.stream.Collectors; - -import org.openrdf.model.URI; -import org.openrdf.repository.RepositoryException; - -import hu.bme.mit.trainbenchmark.benchmark.sesame.driver.SesameDriver; -import hu.bme.mit.trainbenchmark.benchmark.sesame.matches.SesameSwitchMonitoredInjectMatch; -import hu.bme.mit.trainbenchmark.benchmark.sesame.transformations.SesameTransformation; -import hu.bme.mit.trainbenchmark.constants.ModelConstants; - -public class SesameTransformationInjectSwitchMonitored<TSesameDriver extends SesameDriver> extends SesameTransformation<SesameSwitchMonitoredInjectMatch, TSesameDriver> { - - public SesameTransformationInjectSwitchMonitored(final TSesameDriver driver) { - super(driver); - } - - @Override - public void activate(final Collection<SesameSwitchMonitoredInjectMatch> matches) throws RepositoryException { - final List<URI> switches = matches.stream().map(it -> it.getSw()).collect(Collectors.toList()); - driver.deleteOutgoingEdges(switches, ModelConstants.SWITCH, ModelConstants.MONITORED_BY); - } - -} diff --git a/trainbenchmark-tool-sesame/src/main/java/hu/bme/mit/trainbenchmark/benchmark/sesame/transformations/inject/SesameTransformationInjectSwitchSet.java b/trainbenchmark-tool-sesame/src/main/java/hu/bme/mit/trainbenchmark/benchmark/sesame/transformations/inject/SesameTransformationInjectSwitchSet.java deleted file mode 100644 index 53398495d..000000000 --- a/trainbenchmark-tool-sesame/src/main/java/hu/bme/mit/trainbenchmark/benchmark/sesame/transformations/inject/SesameTransformationInjectSwitchSet.java +++ /dev/null @@ -1,71 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2010-2015, Benedek Izso, Gabor Szarnyas, Istvan Rath and Daniel Varro - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Benedek Izso - initial API and implementation - * Gabor Szarnyas - initial API and implementation - *******************************************************************************/ -package hu.bme.mit.trainbenchmark.benchmark.sesame.transformations.inject; - -import static hu.bme.mit.trainbenchmark.constants.ModelConstants.CURRENTPOSITION; -import static hu.bme.mit.trainbenchmark.rdf.RdfConstants.BASE_PREFIX; - -import java.util.Collection; - -import org.openrdf.model.Statement; -import org.openrdf.model.URI; -import org.openrdf.model.ValueFactory; -import org.openrdf.repository.RepositoryConnection; -import org.openrdf.repository.RepositoryException; -import org.openrdf.repository.RepositoryResult; - -import hu.bme.mit.trainbenchmark.benchmark.sesame.driver.SesameDriver; -import hu.bme.mit.trainbenchmark.benchmark.sesame.matches.SesameSwitchSetInjectMatch; -import hu.bme.mit.trainbenchmark.benchmark.sesame.transformations.SesameTransformation; -import hu.bme.mit.trainbenchmark.constants.Position; -import hu.bme.mit.trainbenchmark.rdf.RdfHelper; - -public class SesameTransformationInjectSwitchSet<TSesameDriver extends SesameDriver> extends SesameTransformation<SesameSwitchSetInjectMatch, TSesameDriver> { - - public SesameTransformationInjectSwitchSet(final TSesameDriver driver) { - super(driver); - } - - @Override - public void activate(final Collection<SesameSwitchSetInjectMatch> matches) throws RepositoryException { - final RepositoryConnection con = driver.getConnection(); - final ValueFactory vf = driver.getValueFactory(); - - final URI currentPositionProperty = vf.createURI(BASE_PREFIX + CURRENTPOSITION); - - for (final SesameSwitchSetInjectMatch match : matches) { - final URI sw = match.getSw(); - final RepositoryResult<Statement> statements = con.getStatements(sw, currentPositionProperty, null, true); - if (!statements.hasNext()) { - continue; - } - - final Statement oldStatement = statements.next(); - - // delete old statement - con.remove(oldStatement); - - // get next enum value - final URI currentPositionURI = (URI) oldStatement.getObject(); - final String currentPositionRDFString = currentPositionURI.getLocalName(); - final String currentPositionString = RdfHelper.removePrefix(Position.class, currentPositionRDFString); - final Position currentPosition = Position.valueOf(currentPositionString); - final Position newCurrentPosition = Position.values()[(currentPosition.ordinal() + 1) % Position.values().length]; - final String newCurrentPositionString = RdfHelper.addEnumPrefix(newCurrentPosition); - final URI newCurrentPositionUri = vf.createURI(BASE_PREFIX + newCurrentPositionString); - - // set new value - con.add(sw, currentPositionProperty, newCurrentPositionUri); - } - } - -} diff --git a/trainbenchmark-tool-sesame/src/main/java/hu/bme/mit/trainbenchmark/benchmark/sesame/transformations/repair/SesameTransformationRepairConnectedSegments.java b/trainbenchmark-tool-sesame/src/main/java/hu/bme/mit/trainbenchmark/benchmark/sesame/transformations/repair/SesameTransformationRepairConnectedSegments.java deleted file mode 100644 index 69f1cdce9..000000000 --- a/trainbenchmark-tool-sesame/src/main/java/hu/bme/mit/trainbenchmark/benchmark/sesame/transformations/repair/SesameTransformationRepairConnectedSegments.java +++ /dev/null @@ -1,57 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2010-2015, Benedek Izso, Gabor Szarnyas, Istvan Rath and Daniel Varro - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Benedek Izso - initial API and implementation - * Gabor Szarnyas - initial API and implementation - *******************************************************************************/ -package hu.bme.mit.trainbenchmark.benchmark.sesame.transformations.repair; - -import static hu.bme.mit.trainbenchmark.constants.ModelConstants.CONNECTS_TO; -import static hu.bme.mit.trainbenchmark.rdf.RdfConstants.BASE_PREFIX; - -import java.util.Collection; - -import org.openrdf.model.Statement; -import org.openrdf.model.URI; -import org.openrdf.model.ValueFactory; -import org.openrdf.repository.RepositoryConnection; -import org.openrdf.repository.RepositoryException; -import org.openrdf.repository.RepositoryResult; - -import hu.bme.mit.trainbenchmark.benchmark.sesame.driver.SesameDriver; -import hu.bme.mit.trainbenchmark.benchmark.sesame.matches.SesameConnectedSegmentsMatch; -import hu.bme.mit.trainbenchmark.benchmark.sesame.transformations.SesameTransformation; - -public class SesameTransformationRepairConnectedSegments<TSesameDriver extends SesameDriver> extends SesameTransformation<SesameConnectedSegmentsMatch, TSesameDriver> { - - public SesameTransformationRepairConnectedSegments(final TSesameDriver driver) { - super(driver); - } - - @Override - public void activate(final Collection<SesameConnectedSegmentsMatch> matches) throws RepositoryException { - final RepositoryConnection con = driver.getConnection(); - final ValueFactory vf = driver.getValueFactory(); - - final URI connectsTo = vf.createURI(BASE_PREFIX + CONNECTS_TO); - for (final SesameConnectedSegmentsMatch match : matches) { - // delete segment2 by removing all (segment2, _, _) and (_, _, segment2) triples - final RepositoryResult<Statement> outgoingEdges = con.getStatements(match.getSegment2(), null, null, true); - while (outgoingEdges.hasNext()) { - con.remove(outgoingEdges.next()); - } - final RepositoryResult<Statement> incomingEdges = con.getStatements(null, null, match.getSegment2(), true); - while (incomingEdges.hasNext()) { - con.remove(incomingEdges.next()); - } - - // insert (segment1)-[:connectsTo]->(segment3) edge - con.add(match.getSegment1(), connectsTo, match.getSegment3()); - } - } -} diff --git a/trainbenchmark-tool-sesame/src/main/java/hu/bme/mit/trainbenchmark/benchmark/sesame/transformations/repair/SesameTransformationRepairPosLength.java b/trainbenchmark-tool-sesame/src/main/java/hu/bme/mit/trainbenchmark/benchmark/sesame/transformations/repair/SesameTransformationRepairPosLength.java deleted file mode 100644 index 3056ef881..000000000 --- a/trainbenchmark-tool-sesame/src/main/java/hu/bme/mit/trainbenchmark/benchmark/sesame/transformations/repair/SesameTransformationRepairPosLength.java +++ /dev/null @@ -1,63 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2010-2015, Benedek Izso, Gabor Szarnyas, Istvan Rath and Daniel Varro - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Benedek Izso - initial API and implementation - * Gabor Szarnyas - initial API and implementation - *******************************************************************************/ -package hu.bme.mit.trainbenchmark.benchmark.sesame.transformations.repair; - -import static hu.bme.mit.trainbenchmark.constants.ModelConstants.LENGTH; -import static hu.bme.mit.trainbenchmark.rdf.RdfConstants.BASE_PREFIX; - -import java.util.Collection; - -import org.openrdf.model.Literal; -import org.openrdf.model.Resource; -import org.openrdf.model.Statement; -import org.openrdf.model.URI; -import org.openrdf.model.Value; -import org.openrdf.model.ValueFactory; -import org.openrdf.repository.RepositoryConnection; -import org.openrdf.repository.RepositoryException; -import org.openrdf.repository.RepositoryResult; - -import hu.bme.mit.trainbenchmark.benchmark.sesame.driver.SesameDriver; -import hu.bme.mit.trainbenchmark.benchmark.sesame.matches.SesamePosLengthMatch; -import hu.bme.mit.trainbenchmark.benchmark.sesame.transformations.SesameTransformation; - -public class SesameTransformationRepairPosLength<TSesameDriver extends SesameDriver> extends SesameTransformation<SesamePosLengthMatch, TSesameDriver> { - - public SesameTransformationRepairPosLength(final TSesameDriver driver) { - super(driver); - } - - @Override - public void activate(final Collection<SesamePosLengthMatch> matches) throws RepositoryException { - final RepositoryConnection con = driver.getConnection(); - final ValueFactory vf = driver.getValueFactory(); - - final URI lengthProperty = vf.createURI(BASE_PREFIX + LENGTH); - - for (final SesamePosLengthMatch match : matches) { - final Resource segment = match.getSegment(); - final Value length = match.getLength(); - - final RepositoryResult<Statement> statementsToRemove = con.getStatements(segment, lengthProperty, length, true); - while (statementsToRemove.hasNext()) { - final Statement oldStatement = statementsToRemove.next(); - con.remove(oldStatement); - } - - final Integer lengthInteger = new Integer(length.stringValue()); - final Integer newLengthInteger = -lengthInteger + 1; - final Literal newLength = vf.createLiteral(newLengthInteger); - final Statement newStatement = vf.createStatement(segment, lengthProperty, newLength); - con.add(newStatement); - } - } -} diff --git a/trainbenchmark-tool-sesame/src/main/java/hu/bme/mit/trainbenchmark/benchmark/sesame/transformations/repair/SesameTransformationRepairRouteSensor.java b/trainbenchmark-tool-sesame/src/main/java/hu/bme/mit/trainbenchmark/benchmark/sesame/transformations/repair/SesameTransformationRepairRouteSensor.java deleted file mode 100644 index 7b1135314..000000000 --- a/trainbenchmark-tool-sesame/src/main/java/hu/bme/mit/trainbenchmark/benchmark/sesame/transformations/repair/SesameTransformationRepairRouteSensor.java +++ /dev/null @@ -1,50 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2010-2015, Benedek Izso, Gabor Szarnyas, Istvan Rath and Daniel Varro - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Benedek Izso - initial API and implementation - * Gabor Szarnyas - initial API and implementation - *******************************************************************************/ -package hu.bme.mit.trainbenchmark.benchmark.sesame.transformations.repair; - -import static hu.bme.mit.trainbenchmark.constants.ModelConstants.REQUIRES; -import static hu.bme.mit.trainbenchmark.rdf.RdfConstants.BASE_PREFIX; - -import java.util.Collection; - -import org.openrdf.model.Resource; -import org.openrdf.model.URI; -import org.openrdf.model.ValueFactory; -import org.openrdf.repository.RepositoryConnection; -import org.openrdf.repository.RepositoryException; - -import hu.bme.mit.trainbenchmark.benchmark.sesame.driver.SesameDriver; -import hu.bme.mit.trainbenchmark.benchmark.sesame.matches.SesameRouteSensorMatch; -import hu.bme.mit.trainbenchmark.benchmark.sesame.transformations.SesameTransformation; - -public class SesameTransformationRepairRouteSensor<TSesameDriver extends SesameDriver> extends SesameTransformation<SesameRouteSensorMatch, TSesameDriver> { - - public SesameTransformationRepairRouteSensor(final TSesameDriver driver) { - super(driver); - } - - @Override - public void activate(final Collection<SesameRouteSensorMatch> matches) throws RepositoryException { - final RepositoryConnection con = driver.getConnection(); - final ValueFactory vf = driver.getValueFactory(); - - final URI requires = vf.createURI(BASE_PREFIX + REQUIRES); - - for (final SesameRouteSensorMatch match : matches) { - final Resource route = match.getRoute(); - final Resource sensor = match.getSensor(); - - con.add(route, requires, sensor); - } - } - -} diff --git a/trainbenchmark-tool-sesame/src/main/java/hu/bme/mit/trainbenchmark/benchmark/sesame/transformations/repair/SesameTransformationRepairSemaphoreNeighbor.java b/trainbenchmark-tool-sesame/src/main/java/hu/bme/mit/trainbenchmark/benchmark/sesame/transformations/repair/SesameTransformationRepairSemaphoreNeighbor.java deleted file mode 100644 index 819924971..000000000 --- a/trainbenchmark-tool-sesame/src/main/java/hu/bme/mit/trainbenchmark/benchmark/sesame/transformations/repair/SesameTransformationRepairSemaphoreNeighbor.java +++ /dev/null @@ -1,49 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2010-2015, Benedek Izso, Gabor Szarnyas, Istvan Rath and Daniel Varro - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Benedek Izso - initial API and implementation - * Gabor Szarnyas - initial API and implementation - *******************************************************************************/ -package hu.bme.mit.trainbenchmark.benchmark.sesame.transformations.repair; - -import static hu.bme.mit.trainbenchmark.constants.ModelConstants.ENTRY; -import static hu.bme.mit.trainbenchmark.rdf.RdfConstants.BASE_PREFIX; - -import java.util.Collection; - -import org.openrdf.model.Resource; -import org.openrdf.model.URI; -import org.openrdf.model.ValueFactory; -import org.openrdf.repository.RepositoryConnection; -import org.openrdf.repository.RepositoryException; - -import hu.bme.mit.trainbenchmark.benchmark.sesame.driver.SesameDriver; -import hu.bme.mit.trainbenchmark.benchmark.sesame.matches.SesameSemaphoreNeighborMatch; -import hu.bme.mit.trainbenchmark.benchmark.sesame.transformations.SesameTransformation; - -public class SesameTransformationRepairSemaphoreNeighbor<TSesameDriver extends SesameDriver> extends SesameTransformation<SesameSemaphoreNeighborMatch, TSesameDriver> { - - public SesameTransformationRepairSemaphoreNeighbor(final TSesameDriver driver) { - super(driver); - } - - @Override - public void activate(final Collection<SesameSemaphoreNeighborMatch> matches) throws RepositoryException { - final RepositoryConnection con = driver.getConnection(); - final ValueFactory vf = driver.getValueFactory(); - - final URI entry = vf.createURI(BASE_PREFIX + ENTRY); - - for (final SesameSemaphoreNeighborMatch match : matches) { - final Resource route2 = match.getRoute2(); - final Resource semaphore = match.getSemaphore(); - con.add(route2, entry, semaphore); - } - } - -} diff --git a/trainbenchmark-tool-sesame/src/main/java/hu/bme/mit/trainbenchmark/benchmark/sesame/transformations/repair/SesameTransformationRepairSwitchMonitored.java b/trainbenchmark-tool-sesame/src/main/java/hu/bme/mit/trainbenchmark/benchmark/sesame/transformations/repair/SesameTransformationRepairSwitchMonitored.java deleted file mode 100644 index 1a8978dd5..000000000 --- a/trainbenchmark-tool-sesame/src/main/java/hu/bme/mit/trainbenchmark/benchmark/sesame/transformations/repair/SesameTransformationRepairSwitchMonitored.java +++ /dev/null @@ -1,65 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2010-2015, Benedek Izso, Gabor Szarnyas, Istvan Rath and Daniel Varro - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Benedek Izso - initial API and implementation - * Gabor Szarnyas - initial API and implementation - *******************************************************************************/ -package hu.bme.mit.trainbenchmark.benchmark.sesame.transformations.repair; - -import static hu.bme.mit.trainbenchmark.constants.ModelConstants.MONITORED_BY; -import static hu.bme.mit.trainbenchmark.constants.ModelConstants.SENSOR; -import static hu.bme.mit.trainbenchmark.constants.ModelConstants.TRACKELEMENT; -import static hu.bme.mit.trainbenchmark.rdf.RdfConstants.BASE_PREFIX; -import static hu.bme.mit.trainbenchmark.rdf.RdfConstants.ID_PREFIX; - -import java.util.Collection; - -import org.openrdf.model.Resource; -import org.openrdf.model.URI; -import org.openrdf.model.ValueFactory; -import org.openrdf.model.vocabulary.RDF; -import org.openrdf.repository.RepositoryConnection; - -import hu.bme.mit.trainbenchmark.benchmark.sesame.driver.SesameDriver; -import hu.bme.mit.trainbenchmark.benchmark.sesame.matches.SesameSwitchMonitoredMatch; -import hu.bme.mit.trainbenchmark.benchmark.sesame.transformations.SesameTransformation; - -public class SesameTransformationRepairSwitchMonitored<TSesameDriver extends SesameDriver> extends SesameTransformation<SesameSwitchMonitoredMatch, TSesameDriver> { - - public SesameTransformationRepairSwitchMonitored(final TSesameDriver driver) { - super(driver); - } - - @Override - public void activate(final Collection<SesameSwitchMonitoredMatch> matches) throws Exception { - final RepositoryConnection con = driver.getConnection(); - final ValueFactory vf = driver.getValueFactory(); - - final URI sensorEdgeType = vf.createURI(BASE_PREFIX + MONITORED_BY); - final URI sensorType = vf.createURI(BASE_PREFIX + SENSOR); - final URI trackElementType = vf.createURI(BASE_PREFIX + TRACKELEMENT); - - for (final SesameSwitchMonitoredMatch match : matches) { - final Resource sw = match.getSw(); - - final URI sensor = vf.createURI(BASE_PREFIX + ID_PREFIX + driver.generateNewVertexId()); - - // set vertex type - con.add(sensor, RDF.TYPE, sensorType); - - // insert the supertype as well - if (!driver.isInferencing()) { - con.add(sensor, RDF.TYPE, trackElementType); - } - - // insert edge - con.add(sw, sensorEdgeType, sensor); - } - } - -} diff --git a/trainbenchmark-tool-sesame/src/main/java/hu/bme/mit/trainbenchmark/benchmark/sesame/transformations/repair/SesameTransformationRepairSwitchSet.java b/trainbenchmark-tool-sesame/src/main/java/hu/bme/mit/trainbenchmark/benchmark/sesame/transformations/repair/SesameTransformationRepairSwitchSet.java deleted file mode 100644 index 0ad3b690a..000000000 --- a/trainbenchmark-tool-sesame/src/main/java/hu/bme/mit/trainbenchmark/benchmark/sesame/transformations/repair/SesameTransformationRepairSwitchSet.java +++ /dev/null @@ -1,59 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2010-2015, Benedek Izso, Gabor Szarnyas, Istvan Rath and Daniel Varro - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Benedek Izso - initial API and implementation - * Gabor Szarnyas - initial API and implementation - *******************************************************************************/ -package hu.bme.mit.trainbenchmark.benchmark.sesame.transformations.repair; - -import static hu.bme.mit.trainbenchmark.constants.ModelConstants.CURRENTPOSITION; -import static hu.bme.mit.trainbenchmark.rdf.RdfConstants.BASE_PREFIX; - -import java.util.Collection; - -import org.openrdf.model.Resource; -import org.openrdf.model.Statement; -import org.openrdf.model.URI; -import org.openrdf.model.Value; -import org.openrdf.model.ValueFactory; -import org.openrdf.repository.RepositoryConnection; -import org.openrdf.repository.RepositoryException; -import org.openrdf.repository.RepositoryResult; - -import hu.bme.mit.trainbenchmark.benchmark.sesame.driver.SesameDriver; -import hu.bme.mit.trainbenchmark.benchmark.sesame.matches.SesameSwitchSetMatch; -import hu.bme.mit.trainbenchmark.benchmark.sesame.transformations.SesameTransformation; - -public class SesameTransformationRepairSwitchSet<TSesameDriver extends SesameDriver> extends SesameTransformation<SesameSwitchSetMatch, TSesameDriver> { - - public SesameTransformationRepairSwitchSet(final TSesameDriver driver) { - super(driver); - } - - @Override - public void activate(final Collection<SesameSwitchSetMatch> matches) throws RepositoryException { - final RepositoryConnection con = driver.getConnection(); - final ValueFactory vf = driver.getValueFactory(); - - final URI currentPositionProperty = vf.createURI(BASE_PREFIX + CURRENTPOSITION); - - for (final SesameSwitchSetMatch match : matches) { - final Resource sw = match.getSw(); - final Value position = match.getPosition(); - final Value currentPosition = match.getCurrentPosition(); - - final RepositoryResult<Statement> statementsToRemove = con.getStatements(sw, currentPositionProperty, currentPosition, false); - while (statementsToRemove.hasNext()) { - con.remove(statementsToRemove.next()); - } - - con.add(sw, currentPositionProperty, position); - } - } - -} diff --git a/trainbenchmark-tool-sesame/src/main/resources/.gitignore b/trainbenchmark-tool-sesame/src/main/resources/.gitignore deleted file mode 100644 index e69de29bb..000000000 diff --git a/trainbenchmark-tool-sesame/src/test/java/hu/bme/mit/trainbenchmark/benchmark/sesame/test/SesameTest.java b/trainbenchmark-tool-sesame/src/test/java/hu/bme/mit/trainbenchmark/benchmark/sesame/test/SesameTest.java deleted file mode 100644 index d924bc348..000000000 --- a/trainbenchmark-tool-sesame/src/test/java/hu/bme/mit/trainbenchmark/benchmark/sesame/test/SesameTest.java +++ /dev/null @@ -1,25 +0,0 @@ -package hu.bme.mit.trainbenchmark.benchmark.sesame.test; - -import org.junit.runner.RunWith; -import org.junit.runners.Parameterized; - -import hu.bme.mit.trainbenchmark.benchmark.config.BenchmarkConfigBase; -import hu.bme.mit.trainbenchmark.benchmark.rdf.tests.RdfTest; -import hu.bme.mit.trainbenchmark.benchmark.runcomponents.BenchmarkResult; -import hu.bme.mit.trainbenchmark.benchmark.sesame.SesameBenchmarkScenario; -import hu.bme.mit.trainbenchmark.benchmark.sesame.config.SesameBenchmarkConfig; -import hu.bme.mit.trainbenchmark.benchmark.sesame.config.SesameBenchmarkConfigBuilder; - -@RunWith(Parameterized.class) -public class SesameTest extends RdfTest { - - @Override - protected BenchmarkResult runTest(final BenchmarkConfigBase bcb) throws Exception { - final SesameBenchmarkConfig bc = new SesameBenchmarkConfigBuilder().setConfigBase(bcb) - .setInferencing(inferencing).createConfig(); - final SesameBenchmarkScenario scenario = new SesameBenchmarkScenario(bc); - final BenchmarkResult result = scenario.performBenchmark(); - return result; - } - -} diff --git a/trainbenchmark-tool-sesame/src/test/resources/.gitignore b/trainbenchmark-tool-sesame/src/test/resources/.gitignore deleted file mode 100644 index e69de29bb..000000000 diff --git a/trainbenchmark-tool-sql/build.gradle b/trainbenchmark-tool-sql/build.gradle deleted file mode 100644 index 20c94f3ef..000000000 --- a/trainbenchmark-tool-sql/build.gradle +++ /dev/null @@ -1,4 +0,0 @@ -dependencies { - compile project(':trainbenchmark-tool') - compile project(':trainbenchmark-format-sql') -} diff --git a/trainbenchmark-tool-sql/src/main/java/hu/bme/mit/trainbenchmark/benchmark/sql/driver/SqlDriver.java b/trainbenchmark-tool-sql/src/main/java/hu/bme/mit/trainbenchmark/benchmark/sql/driver/SqlDriver.java deleted file mode 100644 index 88dce96b6..000000000 --- a/trainbenchmark-tool-sql/src/main/java/hu/bme/mit/trainbenchmark/benchmark/sql/driver/SqlDriver.java +++ /dev/null @@ -1,58 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2010-2015, Benedek Izso, Gabor Szarnyas, Istvan Rath and Daniel Varro - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Benedek Izso - initial API and implementation - * Gabor Szarnyas - initial API and implementation - *******************************************************************************/ -package hu.bme.mit.trainbenchmark.benchmark.sql.driver; - -import java.sql.Connection; -import java.sql.PreparedStatement; -import java.sql.ResultSet; -import java.sql.SQLException; -import java.util.ArrayList; -import java.util.Collection; - -import hu.bme.mit.trainbenchmark.benchmark.driver.Driver; -import hu.bme.mit.trainbenchmark.benchmark.sql.matches.SqlMatch; -import hu.bme.mit.trainbenchmark.constants.RailwayQuery; - -public abstract class SqlDriver extends Driver { - - protected static final String COLLECT_VERTICES = "SELECT * FROM `%s`;"; - - protected String queryDefinition; - protected Connection connection; - protected PreparedStatement preparedQuery; - - public SqlDriver() { - super(); - } - - public Collection<SqlMatch> runStatement(final RailwayQuery query, final PreparedStatement statement) throws SQLException { - final Collection<SqlMatch> results = new ArrayList<>(); - - try (ResultSet rs = statement.executeQuery()) { - while (rs.next()) { - final SqlMatch match = SqlMatch.createMatch(query, rs); - results.add(match); - } - } - - return results; - } - - public Connection getConnection() { - return connection; - } - - public String getResourceDirectory() { - return "/trainbenchmark-tool-sql/src/main/resources/"; - } - -} diff --git a/trainbenchmark-tool-sql/src/main/java/hu/bme/mit/trainbenchmark/benchmark/sql/matches/SqlConnectedSegmentsInjectMatch.java b/trainbenchmark-tool-sql/src/main/java/hu/bme/mit/trainbenchmark/benchmark/sql/matches/SqlConnectedSegmentsInjectMatch.java deleted file mode 100644 index 81a1b5915..000000000 --- a/trainbenchmark-tool-sql/src/main/java/hu/bme/mit/trainbenchmark/benchmark/sql/matches/SqlConnectedSegmentsInjectMatch.java +++ /dev/null @@ -1,41 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2010-2015, Benedek Izso, Gabor Szarnyas, Istvan Rath and Daniel Varro - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Benedek Izso - initial API and implementation - * Gabor Szarnyas - initial API and implementation - *******************************************************************************/ -package hu.bme.mit.trainbenchmark.benchmark.sql.matches; - -import java.sql.ResultSet; -import java.sql.SQLException; - -import hu.bme.mit.trainbenchmark.benchmark.matches.ConnectedSegmentsInjectMatch; -import hu.bme.mit.trainbenchmark.constants.QueryConstants; - -public class SqlConnectedSegmentsInjectMatch extends SqlMatch implements ConnectedSegmentsInjectMatch { - - public SqlConnectedSegmentsInjectMatch(final ResultSet rs) throws SQLException { - match = new Long[] { rs.getLong(QueryConstants.VAR_SENSOR), rs.getLong(QueryConstants.VAR_SEGMENT1), rs.getLong(QueryConstants.VAR_SEGMENT3) }; - } - - @Override - public Long getSensor() { - return match[0]; - } - - @Override - public Long getSegment1() { - return match[1]; - } - - @Override - public Long getSegment3() { - return match[2]; - } - -} diff --git a/trainbenchmark-tool-sql/src/main/java/hu/bme/mit/trainbenchmark/benchmark/sql/matches/SqlConnectedSegmentsMatch.java b/trainbenchmark-tool-sql/src/main/java/hu/bme/mit/trainbenchmark/benchmark/sql/matches/SqlConnectedSegmentsMatch.java deleted file mode 100644 index 87191161b..000000000 --- a/trainbenchmark-tool-sql/src/main/java/hu/bme/mit/trainbenchmark/benchmark/sql/matches/SqlConnectedSegmentsMatch.java +++ /dev/null @@ -1,63 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2010-2015, Benedek Izso, Gabor Szarnyas, Istvan Rath and Daniel Varro - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Benedek Izso - initial API and implementation - * Gabor Szarnyas - initial API and implementation - *******************************************************************************/ -package hu.bme.mit.trainbenchmark.benchmark.sql.matches; - -import java.sql.ResultSet; -import java.sql.SQLException; - -import hu.bme.mit.trainbenchmark.benchmark.matches.ConnectedSegmentsMatch; -import hu.bme.mit.trainbenchmark.constants.QueryConstants; - -public class SqlConnectedSegmentsMatch extends SqlMatch implements ConnectedSegmentsMatch { - - public SqlConnectedSegmentsMatch(final ResultSet rs) throws SQLException { - match = new Long[] { rs.getLong(QueryConstants.VAR_SENSOR), // - rs.getLong(QueryConstants.VAR_SEGMENT1), rs.getLong(QueryConstants.VAR_SEGMENT2), rs.getLong(QueryConstants.VAR_SEGMENT3), - rs.getLong(QueryConstants.VAR_SEGMENT4), rs.getLong(QueryConstants.VAR_SEGMENT5), rs.getLong(QueryConstants.VAR_SEGMENT6) }; - } - - @Override - public Long getSensor() { - return match[0]; - } - - @Override - public Long getSegment1() { - return match[1]; - } - - @Override - public Long getSegment2() { - return match[2]; - } - - @Override - public Long getSegment3() { - return match[3]; - } - - @Override - public Long getSegment4() { - return match[4]; - } - - @Override - public Long getSegment5() { - return match[5]; - } - - @Override - public Long getSegment6() { - return match[6]; - } - -} diff --git a/trainbenchmark-tool-sql/src/main/java/hu/bme/mit/trainbenchmark/benchmark/sql/matches/SqlMatch.java b/trainbenchmark-tool-sql/src/main/java/hu/bme/mit/trainbenchmark/benchmark/sql/matches/SqlMatch.java deleted file mode 100644 index d7e37446a..000000000 --- a/trainbenchmark-tool-sql/src/main/java/hu/bme/mit/trainbenchmark/benchmark/sql/matches/SqlMatch.java +++ /dev/null @@ -1,60 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2010-2015, Benedek Izso, Gabor Szarnyas, Istvan Rath and Daniel Varro - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Benedek Izso - initial API and implementation - * Gabor Szarnyas - initial API and implementation - *******************************************************************************/ -package hu.bme.mit.trainbenchmark.benchmark.sql.matches; - -import java.sql.ResultSet; -import java.sql.SQLException; - -import hu.bme.mit.trainbenchmark.benchmark.matches.LongMatch; -import hu.bme.mit.trainbenchmark.constants.RailwayQuery; - -/** - * Due to the iterator-like nature of the java.sql.ResultSet interface, we cannot store the ResultSet and have to copy its contents. This is - * implemented for each match in the subclasses of the SqlMatch class. - * - * @author szarnyasg - * - */ -public abstract class SqlMatch extends LongMatch { - - public static SqlMatch createMatch(final RailwayQuery query, final ResultSet rs) throws SQLException { - switch (query) { - case CONNECTEDSEGMENTS: - return new SqlConnectedSegmentsMatch(rs); - case CONNECTEDSEGMENTS_INJECT: - return new SqlConnectedSegmentsInjectMatch(rs); - case POSLENGTH: - return new SqlPosLengthMatch(rs); - case POSLENGTH_INJECT: - return new SqlPosLengthInjectMatch(rs); - case ROUTESENSOR: - return new SqlRouteSensorMatch(rs); - case ROUTESENSOR_INJECT: - return new SqlRouteSensorInjectMatch(rs); - case SEMAPHORENEIGHBOR: - return new SqlSemaphoreNeighborMatch(rs); - case SEMAPHORENEIGHBOR_INJECT: - return new SqlSemaphoreNeighborInjectMatch(rs); - case SWITCHMONITORED: - return new SqlSwitchMonitoredMatch(rs); - case SWITCHMONITORED_INJECT: - return new SqlSwitchMonitoredInjectMatch(rs); - case SWITCHSET: - return new SqlSwitchSetMatch(rs); - case SWITCHSET_INJECT: - return new SqlSwitchSetInjectMatch(rs); - default: - throw new UnsupportedOperationException("Query not supported: " + query); - } - } - -} diff --git a/trainbenchmark-tool-sql/src/main/java/hu/bme/mit/trainbenchmark/benchmark/sql/matches/SqlPosLengthInjectMatch.java b/trainbenchmark-tool-sql/src/main/java/hu/bme/mit/trainbenchmark/benchmark/sql/matches/SqlPosLengthInjectMatch.java deleted file mode 100644 index 3fe94dadd..000000000 --- a/trainbenchmark-tool-sql/src/main/java/hu/bme/mit/trainbenchmark/benchmark/sql/matches/SqlPosLengthInjectMatch.java +++ /dev/null @@ -1,32 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2010-2015, Benedek Izso, Gabor Szarnyas, Istvan Rath and Daniel Varro - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Benedek Izso - initial API and implementation - * Gabor Szarnyas - initial API and implementation - *******************************************************************************/ -package hu.bme.mit.trainbenchmark.benchmark.sql.matches; - -import static hu.bme.mit.trainbenchmark.constants.QueryConstants.VAR_SEGMENT; - -import java.sql.ResultSet; -import java.sql.SQLException; - -import hu.bme.mit.trainbenchmark.benchmark.matches.PosLengthInjectMatch; - -public class SqlPosLengthInjectMatch extends SqlMatch implements PosLengthInjectMatch { - - public SqlPosLengthInjectMatch(final ResultSet rs) throws SQLException { - match = new Long[] { rs.getLong(VAR_SEGMENT) }; - } - - @Override - public Long getSegment() { - return match[0]; - } - -} diff --git a/trainbenchmark-tool-sql/src/main/java/hu/bme/mit/trainbenchmark/benchmark/sql/matches/SqlPosLengthMatch.java b/trainbenchmark-tool-sql/src/main/java/hu/bme/mit/trainbenchmark/benchmark/sql/matches/SqlPosLengthMatch.java deleted file mode 100644 index 6f5378432..000000000 --- a/trainbenchmark-tool-sql/src/main/java/hu/bme/mit/trainbenchmark/benchmark/sql/matches/SqlPosLengthMatch.java +++ /dev/null @@ -1,37 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2010-2015, Benedek Izso, Gabor Szarnyas, Istvan Rath and Daniel Varro - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Benedek Izso - initial API and implementation - * Gabor Szarnyas - initial API and implementation - *******************************************************************************/ -package hu.bme.mit.trainbenchmark.benchmark.sql.matches; - -import static hu.bme.mit.trainbenchmark.constants.QueryConstants.VAR_LENGTH; -import static hu.bme.mit.trainbenchmark.constants.QueryConstants.VAR_SEGMENT; - -import java.sql.ResultSet; -import java.sql.SQLException; - -import hu.bme.mit.trainbenchmark.benchmark.matches.PosLengthMatch; - -public class SqlPosLengthMatch extends SqlMatch implements PosLengthMatch { - - public SqlPosLengthMatch(final ResultSet rs) throws SQLException { - match = new Long[] { rs.getLong(VAR_SEGMENT), rs.getLong(VAR_LENGTH) }; - } - - @Override - public Long getSegment() { - return match[0]; - } - - public Long getLength() { - return match[1]; - } - -} diff --git a/trainbenchmark-tool-sql/src/main/java/hu/bme/mit/trainbenchmark/benchmark/sql/matches/SqlRouteSensorInjectMatch.java b/trainbenchmark-tool-sql/src/main/java/hu/bme/mit/trainbenchmark/benchmark/sql/matches/SqlRouteSensorInjectMatch.java deleted file mode 100644 index 058e1dd43..000000000 --- a/trainbenchmark-tool-sql/src/main/java/hu/bme/mit/trainbenchmark/benchmark/sql/matches/SqlRouteSensorInjectMatch.java +++ /dev/null @@ -1,38 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2010-2015, Benedek Izso, Gabor Szarnyas, Istvan Rath and Daniel Varro - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Benedek Izso - initial API and implementation - * Gabor Szarnyas - initial API and implementation - *******************************************************************************/ -package hu.bme.mit.trainbenchmark.benchmark.sql.matches; - -import static hu.bme.mit.trainbenchmark.constants.QueryConstants.VAR_ROUTE; -import static hu.bme.mit.trainbenchmark.constants.QueryConstants.VAR_SENSOR; - -import java.sql.ResultSet; -import java.sql.SQLException; - -import hu.bme.mit.trainbenchmark.benchmark.matches.RouteSensorInjectMatch; - -public class SqlRouteSensorInjectMatch extends SqlMatch implements RouteSensorInjectMatch { - - public SqlRouteSensorInjectMatch(final ResultSet rs) throws SQLException { - match = new Long[] { rs.getLong(VAR_ROUTE), rs.getLong(VAR_SENSOR) }; - } - - @Override - public Long getRoute() { - return match[0]; - } - - @Override - public Long getSensor() { - return match[1]; - } - -} diff --git a/trainbenchmark-tool-sql/src/main/java/hu/bme/mit/trainbenchmark/benchmark/sql/matches/SqlRouteSensorMatch.java b/trainbenchmark-tool-sql/src/main/java/hu/bme/mit/trainbenchmark/benchmark/sql/matches/SqlRouteSensorMatch.java deleted file mode 100644 index 0099f5897..000000000 --- a/trainbenchmark-tool-sql/src/main/java/hu/bme/mit/trainbenchmark/benchmark/sql/matches/SqlRouteSensorMatch.java +++ /dev/null @@ -1,50 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2010-2015, Benedek Izso, Gabor Szarnyas, Istvan Rath and Daniel Varro - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Benedek Izso - initial API and implementation - * Gabor Szarnyas - initial API and implementation - *******************************************************************************/ -package hu.bme.mit.trainbenchmark.benchmark.sql.matches; - -import static hu.bme.mit.trainbenchmark.constants.QueryConstants.VAR_ROUTE; -import static hu.bme.mit.trainbenchmark.constants.QueryConstants.VAR_SENSOR; -import static hu.bme.mit.trainbenchmark.constants.QueryConstants.VAR_SW; -import static hu.bme.mit.trainbenchmark.constants.QueryConstants.VAR_SWP; - -import java.sql.ResultSet; -import java.sql.SQLException; - -import hu.bme.mit.trainbenchmark.benchmark.matches.RouteSensorMatch; - -public class SqlRouteSensorMatch extends SqlMatch implements RouteSensorMatch { - - public SqlRouteSensorMatch(final ResultSet rs) throws SQLException { - match = new Long[] { rs.getLong(VAR_ROUTE), rs.getLong(VAR_SENSOR), rs.getLong(VAR_SWP), rs.getLong(VAR_SW) }; - } - - @Override - public Long getRoute() { - return match[0]; - } - - @Override - public Long getSensor() { - return match[1]; - } - - @Override - public Long getSwP() { - return match[2]; - } - - @Override - public Long getSw() { - return match[3]; - } - -} diff --git a/trainbenchmark-tool-sql/src/main/java/hu/bme/mit/trainbenchmark/benchmark/sql/matches/SqlSemaphoreNeighborInjectMatch.java b/trainbenchmark-tool-sql/src/main/java/hu/bme/mit/trainbenchmark/benchmark/sql/matches/SqlSemaphoreNeighborInjectMatch.java deleted file mode 100644 index 7d2ea43aa..000000000 --- a/trainbenchmark-tool-sql/src/main/java/hu/bme/mit/trainbenchmark/benchmark/sql/matches/SqlSemaphoreNeighborInjectMatch.java +++ /dev/null @@ -1,38 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2010-2015, Benedek Izso, Gabor Szarnyas, Istvan Rath and Daniel Varro - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Benedek Izso - initial API and implementation - * Gabor Szarnyas - initial API and implementation - *******************************************************************************/ -package hu.bme.mit.trainbenchmark.benchmark.sql.matches; - -import static hu.bme.mit.trainbenchmark.constants.QueryConstants.VAR_ROUTE; -import static hu.bme.mit.trainbenchmark.constants.QueryConstants.VAR_SEMAPHORE; - -import java.sql.ResultSet; -import java.sql.SQLException; - -import hu.bme.mit.trainbenchmark.benchmark.matches.SemaphoreNeighborInjectMatch; - -public class SqlSemaphoreNeighborInjectMatch extends SqlMatch implements SemaphoreNeighborInjectMatch { - - public SqlSemaphoreNeighborInjectMatch(final ResultSet rs) throws SQLException { - match = new Long[] { rs.getLong(VAR_ROUTE), rs.getLong(VAR_SEMAPHORE) }; - } - - @Override - public Long getRoute() { - return match[0]; - } - - @Override - public Long getSemaphore() { - return match[1]; - } - -} diff --git a/trainbenchmark-tool-sql/src/main/java/hu/bme/mit/trainbenchmark/benchmark/sql/matches/SqlSemaphoreNeighborMatch.java b/trainbenchmark-tool-sql/src/main/java/hu/bme/mit/trainbenchmark/benchmark/sql/matches/SqlSemaphoreNeighborMatch.java deleted file mode 100644 index 3748a427e..000000000 --- a/trainbenchmark-tool-sql/src/main/java/hu/bme/mit/trainbenchmark/benchmark/sql/matches/SqlSemaphoreNeighborMatch.java +++ /dev/null @@ -1,61 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2010-2015, Benedek Izso, Gabor Szarnyas, Istvan Rath and Daniel Varro - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Benedek Izso - initial API and implementation - * Gabor Szarnyas - initial API and implementation - *******************************************************************************/ -package hu.bme.mit.trainbenchmark.benchmark.sql.matches; - -import static hu.bme.mit.trainbenchmark.constants.QueryConstants.VAR_ROUTE1; -import static hu.bme.mit.trainbenchmark.constants.QueryConstants.VAR_ROUTE2; -import static hu.bme.mit.trainbenchmark.constants.QueryConstants.VAR_SEMAPHORE; -import static hu.bme.mit.trainbenchmark.constants.QueryConstants.VAR_SENSOR1; -import static hu.bme.mit.trainbenchmark.constants.QueryConstants.VAR_SENSOR2; -import static hu.bme.mit.trainbenchmark.constants.QueryConstants.VAR_TE1; -import static hu.bme.mit.trainbenchmark.constants.QueryConstants.VAR_TE2; - -import java.sql.ResultSet; -import java.sql.SQLException; - -import hu.bme.mit.trainbenchmark.benchmark.matches.SemaphoreNeighborMatch; - -public class SqlSemaphoreNeighborMatch extends SqlMatch implements SemaphoreNeighborMatch { - - public SqlSemaphoreNeighborMatch(final ResultSet rs) throws SQLException { - match = new Long[] { rs.getLong(VAR_SEMAPHORE), rs.getLong(VAR_ROUTE1), rs.getLong(VAR_ROUTE2), rs.getLong(VAR_SENSOR1), - rs.getLong(VAR_SENSOR2), rs.getLong(VAR_TE1), rs.getLong(VAR_TE2), }; - } - - public Long getSemaphore() { - return match[0]; - } - - public Long getRoute1() { - return match[1]; - } - - public Long getRoute2() { - return match[2]; - } - - public Long getSensor1() { - return match[3]; - } - - public Long getSensor2() { - return match[4]; - } - - public Long getTe1() { - return match[5]; - } - - public Long getTe2() { - return match[6]; - } -} diff --git a/trainbenchmark-tool-sql/src/main/java/hu/bme/mit/trainbenchmark/benchmark/sql/matches/SqlSwitchMonitoredInjectMatch.java b/trainbenchmark-tool-sql/src/main/java/hu/bme/mit/trainbenchmark/benchmark/sql/matches/SqlSwitchMonitoredInjectMatch.java deleted file mode 100644 index 109be582d..000000000 --- a/trainbenchmark-tool-sql/src/main/java/hu/bme/mit/trainbenchmark/benchmark/sql/matches/SqlSwitchMonitoredInjectMatch.java +++ /dev/null @@ -1,32 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2010-2015, Benedek Izso, Gabor Szarnyas, Istvan Rath and Daniel Varro - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Benedek Izso - initial API and implementation - * Gabor Szarnyas - initial API and implementation - *******************************************************************************/ -package hu.bme.mit.trainbenchmark.benchmark.sql.matches; - -import static hu.bme.mit.trainbenchmark.constants.QueryConstants.VAR_SW; - -import java.sql.ResultSet; -import java.sql.SQLException; - -import hu.bme.mit.trainbenchmark.benchmark.matches.SwitchMonitoredInjectMatch; - -public class SqlSwitchMonitoredInjectMatch extends SqlMatch implements SwitchMonitoredInjectMatch { - - public SqlSwitchMonitoredInjectMatch(final ResultSet rs) throws SQLException { - match = new Long[] { rs.getLong(VAR_SW) }; - } - - @Override - public Long getSw() { - return match[0]; - } - -} diff --git a/trainbenchmark-tool-sql/src/main/java/hu/bme/mit/trainbenchmark/benchmark/sql/matches/SqlSwitchMonitoredMatch.java b/trainbenchmark-tool-sql/src/main/java/hu/bme/mit/trainbenchmark/benchmark/sql/matches/SqlSwitchMonitoredMatch.java deleted file mode 100644 index f7acd078a..000000000 --- a/trainbenchmark-tool-sql/src/main/java/hu/bme/mit/trainbenchmark/benchmark/sql/matches/SqlSwitchMonitoredMatch.java +++ /dev/null @@ -1,32 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2010-2015, Benedek Izso, Gabor Szarnyas, Istvan Rath and Daniel Varro - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Benedek Izso - initial API and implementation - * Gabor Szarnyas - initial API and implementation - *******************************************************************************/ -package hu.bme.mit.trainbenchmark.benchmark.sql.matches; - -import static hu.bme.mit.trainbenchmark.constants.QueryConstants.VAR_SW; - -import java.sql.ResultSet; -import java.sql.SQLException; - -import hu.bme.mit.trainbenchmark.benchmark.matches.SwitchMonitoredMatch; - -public class SqlSwitchMonitoredMatch extends SqlMatch implements SwitchMonitoredMatch { - - public SqlSwitchMonitoredMatch(final ResultSet rs) throws SQLException { - match = new Long[] { rs.getLong(VAR_SW) }; - } - - @Override - public Long getSw() { - return match[0]; - } - -} diff --git a/trainbenchmark-tool-sql/src/main/java/hu/bme/mit/trainbenchmark/benchmark/sql/matches/SqlSwitchSetInjectMatch.java b/trainbenchmark-tool-sql/src/main/java/hu/bme/mit/trainbenchmark/benchmark/sql/matches/SqlSwitchSetInjectMatch.java deleted file mode 100644 index 080ce854a..000000000 --- a/trainbenchmark-tool-sql/src/main/java/hu/bme/mit/trainbenchmark/benchmark/sql/matches/SqlSwitchSetInjectMatch.java +++ /dev/null @@ -1,32 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2010-2015, Benedek Izso, Gabor Szarnyas, Istvan Rath and Daniel Varro - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Benedek Izso - initial API and implementation - * Gabor Szarnyas - initial API and implementation - *******************************************************************************/ -package hu.bme.mit.trainbenchmark.benchmark.sql.matches; - -import static hu.bme.mit.trainbenchmark.constants.QueryConstants.VAR_SW; - -import java.sql.ResultSet; -import java.sql.SQLException; - -import hu.bme.mit.trainbenchmark.benchmark.matches.SwitchSetInjectMatch; - -public class SqlSwitchSetInjectMatch extends SqlMatch implements SwitchSetInjectMatch { - - public SqlSwitchSetInjectMatch(final ResultSet rs) throws SQLException { - match = new Long[] {rs.getLong(VAR_SW) }; - } - - @Override - public Long getSw() { - return match[0]; - } - -} diff --git a/trainbenchmark-tool-sql/src/main/java/hu/bme/mit/trainbenchmark/benchmark/sql/matches/SqlSwitchSetMatch.java b/trainbenchmark-tool-sql/src/main/java/hu/bme/mit/trainbenchmark/benchmark/sql/matches/SqlSwitchSetMatch.java deleted file mode 100644 index fdbe9330d..000000000 --- a/trainbenchmark-tool-sql/src/main/java/hu/bme/mit/trainbenchmark/benchmark/sql/matches/SqlSwitchSetMatch.java +++ /dev/null @@ -1,61 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2010-2015, Benedek Izso, Gabor Szarnyas, Istvan Rath and Daniel Varro - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Benedek Izso - initial API and implementation - * Gabor Szarnyas - initial API and implementation - *******************************************************************************/ -package hu.bme.mit.trainbenchmark.benchmark.sql.matches; - -import static hu.bme.mit.trainbenchmark.constants.QueryConstants.VAR_CURRENTPOSITION; -import static hu.bme.mit.trainbenchmark.constants.QueryConstants.VAR_POSITION; -import static hu.bme.mit.trainbenchmark.constants.QueryConstants.VAR_ROUTE; -import static hu.bme.mit.trainbenchmark.constants.QueryConstants.VAR_SEMAPHORE; -import static hu.bme.mit.trainbenchmark.constants.QueryConstants.VAR_SW; -import static hu.bme.mit.trainbenchmark.constants.QueryConstants.VAR_SWP; - -import java.sql.ResultSet; -import java.sql.SQLException; - -import hu.bme.mit.trainbenchmark.benchmark.matches.SwitchSetMatch; - -public class SqlSwitchSetMatch extends SqlMatch implements SwitchSetMatch { - - public SqlSwitchSetMatch(final ResultSet rs) throws SQLException { - match = new Long[] { rs.getLong(VAR_SEMAPHORE), rs.getLong(VAR_ROUTE), rs.getLong(VAR_SWP), rs.getLong(VAR_SW), - rs.getLong(VAR_POSITION), rs.getLong(VAR_CURRENTPOSITION) }; - } - - @Override - public Long getSemaphore() { - return match[0]; - } - - @Override - public Long getRoute() { - return match[1]; - } - - @Override - public Long getSwP() { - return match[2]; - } - - @Override - public Long getSw() { - return match[3]; - } - - public Long getPosition() { - return match[4]; - } - - public Long getCurrentPosition() { - return match[5]; - } - -} diff --git a/trainbenchmark-tool-sql/src/main/java/hu/bme/mit/trainbenchmark/benchmark/sql/queries/SqlQuery.java b/trainbenchmark-tool-sql/src/main/java/hu/bme/mit/trainbenchmark/benchmark/sql/queries/SqlQuery.java deleted file mode 100644 index 93a65c792..000000000 --- a/trainbenchmark-tool-sql/src/main/java/hu/bme/mit/trainbenchmark/benchmark/sql/queries/SqlQuery.java +++ /dev/null @@ -1,48 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2010-2015, Benedek Izso, Gabor Szarnyas, Istvan Rath and Daniel Varro - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Benedek Izso - initial API and implementation - * Gabor Szarnyas - initial API and implementation - *******************************************************************************/ -package hu.bme.mit.trainbenchmark.benchmark.sql.queries; - -import java.io.File; -import java.io.IOException; -import java.sql.PreparedStatement; -import java.sql.SQLException; -import java.util.Collection; - -import org.apache.commons.io.FileUtils; - -import hu.bme.mit.trainbenchmark.benchmark.operations.ModelQuery; -import hu.bme.mit.trainbenchmark.benchmark.sql.driver.SqlDriver; -import hu.bme.mit.trainbenchmark.benchmark.sql.matches.SqlMatch; -import hu.bme.mit.trainbenchmark.constants.RailwayQuery; - -public class SqlQuery<TSqlMatch extends SqlMatch, TSqlDriver extends SqlDriver> extends ModelQuery<TSqlMatch, TSqlDriver> { - - protected final String queryDefinition; - protected PreparedStatement statement; - - public SqlQuery(final TSqlDriver driver, final String workspaceDir, final RailwayQuery query) throws IOException, SQLException { - super(query, driver); - - final String queryPath = workspaceDir + driver.getResourceDirectory() + "queries/" + query + ".sql"; - queryDefinition = FileUtils.readFileToString(new File(queryPath)); - } - - @SuppressWarnings("unchecked") - @Override - public Collection<TSqlMatch> evaluate() throws SQLException { - if (statement == null) { - statement = driver.getConnection().prepareStatement(queryDefinition); - } - return (Collection<TSqlMatch>) driver.runStatement(query, statement); - } - -} diff --git a/trainbenchmark-tool-sql/src/main/java/hu/bme/mit/trainbenchmark/benchmark/sql/transformations/SqlTransformation.java b/trainbenchmark-tool-sql/src/main/java/hu/bme/mit/trainbenchmark/benchmark/sql/transformations/SqlTransformation.java deleted file mode 100644 index 56805b2c1..000000000 --- a/trainbenchmark-tool-sql/src/main/java/hu/bme/mit/trainbenchmark/benchmark/sql/transformations/SqlTransformation.java +++ /dev/null @@ -1,37 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2010-2015, Benedek Izso, Gabor Szarnyas, Istvan Rath and Daniel Varro - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Benedek Izso - initial API and implementation - * Gabor Szarnyas - initial API and implementation - *******************************************************************************/ -package hu.bme.mit.trainbenchmark.benchmark.sql.transformations; - -import java.io.File; -import java.io.IOException; -import java.sql.PreparedStatement; - -import org.apache.commons.io.FileUtils; - -import hu.bme.mit.trainbenchmark.benchmark.operations.ModelTransformation; -import hu.bme.mit.trainbenchmark.benchmark.sql.driver.SqlDriver; -import hu.bme.mit.trainbenchmark.benchmark.sql.matches.SqlMatch; -import hu.bme.mit.trainbenchmark.constants.RailwayOperation; - -public abstract class SqlTransformation<TSqlMatch extends SqlMatch, TSqlDriver extends SqlDriver> extends ModelTransformation<TSqlMatch, TSqlDriver> { - - protected PreparedStatement preparedUpdateStatement; - protected String updateQuery; - - protected SqlTransformation(final TSqlDriver driver, final String workspaceDir, final RailwayOperation operation) throws IOException { - super(driver); - - final String updatePath = workspaceDir + driver.getResourceDirectory() + "transformations/" + operation + "Rhs.sql"; - this.updateQuery = FileUtils.readFileToString(new File(updatePath)); - } - -} diff --git a/trainbenchmark-tool-sql/src/main/java/hu/bme/mit/trainbenchmark/benchmark/sql/transformations/inject/SqlTransformationInjectConnectedSegments.java b/trainbenchmark-tool-sql/src/main/java/hu/bme/mit/trainbenchmark/benchmark/sql/transformations/inject/SqlTransformationInjectConnectedSegments.java deleted file mode 100644 index d4ce5452f..000000000 --- a/trainbenchmark-tool-sql/src/main/java/hu/bme/mit/trainbenchmark/benchmark/sql/transformations/inject/SqlTransformationInjectConnectedSegments.java +++ /dev/null @@ -1,45 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2010-2015, Benedek Izso, Gabor Szarnyas, Istvan Rath and Daniel Varro - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Benedek Izso - initial API and implementation - * Gabor Szarnyas - initial API and implementation - *******************************************************************************/ -package hu.bme.mit.trainbenchmark.benchmark.sql.transformations.inject; - -import java.io.IOException; -import java.sql.SQLException; -import java.util.Collection; - -import hu.bme.mit.trainbenchmark.benchmark.sql.driver.SqlDriver; -import hu.bme.mit.trainbenchmark.benchmark.sql.matches.SqlConnectedSegmentsInjectMatch; -import hu.bme.mit.trainbenchmark.benchmark.sql.transformations.SqlTransformation; -import hu.bme.mit.trainbenchmark.constants.RailwayOperation; -import hu.bme.mit.trainbenchmark.constants.TrainBenchmarkConstants; - -public class SqlTransformationInjectConnectedSegments<TSqlDriver extends SqlDriver> extends SqlTransformation<SqlConnectedSegmentsInjectMatch, TSqlDriver> { - - public SqlTransformationInjectConnectedSegments(final TSqlDriver driver, final String workspaceDir) throws IOException { - super(driver, workspaceDir, RailwayOperation.CONNECTEDSEGMENTS_INJECT); - } - - @Override - public void activate(final Collection<SqlConnectedSegmentsInjectMatch> matches) throws SQLException { - if (preparedUpdateStatement == null) { - preparedUpdateStatement = driver.getConnection().prepareStatement(updateQuery); - } - - for (final SqlConnectedSegmentsInjectMatch match : matches) { - preparedUpdateStatement.setLong(1, match.getSensor()); - preparedUpdateStatement.setLong(2, match.getSegment1()); - preparedUpdateStatement.setLong(3, match.getSegment3()); - preparedUpdateStatement.setLong(4, TrainBenchmarkConstants.DEFAULT_SEGMENT_LENGTH); - preparedUpdateStatement.executeUpdate(); - } - } - -} diff --git a/trainbenchmark-tool-sql/src/main/java/hu/bme/mit/trainbenchmark/benchmark/sql/transformations/inject/SqlTransformationInjectPosLength.java b/trainbenchmark-tool-sql/src/main/java/hu/bme/mit/trainbenchmark/benchmark/sql/transformations/inject/SqlTransformationInjectPosLength.java deleted file mode 100644 index 0d59ecc05..000000000 --- a/trainbenchmark-tool-sql/src/main/java/hu/bme/mit/trainbenchmark/benchmark/sql/transformations/inject/SqlTransformationInjectPosLength.java +++ /dev/null @@ -1,41 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2010-2015, Benedek Izso, Gabor Szarnyas, Istvan Rath and Daniel Varro - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Benedek Izso - initial API and implementation - * Gabor Szarnyas - initial API and implementation - *******************************************************************************/ -package hu.bme.mit.trainbenchmark.benchmark.sql.transformations.inject; - -import java.io.IOException; -import java.sql.SQLException; -import java.util.Collection; - -import hu.bme.mit.trainbenchmark.benchmark.sql.driver.SqlDriver; -import hu.bme.mit.trainbenchmark.benchmark.sql.matches.SqlPosLengthInjectMatch; -import hu.bme.mit.trainbenchmark.benchmark.sql.transformations.SqlTransformation; -import hu.bme.mit.trainbenchmark.constants.RailwayOperation; - -public class SqlTransformationInjectPosLength<TSqlDriver extends SqlDriver> extends SqlTransformation<SqlPosLengthInjectMatch, TSqlDriver> { - - public SqlTransformationInjectPosLength(final TSqlDriver driver, final String workspaceDir) throws IOException { - super(driver, workspaceDir, RailwayOperation.POSLENGTH_INJECT); - } - - @Override - public void activate(final Collection<SqlPosLengthInjectMatch> matches) throws SQLException { - if (preparedUpdateStatement == null) { - preparedUpdateStatement = driver.getConnection().prepareStatement(updateQuery); - } - - for (final SqlPosLengthInjectMatch match : matches) { - preparedUpdateStatement.setLong(1, match.getSegment()); - preparedUpdateStatement.executeUpdate(); - } - } - -} diff --git a/trainbenchmark-tool-sql/src/main/java/hu/bme/mit/trainbenchmark/benchmark/sql/transformations/inject/SqlTransformationInjectRouteSensor.java b/trainbenchmark-tool-sql/src/main/java/hu/bme/mit/trainbenchmark/benchmark/sql/transformations/inject/SqlTransformationInjectRouteSensor.java deleted file mode 100644 index f2aef60f6..000000000 --- a/trainbenchmark-tool-sql/src/main/java/hu/bme/mit/trainbenchmark/benchmark/sql/transformations/inject/SqlTransformationInjectRouteSensor.java +++ /dev/null @@ -1,43 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2010-2015, Benedek Izso, Gabor Szarnyas, Istvan Rath and Daniel Varro - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Benedek Izso - initial API and implementation - * Gabor Szarnyas - initial API and implementation - *******************************************************************************/ -package hu.bme.mit.trainbenchmark.benchmark.sql.transformations.inject; - -import java.io.IOException; -import java.sql.SQLException; -import java.util.Collection; - -import hu.bme.mit.trainbenchmark.benchmark.sql.driver.SqlDriver; -import hu.bme.mit.trainbenchmark.benchmark.sql.matches.SqlRouteSensorInjectMatch; -import hu.bme.mit.trainbenchmark.benchmark.sql.transformations.SqlTransformation; -import hu.bme.mit.trainbenchmark.constants.RailwayOperation; - -public class SqlTransformationInjectRouteSensor<TSqlDriver extends SqlDriver> - extends SqlTransformation<SqlRouteSensorInjectMatch, TSqlDriver> { - - public SqlTransformationInjectRouteSensor(final TSqlDriver driver, final String workspaceDir) throws IOException { - super(driver, workspaceDir, RailwayOperation.ROUTESENSOR_INJECT); - } - - @Override - public void activate(final Collection<SqlRouteSensorInjectMatch> matches) throws SQLException { - if (preparedUpdateStatement == null) { - preparedUpdateStatement = driver.getConnection().prepareStatement(updateQuery); - } - - for (final SqlRouteSensorInjectMatch match : matches) { - preparedUpdateStatement.setLong(1, match.getRoute()); - preparedUpdateStatement.setLong(2, match.getSensor()); - preparedUpdateStatement.executeUpdate(); - } - } - -} diff --git a/trainbenchmark-tool-sql/src/main/java/hu/bme/mit/trainbenchmark/benchmark/sql/transformations/inject/SqlTransformationInjectSemaphoreNeighbor.java b/trainbenchmark-tool-sql/src/main/java/hu/bme/mit/trainbenchmark/benchmark/sql/transformations/inject/SqlTransformationInjectSemaphoreNeighbor.java deleted file mode 100644 index 52200b120..000000000 --- a/trainbenchmark-tool-sql/src/main/java/hu/bme/mit/trainbenchmark/benchmark/sql/transformations/inject/SqlTransformationInjectSemaphoreNeighbor.java +++ /dev/null @@ -1,42 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2010-2015, Benedek Izso, Gabor Szarnyas, Istvan Rath and Daniel Varro - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Benedek Izso - initial API and implementation - * Gabor Szarnyas - initial API and implementation - *******************************************************************************/ -package hu.bme.mit.trainbenchmark.benchmark.sql.transformations.inject; - -import java.io.IOException; -import java.sql.SQLException; -import java.util.Collection; - -import hu.bme.mit.trainbenchmark.benchmark.sql.driver.SqlDriver; -import hu.bme.mit.trainbenchmark.benchmark.sql.matches.SqlSemaphoreNeighborInjectMatch; -import hu.bme.mit.trainbenchmark.benchmark.sql.transformations.SqlTransformation; -import hu.bme.mit.trainbenchmark.constants.RailwayOperation; - -public class SqlTransformationInjectSemaphoreNeighbor<TSqlDriver extends SqlDriver> extends SqlTransformation<SqlSemaphoreNeighborInjectMatch, TSqlDriver> { - - public SqlTransformationInjectSemaphoreNeighbor(final TSqlDriver driver, final String workspaceDir) throws IOException { - super(driver, workspaceDir, RailwayOperation.SEMAPHORENEIGHBOR_INJECT); - } - - @Override - public void activate(final Collection<SqlSemaphoreNeighborInjectMatch> matches) throws SQLException { - if (preparedUpdateStatement == null) { - preparedUpdateStatement = driver.getConnection().prepareStatement(updateQuery); - } - - for (final SqlSemaphoreNeighborInjectMatch match : matches) { - preparedUpdateStatement.setLong(1, match.getRoute()); - preparedUpdateStatement.setLong(2, match.getSemaphore()); - preparedUpdateStatement.executeUpdate(); - } - } - -} diff --git a/trainbenchmark-tool-sql/src/main/java/hu/bme/mit/trainbenchmark/benchmark/sql/transformations/inject/SqlTransformationInjectSwitchMonitored.java b/trainbenchmark-tool-sql/src/main/java/hu/bme/mit/trainbenchmark/benchmark/sql/transformations/inject/SqlTransformationInjectSwitchMonitored.java deleted file mode 100644 index e703529ef..000000000 --- a/trainbenchmark-tool-sql/src/main/java/hu/bme/mit/trainbenchmark/benchmark/sql/transformations/inject/SqlTransformationInjectSwitchMonitored.java +++ /dev/null @@ -1,41 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2010-2015, Benedek Izso, Gabor Szarnyas, Istvan Rath and Daniel Varro - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Benedek Izso - initial API and implementation - * Gabor Szarnyas - initial API and implementation - *******************************************************************************/ -package hu.bme.mit.trainbenchmark.benchmark.sql.transformations.inject; - -import java.io.IOException; -import java.sql.SQLException; -import java.util.Collection; - -import hu.bme.mit.trainbenchmark.benchmark.sql.driver.SqlDriver; -import hu.bme.mit.trainbenchmark.benchmark.sql.matches.SqlSwitchMonitoredInjectMatch; -import hu.bme.mit.trainbenchmark.benchmark.sql.transformations.SqlTransformation; -import hu.bme.mit.trainbenchmark.constants.RailwayOperation; - -public class SqlTransformationInjectSwitchMonitored<TSqlDriver extends SqlDriver> extends SqlTransformation<SqlSwitchMonitoredInjectMatch, TSqlDriver> { - - public SqlTransformationInjectSwitchMonitored(final TSqlDriver driver, final String workspaceDir) throws IOException { - super(driver, workspaceDir, RailwayOperation.SWITCHMONITORED_INJECT); - } - - @Override - public void activate(final Collection<SqlSwitchMonitoredInjectMatch> matches) throws SQLException { - if (preparedUpdateStatement == null) { - preparedUpdateStatement = driver.getConnection().prepareStatement(updateQuery); - } - - for (final SqlSwitchMonitoredInjectMatch match : matches) { - preparedUpdateStatement.setLong(1, match.getSw()); - preparedUpdateStatement.executeUpdate(); - } - } - -} diff --git a/trainbenchmark-tool-sql/src/main/java/hu/bme/mit/trainbenchmark/benchmark/sql/transformations/inject/SqlTransformationInjectSwitchSet.java b/trainbenchmark-tool-sql/src/main/java/hu/bme/mit/trainbenchmark/benchmark/sql/transformations/inject/SqlTransformationInjectSwitchSet.java deleted file mode 100644 index 0acb42488..000000000 --- a/trainbenchmark-tool-sql/src/main/java/hu/bme/mit/trainbenchmark/benchmark/sql/transformations/inject/SqlTransformationInjectSwitchSet.java +++ /dev/null @@ -1,41 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2010-2015, Benedek Izso, Gabor Szarnyas, Istvan Rath and Daniel Varro - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Benedek Izso - initial API and implementation - * Gabor Szarnyas - initial API and implementation - *******************************************************************************/ -package hu.bme.mit.trainbenchmark.benchmark.sql.transformations.inject; - -import java.io.IOException; -import java.sql.SQLException; -import java.util.Collection; - -import hu.bme.mit.trainbenchmark.benchmark.sql.driver.SqlDriver; -import hu.bme.mit.trainbenchmark.benchmark.sql.matches.SqlSwitchSetInjectMatch; -import hu.bme.mit.trainbenchmark.benchmark.sql.transformations.SqlTransformation; -import hu.bme.mit.trainbenchmark.constants.RailwayOperation; - -public class SqlTransformationInjectSwitchSet<TSqlDriver extends SqlDriver> extends SqlTransformation<SqlSwitchSetInjectMatch, TSqlDriver> { - - public SqlTransformationInjectSwitchSet(final TSqlDriver driver, final String workspaceDir) throws IOException { - super(driver, workspaceDir, RailwayOperation.SWITCHSET_INJECT); - } - - @Override - public void activate(final Collection<SqlSwitchSetInjectMatch> matches) throws SQLException { - if (preparedUpdateStatement == null) { - preparedUpdateStatement = driver.getConnection().prepareStatement(updateQuery); - } - - for (final SqlSwitchSetInjectMatch match : matches) { - preparedUpdateStatement.setLong(1, match.getSw()); - preparedUpdateStatement.executeUpdate(); - } - } - -} diff --git a/trainbenchmark-tool-sql/src/main/java/hu/bme/mit/trainbenchmark/benchmark/sql/transformations/repair/SqlTransformationRepairConnectedSegments.java b/trainbenchmark-tool-sql/src/main/java/hu/bme/mit/trainbenchmark/benchmark/sql/transformations/repair/SqlTransformationRepairConnectedSegments.java deleted file mode 100644 index a56ec89b2..000000000 --- a/trainbenchmark-tool-sql/src/main/java/hu/bme/mit/trainbenchmark/benchmark/sql/transformations/repair/SqlTransformationRepairConnectedSegments.java +++ /dev/null @@ -1,44 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2010-2015, Benedek Izso, Gabor Szarnyas, Istvan Rath and Daniel Varro - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Benedek Izso - initial API and implementation - * Gabor Szarnyas - initial API and implementation - *******************************************************************************/ -package hu.bme.mit.trainbenchmark.benchmark.sql.transformations.repair; - -import java.io.IOException; -import java.sql.SQLException; -import java.util.Collection; - -import hu.bme.mit.trainbenchmark.benchmark.sql.driver.SqlDriver; -import hu.bme.mit.trainbenchmark.benchmark.sql.matches.SqlConnectedSegmentsMatch; -import hu.bme.mit.trainbenchmark.benchmark.sql.transformations.SqlTransformation; -import hu.bme.mit.trainbenchmark.constants.RailwayOperation; - -public class SqlTransformationRepairConnectedSegments<TSqlDriver extends SqlDriver> extends SqlTransformation<SqlConnectedSegmentsMatch, TSqlDriver> { - - public SqlTransformationRepairConnectedSegments(final TSqlDriver driver, final String workspaceDir) - throws IOException { - super(driver, workspaceDir, RailwayOperation.CONNECTEDSEGMENTS_REPAIR); - } - - @Override - public void activate(final Collection<SqlConnectedSegmentsMatch> matches) throws SQLException { - if (preparedUpdateStatement == null) { - preparedUpdateStatement = driver.getConnection().prepareStatement(updateQuery); - } - - for (final SqlConnectedSegmentsMatch match : matches) { - preparedUpdateStatement.setLong(1, match.getSegment1()); - preparedUpdateStatement.setLong(2, match.getSegment2()); - preparedUpdateStatement.setLong(3, match.getSegment3()); - preparedUpdateStatement.executeUpdate(); - } - } - -} diff --git a/trainbenchmark-tool-sql/src/main/java/hu/bme/mit/trainbenchmark/benchmark/sql/transformations/repair/SqlTransformationRepairPosLength.java b/trainbenchmark-tool-sql/src/main/java/hu/bme/mit/trainbenchmark/benchmark/sql/transformations/repair/SqlTransformationRepairPosLength.java deleted file mode 100644 index 7e54432b0..000000000 --- a/trainbenchmark-tool-sql/src/main/java/hu/bme/mit/trainbenchmark/benchmark/sql/transformations/repair/SqlTransformationRepairPosLength.java +++ /dev/null @@ -1,41 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2010-2015, Benedek Izso, Gabor Szarnyas, Istvan Rath and Daniel Varro - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Benedek Izso - initial API and implementation - * Gabor Szarnyas - initial API and implementation - *******************************************************************************/ -package hu.bme.mit.trainbenchmark.benchmark.sql.transformations.repair; - -import java.io.IOException; -import java.sql.SQLException; -import java.util.Collection; - -import hu.bme.mit.trainbenchmark.benchmark.sql.driver.SqlDriver; -import hu.bme.mit.trainbenchmark.benchmark.sql.matches.SqlPosLengthMatch; -import hu.bme.mit.trainbenchmark.benchmark.sql.transformations.SqlTransformation; -import hu.bme.mit.trainbenchmark.constants.RailwayOperation; - -public class SqlTransformationRepairPosLength<TSqlDriver extends SqlDriver> extends SqlTransformation<SqlPosLengthMatch, TSqlDriver> { - - public SqlTransformationRepairPosLength(final TSqlDriver driver, final String workspaceDir) throws IOException { - super(driver, workspaceDir, RailwayOperation.POSLENGTH_REPAIR); - } - - @Override - public void activate(final Collection<SqlPosLengthMatch> matches) throws SQLException { - if (preparedUpdateStatement == null) { - preparedUpdateStatement = driver.getConnection().prepareStatement(updateQuery); - } - - for (final SqlPosLengthMatch match : matches) { - preparedUpdateStatement.setLong(1, match.getSegment()); - preparedUpdateStatement.executeUpdate(); - } - } - -} diff --git a/trainbenchmark-tool-sql/src/main/java/hu/bme/mit/trainbenchmark/benchmark/sql/transformations/repair/SqlTransformationRepairRouteSensor.java b/trainbenchmark-tool-sql/src/main/java/hu/bme/mit/trainbenchmark/benchmark/sql/transformations/repair/SqlTransformationRepairRouteSensor.java deleted file mode 100644 index 601288417..000000000 --- a/trainbenchmark-tool-sql/src/main/java/hu/bme/mit/trainbenchmark/benchmark/sql/transformations/repair/SqlTransformationRepairRouteSensor.java +++ /dev/null @@ -1,43 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2010-2015, Benedek Izso, Gabor Szarnyas, Istvan Rath and Daniel Varro - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Benedek Izso - initial API and implementation - * Gabor Szarnyas - initial API and implementation - *******************************************************************************/ -package hu.bme.mit.trainbenchmark.benchmark.sql.transformations.repair; - -import java.io.IOException; -import java.sql.SQLException; -import java.util.Collection; - -import hu.bme.mit.trainbenchmark.benchmark.sql.driver.SqlDriver; -import hu.bme.mit.trainbenchmark.benchmark.sql.matches.SqlRouteSensorMatch; -import hu.bme.mit.trainbenchmark.benchmark.sql.transformations.SqlTransformation; -import hu.bme.mit.trainbenchmark.constants.RailwayOperation; - -public class SqlTransformationRepairRouteSensor<TSqlDriver extends SqlDriver> extends SqlTransformation<SqlRouteSensorMatch, TSqlDriver> { - - public SqlTransformationRepairRouteSensor(final TSqlDriver driver, final String workspaceDir) - throws IOException { - super(driver, workspaceDir, RailwayOperation.ROUTESENSOR_REPAIR); - } - - @Override - public void activate(final Collection<SqlRouteSensorMatch> matches) throws SQLException { - if (preparedUpdateStatement == null) { - preparedUpdateStatement = driver.getConnection().prepareStatement(updateQuery); - } - - for (final SqlRouteSensorMatch match : matches) { - preparedUpdateStatement.setLong(1, match.getRoute()); - preparedUpdateStatement.setLong(2, match.getSensor()); - preparedUpdateStatement.executeUpdate(); - } - } - -} diff --git a/trainbenchmark-tool-sql/src/main/java/hu/bme/mit/trainbenchmark/benchmark/sql/transformations/repair/SqlTransformationRepairSemaphoreNeighbor.java b/trainbenchmark-tool-sql/src/main/java/hu/bme/mit/trainbenchmark/benchmark/sql/transformations/repair/SqlTransformationRepairSemaphoreNeighbor.java deleted file mode 100644 index 79e226ed7..000000000 --- a/trainbenchmark-tool-sql/src/main/java/hu/bme/mit/trainbenchmark/benchmark/sql/transformations/repair/SqlTransformationRepairSemaphoreNeighbor.java +++ /dev/null @@ -1,43 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2010-2015, Benedek Izso, Gabor Szarnyas, Istvan Rath and Daniel Varro - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Benedek Izso - initial API and implementation - * Gabor Szarnyas - initial API and implementation - *******************************************************************************/ -package hu.bme.mit.trainbenchmark.benchmark.sql.transformations.repair; - -import java.io.IOException; -import java.sql.SQLException; -import java.util.Collection; - -import hu.bme.mit.trainbenchmark.benchmark.sql.driver.SqlDriver; -import hu.bme.mit.trainbenchmark.benchmark.sql.matches.SqlSemaphoreNeighborMatch; -import hu.bme.mit.trainbenchmark.benchmark.sql.transformations.SqlTransformation; -import hu.bme.mit.trainbenchmark.constants.RailwayOperation; - -public class SqlTransformationRepairSemaphoreNeighbor<TSqlDriver extends SqlDriver> extends SqlTransformation<SqlSemaphoreNeighborMatch, TSqlDriver> { - - public SqlTransformationRepairSemaphoreNeighbor(final TSqlDriver driver, final String workspaceDir) - throws IOException { - super(driver, workspaceDir, RailwayOperation.SEMAPHORENEIGHBOR_REPAIR); - } - - @Override - public void activate(final Collection<SqlSemaphoreNeighborMatch> matches) throws SQLException { - if (preparedUpdateStatement == null) { - preparedUpdateStatement = driver.getConnection().prepareStatement(updateQuery); - } - - for (final SqlSemaphoreNeighborMatch match : matches) { - preparedUpdateStatement.setLong(1, match.getSemaphore()); - preparedUpdateStatement.setLong(2, match.getRoute2()); - preparedUpdateStatement.executeUpdate(); - } - } - -} diff --git a/trainbenchmark-tool-sql/src/main/java/hu/bme/mit/trainbenchmark/benchmark/sql/transformations/repair/SqlTransformationRepairSwitchMonitored.java b/trainbenchmark-tool-sql/src/main/java/hu/bme/mit/trainbenchmark/benchmark/sql/transformations/repair/SqlTransformationRepairSwitchMonitored.java deleted file mode 100644 index a0810c849..000000000 --- a/trainbenchmark-tool-sql/src/main/java/hu/bme/mit/trainbenchmark/benchmark/sql/transformations/repair/SqlTransformationRepairSwitchMonitored.java +++ /dev/null @@ -1,42 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2010-2015, Benedek Izso, Gabor Szarnyas, Istvan Rath and Daniel Varro - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Benedek Izso - initial API and implementation - * Gabor Szarnyas - initial API and implementation - *******************************************************************************/ -package hu.bme.mit.trainbenchmark.benchmark.sql.transformations.repair; - -import java.io.IOException; -import java.sql.SQLException; -import java.util.Collection; - -import hu.bme.mit.trainbenchmark.benchmark.sql.driver.SqlDriver; -import hu.bme.mit.trainbenchmark.benchmark.sql.matches.SqlSwitchMonitoredMatch; -import hu.bme.mit.trainbenchmark.benchmark.sql.transformations.SqlTransformation; -import hu.bme.mit.trainbenchmark.constants.RailwayOperation; - -public class SqlTransformationRepairSwitchMonitored<TSqlDriver extends SqlDriver> extends SqlTransformation<SqlSwitchMonitoredMatch, TSqlDriver> { - - public SqlTransformationRepairSwitchMonitored(final TSqlDriver driver, final String workspaceDir) - throws IOException { - super(driver, workspaceDir, RailwayOperation.SWITCHMONITORED_REPAIR); - } - - @Override - public void activate(final Collection<SqlSwitchMonitoredMatch> matches) throws SQLException { - if (preparedUpdateStatement == null) { - preparedUpdateStatement = driver.getConnection().prepareStatement(updateQuery); - } - - for (final SqlSwitchMonitoredMatch match : matches) { - preparedUpdateStatement.setLong(1, match.getSw()); - preparedUpdateStatement.executeUpdate(); - } - } - -} diff --git a/trainbenchmark-tool-sql/src/main/java/hu/bme/mit/trainbenchmark/benchmark/sql/transformations/repair/SqlTransformationRepairSwitchSet.java b/trainbenchmark-tool-sql/src/main/java/hu/bme/mit/trainbenchmark/benchmark/sql/transformations/repair/SqlTransformationRepairSwitchSet.java deleted file mode 100644 index 1aeac17b2..000000000 --- a/trainbenchmark-tool-sql/src/main/java/hu/bme/mit/trainbenchmark/benchmark/sql/transformations/repair/SqlTransformationRepairSwitchSet.java +++ /dev/null @@ -1,43 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2010-2015, Benedek Izso, Gabor Szarnyas, Istvan Rath and Daniel Varro - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Benedek Izso - initial API and implementation - * Gabor Szarnyas - initial API and implementation - *******************************************************************************/ -package hu.bme.mit.trainbenchmark.benchmark.sql.transformations.repair; - -import java.io.IOException; -import java.sql.SQLException; -import java.util.Collection; - -import hu.bme.mit.trainbenchmark.benchmark.sql.driver.SqlDriver; -import hu.bme.mit.trainbenchmark.benchmark.sql.matches.SqlSwitchSetMatch; -import hu.bme.mit.trainbenchmark.benchmark.sql.transformations.SqlTransformation; -import hu.bme.mit.trainbenchmark.constants.RailwayOperation; - -public class SqlTransformationRepairSwitchSet<TSqlDriver extends SqlDriver> extends SqlTransformation<SqlSwitchSetMatch, TSqlDriver> { - - public SqlTransformationRepairSwitchSet(final TSqlDriver driver, final String workspaceDir) - throws IOException { - super(driver, workspaceDir, RailwayOperation.SWITCHSET_REPAIR); - } - - @Override - public void activate(final Collection<SqlSwitchSetMatch> matches) throws SQLException { - if (preparedUpdateStatement == null) { - preparedUpdateStatement = driver.getConnection().prepareStatement(updateQuery); - } - - for (final SqlSwitchSetMatch match : matches) { - preparedUpdateStatement.setLong(1, match.getPosition()); - preparedUpdateStatement.setLong(2, match.getSw()); - preparedUpdateStatement.executeUpdate(); - } - } - -} diff --git a/trainbenchmark-tool-sql/src/main/resources/queries/ConnectedSegments.sql b/trainbenchmark-tool-sql/src/main/resources/queries/ConnectedSegments.sql deleted file mode 100644 index 295d67641..000000000 --- a/trainbenchmark-tool-sql/src/main/resources/queries/ConnectedSegments.sql +++ /dev/null @@ -1,25 +0,0 @@ -SELECT DISTINCT - mb1.Sensor_id AS sensor, - ct1.TrackElement1_id AS segment1, - ct2.TrackElement1_id AS segment2, - ct3.TrackElement1_id AS segment3, - ct4.TrackElement1_id AS segment4, - ct5.TrackElement1_id AS segment5, - ct5.TrackElement2_id AS segment6 -FROM Segment -INNER JOIN connectsTo as ct1 ON Segment.id = ct1.TrackElement1_id -INNER JOIN connectsTo as ct2 ON ct1.TrackElement2_id = ct2.TrackElement1_id -INNER JOIN connectsTo as ct3 ON ct2.TrackElement2_id = ct3.TrackElement1_id -INNER JOIN connectsTo as ct4 ON ct3.TrackElement2_id = ct4.TrackElement1_id -INNER JOIN connectsTo as ct5 ON ct4.TrackElement2_id = ct5.TrackElement1_id -INNER JOIN monitoredBy as mb1 ON mb1.TrackElement_id = ct1.TrackElement1_id -- segment1 -INNER JOIN monitoredBy as mb2 ON mb2.TrackElement_id = ct2.TrackElement1_id -- segment2 -INNER JOIN monitoredBy as mb3 ON mb3.TrackElement_id = ct3.TrackElement1_id -- segment3 -INNER JOIN monitoredBy as mb4 ON mb4.TrackElement_id = ct4.TrackElement1_id -- segment4 -INNER JOIN monitoredBy as mb5 ON mb5.TrackElement_id = ct5.TrackElement1_id -- segment5 -INNER JOIN monitoredBy as mb6 ON mb6.TrackElement_id = ct5.TrackElement2_id -- segment6 -WHERE mb1.Sensor_id = mb2.Sensor_id - AND mb1.Sensor_id = mb3.Sensor_id - AND mb1.Sensor_id = mb4.Sensor_id - AND mb1.Sensor_id = mb5.Sensor_id - AND mb1.Sensor_id = mb6.Sensor_id; diff --git a/trainbenchmark-tool-sql/src/main/resources/queries/ConnectedSegmentsInject.sql b/trainbenchmark-tool-sql/src/main/resources/queries/ConnectedSegmentsInject.sql deleted file mode 100644 index 2a36fa823..000000000 --- a/trainbenchmark-tool-sql/src/main/resources/queries/ConnectedSegmentsInject.sql +++ /dev/null @@ -1,9 +0,0 @@ -SELECT DISTINCT - mb1.Sensor_id AS sensor, - ct.TrackElement1_id AS segment1, - ct.TrackElement2_id AS segment3 -FROM Segment -INNER JOIN connectsTo as ct ON Segment.id = ct.TrackElement1_id -INNER JOIN monitoredBy as mb1 ON mb1.TrackElement_id = ct.TrackElement1_id -- segment1 -INNER JOIN monitoredBy as mb2 ON mb2.TrackElement_id = ct.TrackElement2_id -- segment3 -WHERE mb1.Sensor_id = mb2.Sensor_id; diff --git a/trainbenchmark-tool-sql/src/main/resources/queries/PosLength.sql b/trainbenchmark-tool-sql/src/main/resources/queries/PosLength.sql deleted file mode 100644 index 2a3dac092..000000000 --- a/trainbenchmark-tool-sql/src/main/resources/queries/PosLength.sql +++ /dev/null @@ -1,5 +0,0 @@ -SELECT - id AS segment, - length AS length -FROM Segment -WHERE length <= 0; diff --git a/trainbenchmark-tool-sql/src/main/resources/queries/PosLengthInject.sql b/trainbenchmark-tool-sql/src/main/resources/queries/PosLengthInject.sql deleted file mode 100644 index 2ce329ebf..000000000 --- a/trainbenchmark-tool-sql/src/main/resources/queries/PosLengthInject.sql +++ /dev/null @@ -1,2 +0,0 @@ -SELECT DISTINCT id AS segment -FROM Segment; diff --git a/trainbenchmark-tool-sql/src/main/resources/queries/RouteSensor.sql b/trainbenchmark-tool-sql/src/main/resources/queries/RouteSensor.sql deleted file mode 100644 index 2e6d8a7f2..000000000 --- a/trainbenchmark-tool-sql/src/main/resources/queries/RouteSensor.sql +++ /dev/null @@ -1,13 +0,0 @@ -SELECT DISTINCT - Route.id AS route, - Sensor.id AS sensor, - SwitchPosition.id AS swP, - Switch.id as sw -FROM Sensor - INNER JOIN monitoredBy ON monitoredBy.Sensor_id = Sensor.id - INNER JOIN Switch ON Switch.id = monitoredBy.TrackElement_id - INNER JOIN SwitchPosition ON SwitchPosition.target = Switch.id - INNER JOIN Route ON Route.id = SwitchPosition.route -- the "SwitchPosition.route" attribute is the inverse of the "Route.follows" edge -LEFT OUTER JOIN requires ON requires.Route_id = Route.id - AND requires.Sensor_id = Sensor.id -WHERE requires.Sensor_id IS NULL diff --git a/trainbenchmark-tool-sql/src/main/resources/queries/RouteSensorInject.sql b/trainbenchmark-tool-sql/src/main/resources/queries/RouteSensorInject.sql deleted file mode 100644 index e3b104393..000000000 --- a/trainbenchmark-tool-sql/src/main/resources/queries/RouteSensorInject.sql +++ /dev/null @@ -1,4 +0,0 @@ -SELECT DISTINCT - Route_id AS route, - Sensor_id AS sensor -FROM requires diff --git a/trainbenchmark-tool-sql/src/main/resources/queries/SemaphoreNeighbor.sql b/trainbenchmark-tool-sql/src/main/resources/queries/SemaphoreNeighbor.sql deleted file mode 100644 index 55674fb57..000000000 --- a/trainbenchmark-tool-sql/src/main/resources/queries/SemaphoreNeighbor.sql +++ /dev/null @@ -1,39 +0,0 @@ -SELECT DISTINCT - Route1.exit AS semaphore, - Route1.id AS route1, - Route2.id AS route2, - requires1.Sensor_id AS sensor1, - requires2.Sensor_id AS sensor2, - ct.TrackElement1_id AS te1, - ct.TrackElement2_id AS te2 - --- (route1) -FROM Route AS Route1 - --- (route1)-[:requires]->(sensor1) -INNER JOIN requires AS requires1 -ON Route1.id = requires1.Route_id - --- (sensor1)<-[:monitoredBy]-(te1) -INNER JOIN monitoredBy AS mb1 -ON requires1.Sensor_id = mb1.Sensor_id - --- (te1)-[:connectsTo]->(te2) -INNER JOIN connectsTo AS ct -ON mb1.TrackElement_id = ct.TrackElement1_id - --- (te2)-[:monitoredBy]->(sensor2) -INNER JOIN monitoredBy AS mb2 -ON ct.TrackElement2_id = mb2.TrackElement_id - --- (sensor2)<-[:requires]-(route2) -INNER JOIN requires AS requires2 -ON mb2.Sensor_id = requires2.Sensor_id - --- (route2) -INNER JOIN Route AS Route2 -ON requires2.Route_id = Route2.id - -WHERE Route1.id != Route2.id - AND Route1.exit IS NOT NULL -- semaphore - AND (Route2.entry IS NULL OR Route2.entry != Route1.exit); diff --git a/trainbenchmark-tool-sql/src/main/resources/queries/SemaphoreNeighborInject.sql b/trainbenchmark-tool-sql/src/main/resources/queries/SemaphoreNeighborInject.sql deleted file mode 100644 index 7dbe945ef..000000000 --- a/trainbenchmark-tool-sql/src/main/resources/queries/SemaphoreNeighborInject.sql +++ /dev/null @@ -1,3 +0,0 @@ -SELECT DISTINCT id AS route, entry AS semaphore -FROM Route -WHERE entry != 0; diff --git a/trainbenchmark-tool-sql/src/main/resources/queries/SwitchMonitored.sql b/trainbenchmark-tool-sql/src/main/resources/queries/SwitchMonitored.sql deleted file mode 100644 index 4562b7cd5..000000000 --- a/trainbenchmark-tool-sql/src/main/resources/queries/SwitchMonitored.sql +++ /dev/null @@ -1,4 +0,0 @@ -SELECT Switch.id AS sw -FROM Switch -LEFT JOIN monitoredBy ON monitoredBy.TrackElement_id = Switch.id -WHERE monitoredBy.TrackElement_id IS NULL; diff --git a/trainbenchmark-tool-sql/src/main/resources/queries/SwitchMonitoredInject.sql b/trainbenchmark-tool-sql/src/main/resources/queries/SwitchMonitoredInject.sql deleted file mode 100644 index d2be998bc..000000000 --- a/trainbenchmark-tool-sql/src/main/resources/queries/SwitchMonitoredInject.sql +++ /dev/null @@ -1,2 +0,0 @@ -SELECT DISTINCT id AS sw -FROM Switch; diff --git a/trainbenchmark-tool-sql/src/main/resources/queries/SwitchSet.sql b/trainbenchmark-tool-sql/src/main/resources/queries/SwitchSet.sql deleted file mode 100644 index 6c188afc6..000000000 --- a/trainbenchmark-tool-sql/src/main/resources/queries/SwitchSet.sql +++ /dev/null @@ -1,26 +0,0 @@ -SELECT - Semaphore.id AS semaphore, - Route.id AS route, - SwitchPosition.id AS swP, - Switch.id AS sw, - SwitchPosition.position AS position, - Switch.currentPosition AS currentPosition - --- (route) -FROM Route - --- (route)-[:follows]->(swP) -INNER JOIN SwitchPosition -ON Route.id = SwitchPosition.route -- the "SwitchPosition.route" attribute is the inverse of the "Route.follows" edge - --- (swP)-[:target]->(sw) -INNER JOIN Switch -ON SwitchPosition.target = Switch.id - --- (route)-[:entry]->(semaphore) -INNER JOIN Semaphore -ON Route.entry = Semaphore.id - -WHERE Route.active = 1 - AND Switch.currentPosition != SwitchPosition.position - AND Semaphore.signal = 2; diff --git a/trainbenchmark-tool-sql/src/main/resources/queries/SwitchSetInject.sql b/trainbenchmark-tool-sql/src/main/resources/queries/SwitchSetInject.sql deleted file mode 100644 index d2be998bc..000000000 --- a/trainbenchmark-tool-sql/src/main/resources/queries/SwitchSetInject.sql +++ /dev/null @@ -1,2 +0,0 @@ -SELECT DISTINCT id AS sw -FROM Switch; diff --git a/trainbenchmark-tool-sql/src/main/resources/transformations/ConnectedSegmentsInjectRhs.sql b/trainbenchmark-tool-sql/src/main/resources/transformations/ConnectedSegmentsInjectRhs.sql deleted file mode 100644 index e9a27f19c..000000000 --- a/trainbenchmark-tool-sql/src/main/resources/transformations/ConnectedSegmentsInjectRhs.sql +++ /dev/null @@ -1,35 +0,0 @@ -SET @sensor := ?; -SET @segment1 := ?; -SET @segment3 := ?; -SET @length := ?; - --- get (region) node -SET @region := - (SELECT region - FROM TrackElement - WHERE id = @segment1); - --- delete (segment1)-[:connectsTo]->(segment3) edge -DELETE FROM connectsTo -WHERE TrackElement1_id = @segment1 AND TrackElement2_id = @segment3; - --- insert new node (segment2) as a TrackElement and retrieve its id -INSERT INTO TrackElement (region) VALUES (@region); - -SET @segment2 := (SELECT LAST_INSERT_ID()); - --- insert (segment2) node as a Segment -INSERT INTO Segment (id, length) -VALUES (@segment2, @length); - --- insert (segment1)-[:connectsTo]->(segment2) edge -INSERT INTO connectsTo -VALUES (@segment1, @segment2); - --- insert (segment1)-[:connectsTo]->(segment3) edge -INSERT INTO connectsTo -VALUES (@segment2, @segment3); - --- insert (segment2)-[:monitoredBy]->(sensor) edge -INSERT INTO monitoredBy -VALUES (@segment2, @sensor); diff --git a/trainbenchmark-tool-sql/src/main/resources/transformations/ConnectedSegmentsRepairRhs.sql b/trainbenchmark-tool-sql/src/main/resources/transformations/ConnectedSegmentsRepairRhs.sql deleted file mode 100644 index c72677f57..000000000 --- a/trainbenchmark-tool-sql/src/main/resources/transformations/ConnectedSegmentsRepairRhs.sql +++ /dev/null @@ -1,19 +0,0 @@ -SET @segment1 := ?; -SET @segment2 := ?; -SET @segment3 := ?; - --- delete (segment2) node as segment -DELETE FROM Segment WHERE id = @segment2; --- delete (segment2) node as TrackElement and sensor edge -DELETE FROM TrackElement WHERE id = @segment2; - --- delete (segment1)-[:connectsTo]->(segment2) edge -DELETE FROM connectsTo WHERE TrackElement1_id = @segment1 AND TrackElement2_id = @segment2; --- delete (segment2)-[:connectsTo]->(segment3) edge -DELETE FROM connectsTo WHERE TrackElement1_id = @segment2 AND TrackElement2_id = @segment3; - --- delete (segment2)-[:monitoredBy]->(sensor) edge -DELETE FROM monitoredBy WHERE TrackElement_id = @segment2 AND Sensor_id = @sensor; - --- insert (segment1)-[:connectsTo]->(segment3) edge -INSERT INTO connectsTo VALUES (@segment1, @segment3); diff --git a/trainbenchmark-tool-sql/src/main/resources/transformations/PosLengthInjectRhs.sql b/trainbenchmark-tool-sql/src/main/resources/transformations/PosLengthInjectRhs.sql deleted file mode 100644 index 6fe91f585..000000000 --- a/trainbenchmark-tool-sql/src/main/resources/transformations/PosLengthInjectRhs.sql +++ /dev/null @@ -1,3 +0,0 @@ -UPDATE Segment -SET length = 0 -WHERE id = ?; diff --git a/trainbenchmark-tool-sql/src/main/resources/transformations/PosLengthRepairRhs.sql b/trainbenchmark-tool-sql/src/main/resources/transformations/PosLengthRepairRhs.sql deleted file mode 100644 index 549770860..000000000 --- a/trainbenchmark-tool-sql/src/main/resources/transformations/PosLengthRepairRhs.sql +++ /dev/null @@ -1,3 +0,0 @@ -UPDATE Segment -SET length = -length + 1 -WHERE id = ?; diff --git a/trainbenchmark-tool-sql/src/main/resources/transformations/RouteSensorInjectRhs.sql b/trainbenchmark-tool-sql/src/main/resources/transformations/RouteSensorInjectRhs.sql deleted file mode 100644 index 59cad5481..000000000 --- a/trainbenchmark-tool-sql/src/main/resources/transformations/RouteSensorInjectRhs.sql +++ /dev/null @@ -1,6 +0,0 @@ -SET @route := ?; -SET @sensor := ?; - -DELETE FROM requires -WHERE Route_id = @route - AND Sensor_id = @sensor; diff --git a/trainbenchmark-tool-sql/src/main/resources/transformations/RouteSensorRepairRhs.sql b/trainbenchmark-tool-sql/src/main/resources/transformations/RouteSensorRepairRhs.sql deleted file mode 100644 index ab9ff09e5..000000000 --- a/trainbenchmark-tool-sql/src/main/resources/transformations/RouteSensorRepairRhs.sql +++ /dev/null @@ -1,2 +0,0 @@ -INSERT INTO requires (Route_id, Sensor_id) -VALUES (?, ?); diff --git a/trainbenchmark-tool-sql/src/main/resources/transformations/SemaphoreNeighborInjectRhs.sql b/trainbenchmark-tool-sql/src/main/resources/transformations/SemaphoreNeighborInjectRhs.sql deleted file mode 100644 index f79cb293c..000000000 --- a/trainbenchmark-tool-sql/src/main/resources/transformations/SemaphoreNeighborInjectRhs.sql +++ /dev/null @@ -1,5 +0,0 @@ --- (route)-[:entry]->(semaphore) edge -UPDATE Route -SET entry = NULL -WHERE id = ? - AND entry = ?; diff --git a/trainbenchmark-tool-sql/src/main/resources/transformations/SemaphoreNeighborRepairRhs.sql b/trainbenchmark-tool-sql/src/main/resources/transformations/SemaphoreNeighborRepairRhs.sql deleted file mode 100644 index c74f17b0b..000000000 --- a/trainbenchmark-tool-sql/src/main/resources/transformations/SemaphoreNeighborRepairRhs.sql +++ /dev/null @@ -1,3 +0,0 @@ -UPDATE Route -SET entry = ? -WHERE id = ?; diff --git a/trainbenchmark-tool-sql/src/main/resources/transformations/SwitchMonitoredInjectRhs.sql b/trainbenchmark-tool-sql/src/main/resources/transformations/SwitchMonitoredInjectRhs.sql deleted file mode 100644 index 16b67da28..000000000 --- a/trainbenchmark-tool-sql/src/main/resources/transformations/SwitchMonitoredInjectRhs.sql +++ /dev/null @@ -1,2 +0,0 @@ -DELETE FROM monitoredBy -WHERE monitoredBy.TrackElement_id = ?; diff --git a/trainbenchmark-tool-sql/src/main/resources/transformations/SwitchMonitoredRepairRhs.sql b/trainbenchmark-tool-sql/src/main/resources/transformations/SwitchMonitoredRepairRhs.sql deleted file mode 100644 index fc50bba47..000000000 --- a/trainbenchmark-tool-sql/src/main/resources/transformations/SwitchMonitoredRepairRhs.sql +++ /dev/null @@ -1,11 +0,0 @@ -SET @switch := ?; -SET @region := - (SELECT region FROM TrackElement WHERE id = @switch); - --- insert a (sensor) vertex and retrieve its id -INSERT INTO Sensor (region) VALUES (@region); -SET @sensor := - (SELECT LAST_INSERT_ID()); - -INSERT INTO monitoredBy (TrackElement_id, Sensor_id) -VALUES (@switch, @sensor); diff --git a/trainbenchmark-tool-sql/src/main/resources/transformations/SwitchSetInjectRhs.sql b/trainbenchmark-tool-sql/src/main/resources/transformations/SwitchSetInjectRhs.sql deleted file mode 100644 index 72252f3ae..000000000 --- a/trainbenchmark-tool-sql/src/main/resources/transformations/SwitchSetInjectRhs.sql +++ /dev/null @@ -1,3 +0,0 @@ -UPDATE Switch -SET currentPosition = (currentPosition + 1) % 4 -WHERE id = ?; diff --git a/trainbenchmark-tool-sql/src/main/resources/transformations/SwitchSetRepairRhs.sql b/trainbenchmark-tool-sql/src/main/resources/transformations/SwitchSetRepairRhs.sql deleted file mode 100644 index 762aae8af..000000000 --- a/trainbenchmark-tool-sql/src/main/resources/transformations/SwitchSetRepairRhs.sql +++ /dev/null @@ -1,3 +0,0 @@ -UPDATE Switch -SET currentPosition = ? -WHERE Switch.id = ?; diff --git a/trainbenchmark-tool-sqlite/.gitignore b/trainbenchmark-tool-sqlite/.gitignore deleted file mode 100644 index ea8c4bf7f..000000000 --- a/trainbenchmark-tool-sqlite/.gitignore +++ /dev/null @@ -1 +0,0 @@ -/target diff --git a/trainbenchmark-tool-sqlite/README.md b/trainbenchmark-tool-sqlite/README.md deleted file mode 100644 index 41a2bc88c..000000000 --- a/trainbenchmark-tool-sqlite/README.md +++ /dev/null @@ -1 +0,0 @@ -# Train Benchmark SQLite implementation diff --git a/trainbenchmark-tool-sqlite/build.gradle b/trainbenchmark-tool-sqlite/build.gradle deleted file mode 100644 index 792e8f896..000000000 --- a/trainbenchmark-tool-sqlite/build.gradle +++ /dev/null @@ -1,12 +0,0 @@ -plugins { id "com.github.johnrengelman.shadow" version "1.2.3" } - -shadowJar { - classifier = 'fat' - manifest { attributes 'Main-Class': 'hu.bme.mit.trainbenchmark.benchmark.sqlite.SQLiteBenchmarkMain' } -} - -dependencies { - compile project(':trainbenchmark-tool') - compile project(':trainbenchmark-tool-sql') - compile group: 'org.xerial', name: 'sqlite-jdbc', version:'3.8.11.2' -} diff --git a/trainbenchmark-tool-sqlite/src/main/java/hu/bme/mit/trainbenchmark/benchmark/sqlite/SQLiteBenchmarkMain.java b/trainbenchmark-tool-sqlite/src/main/java/hu/bme/mit/trainbenchmark/benchmark/sqlite/SQLiteBenchmarkMain.java deleted file mode 100644 index b4066833e..000000000 --- a/trainbenchmark-tool-sqlite/src/main/java/hu/bme/mit/trainbenchmark/benchmark/sqlite/SQLiteBenchmarkMain.java +++ /dev/null @@ -1,26 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2010-2015, Benedek Izso, Gabor Szarnyas, Istvan Rath and Daniel Varro - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Benedek Izso - initial API and implementation - * Gabor Szarnyas - initial API and implementation - *******************************************************************************/ - -package hu.bme.mit.trainbenchmark.benchmark.sqlite; - -import hu.bme.mit.trainbenchmark.benchmark.config.BenchmarkConfig; -import hu.bme.mit.trainbenchmark.benchmark.sqlite.config.SQLiteBenchmarkConfig; - -public class SQLiteBenchmarkMain { - - public static void main(final String[] args) throws Exception { - final SQLiteBenchmarkConfig bc = BenchmarkConfig.fromFile(args[0], SQLiteBenchmarkConfig.class); - final SQLiteBenchmarkScenario scenario = new SQLiteBenchmarkScenario(bc); - scenario.performBenchmark(); - } - -} diff --git a/trainbenchmark-tool-sqlite/src/main/java/hu/bme/mit/trainbenchmark/benchmark/sqlite/SQLiteBenchmarkScenario.java b/trainbenchmark-tool-sqlite/src/main/java/hu/bme/mit/trainbenchmark/benchmark/sqlite/SQLiteBenchmarkScenario.java deleted file mode 100644 index 228779562..000000000 --- a/trainbenchmark-tool-sqlite/src/main/java/hu/bme/mit/trainbenchmark/benchmark/sqlite/SQLiteBenchmarkScenario.java +++ /dev/null @@ -1,17 +0,0 @@ -package hu.bme.mit.trainbenchmark.benchmark.sqlite; - -import hu.bme.mit.trainbenchmark.benchmark.comparators.LongMatchComparator; -import hu.bme.mit.trainbenchmark.benchmark.phases.BenchmarkScenario; -import hu.bme.mit.trainbenchmark.benchmark.sql.matches.SqlMatch; -import hu.bme.mit.trainbenchmark.benchmark.sqlite.config.SQLiteBenchmarkConfig; -import hu.bme.mit.trainbenchmark.benchmark.sqlite.driver.SQLiteDriver; -import hu.bme.mit.trainbenchmark.benchmark.sqlite.driver.SQLiteDriverFactory; -import hu.bme.mit.trainbenchmark.benchmark.sqlite.operations.SQLiteModelOperationFactory; - -public class SQLiteBenchmarkScenario extends BenchmarkScenario<SqlMatch, SQLiteDriver, SQLiteBenchmarkConfig> { - - public SQLiteBenchmarkScenario(final SQLiteBenchmarkConfig bc) throws Exception { - super(new SQLiteDriverFactory(), new SQLiteModelOperationFactory(), new LongMatchComparator<SqlMatch>(), bc); - } - -} diff --git a/trainbenchmark-tool-sqlite/src/main/java/hu/bme/mit/trainbenchmark/benchmark/sqlite/config/SQLiteBenchmarkConfig.java b/trainbenchmark-tool-sqlite/src/main/java/hu/bme/mit/trainbenchmark/benchmark/sqlite/config/SQLiteBenchmarkConfig.java deleted file mode 100644 index 65572b7e4..000000000 --- a/trainbenchmark-tool-sqlite/src/main/java/hu/bme/mit/trainbenchmark/benchmark/sqlite/config/SQLiteBenchmarkConfig.java +++ /dev/null @@ -1,34 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2010-2015, Benedek Izso, Gabor Szarnyas, Istvan Rath and Daniel Varro - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Benedek Izso - initial API and implementation - * Gabor Szarnyas - initial API and implementation - *******************************************************************************/ - -package hu.bme.mit.trainbenchmark.benchmark.sqlite.config; - -import hu.bme.mit.trainbenchmark.benchmark.config.BenchmarkConfig; -import hu.bme.mit.trainbenchmark.benchmark.config.BenchmarkConfigBase; - -public class SQLiteBenchmarkConfig extends BenchmarkConfig { - - protected SQLiteBenchmarkConfig(final BenchmarkConfigBase configBase) { - super(configBase); - } - - @Override - public String getToolName() { - return "SQLite"; - } - - @Override - public String getProjectName() { - return "sqlite"; - } - -} diff --git a/trainbenchmark-tool-sqlite/src/main/java/hu/bme/mit/trainbenchmark/benchmark/sqlite/config/SQLiteBenchmarkConfigBuilder.java b/trainbenchmark-tool-sqlite/src/main/java/hu/bme/mit/trainbenchmark/benchmark/sqlite/config/SQLiteBenchmarkConfigBuilder.java deleted file mode 100644 index e7e3b5420..000000000 --- a/trainbenchmark-tool-sqlite/src/main/java/hu/bme/mit/trainbenchmark/benchmark/sqlite/config/SQLiteBenchmarkConfigBuilder.java +++ /dev/null @@ -1,14 +0,0 @@ -package hu.bme.mit.trainbenchmark.benchmark.sqlite.config; - -import hu.bme.mit.trainbenchmark.benchmark.config.BenchmarkConfigBuilder; - -public class SQLiteBenchmarkConfigBuilder - extends BenchmarkConfigBuilder<SQLiteBenchmarkConfig, SQLiteBenchmarkConfigBuilder> { - - @Override - public SQLiteBenchmarkConfig createConfig() { - checkNotNulls(); - return new SQLiteBenchmarkConfig(configBase); - } - -} diff --git a/trainbenchmark-tool-sqlite/src/main/java/hu/bme/mit/trainbenchmark/benchmark/sqlite/driver/SQLiteDriver.java b/trainbenchmark-tool-sqlite/src/main/java/hu/bme/mit/trainbenchmark/benchmark/sqlite/driver/SQLiteDriver.java deleted file mode 100644 index e3de3f4cb..000000000 --- a/trainbenchmark-tool-sqlite/src/main/java/hu/bme/mit/trainbenchmark/benchmark/sqlite/driver/SQLiteDriver.java +++ /dev/null @@ -1,56 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2010-2015, Benedek Izso, Gabor Szarnyas, Istvan Rath and Daniel Varro - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Benedek Izso - initial API and implementation - * Gabor Szarnyas - initial API and implementation - *******************************************************************************/ -package hu.bme.mit.trainbenchmark.benchmark.sqlite.driver; - -import java.io.File; -import java.io.IOException; -import java.sql.DriverManager; -import java.sql.PreparedStatement; -import java.sql.SQLException; -import java.sql.Statement; - -import org.apache.commons.io.FileUtils; - -import hu.bme.mit.trainbenchmark.benchmark.sql.driver.SqlDriver; - -public class SQLiteDriver extends SqlDriver { - - @Override - public void read(final String modelPath) throws IOException, InterruptedException, SQLException { - final File modelFile = new File(modelPath); - if (!modelFile.exists()) { - throw new IOException("Model does not exist: " + modelPath); - } - - connection = DriverManager.getConnection("jdbc:sqlite::memory:"); - final Statement statement = connection.createStatement(); - statement.setQueryTimeout(3600); - - final String sql = FileUtils.readFileToString(new File(modelPath)); - statement.executeUpdate(sql); - - // create temporary table (used by the transformations) - final PreparedStatement createStatement = connection - .prepareStatement("CREATE TEMP TABLE IF NOT EXISTS Variables (Name TEXT PRIMARY KEY, Value LONG);"); - createStatement.execute(); - } - - @Override - public String getPostfix() { - return "-sqlite.sql"; - } - - public String getSQLiteResourceDirectory() { - return "/trainbenchmark-tool-sqlite/src/main/resources/"; - } - -} diff --git a/trainbenchmark-tool-sqlite/src/main/java/hu/bme/mit/trainbenchmark/benchmark/sqlite/driver/SQLiteDriverFactory.java b/trainbenchmark-tool-sqlite/src/main/java/hu/bme/mit/trainbenchmark/benchmark/sqlite/driver/SQLiteDriverFactory.java deleted file mode 100644 index f013c0d90..000000000 --- a/trainbenchmark-tool-sqlite/src/main/java/hu/bme/mit/trainbenchmark/benchmark/sqlite/driver/SQLiteDriverFactory.java +++ /dev/null @@ -1,12 +0,0 @@ -package hu.bme.mit.trainbenchmark.benchmark.sqlite.driver; - -import hu.bme.mit.trainbenchmark.benchmark.driver.DriverFactory; - -public class SQLiteDriverFactory extends DriverFactory<SQLiteDriver> { - - @Override - public SQLiteDriver createInstance() throws Exception { - return new SQLiteDriver(); - } - -} diff --git a/trainbenchmark-tool-sqlite/src/main/java/hu/bme/mit/trainbenchmark/benchmark/sqlite/operations/SQLiteModelOperationFactory.java b/trainbenchmark-tool-sqlite/src/main/java/hu/bme/mit/trainbenchmark/benchmark/sqlite/operations/SQLiteModelOperationFactory.java deleted file mode 100644 index a16579965..000000000 --- a/trainbenchmark-tool-sqlite/src/main/java/hu/bme/mit/trainbenchmark/benchmark/sqlite/operations/SQLiteModelOperationFactory.java +++ /dev/null @@ -1,167 +0,0 @@ -package hu.bme.mit.trainbenchmark.benchmark.sqlite.operations; - -import hu.bme.mit.trainbenchmark.benchmark.operations.ModelOperation; -import hu.bme.mit.trainbenchmark.benchmark.operations.ModelOperationFactory; -import hu.bme.mit.trainbenchmark.benchmark.sql.matches.SqlConnectedSegmentsInjectMatch; -import hu.bme.mit.trainbenchmark.benchmark.sql.matches.SqlConnectedSegmentsMatch; -import hu.bme.mit.trainbenchmark.benchmark.sql.matches.SqlMatch; -import hu.bme.mit.trainbenchmark.benchmark.sql.matches.SqlPosLengthInjectMatch; -import hu.bme.mit.trainbenchmark.benchmark.sql.matches.SqlPosLengthMatch; -import hu.bme.mit.trainbenchmark.benchmark.sql.matches.SqlRouteSensorInjectMatch; -import hu.bme.mit.trainbenchmark.benchmark.sql.matches.SqlRouteSensorMatch; -import hu.bme.mit.trainbenchmark.benchmark.sql.matches.SqlSemaphoreNeighborInjectMatch; -import hu.bme.mit.trainbenchmark.benchmark.sql.matches.SqlSemaphoreNeighborMatch; -import hu.bme.mit.trainbenchmark.benchmark.sql.matches.SqlSwitchMonitoredInjectMatch; -import hu.bme.mit.trainbenchmark.benchmark.sql.matches.SqlSwitchMonitoredMatch; -import hu.bme.mit.trainbenchmark.benchmark.sql.matches.SqlSwitchSetInjectMatch; -import hu.bme.mit.trainbenchmark.benchmark.sql.matches.SqlSwitchSetMatch; -import hu.bme.mit.trainbenchmark.benchmark.sql.queries.SqlQuery; -import hu.bme.mit.trainbenchmark.benchmark.sql.transformations.SqlTransformation; -import hu.bme.mit.trainbenchmark.benchmark.sql.transformations.inject.SqlTransformationInjectPosLength; -import hu.bme.mit.trainbenchmark.benchmark.sql.transformations.inject.SqlTransformationInjectSemaphoreNeighbor; -import hu.bme.mit.trainbenchmark.benchmark.sql.transformations.inject.SqlTransformationInjectSwitchMonitored; -import hu.bme.mit.trainbenchmark.benchmark.sql.transformations.inject.SqlTransformationInjectSwitchSet; -import hu.bme.mit.trainbenchmark.benchmark.sql.transformations.repair.SqlTransformationRepairPosLength; -import hu.bme.mit.trainbenchmark.benchmark.sql.transformations.repair.SqlTransformationRepairRouteSensor; -import hu.bme.mit.trainbenchmark.benchmark.sql.transformations.repair.SqlTransformationRepairSemaphoreNeighbor; -import hu.bme.mit.trainbenchmark.benchmark.sql.transformations.repair.SqlTransformationRepairSwitchSet; -import hu.bme.mit.trainbenchmark.benchmark.sqlite.driver.SQLiteDriver; -import hu.bme.mit.trainbenchmark.benchmark.sqlite.transformations.inject.SQLiteTransformationInjectConnectedSegments; -import hu.bme.mit.trainbenchmark.benchmark.sqlite.transformations.inject.SQLiteTransformationInjectRouteSensor; -import hu.bme.mit.trainbenchmark.benchmark.sqlite.transformations.repair.SQLiteTransformationRepairConnectedSegments; -import hu.bme.mit.trainbenchmark.benchmark.sqlite.transformations.repair.SQLiteTransformationRepairSwitchMonitored; -import hu.bme.mit.trainbenchmark.constants.RailwayOperation; -import hu.bme.mit.trainbenchmark.constants.RailwayQuery; - -public class SQLiteModelOperationFactory extends ModelOperationFactory<SqlMatch, SQLiteDriver> { - - @Override - public ModelOperation<? extends SqlMatch, SQLiteDriver> createOperation(final RailwayOperation operationEnum, final String workspaceDir, - final SQLiteDriver driver) throws Exception { - - switch (operationEnum) { - // ConnectedSegments - case CONNECTEDSEGMENTS: { - final SqlQuery<SqlConnectedSegmentsMatch, SQLiteDriver> query = new SqlQuery<>(driver, workspaceDir, RailwayQuery.CONNECTEDSEGMENTS); - final ModelOperation<SqlConnectedSegmentsMatch, SQLiteDriver> operation = ModelOperation.of(query); - return operation; - } - case CONNECTEDSEGMENTS_INJECT: { - final SqlQuery<SqlConnectedSegmentsInjectMatch, SQLiteDriver> query = new SqlQuery<>(driver, workspaceDir, RailwayQuery.CONNECTEDSEGMENTS_INJECT); - final SqlTransformation<SqlConnectedSegmentsInjectMatch, SQLiteDriver> transformation = new SQLiteTransformationInjectConnectedSegments(driver, - workspaceDir); - final ModelOperation<SqlConnectedSegmentsInjectMatch, SQLiteDriver> operation = ModelOperation.of(query, transformation); - return operation; - } - case CONNECTEDSEGMENTS_REPAIR: { - final SqlQuery<SqlConnectedSegmentsMatch, SQLiteDriver> query = new SqlQuery<>(driver, workspaceDir, RailwayQuery.CONNECTEDSEGMENTS); - final SqlTransformation<SqlConnectedSegmentsMatch, SQLiteDriver> transformation = new SQLiteTransformationRepairConnectedSegments(driver, - workspaceDir); - final ModelOperation<SqlConnectedSegmentsMatch, SQLiteDriver> operation = ModelOperation.of(query, transformation); - return operation; - } - - // PosLength - case POSLENGTH: { - final SqlQuery<SqlPosLengthMatch, SQLiteDriver> query = new SqlQuery<>(driver, workspaceDir, RailwayQuery.POSLENGTH); - final ModelOperation<SqlPosLengthMatch, SQLiteDriver> operation = ModelOperation.of(query); - return operation; - } - case POSLENGTH_INJECT: { - final SqlQuery<SqlPosLengthInjectMatch, SQLiteDriver> query = new SqlQuery<>(driver, workspaceDir, RailwayQuery.POSLENGTH_INJECT); - final SqlTransformation<SqlPosLengthInjectMatch, SQLiteDriver> transformation = new SqlTransformationInjectPosLength<>(driver, workspaceDir); - final ModelOperation<SqlPosLengthInjectMatch, SQLiteDriver> operation = ModelOperation.of(query, transformation); - return operation; - } - case POSLENGTH_REPAIR: { - final SqlQuery<SqlPosLengthMatch, SQLiteDriver> query = new SqlQuery<>(driver, workspaceDir, RailwayQuery.POSLENGTH); - final SqlTransformation<SqlPosLengthMatch, SQLiteDriver> transformation = new SqlTransformationRepairPosLength<>(driver, workspaceDir); - final ModelOperation<SqlPosLengthMatch, SQLiteDriver> operation = ModelOperation.of(query, transformation); - return operation; - } - - // RouteSensor - case ROUTESENSOR: { - final SqlQuery<SqlRouteSensorMatch, SQLiteDriver> query = new SqlQuery<>(driver, workspaceDir, RailwayQuery.ROUTESENSOR); - final ModelOperation<SqlRouteSensorMatch, SQLiteDriver> operation = ModelOperation.of(query); - return operation; - } - case ROUTESENSOR_INJECT: { - final SqlQuery<SqlRouteSensorInjectMatch, SQLiteDriver> query = new SqlQuery<>(driver, workspaceDir, RailwayQuery.ROUTESENSOR_INJECT); - final SqlTransformation<SqlRouteSensorInjectMatch, SQLiteDriver> transformation = new SQLiteTransformationInjectRouteSensor(driver, workspaceDir); - final ModelOperation<SqlRouteSensorInjectMatch, SQLiteDriver> operation = ModelOperation.of(query, transformation); - return operation; - } - case ROUTESENSOR_REPAIR: { - final SqlQuery<SqlRouteSensorMatch, SQLiteDriver> query = new SqlQuery<>(driver, workspaceDir, RailwayQuery.ROUTESENSOR); - final SqlTransformation<SqlRouteSensorMatch, SQLiteDriver> transformation = new SqlTransformationRepairRouteSensor<>(driver, workspaceDir); - final ModelOperation<SqlRouteSensorMatch, SQLiteDriver> operation = ModelOperation.of(query, transformation); - return operation; - } - - // SemaphoreNeighbor - case SEMAPHORENEIGHBOR: { - final SqlQuery<SqlSemaphoreNeighborMatch, SQLiteDriver> query = new SqlQuery<>(driver, workspaceDir, RailwayQuery.SEMAPHORENEIGHBOR); - final ModelOperation<SqlSemaphoreNeighborMatch, SQLiteDriver> operation = ModelOperation.of(query); - return operation; - } - case SEMAPHORENEIGHBOR_INJECT: { - final SqlQuery<SqlSemaphoreNeighborInjectMatch, SQLiteDriver> query = new SqlQuery<>(driver, workspaceDir, RailwayQuery.SEMAPHORENEIGHBOR_INJECT); - final SqlTransformation<SqlSemaphoreNeighborInjectMatch, SQLiteDriver> transformation = new SqlTransformationInjectSemaphoreNeighbor<>(driver, - workspaceDir); - final ModelOperation<SqlSemaphoreNeighborInjectMatch, SQLiteDriver> operation = ModelOperation.of(query, transformation); - return operation; - } - case SEMAPHORENEIGHBOR_REPAIR: { - final SqlQuery<SqlSemaphoreNeighborMatch, SQLiteDriver> query = new SqlQuery<>(driver, workspaceDir, RailwayQuery.SEMAPHORENEIGHBOR); - final SqlTransformation<SqlSemaphoreNeighborMatch, SQLiteDriver> transformation = new SqlTransformationRepairSemaphoreNeighbor<>(driver, - workspaceDir); - final ModelOperation<SqlSemaphoreNeighborMatch, SQLiteDriver> operation = ModelOperation.of(query, transformation); - return operation; - } - - // SwitchMonitored - case SWITCHMONITORED: { - final SqlQuery<SqlSwitchMonitoredMatch, SQLiteDriver> query = new SqlQuery<>(driver, workspaceDir, RailwayQuery.SWITCHMONITORED); - final ModelOperation<SqlSwitchMonitoredMatch, SQLiteDriver> operation = ModelOperation.of(query); - return operation; - } - case SWITCHMONITORED_INJECT: { - final SqlQuery<SqlSwitchMonitoredInjectMatch, SQLiteDriver> query = new SqlQuery<>(driver, workspaceDir, RailwayQuery.SWITCHMONITORED_INJECT); - final SqlTransformation<SqlSwitchMonitoredInjectMatch, SQLiteDriver> transformation = new SqlTransformationInjectSwitchMonitored<>(driver, - workspaceDir); - final ModelOperation<SqlSwitchMonitoredInjectMatch, SQLiteDriver> operation = ModelOperation.of(query, transformation); - return operation; - } - case SWITCHMONITORED_REPAIR: { - final SqlQuery<SqlSwitchMonitoredMatch, SQLiteDriver> query = new SqlQuery<>(driver, workspaceDir, RailwayQuery.SWITCHMONITORED); - final SqlTransformation<SqlSwitchMonitoredMatch, SQLiteDriver> transformation = new SQLiteTransformationRepairSwitchMonitored(driver, workspaceDir); - final ModelOperation<SqlSwitchMonitoredMatch, SQLiteDriver> operation = ModelOperation.of(query, transformation); - return operation; - } - - // SwitchSet - case SWITCHSET: { - final SqlQuery<SqlSwitchSetMatch, SQLiteDriver> query = new SqlQuery<>(driver, workspaceDir, RailwayQuery.SWITCHSET); - final ModelOperation<SqlSwitchSetMatch, SQLiteDriver> operation = ModelOperation.of(query); - return operation; - } - case SWITCHSET_INJECT: { - final SqlQuery<SqlSwitchSetInjectMatch, SQLiteDriver> query = new SqlQuery<>(driver, workspaceDir, RailwayQuery.SWITCHSET_INJECT); - final SqlTransformation<SqlSwitchSetInjectMatch, SQLiteDriver> transformation = new SqlTransformationInjectSwitchSet<>(driver, workspaceDir); - final ModelOperation<SqlSwitchSetInjectMatch, SQLiteDriver> operation = ModelOperation.of(query, transformation); - return operation; - } - case SWITCHSET_REPAIR: { - final SqlQuery<SqlSwitchSetMatch, SQLiteDriver> query = new SqlQuery<>(driver, workspaceDir, RailwayQuery.SWITCHSET); - final SqlTransformation<SqlSwitchSetMatch, SQLiteDriver> transformation = new SqlTransformationRepairSwitchSet<>(driver, workspaceDir); - final ModelOperation<SqlSwitchSetMatch, SQLiteDriver> operation = ModelOperation.of(query, transformation); - return operation; - } - default: - break; - } - throw new UnsupportedOperationException("Operation " + operationEnum + " not supported."); - } - -} diff --git a/trainbenchmark-tool-sqlite/src/main/java/hu/bme/mit/trainbenchmark/benchmark/sqlite/transformation/SQLiteTransformation.java b/trainbenchmark-tool-sqlite/src/main/java/hu/bme/mit/trainbenchmark/benchmark/sqlite/transformation/SQLiteTransformation.java deleted file mode 100644 index 7fc79f3b4..000000000 --- a/trainbenchmark-tool-sqlite/src/main/java/hu/bme/mit/trainbenchmark/benchmark/sqlite/transformation/SQLiteTransformation.java +++ /dev/null @@ -1,27 +0,0 @@ -package hu.bme.mit.trainbenchmark.benchmark.sqlite.transformation; - -import java.io.File; -import java.io.IOException; - -import org.apache.commons.io.FileUtils; - -import hu.bme.mit.trainbenchmark.benchmark.sql.matches.SqlMatch; -import hu.bme.mit.trainbenchmark.benchmark.sql.transformations.SqlTransformation; -import hu.bme.mit.trainbenchmark.benchmark.sqlite.driver.SQLiteDriver; -import hu.bme.mit.trainbenchmark.constants.RailwayOperation; - -public abstract class SQLiteTransformation<TSqlMatch extends SqlMatch> extends SqlTransformation<TSqlMatch, SQLiteDriver> { - - protected SQLiteTransformation(final SQLiteDriver driver, final String workspaceDir, final RailwayOperation operation) - throws IOException { - super(driver, workspaceDir, operation); - - // if there is a different transformation for SQLite, load that instead of the generic SQL one - final String updatePath = workspaceDir + driver.getSQLiteResourceDirectory() + "transformations/" + operation + "Rhs.sql"; - final File file = new File(updatePath); - if (file.exists()) { - this.updateQuery = FileUtils.readFileToString(new File(updatePath)); - } - } - -} diff --git a/trainbenchmark-tool-sqlite/src/main/java/hu/bme/mit/trainbenchmark/benchmark/sqlite/transformations/inject/SQLiteTransformationInjectConnectedSegments.java b/trainbenchmark-tool-sqlite/src/main/java/hu/bme/mit/trainbenchmark/benchmark/sqlite/transformations/inject/SQLiteTransformationInjectConnectedSegments.java deleted file mode 100644 index 61dd1c6ee..000000000 --- a/trainbenchmark-tool-sqlite/src/main/java/hu/bme/mit/trainbenchmark/benchmark/sqlite/transformations/inject/SQLiteTransformationInjectConnectedSegments.java +++ /dev/null @@ -1,50 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2010-2015, Benedek Izso, Gabor Szarnyas, Istvan Rath and Daniel Varro - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Benedek Izso - initial API and implementation - * Gabor Szarnyas - initial API and implementation - *******************************************************************************/ -package hu.bme.mit.trainbenchmark.benchmark.sqlite.transformations.inject; - -import java.io.IOException; -import java.sql.SQLException; -import java.util.Collection; - -import hu.bme.mit.trainbenchmark.benchmark.sql.matches.SqlConnectedSegmentsInjectMatch; -import hu.bme.mit.trainbenchmark.benchmark.sqlite.driver.SQLiteDriver; -import hu.bme.mit.trainbenchmark.benchmark.sqlite.transformation.SQLiteTransformation; -import hu.bme.mit.trainbenchmark.constants.RailwayOperation; -import hu.bme.mit.trainbenchmark.constants.TrainBenchmarkConstants; - -public class SQLiteTransformationInjectConnectedSegments extends SQLiteTransformation<SqlConnectedSegmentsInjectMatch> { - - final String setBindings = "INSERT OR REPLACE INTO Variables VALUES ('sensor', ?), ('segment1', ?), ('segment3', ?), ('length', ?);"; - - public SQLiteTransformationInjectConnectedSegments(final SQLiteDriver driver, final String workspaceDir) - throws IOException { - super(driver, workspaceDir, RailwayOperation.CONNECTEDSEGMENTS_INJECT); - } - - @Override - public void activate(final Collection<SqlConnectedSegmentsInjectMatch> matches) throws SQLException { - if (preparedUpdateStatement == null) { - preparedUpdateStatement = driver.getConnection().prepareStatement(setBindings); - } - - for (final SqlConnectedSegmentsInjectMatch match : matches) { - preparedUpdateStatement.setLong(1, match.getSensor()); - preparedUpdateStatement.setLong(2, match.getSegment1()); - preparedUpdateStatement.setLong(3, match.getSegment3()); - preparedUpdateStatement.setLong(4, TrainBenchmarkConstants.DEFAULT_SEGMENT_LENGTH); - preparedUpdateStatement.executeUpdate(); - - driver.getConnection().createStatement().executeUpdate(updateQuery); - } - } - -} diff --git a/trainbenchmark-tool-sqlite/src/main/java/hu/bme/mit/trainbenchmark/benchmark/sqlite/transformations/inject/SQLiteTransformationInjectRouteSensor.java b/trainbenchmark-tool-sqlite/src/main/java/hu/bme/mit/trainbenchmark/benchmark/sqlite/transformations/inject/SQLiteTransformationInjectRouteSensor.java deleted file mode 100644 index 95c02eeaa..000000000 --- a/trainbenchmark-tool-sqlite/src/main/java/hu/bme/mit/trainbenchmark/benchmark/sqlite/transformations/inject/SQLiteTransformationInjectRouteSensor.java +++ /dev/null @@ -1,47 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2010-2015, Benedek Izso, Gabor Szarnyas, Istvan Rath and Daniel Varro - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Benedek Izso - initial API and implementation - * Gabor Szarnyas - initial API and implementation - *******************************************************************************/ -package hu.bme.mit.trainbenchmark.benchmark.sqlite.transformations.inject; - -import java.io.IOException; -import java.sql.SQLException; -import java.util.Collection; - -import hu.bme.mit.trainbenchmark.benchmark.sql.matches.SqlRouteSensorInjectMatch; -import hu.bme.mit.trainbenchmark.benchmark.sqlite.driver.SQLiteDriver; -import hu.bme.mit.trainbenchmark.benchmark.sqlite.transformation.SQLiteTransformation; -import hu.bme.mit.trainbenchmark.constants.RailwayOperation; - -public class SQLiteTransformationInjectRouteSensor extends SQLiteTransformation<SqlRouteSensorInjectMatch> { - - final String setBindings = "INSERT OR REPLACE INTO Variables VALUES ('route', ?), ('sensor', ?);"; - - public SQLiteTransformationInjectRouteSensor(final SQLiteDriver driver, final String workspaceDir) - throws IOException { - super(driver, workspaceDir, RailwayOperation.ROUTESENSOR_INJECT); - } - - @Override - public void activate(final Collection<SqlRouteSensorInjectMatch> matches) throws SQLException { - if (preparedUpdateStatement == null) { - preparedUpdateStatement = driver.getConnection().prepareStatement(setBindings); - } - - for (final SqlRouteSensorInjectMatch match : matches) { - preparedUpdateStatement.setLong(1, match.getRoute()); - preparedUpdateStatement.setLong(2, match.getSensor()); - preparedUpdateStatement.executeUpdate(); - - driver.getConnection().createStatement().executeUpdate(updateQuery); - } - } - -} diff --git a/trainbenchmark-tool-sqlite/src/main/java/hu/bme/mit/trainbenchmark/benchmark/sqlite/transformations/repair/SQLiteTransformationRepairConnectedSegments.java b/trainbenchmark-tool-sqlite/src/main/java/hu/bme/mit/trainbenchmark/benchmark/sqlite/transformations/repair/SQLiteTransformationRepairConnectedSegments.java deleted file mode 100644 index a7e532306..000000000 --- a/trainbenchmark-tool-sqlite/src/main/java/hu/bme/mit/trainbenchmark/benchmark/sqlite/transformations/repair/SQLiteTransformationRepairConnectedSegments.java +++ /dev/null @@ -1,46 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2010-2015, Benedek Izso, Gabor Szarnyas, Istvan Rath and Daniel Varro - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Benedek Izso - initial API and implementation - * Gabor Szarnyas - initial API and implementation - *******************************************************************************/ -package hu.bme.mit.trainbenchmark.benchmark.sqlite.transformations.repair; - -import java.io.IOException; -import java.sql.SQLException; -import java.util.Collection; - -import hu.bme.mit.trainbenchmark.benchmark.sql.matches.SqlConnectedSegmentsMatch; -import hu.bme.mit.trainbenchmark.benchmark.sqlite.driver.SQLiteDriver; -import hu.bme.mit.trainbenchmark.benchmark.sqlite.transformation.SQLiteTransformation; -import hu.bme.mit.trainbenchmark.constants.RailwayOperation; - -public class SQLiteTransformationRepairConnectedSegments extends SQLiteTransformation<SqlConnectedSegmentsMatch> { - - final String setBindings = "INSERT OR REPLACE INTO Variables VALUES ('segment1', ?), ('segment2', ?), ('segment3', ?);"; - - public SQLiteTransformationRepairConnectedSegments(final SQLiteDriver driver, final String workspaceDir) throws IOException { - super(driver, workspaceDir, RailwayOperation.CONNECTEDSEGMENTS_REPAIR); - } - - @Override - public void activate(final Collection<SqlConnectedSegmentsMatch> matches) throws SQLException { - if (preparedUpdateStatement == null) { - preparedUpdateStatement = driver.getConnection().prepareStatement(setBindings); - } - - for (final SqlConnectedSegmentsMatch match : matches) { - preparedUpdateStatement.setLong(1, match.getSegment1()); - preparedUpdateStatement.setLong(2, match.getSegment2()); - preparedUpdateStatement.setLong(3, match.getSegment3()); - preparedUpdateStatement.executeUpdate(); - - driver.getConnection().createStatement().executeUpdate(updateQuery); - } - } -} diff --git a/trainbenchmark-tool-sqlite/src/main/java/hu/bme/mit/trainbenchmark/benchmark/sqlite/transformations/repair/SQLiteTransformationRepairSwitchMonitored.java b/trainbenchmark-tool-sqlite/src/main/java/hu/bme/mit/trainbenchmark/benchmark/sqlite/transformations/repair/SQLiteTransformationRepairSwitchMonitored.java deleted file mode 100644 index 1e105929d..000000000 --- a/trainbenchmark-tool-sqlite/src/main/java/hu/bme/mit/trainbenchmark/benchmark/sqlite/transformations/repair/SQLiteTransformationRepairSwitchMonitored.java +++ /dev/null @@ -1,45 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2010-2015, Benedek Izso, Gabor Szarnyas, Istvan Rath and Daniel Varro - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Benedek Izso - initial API and implementation - * Gabor Szarnyas - initial API and implementation - *******************************************************************************/ -package hu.bme.mit.trainbenchmark.benchmark.sqlite.transformations.repair; - -import java.io.IOException; -import java.sql.SQLException; -import java.util.Collection; - -import hu.bme.mit.trainbenchmark.benchmark.sql.matches.SqlSwitchMonitoredMatch; -import hu.bme.mit.trainbenchmark.benchmark.sqlite.driver.SQLiteDriver; -import hu.bme.mit.trainbenchmark.benchmark.sqlite.transformation.SQLiteTransformation; -import hu.bme.mit.trainbenchmark.constants.RailwayOperation; - -public class SQLiteTransformationRepairSwitchMonitored extends SQLiteTransformation<SqlSwitchMonitoredMatch> { - - final String setBindings = "INSERT OR REPLACE INTO Variables VALUES ('switch', ?);"; - - public SQLiteTransformationRepairSwitchMonitored(final SQLiteDriver driver, final String workspaceDir) throws IOException { - super(driver, workspaceDir, RailwayOperation.SWITCHMONITORED_REPAIR); - } - - @Override - public void activate(final Collection<SqlSwitchMonitoredMatch> matches) throws SQLException { - if (preparedUpdateStatement == null) { - preparedUpdateStatement = driver.getConnection().prepareStatement(setBindings); - } - - for (final SqlSwitchMonitoredMatch match : matches) { - preparedUpdateStatement.setLong(1, match.getSw()); - preparedUpdateStatement.executeUpdate(); - - driver.getConnection().createStatement().executeUpdate(updateQuery); - } - } - -} diff --git a/trainbenchmark-tool-sqlite/src/main/resources/transformations/ConnectedSegmentsInjectRhs.sql b/trainbenchmark-tool-sqlite/src/main/resources/transformations/ConnectedSegmentsInjectRhs.sql deleted file mode 100644 index 9a6858db5..000000000 --- a/trainbenchmark-tool-sqlite/src/main/resources/transformations/ConnectedSegmentsInjectRhs.sql +++ /dev/null @@ -1,49 +0,0 @@ --- get (region) node -INSERT OR REPLACE INTO Variables VALUES ('region', - (SELECT region - FROM TrackElement - WHERE id = (SELECT Value FROM Variables WHERE Name = 'segment1')) - ); - --- delete (segment1)-[:connectsTo]->(segment3) edge -DELETE FROM connectsTo -WHERE - TrackElement1_id = (SELECT Value FROM Variables WHERE Name = 'segment1') AND - TrackElement2_id = (SELECT Value FROM Variables WHERE Name = 'segment3'); - --- insert new node (segment2) as a TrackElement and retrieve its id -INSERT INTO TrackElement (region) VALUES ( - (SELECT Value FROM Variables WHERE Name = 'region') - ); - -INSERT OR REPLACE INTO Variables VALUES ('segment2', - (SELECT MAX(id) FROM TrackElement) - ); - --- insert (segment2) node as a Segment -INSERT INTO Segment (id, length) -VALUES ( - (SELECT Value FROM Variables WHERE Name = 'segment2'), - (SELECT Value FROM Variables WHERE Name = 'length') -); - --- insert (segment1)-[:connectsTo]->(segment2) edge -INSERT INTO connectsTo -VALUES ( - (SELECT Value FROM Variables WHERE Name = 'segment1'), - (SELECT Value FROM Variables WHERE Name = 'segment2') -); - --- insert (segment1)-[:connectsTo]->(segment3) edge -INSERT INTO connectsTo -VALUES ( - (SELECT Value FROM Variables WHERE Name = 'segment2'), - (SELECT Value FROM Variables WHERE Name = 'segment3') -); - --- insert (segment2)-[:monitoredBy]->(sensor) edge -INSERT INTO monitoredBy -VALUES ( - (SELECT Value FROM Variables WHERE Name = 'segment2'), - (SELECT Value FROM Variables WHERE Name = 'sensor') -); diff --git a/trainbenchmark-tool-sqlite/src/main/resources/transformations/ConnectedSegmentsRepairRhs.sql b/trainbenchmark-tool-sqlite/src/main/resources/transformations/ConnectedSegmentsRepairRhs.sql deleted file mode 100644 index d2d77ee1e..000000000 --- a/trainbenchmark-tool-sqlite/src/main/resources/transformations/ConnectedSegmentsRepairRhs.sql +++ /dev/null @@ -1,24 +0,0 @@ --- delete (segment2) node as segment -DELETE FROM Segment WHERE id = (SELECT Value FROM Variables WHERE Name = 'segment2'); --- delete (segment2) node as TrackElement and sensor edge -DELETE FROM TrackElement WHERE id = (SELECT Value FROM Variables WHERE Name = 'segment2'); - --- delete (segment1)-[:connectsTo]->(segment2) edge -DELETE FROM connectsTo WHERE - TrackElement1_id = (SELECT Value FROM Variables WHERE Name = 'segment1') AND - TrackElement2_id = (SELECT Value FROM Variables WHERE Name = 'segment2'); --- delete (segment2)-[:connectsTo]->(segment3) edge -DELETE FROM connectsTo WHERE - TrackElement1_id = (SELECT Value FROM Variables WHERE Name = 'segment2') AND - TrackElement2_id = (SELECT Value FROM Variables WHERE Name = 'segment3'); - --- delete (segment2)-[:monitoredBy]->(sensor) edge -DELETE FROM monitoredBy WHERE - TrackElement_id = (SELECT Value FROM Variables WHERE Name = 'segment2') AND - Sensor_id = (SELECT Value FROM Variables WHERE Name = 'sensor'); - --- insert (segment1)-[:connectsTo]->(segment3) edge -INSERT INTO connectsTo VALUES ( - (SELECT Value FROM Variables WHERE Name = 'segment1'), - (SELECT Value FROM Variables WHERE Name = 'segment3') - ); diff --git a/trainbenchmark-tool-sqlite/src/main/resources/transformations/RouteSensorInjectRhs.sql b/trainbenchmark-tool-sqlite/src/main/resources/transformations/RouteSensorInjectRhs.sql deleted file mode 100644 index 193b7d2a3..000000000 --- a/trainbenchmark-tool-sqlite/src/main/resources/transformations/RouteSensorInjectRhs.sql +++ /dev/null @@ -1,3 +0,0 @@ -DELETE FROM requires -WHERE Route_id = (SELECT Value FROM Variables WHERE Name = 'route') - AND Sensor_id = (SELECT Value FROM Variables WHERE Name = 'sensor'); diff --git a/trainbenchmark-tool-sqlite/src/main/resources/transformations/SwitchMonitoredRepairRhs.sql b/trainbenchmark-tool-sqlite/src/main/resources/transformations/SwitchMonitoredRepairRhs.sql deleted file mode 100644 index 26799d546..000000000 --- a/trainbenchmark-tool-sqlite/src/main/resources/transformations/SwitchMonitoredRepairRhs.sql +++ /dev/null @@ -1,16 +0,0 @@ -INSERT OR REPLACE INTO Variables VALUES ('region', - (SELECT region - FROM TrackElement - WHERE id = (SELECT Value FROM Variables WHERE Name = 'switch')) - ); - --- insert a (sensor) vertex and retrieve its id -INSERT INTO Sensor (region) VALUES ( - (SELECT Value FROM Variables WHERE Name = 'region') -); - -INSERT INTO monitoredBy (TrackElement_id, Sensor_id) -VALUES ( - (SELECT Value FROM Variables WHERE Name = 'switch'), - (SELECT MAX(id) FROM Sensor) -); diff --git a/trainbenchmark-tool-sqlite/src/test/java/hu/bme/mit/trainbenchmark/benchmark/sqlite/test/SQLiteTest.java b/trainbenchmark-tool-sqlite/src/test/java/hu/bme/mit/trainbenchmark/benchmark/sqlite/test/SQLiteTest.java deleted file mode 100644 index 1b5cd83b9..000000000 --- a/trainbenchmark-tool-sqlite/src/test/java/hu/bme/mit/trainbenchmark/benchmark/sqlite/test/SQLiteTest.java +++ /dev/null @@ -1,32 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2010-2015, Benedek Izso, Gabor Szarnyas, Istvan Rath and Daniel Varro - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Benedek Izso - initial API and implementation - * Gabor Szarnyas - initial API and implementation - *******************************************************************************/ - -package hu.bme.mit.trainbenchmark.benchmark.sqlite.test; - -import hu.bme.mit.trainbenchmark.benchmark.config.BenchmarkConfigBase; -import hu.bme.mit.trainbenchmark.benchmark.runcomponents.BenchmarkResult; -import hu.bme.mit.trainbenchmark.benchmark.sqlite.SQLiteBenchmarkScenario; -import hu.bme.mit.trainbenchmark.benchmark.sqlite.config.SQLiteBenchmarkConfig; -import hu.bme.mit.trainbenchmark.benchmark.sqlite.config.SQLiteBenchmarkConfigBuilder; -import hu.bme.mit.trainbenchmark.benchmark.test.TrainBenchmarkTest; - -public class SQLiteTest extends TrainBenchmarkTest { - - @Override - protected BenchmarkResult runTest(final BenchmarkConfigBase bcb) throws Exception { - final SQLiteBenchmarkConfig bc = new SQLiteBenchmarkConfigBuilder().setConfigBase(bcb).createConfig(); - final SQLiteBenchmarkScenario scenario = new SQLiteBenchmarkScenario(bc); - final BenchmarkResult result = scenario.performBenchmark(); - return result; - } - -} -- GitLab