Commit f8c1706a authored by akucera's avatar akucera
Browse files

efforts to make it work in tomcat

parent a6191d58
package cz.muni.fi.lasaris.sbms.semantics.logic;
import java.io.ByteArrayOutputStream;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.util.ArrayList;
import java.util.Collections;
import java.util.GregorianCalendar;
......@@ -54,12 +52,12 @@ public class TdbConnector {
model.close();
}
/*
Path currentRelativePath = Paths.get("");
String s = currentRelativePath.toAbsolutePath().toString();
logger.debug("Current relative path is: " + s);
logger.debug("User dir is: " + System.getProperty("user.dir"));
*/
GregorianCalendar d = new GregorianCalendar();
dataset.begin(ReadWrite.READ);
// Get model inside the transaction
......
This diff is collapsed.
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
@prefix owl: <http://www.w3.org/2002/07/owl#> .
@prefix dc: <http://purl.org/dc/elements/1.1/> .
<http://www.w3.org/2000/01/rdf-schema#> a owl:Ontology ;
dc:title "The RDF Schema vocabulary (RDFS)" .
rdfs:Resource a rdfs:Class ;
rdfs:isDefinedBy <http://www.w3.org/2000/01/rdf-schema#> ;
rdfs:label "Resource" ;
rdfs:comment "The class resource, everything." .
rdfs:Class a rdfs:Class ;
rdfs:isDefinedBy <http://www.w3.org/2000/01/rdf-schema#> ;
rdfs:label "Class" ;
rdfs:comment "The class of classes." ;
rdfs:subClassOf rdfs:Resource .
rdfs:subClassOf a rdf:Property ;
rdfs:isDefinedBy <http://www.w3.org/2000/01/rdf-schema#> ;
rdfs:label "subClassOf" ;
rdfs:comment "The subject is a subclass of a class." ;
rdfs:range rdfs:Class ;
rdfs:domain rdfs:Class .
rdfs:subPropertyOf a rdf:Property ;
rdfs:isDefinedBy <http://www.w3.org/2000/01/rdf-schema#> ;
rdfs:label "subPropertyOf" ;
rdfs:comment "The subject is a subproperty of a property." ;
rdfs:range rdf:Property ;
rdfs:domain rdf:Property .
rdfs:comment a rdf:Property ;
rdfs:isDefinedBy <http://www.w3.org/2000/01/rdf-schema#> ;
rdfs:label "comment" ;
rdfs:comment "A description of the subject resource." ;
rdfs:domain rdfs:Resource ;
rdfs:range rdfs:Literal .
rdfs:label a rdf:Property ;
rdfs:isDefinedBy <http://www.w3.org/2000/01/rdf-schema#> ;
rdfs:label "label" ;
rdfs:comment "A human-readable name for the subject." ;
rdfs:domain rdfs:Resource ;
rdfs:range rdfs:Literal .
rdfs:domain a rdf:Property ;
rdfs:isDefinedBy <http://www.w3.org/2000/01/rdf-schema#> ;
rdfs:label "domain" ;
rdfs:comment "A domain of the subject property." ;
rdfs:range rdfs:Class ;
rdfs:domain rdf:Property .
rdfs:range a rdf:Property ;
rdfs:isDefinedBy <http://www.w3.org/2000/01/rdf-schema#> ;
rdfs:label "range" ;
rdfs:comment "A range of the subject property." ;
rdfs:range rdfs:Class ;
rdfs:domain rdf:Property .
rdfs:seeAlso a rdf:Property ;
rdfs:isDefinedBy <http://www.w3.org/2000/01/rdf-schema#> ;
rdfs:label "seeAlso" ;
rdfs:comment "Further information about the subject resource." ;
rdfs:range rdfs:Resource ;
rdfs:domain rdfs:Resource .
rdfs:isDefinedBy a rdf:Property ;
rdfs:isDefinedBy <http://www.w3.org/2000/01/rdf-schema#> ;
rdfs:subPropertyOf rdfs:seeAlso ;
rdfs:label "isDefinedBy" ;
rdfs:comment "The defininition of the subject resource." ;
rdfs:range rdfs:Resource ;
rdfs:domain rdfs:Resource .
rdfs:Literal a rdfs:Class ;
rdfs:isDefinedBy <http://www.w3.org/2000/01/rdf-schema#> ;
rdfs:label "Literal" ;
rdfs:comment "The class of literal values, eg. textual strings and integers." ;
rdfs:subClassOf rdfs:Resource .
rdfs:Container a rdfs:Class ;
rdfs:isDefinedBy <http://www.w3.org/2000/01/rdf-schema#> ;
rdfs:label "Container" ;
rdfs:subClassOf rdfs:Resource ;
rdfs:comment "The class of RDF containers." .
rdfs:ContainerMembershipProperty a rdfs:Class ;
rdfs:isDefinedBy <http://www.w3.org/2000/01/rdf-schema#> ;
rdfs:label "ContainerMembershipProperty" ;
rdfs:comment """The class of container membership properties, rdf:_1, rdf:_2, ...,
all of which are sub-properties of 'member'.""" ;
rdfs:subClassOf rdf:Property .
rdfs:member a rdf:Property ;
rdfs:isDefinedBy <http://www.w3.org/2000/01/rdf-schema#> ;
rdfs:label "member" ;
rdfs:comment "A member of the subject resource." ;
rdfs:domain rdfs:Resource ;
rdfs:range rdfs:Resource .
rdfs:Datatype a rdfs:Class ;
rdfs:isDefinedBy <http://www.w3.org/2000/01/rdf-schema#> ;
rdfs:label "Datatype" ;
rdfs:comment "The class of RDF datatypes." ;
rdfs:subClassOf rdfs:Class .
<http://www.w3.org/2000/01/rdf-schema#> rdfs:seeAlso <http://www.w3.org/2000/01/rdf-schema-more> .
# Root logger option
log4j.rootLogger=INFO, stdout
log4j.logger.cz.muni.fi.lasaris.sbms.semantics=DEBUG
log4j.logger.org.apache.jena=DEBUG
# Direct log messages to stdout
log4j.appender.stdout=org.apache.log4j.ConsoleAppender
......
......@@ -47,8 +47,8 @@
<OntologySpec>
<!-- local version of the OWL language ontology (in OWL) -->
<publicURI rdf:resource="http://www.w3.org/2002/07/owl" />
<!-- uncomment the following line to re-direct attempts to http get the file
<altURL rdf:resource="file:vocabularies/owl.owl" /-->
<!-- uncomment the following line to re-direct attempts to http get the file /-->
<altURL rdf:resource="file:C:\apache-tomcat-9.0.0.M19\webapps\sbms\WEB-INF\classes\RDF\owl.owl"
<language rdf:resource="http://www.w3.org/2002/07/owl" />
<prefix rdf:datatype="&xsd;string">owl</prefix>
</OntologySpec>
......@@ -56,40 +56,42 @@
<OntologySpec>
<!-- local version of the RDFS vocabulary -->
<publicURI rdf:resource="http://www.w3.org/2000/01/rdf-schema" />
<!-- uncomment the following line to re-direct attempts to http get the file
<altURL rdf:resource="file:vocabularies/rdf-schema.rdf" /-->
<!-- uncomment the following line to re-direct attempts to http get the file /-->
<altURL rdf:resource="file:C:\apache-tomcat-9.0.0.M19\webapps\sbms\WEB-INF\classes\RDF\rdf-schema.rdf"
<language rdf:resource="http://www.w3.org/2000/01/rdf-schema" />
<prefix rdf:datatype="&xsd;string">rdfs</prefix>
</OntologySpec>
<OntologySpec>
<publicURI rdf:resource="http://is.muni.cz/www/255658/sbms/v2_0/SemanticBMS" />
<altURL rdf:resource="file:/apache-tomcat-9.0.0.M19/webapps/sbms/WEB-INF/classes/RDF/SemanticBMS.rdf" />
<altURL rdf:resource="file:C:\apache-tomcat-9.0.0.M19\webapps\sbms\WEB-INF\classes\RDF\SemanticBMS.rdf" />
</OntologySpec>
<OntologySpec>
<publicURI rdf:resource="http://is.muni.cz/www/255658/sbms/v2_0/SemanticBIM" />
<altURL rdf:resource="file:/apache-tomcat-9.0.0.M19/webapps/sbms/WEB-INF/classes/RDF/SemanticBIM.rdf" />
<altURL rdf:resource="file:C:\apache-tomcat-9.0.0.M19\webapps\sbms\WEB-INF\classes\RDF\SemanticBIM.rdf" />
</OntologySpec>
<OntologySpec>
<publicURI rdf:resource="http://purl.oclc.org/NET/muo/ucum/" />
<altURL rdf:resource="file:/apache-tomcat-9.0.0.M19/webapps/sbms/WEB-INF/classes/RDF/ucum-instances.rdf" />
<altURL rdf:resource="file:C:\apache-tomcat-9.0.0.M19\webapps\sbms\WEB-INF\classes\RDF\ucum-instances.rdf" />
</OntologySpec>
<OntologySpec>
<publicURI rdf:resource="http://www.loa.istc.cnr.it/ontologies/DUL.owl" />
<altURL rdf:resource="file:/xapache-tomcat-9.0.0.M19/webapps/sbms/WEB-INF/classes/RDF/DUL.rdf" />
<publicURI rdf:resource="http://purl.oclc.org/NET/muo/muo-vocab.owl" />
<altURL rdf:resource="file:C:\apache-tomcat-9.0.0.M19\webapps\sbms\WEB-INF\classes\RDF\muo-vocab.rdf" />
</OntologySpec>
<OntologySpec>
<publicURI rdf:resource="http://purl.oclc.org/NET/ssnx/ssn" />
<altURL rdf:resource="file:/xapache-tomcat-9.0.0.M19/webapps/sbms/WEB-INF/classes/RDF/ssn.rdf" />
<publicURI rdf:resource="http://www.loa.istc.cnr.it/ontologies/DUL.owl" />
<altURL rdf:resource="file:C:\apache-tomcat-9.0.0.M19\webapps\sbms\WEB-INF\classes\RDF\DUL.rdf" />
</OntologySpec>
<OntologySpec>
<publicURI rdf:resource="http://purl.oclc.org/NET/muo/muo-vocab.owl" />
<altURL rdf:resource="file:/xapache-tomcat-9.0.0.M19/webapps/sbms/WEB-INF/classes/RDF/muo-vocab.rdf" />
<publicURI rdf:resource="http://purl.oclc.org/NET/ssnx/ssn" />
<altURL rdf:resource="file:C:\apache-tomcat-9.0.0.M19\webapps\sbms\WEB-INF\classes\RDF\ssn.rdf" />
</OntologySpec>
</rdf:RDF>
\ No newline at end of file
......@@ -6,5 +6,5 @@ auth.propertiesAuth.roles.user=user|adam
auth.propertiesAuth.roles.admin=admin
#tdb.path=C:/Skola/sbms/data/perf_test/tdb
tdb.path=/apache-tomcat-9.0.0.M19/webapps/sbms/WEB-INF/tdb
#tdb.path=C:/Skola/sbms/tdb
\ No newline at end of file
#tdb.path=C:/apache-tomcat-9.0.0.M19/webapps/sbms/WEB-INF/tdb
tdb.path=C:/Skola/sbms/tdb
\ No newline at end of file
......@@ -14,7 +14,7 @@ Each room is equipped with a temperature sensor, a humidity sensor, a motion sen
For each of the data points, there are two trends defined - one in the PLC iself, the other in the archive historian database.
The benchmarking procedure consist of several API calls to the datapoints endpoint. The queries test following scenarios:
- Queryying for all available information about specific data point
- Querying for all available information about specific data point
- Selecting data points according to number of restrictions (e.g. specific device type and observed property at certain location)
- Selecting large number of data points based on loose criteria (all temeprature sensors located on specific site)
......@@ -54,19 +54,10 @@ Usage:
Statistics of the TDB can be found in the <Your tdb location>\stats.opt file
4) Set up the SemanticAPI to use the created TDB
4) Deploy the Semantic API into the Apache Tomcat (see Readme on the project site)
5) Set up the SemanticAPI to use the created TDB
Update the tdb.path property in the semantics.properties file
Check the ont-policy.rdf file and update paths to the local ontology definitions if needed
5) Deploy the Semantic API into the Apache Tomcat
To deploy the application:
- Build the SemanticAPI project using maven (Note: the exloded WAR is convenient when changing the setting in the properties files):
mvn install
mvn war:exploded
- Create a directory named sbms in the webapps folder of your tomcat installation (e.g. C:\apache-tomcat-9.0.0.M19\webapps)
- Copy the resulting build (located in <Your git repositoty>\semanticBMS\SemanticAPI\target\SemanticAPI-1.0)
into the new directory directory (e.g. C:\apache-tomcat-9.0.0.M19\webapps\sbms) - the WEB-INF amnd META-INF folders
are meant to be placed directly in the sbms directory
6) [Optional] Run the Apache Tomcat
Execute the bin\startup.bat script
......
......@@ -13,7 +13,7 @@ Function Request($url) {
$r = Invoke-WebRequest -URI $url | Select-Object StatusCode, Content
$end = [System.DateTime]::Now.Subtract($start) #| Select-Object TotalSeconds
$dur = $end.TotalSeconds
$dur.ToString() + ";" + $r.StatusCode + ";" + $r.Content + ";" + $url
$dur.ToString() + ";" + $r.StatusCode + ";" + $r.Content.Length + ";" + $url
}
......@@ -28,7 +28,7 @@ if($ManageTomcat) {
}
"duration;statusCode;reply;request"
"duration;statusCode;contentLength;request"
Request http://localhost:8080/sbms/semantics/types/type
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment