Skip to content
Snippets Groups Projects
Commit 4ab19f5c authored by Johannes Mey's avatar Johannes Mey
Browse files

removed unused modules

parent 58491c98
Branches
No related tags found
No related merge requests found
Showing
with 0 additions and 605 deletions
[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
Subproject commit f15c5bb0f14043c6c0bf06c3c54fbe41f680dcb4
Subproject commit f15c5bb0f14043c6c0bf06c3c54fbe41f680dcb4
Subproject commit 2f4ee264b5212cafaa9648f5685aa8b36cec0ce6
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
}
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/";
}
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;
}
}
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);
}
}
}
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;
}
}
#### 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`.
dependencies {
compile project(':trainbenchmark-tool')
}
/*******************************************************************************
* Copyright (c) 2010-2015, Benedek Izso, Gabor Szarnyas, Istvan Rath and Daniel Varro
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.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
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;
}
}
/*******************************************************************************
* Copyright (c) 2010-2015, Benedek Izso, Gabor Szarnyas, Istvan Rath and Daniel Varro
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.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";
}
}
}
@prefix : <http://www.semanticweb.org/ontologies/2015/trainbenchmark#> .
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
@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
dependencies {
compile project(':trainbenchmark-tool')
}
The `mysql2sqlite.sh` script is distributed under the MIT license. Source: https://github.com/dumblob/mysql2sqlite
#!/bin/bash
sudo rm -rf /var/lib/mysql/trainbenchmark
#echo "MySQL cleaned"
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment