Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Setup repository

  • Loading branch information...
commit 33967f19847a5dbcb94e291d901b128ad61586d5 0 parents
Andy Seaborne authored
Showing with 192,883 additions and 0 deletions.
  1. +9 −0 .classpath
  2. +20 −0 .gitignore
  3. +17 −0 .project
  4. +147 −0 Notes.txt
  5. +66 −0 README.txt
  6. +16 −0 assembler-template.ttl
  7. +15 −0 assembler.ttl
  8. +291 −0 build.xml
  9. +48 −0 details.txt
  10. +42 −0 genAll
  11. +26 −0 genAllResults
  12. +42 −0 genLoadResults
  13. +26 −0 genOne
  14. +26 −0 genStats
  15. +88,799 −0 givennames.txt
  16. 0  ignoreQueries.txt
  17. +19 −0 init
  18. +42 −0 ivy.xml
  19. +26 −0 ivysettings.xml
  20. BIN  lib/jdom.jar
  21. BIN  lib/ssj.jar
  22. +40 −0 loadAll
  23. +47 −0 loadSesame
  24. +17 −0 log.tidy
  25. +15 −0 log4j.properties
  26. +46 −0 log4j.xml
  27. +30 −0 makeKey
  28. +16 −0 queries/query1.txt
  29. +18 −0 queries/query10.txt
  30. +5 −0 queries/query10desc.txt
  31. +1 −0  queries/query10valid.txt
  32. +6 −0 queries/query11.txt
  33. +3 −0  queries/query11desc.txt
  34. +1 −0  queries/query11valid.txt
  35. +24 −0 queries/query12.txt
  36. +3 −0  queries/query12desc.txt
  37. 0  queries/query12valid.txt
  38. +6 −0 queries/query1desc.txt
  39. +1 −0  queries/query1valid.txt
  40. +24 −0 queries/query2.txt
  41. +3 −0  queries/query2desc.txt
  42. +1 −0  queries/query2valid.txt
  43. +22 −0 queries/query3.txt
  44. +7 −0 queries/query3desc.txt
  45. +1 −0  queries/query3valid.txt
  46. +28 −0 queries/query4.txt
  47. +8 −0 queries/query4desc.txt
  48. +1 −0  queries/query4valid.txt
  49. +19 −0 queries/query5.txt
  50. +3 −0  queries/query5desc.txt
  51. +1 −0  queries/query5valid.txt
  52. +11 −0 queries/query6.txt
  53. +3 −0  queries/query6desc.txt
  54. +1 −0  queries/query6valid.txt
  55. +29 −0 queries/query7.txt
  56. +4 −0 queries/query7desc.txt
  57. +1 −0  queries/query7valid.txt
  58. +21 −0 queries/query8.txt
  59. +3 −0  queries/query8desc.txt
  60. +1 −0  queries/query8valid.txt
  61. +4 −0 queries/query9.txt
  62. +3 −0  queries/query9desc.txt
  63. 0  queries/query9valid.txt
  64. +1 −0  querymix.txt
  65. +48 −0 run-complete
  66. +52 −0 runPerf
  67. +48 −0 runPerfSesame
  68. +14 −0 runResults
  69. +18 −0 sizes
  70. +4 −0 snapshot-setup
  71. +8 −0 sqlQueries/query1.txt
  72. +7 −0 sqlQueries/query10.txt
  73. +5 −0 sqlQueries/query10desc.txt
  74. 0  sqlQueries/query10valid.txt
  75. +3 −0  sqlQueries/query11.txt
  76. +3 −0  sqlQueries/query11desc.txt
  77. 0  sqlQueries/query11valid.txt
  78. +4 −0 sqlQueries/query12.txt
  79. +3 −0  sqlQueries/query12desc.txt
  80. 0  sqlQueries/query12valid.txt
  81. +6 −0 sqlQueries/query1desc.txt
  82. 0  sqlQueries/query1valid.txt
  83. +4 −0 sqlQueries/query2.txt
  84. +3 −0  sqlQueries/query2desc.txt
  85. 0  sqlQueries/query2valid.txt
  86. +10 −0 sqlQueries/query3.txt
  87. +7 −0 sqlQueries/query3desc.txt
  88. 0  sqlQueries/query3valid.txt
  89. +9 −0 sqlQueries/query4.txt
  90. +8 −0 sqlQueries/query4desc.txt
  91. 0  sqlQueries/query4valid.txt
  92. +8 −0 sqlQueries/query5.txt
  93. +3 −0  sqlQueries/query5desc.txt
  94. 0  sqlQueries/query5valid.txt
  95. +4 −0 sqlQueries/query6.txt
  96. +3 −0  sqlQueries/query6desc.txt
  97. 0  sqlQueries/query6valid.txt
  98. +4 −0 sqlQueries/query7.txt
  99. +4 −0 sqlQueries/query7desc.txt
  100. 0  sqlQueries/query7valid.txt
  101. +6 −0 sqlQueries/query8.txt
  102. +3 −0  sqlQueries/query8desc.txt
  103. 0  sqlQueries/query8valid.txt
  104. +3 −0  sqlQueries/query9.txt
  105. +3 −0  sqlQueries/query9desc.txt
  106. 0  sqlQueries/query9valid.txt
  107. +130 −0 src/benchmark/generator/DateGenerator.java
  108. +974 −0 src/benchmark/generator/Generator.java
  109. +41 −0 src/benchmark/generator/NormalDistGenerator.java
  110. +32 −0 src/benchmark/generator/NormalDistRangeGenerator.java
  111. +21 −0 src/benchmark/generator/ParetoDistGenerator.java
  112. +70 −0 src/benchmark/generator/RandomBucket.java
  113. +189 −0 src/benchmark/generator/TextGenerator.java
  114. +85 −0 src/benchmark/generator/ValueGenerator.java
  115. +20 −0 src/benchmark/model/BSBMResource.java
  116. +128 −0 src/benchmark/model/Offer.java
  117. +73 −0 src/benchmark/model/Person.java
  118. +107 −0 src/benchmark/model/Producer.java
  119. +92 −0 src/benchmark/model/Product.java
  120. +65 −0 src/benchmark/model/ProductFeature.java
  121. +97 −0 src/benchmark/model/ProductType.java
  122. +44 −0 src/benchmark/model/RatingSite.java
  123. +93 −0 src/benchmark/model/Review.java
  124. +105 −0 src/benchmark/model/Vendor.java
  125. +244 −0 src/benchmark/qualification/Qualification.java
  126. +6 −0 src/benchmark/qualification/QualificationDefaultValues.java
  127. +145 −0 src/benchmark/qualification/QueryResult.java
  128. +694 −0 src/benchmark/serializer/NTriples.java
  129. +110 −0 src/benchmark/serializer/ObjectBundle.java
  130. +875 −0 src/benchmark/serializer/SQLSerializer.java
  131. +10 −0 src/benchmark/serializer/Serializer.java
  132. +718 −0 src/benchmark/serializer/TriG.java
  133. +791 −0 src/benchmark/serializer/Turtle.java
  134. +686 −0 src/benchmark/serializer/VirtSerializer.java
  135. +571 −0 src/benchmark/serializer/XMLSerializer.java
  136. +11 −0 src/benchmark/testdriver/AbstractParameterPool.java
  137. +123 −0 src/benchmark/testdriver/ClientManager.java
  138. +88 −0 src/benchmark/testdriver/ClientThread.java
  139. +34 −0 src/benchmark/testdriver/CompiledQuery.java
  140. +250 −0 src/benchmark/testdriver/CompiledQueryMix.java
  141. +296 −0 src/benchmark/testdriver/LocalConnectionJena.java
  142. +349 −0 src/benchmark/testdriver/LocalConnectionSesame.java
  143. +270 −0 src/benchmark/testdriver/LocalSPARQLParameterPool.java
  144. +84 −0 src/benchmark/testdriver/NetQuery.java
  145. +86 −0 src/benchmark/testdriver/PreCalcParameterPool.java
  146. +301 −0 src/benchmark/testdriver/Query.java
  147. +310 −0 src/benchmark/testdriver/QueryMix.java
  148. +321 −0 src/benchmark/testdriver/SPARQLConnection.java
  149. +160 −0 src/benchmark/testdriver/SQLConnection.java
  150. +242 −0 src/benchmark/testdriver/SQLParameterPool.java
  151. +17 −0 src/benchmark/testdriver/ServerConnection.java
  152. +768 −0 src/benchmark/testdriver/TestDriver.java
  153. +21 −0 src/benchmark/testdriver/TestDriverDefaultValues.java
  154. +398 −0 src/benchmark/tools/ResultTransform.java
  155. +388 −0 src/benchmark/tools/ResultTransformOriginalStyle.java
  156. +357 −0 src/benchmark/vocabulary/BSBM.java
  157. +36 −0 src/benchmark/vocabulary/DC.java
  158. +39 −0 src/benchmark/vocabulary/FOAF.java
  159. +82 −0 src/benchmark/vocabulary/ISO3166.java
  160. +47 −0 src/benchmark/vocabulary/RDF.java
  161. +39 −0 src/benchmark/vocabulary/RDFS.java
  162. +39 −0 src/benchmark/vocabulary/REV.java
  163. +48 −0 src/benchmark/vocabulary/XSD.java
  164. +69 −0 src/dev/RunBSBM.java
  165. +65 −0 src/openrdf/LoadData.java
  166. +110 −0 src/openrdf/Repo.java
  167. +107 −0 src/openrdf/test.java
  168. +10 −0 sync
  169. +89,523 −0 titlewords.txt
  170. +7 −0 virtSQLqueries/query1.txt
  171. +7 −0 virtSQLqueries/query10.txt
  172. +5 −0 virtSQLqueries/query10desc.txt
  173. 0  virtSQLqueries/query10valid.txt
  174. +3 −0  virtSQLqueries/query11.txt
  175. +3 −0  virtSQLqueries/query11desc.txt
  176. 0  virtSQLqueries/query11valid.txt
  177. +4 −0 virtSQLqueries/query12.txt
  178. +3 −0  virtSQLqueries/query12desc.txt
  179. 0  virtSQLqueries/query12valid.txt
  180. +6 −0 virtSQLqueries/query1desc.txt
  181. 0  virtSQLqueries/query1valid.txt
  182. +4 −0 virtSQLqueries/query2.txt
  183. +3 −0  virtSQLqueries/query2desc.txt
  184. 0  virtSQLqueries/query2valid.txt
  185. +10 −0 virtSQLqueries/query3.txt
  186. +7 −0 virtSQLqueries/query3desc.txt
  187. 0  virtSQLqueries/query3valid.txt
  188. +7 −0 virtSQLqueries/query4.txt
  189. +8 −0 virtSQLqueries/query4desc.txt
  190. 0  virtSQLqueries/query4valid.txt
  191. +7 −0 virtSQLqueries/query5.txt
  192. +3 −0  virtSQLqueries/query5desc.txt
  193. 0  virtSQLqueries/query5valid.txt
  194. +5 −0 virtSQLqueries/query6.txt
  195. +3 −0  virtSQLqueries/query6desc.txt
  196. 0  virtSQLqueries/query6valid.txt
  197. +4 −0 virtSQLqueries/query7.txt
  198. +4 −0 virtSQLqueries/query7desc.txt
  199. 0  virtSQLqueries/query7valid.txt
  200. +6 −0 virtSQLqueries/query8.txt
  201. +3 −0  virtSQLqueries/query8desc.txt
  202. 0  virtSQLqueries/query8valid.txt
  203. +3 −0  virtSQLqueries/query9.txt
  204. +3 −0  virtSQLqueries/query9desc.txt
  205. 0  virtSQLqueries/query9valid.txt
9 .classpath
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="src" path="src"/>
+ <classpathentry kind="lib" path="lib/ssj.jar"/>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
+ <classpathentry kind="con" path="org.apache.ivyde.eclipse.cpcontainer.IVYDE_CONTAINER/?ivyXmlPath=ivy.xml&amp;confs=*"/>
+ <classpathentry kind="lib" path="lib/jdom.jar"/>
+ <classpathentry kind="output" path="classes"/>
+</classpath>
20 .gitignore
@@ -0,0 +1,20 @@
+dwim
+classes
+DB
+Runs/
+Data/*
+TDB-DB/*
+Sesame-DB/*
+lib-sys/*
+Results/*
+run.log
+dataset.ttl
+td_data
+steadystate.tsv
+benchmark_result.xml
+bin
+*.html
+build
+target
+results-backup-*.zip
+Q.rq
17 .project
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>BSBM-Jena</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ </natures>
+</projectDescription>
147 Notes.txt
@@ -0,0 +1,147 @@
+==== Build Setup
+
+# -sync can delete as well
+ivy -settings ivysettings.xml -ivy ivy.xml \
+ -retrieve 'lib-sys/[artifact]-[revision](-[classifier]).[ext]' \
+ -sync retrieve
+
+==== Process
+
+See run-complete for a script to drive all the scripts.
+
+genAll (choose sizes wanted)
+loadAll (choose sizes to load)
+runPerf (choose sizes to test)
+
+# Note: the Java code knows the range of possible store sizes
+# If you miss 200m out, say, you get
+# "Error: XML result file names must contain size metrics e.g. store_50k.xml for res-200m.xml"
+
+# Run results and create bsbm-results.html
+genAllResults
+
+
+
+== Layout:
+
+Data/data-SIZE/...files...
+Results/res....
+
+genAll creates all the datafiles laid out like this.
+
+
+== BSBM details
+
+The original benchmark uses the web API and ...
+# Execute single-client test run (500 mixes performance measurement, randomizer seed: 808080)
+# Execute multiple-client test runs. ( 4 clients, 500 query mixes, randomizer seed: 863528)
+# Execute test run with reduced query mix. (repeat steps 2 to 4 with reduced query mix and different randomizer seed 919191)
+
+== Commands
+benchmark.generator.Generator
+benchmark.testdriver.TestDriver
+benchmark.tools.ResultTransform
+
+
+
+== Run Generator
+
+50k: 128
+250k: 666
+5m: 14088
+
+1M: 2785
+25M: 70812
+100M: 284826
+200M: 570000
+
+
+java -cp bin:lib/ssj.jar benchmark.generator.Generator -fc -pc 1000 -s ttl
+
+-s <output format>
+
+For the dataset there are several output formats supported. See upper table
+for details. Default: nt
+
+-pc <number of products>
+
+Scale factor: The dataset is scaled via the number of products. For
+example: 91 products make about 50K triples. Default: 100
+
+-fc
+
+The data generator by default adds rdf:type statements for all types of a
+product to the dataset. If the SUT supports RDFS reasoning, the option -fc
+can be used to exclude these statements and leave generating them to the
+inference engine of the store. Default: disabled
+
+-dir
+
+The output directory for all the data the Test Driver uses for its
+runs. Default: "td_data"
+
+-fn
+
+The file name for the generated dataset (suffix is added according to the
+output format). Default: "dataset"
+
+--------------------
+== Run tests
+java -cp bin:lib/* benchmark.testdriver.TestDriver http://localhost/sparql
+
+
+-runs <number of runs>
+
+The number of query mix runs. Default: 50
+
+ -idir <directory>
+
+The input parameter directory which was created by the Data
+Generator. Default: "td_data"
+
+ -w <number of warm up runs>
+
+Number of runs executed before the actual test to warm up the
+store. Default: 10
+
+-o <result XML file>
+
+The output file containing the aggregated result overview. Default:
+"benchmark_result.xml"
+
+-dg <default graph URI>
+
+Specify a default graph for the queries. Default: null
+
+-mt <number of clients>
+
+Benchmark with multiple concurrent clients.
+
+-seed <Long value>
+
+Set the seed for the random number generator used for the parameter
+generation.
+
+-t <Timeout in ms>
+
+If for a specific query the complete result is not read after the specified
+timeout, the client disconnects and reports a timeout to the Test
+Driver. This is also the maximum runtime a query can contribute to the
+metrics.
+
+-q
+
+Turn on qualification mode. For more information, see the qualification chapter.
+
+-qf <qualification file name>
+
+Change the qualification file name, also see the qualification chapter.
+
+--------------------
+== Results
+
+java -cp bin:lib/* benchmark.tools.ResultTransform ??????
+
+Data layout:
+
+StoreName/25m.xml etc etc
66 README.txt
@@ -0,0 +1,66 @@
+==== BSBM-Jena
+
+Berlin SPARQL Benchmark with additions for testing Jena local stores.
+
+Adds new endpoint formats:
+
+* "jena:assembler" where "assembler" is the file name of a Jena assembler
+description for the store.
+
+* "sesame:directory" to connect to a Seame repository.
+
+
+== Get the system and setup
+
+git clone git://github.com/afs/BSBM-Local.git
+mkdir Data
+mkdir src-test
+
+# Get the dependent jars
+ivy -settings ivysettings.xml -ivy ivy.xml \
+ -retrieve 'lib-sys/[artifact]-[revision](-[classifier]).[ext]' \
+ -sync retrieve
+
+
+# Compile the system
+ant jar
+
+Either use Eclipse (the project setup is included) or use "ant jar" which
+places the jar in build/.
+
+== Directories
+
+Data/data-SIZE -- generated data
+TDB-DB/DB-SIZE/ -- TDB
+Sesame-DB/Repo-SIZE -- Sesame
+
+== Process - for TDB backed stores.
+
+# Choose sizes wanted
+genAll
+
+# Run the tdbloader, create stats files and assembler files.
+loadAll
+
+# Run the performance tests
+# Results go into "Results/"
+runPerf
+
+# Generate the results, naming the results directory.
+# NB The BSBM formatter knows the possible store sizes
+runResults Results
+
+== Process - Sesame
+
+loadSesame
+runPerfSesame
+
+== Questions?
+
+If about BSBM generaly, ask the authors, see
+http://www4.wiwiss.fu-berlin.de/bizer/BerlinSPARQLBenchmark/
+
+If about teh Jena customization, please send questions to:
+
+ jena-dev@groups.yahoo.com
+
16 assembler-template.ttl
@@ -0,0 +1,16 @@
+@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+
+@prefix ja: <http://jena.hpl.hp.com/2005/11/Assembler#> .
+@prefix sdb: <http://jena.hpl.hp.com/2007/sdb#> .
+@prefix tdb: <http://jena.hpl.hp.com/2008/tdb#> .
+
+[] ja:loadClass "com.hp.hpl.jena.tdb.TDB" .
+tdb:DatasetTDB rdfs:subClassOf ja:RDFDataset .
+tdb:GraphTDB rdfs:subClassOf ja:Model .
+
+## ---- A whole dataset managed by TDB
+<#dataset> rdf:type tdb:DatasetTDB ;
+ tdb:location "TDB-DB/DB-SIZE/Store" ;
+ .
15 assembler.ttl
@@ -0,0 +1,15 @@
+@prefix tdb: <http://jena.hpl.hp.com/2008/tdb#> .
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+@prefix ja: <http://jena.hpl.hp.com/2005/11/Assembler#> .
+@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
+
+[] ja:loadClass "com.hp.hpl.jena.tdb.TDB" .
+[] ja:loadClass "tdbplus.bdb.InitBDB" .
+
+tdb:DatasetTDB rdfs:subClassOf ja:RDFDataset .
+tdb:DatasetTDB_BDB rdfs:subClassOf tdb:DatasetTDB .
+tdb:DatasetTDB_BDB rdfs:subClassOf ja:RDFDataset .
+
+<#dataset> rdf:type tdb:DatasetTDB_BDB ;
+ tdb:location "../BSBM-Jena-BDB/Data/data-50k/BDB" ;
+ .
291 build.xml
@@ -0,0 +1,291 @@
+<project xmlns:ivy="antlib:org.apache.ivy.ant" name="TDB" default="build">
+
+ <!-- Configuration as a propertied file ? -->
+ <!-- <property file="tdb-build.properties"/> -->
+
+ <!-- ========================================== -->
+ <!-- ==== Configuration -->
+ <property name="Name" value="BSBM"/>
+ <property name="name" value="bsbm"/>
+
+ <property environment="env"/>
+
+ <!-- The major and minor version numbers -->
+ <property name="version-major" value="1"/>
+ <property name="version-minor" value="0"/>
+ <property name="version-revision" value="0"/>
+ <property name="version-status" value=""/>
+ <property name="version"
+ value="${version-major}.${version-minor}.${version-revision}${version-status}"/>
+
+ <!-- javadoc -->
+ <property name="copyright.text"
+ value="Copyright &#169; Freie Universitat Berlin"/>
+ <property name="javadoc.packages" value="benchmark.*"/>
+
+ <target name="main" depends="jar"/>
+
+ <!-- Sources as a path -->
+ <property name="src.dir" value="src"/>
+ <property name="src.test.dir" value="src-test"/>
+
+ <!-- Source code -->
+ <path id="java.source.path.main">
+ <pathelement path="${src.dir}"/>
+ </path>
+
+ <!--
+ <path id="java.source.path.test">
+ <pathelement path="${src.test.dir}"/>
+ </path>
+
+ <path id="java.source.path">
+ <path refid="java.source.path.main"/>
+ <path refid="java.source.path.test"/>
+ </path>
+ -->
+
+ <path id="java.source.path">
+ <path refid="java.source.path.main"/>
+ </path>
+
+ <!-- Sources as fileset (want path=>fileset to avoid the duplication here) -->
+ <fileset dir="." id="fileset.src">
+ <include name="${src.dir}/**/*.java"/>
+ </fileset>
+
+ <!-- Library code -->
+
+ <!-- Set version from components (if not already set) -->
+ <property name="version"
+ value="${version-major}.${version-minor}.${version-revision}${version-status}"/>
+
+ <!-- Artifacts -->
+ <property name="jarfile" value="${name}-${version}.jar"/>
+
+ <property name="javadoc.dir" value="${doc.dir}/javadoc"/>
+ <property name="javadoc.all.dir" value="${doc.dir}/javadoc-all"/>
+ <property name="lib.dir" value="lib"/>
+ <property name="lib.sys.dir" value="lib-sys"/>
+
+ <property name="build.dir" value="build"/>
+ <property name="build.classes.dir" value="${build.dir}/classes"/>
+
+ <property name="javadoc.title" value="${Name}"/>
+ <property name="javadoc.window.title" value="${Name}-${version-major}.${version-minor} Javadoc"/>
+
+ <!-- ========================================== -->
+ <!-- ==== Setup -->
+
+ <path id="java.run.class.path">
+ <!-- jar file may, or may not, be in the lib directory -->
+ <fileset dir="${lib.dir}" includes="*.jar" excludes="${jarfile}"/>
+ <fileset dir="${lib.sys.dir}" includes="*.jar" excludes="${jarfile}"/>
+ <fileset dir="${build.dir}" includes="bsbm*.jar"/>
+ </path>
+
+ <tstamp>
+ <format property="build.time.xsd" pattern="yyyy-MM-dd'T'HH:mm:ssZ"/>
+ <format property="build.time.txt" pattern="yyyy-MM-dd HH:mm Z"/>
+ </tstamp>
+
+ <!-- <echo message="Build: ${build.time.xsd}"/> -->
+
+ <filterset id="filters.build.metadata">
+ <filter token="VERSION" value="${version}" />
+ <filter token="BUILD_TIME" value="${build.time.txt}" />
+ <filter token="BUILD_TIME_XSD" value="${build.time.xsd}" />
+ </filterset>
+
+ <target name="javac-flags">
+ <!-- Target - so can have different javac flags (properties are set once) -->
+ <property name="java.debug" value="true"/>
+ <property name="java.debuglevel" value="source,lines,vars"/>
+ <property name="java.deprecation" value="true"/>
+ <property name="java.optimize" value="true"/>
+ <property name="java.encoding" value="UTF8"/>
+ <property name="java.source" value="1.6"/>
+ <property name="java.target" value="1.6"/>
+ </target>
+
+ <target name="set-classpath">
+ <!-- This must be after IVY has done it's dependence stuff, hence as a task -->
+ <path id="java.build.class.path">
+ <fileset dir="${lib.dir}" includes="*.jar" excludes="${jarfile}"/>
+ <fileset dir="${lib.sys.dir}" includes="*.jar"/>
+ </path>
+ </target>
+
+ <target name="java-init" depends="javac-flags,set-classpath"/>
+
+ <!-- ========================================== -->
+ <!-- ==== Build, compile, jar, javadoc -->
+
+ <target name="compile" depends="java-init,compile-main,compile-test" description="Compile project"/>
+
+ <target name="compile-main">
+ <mkdir dir="${build.classes.dir}"/>
+ <javac destdir="${build.classes.dir}"
+ debug="${java.debug}"
+ deprecation="${java.debuglevel}"
+ optimize="${java.optimize}"
+ encoding="${java.encoding}"
+ source="${java.source}"
+ target="${java.target}"
+ >
+ <src refid="java.source.path"/>
+ <classpath refid="java.build.class.path" />
+ <compilerarg value="-Xlint:unchecked"/>
+ </javac>
+ </target>
+
+ <target name="compile-test">
+ </target>
+
+ <target name="build.jar" depends="compile">
+ <antcall target="package.jar"/>
+ </target>
+
+ <target name="package.jar">
+ <delete file="${build.dir}/${jarfile}" failonerror="false"/>
+ <jar destfile="${build.dir}/${jarfile}" basedir="${build.classes.dir}" index="yes">
+ <!--<fileset file="${build.metadata.file.dest}"/>-->
+ </jar>
+ </target>
+
+ <!-- ========================================== -->
+ <!-- ==== Javadoc -->
+
+ <target name="javadoc" depends="java-init"
+ description="Make the javadoc"
+ if="javadoc.packages">
+ <delete dir="${javadoc.dir}"/>
+ <mkdir dir="${javadoc.dir}"/>
+ <javadoc packagenames="${javadoc.packages}"
+ destdir="${javadoc.dir}"
+ author="true"
+ sourcepathref="java.source.path.main"
+ source="${java.source}"
+ version="true"
+ windowtitle="${javadoc.window.title}"
+ doctitle="${javadoc.title}"
+ Public="true"
+ Use="true"
+ bottom="${copyright.text}"
+ additionalparam="-breakiterator">
+ <classpath refid="java.build.class.path"/>
+ </javadoc>
+ </target>
+
+ <!-- ========================================== -->
+ <!-- ==== Basic tasks -->
+
+ <!-- Not depends="build.jar" because that will always be run even if the body is "unless"'ed out -->
+
+ <target name="jar"
+ description="Compile and build the jar"
+ unless="jar.run">
+ <antcall target="build.jar"/>
+ <property name="jar.run" value="done"/>
+ </target>
+
+ <target name="build" depends="clean,jar" description="Clean build of the jar"/>
+
+ <!-- ========================================== -->
+ <!-- ==== JUnit and reporting -->
+
+ <target name="test" unless="test.run"
+ description="Run the test suite">
+ <antcall target="junit"/>
+ <property name="test.run" value="done"/>
+ </target>
+
+ <target name="junit"
+ depends="run-junit,run-report" description="Run the test suite">
+ <fail message="JUnit tests failed" if="junit.failed"/>
+ <echo message="JUnit tests passed"/>
+ </target>
+
+ <target name="report"
+ depends="run-junit,run-report"
+ description="Run tests and generate reports">
+ <fail message="JUnit tests failed" if="junit.failed"/>
+ <echo message="JUnit tests passed"/>
+ </target>
+
+ <!-- Worker task for the above tasks -->
+
+ <target name="pre-run-junit"/>
+
+ <target name="run-junit"
+ depends="clean-once,jar,pre-run-junit,clean-reports">
+ <mkdir dir="${reports.dir}"/>
+ <mkdir dir="${reports.dir.xml}"/>
+
+ <!-- Don't stop on failure - set a property instead -->
+ <junit fork="yes" printsummary="yes"
+ errorProperty="junit.failed" failureProperty="junit.failed">
+ <!-- usefile="false" type="plain"-->
+ <!-- <formatter usefile="false" type="brief"/> -->
+ <formatter type="xml" />
+ <formatter type="plain" />
+ <classpath>
+ <pathelement path="${build.classes.dir}" />
+ <pathelement path="${build.classes.test.dir}" />
+ <path refid="java.run.class.path" />
+ </classpath>
+ <!-- <test name="test.TS_Main" outfile="${reports.dir.xml}/junit-report"/> -->
+ <batchtest todir="${reports.dir.xml}">
+ <fileset dir="${src.test.dir}">
+ <include name="**/TS_*.java" />
+ </fileset>
+ <fileset dir="${src.lib.test.dir}">
+ <include name="**/TS_*.java" />
+ </fileset>
+ </batchtest>
+ </junit>
+ </target>
+
+ <target name="run-report" >
+ <junitreport todir="./${reports.dir}">
+ <fileset dir="./${reports.dir.xml}">
+ <include name="**.xml"/>
+ </fileset>
+ <report format="frames" todir="./${reports.outdir}"/>
+ </junitreport>
+ </target>
+
+ <!-- ========================================== -->
+ <!-- ==== Misc -->
+
+ <target name="clean" description="Clean (build and reports)"
+ depends="clean-build-area,clean-reports">
+ </target>
+
+ <target name="clean-once" unless="clean.run">
+ <antcall target="clean"/>
+ <property name="clean.run" value="set"/>
+ </target>
+
+ <target name="clean-javadoc">
+ <delete dir="${javadoc.dir}"/>
+ <mkdir dir="${javadoc.dir}"/>
+ </target>
+
+ <target name="clean-build-area">
+ <delete quiet="true" dir="${build.dir}"/>
+ <mkdir dir="${build.dir}"/>
+ </target>
+
+ <target name="clean-reports">
+ <delete dir="${reports.dir}"/>
+ <delete dir="${reports.dir.xml}"/>
+ <delete dir="${reports.outdir}"/>
+ </target>
+
+ <target name="clean-artifacts">
+ <delete dir="${artifacts.dir}"/>
+ <mkdir dir="${artifacts.dir}"/>
+ </target>
+
+</project>
48 details.txt
@@ -0,0 +1,48 @@
+## 50k: -fc -pc 128
+## 250k: -fc -pc 666
+## 5m: -fc -pc 14088
+## 1M: -fc -pc 2785
+## 25M: -fc -pc 70812
+## 100M: -fc -pc 284826
+## 200M: -fc -pc 570000
+
+## 350M: -fc -pc 855000
+350M :: 299802872
+
+==== Data/data-50k
+50057
+=> /128 = 391
+
+
+==== Data/data-250k
+250030
+=> /666 = 375284826
+
+==== Data/data-1m
+1000313
+=> /2785 = 359
+
+==== Data/data-5m
+5000339
+=> /14088 = 355
+
+==== Data/data-25m
+25000250
+=> /70812 = 353
+==== Data/data-100m
+100000112
+=> /284826 => 351
+
+==== Data/data-200m
+200031413
+=> /570000 => 350.93
+
+==> Data 350M
+-pc 855000
+299802872
+
+-pc 10000000
+==> 350558896
+
+Diff
+-pc 145000 = 50,756,024
42 genAll
@@ -0,0 +1,42 @@
+#!/bin/bash
+
+. ./init
+
+# To get the same sets as the benchmark:
+## 50k: 128
+## 250k: 666
+## 5m: 14088
+## 1M: -fc -pc 2785
+## 25M: -fc -pc 70812
+## 100M: -fc -pc 284826
+## 200M: -fc -pc 570000
+## 350M: -fc -pc 855000
+
+
+DATADIR="Data"
+[ -d "$DATADIR" ] || { echo "Not a directory: $DATADIR" ; exit 1 ; }
+
+function generate
+{
+ local size="$1"
+ local pc="$2"
+ local DIR="$DATADIR/data-$size"
+ [ -d "$DIR" ] || { mkdir "$DIR" ; }
+
+ echo "==== Generate data for $size"
+
+ java -cp "$CLASSPATH" -Xmx1024M -server benchmark.generator.Generator \
+ -fc -pc $pc -dir $DIR -fn "$DIR/data"
+ gzip "$DIR/data.nt"
+}
+
+# rm -rf $DATADIR/data*
+
+generate 50k 128
+## generate 250k 666
+## generate 1m 2785
+## generate 5m 14088
+## generate 25m 70812
+## generate 100m 284826
+## generate 200m 570000
+## generate 350m 10000000
26 genAllResults
@@ -0,0 +1,26 @@
+#!/bin/bash
+
+# Make results
+
+for X in Runs/[0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9]
+ do
+ RUN_DIR="$X"
+ if [ ! -e "$RUN_DIR/Results" ] ; then
+ echo "No results directory: $RUN_DIR/Results"
+ continue
+ fi
+
+ echo "Process $RUN_DIR/Results"
+ runResults "$RUN_DIR/Results"
+ mv *html "$RUN_DIR/"
+
+ # This is the import file (for me)
+ cp "$RUN_DIR/bsbm_query_and_size_tables_of_stores.html" "$RUN_DIR/bsbm-query-results.html"
+
+ # The load figures.
+ if [ -e "$RUN_DIR/load.log" ]
+ then
+ genLoadResults < "$RUN_DIR/load.log" > "$RUN_DIR/bsbm-load-results.txt"
+ fi
+
+done
42 genLoadResults
@@ -0,0 +1,42 @@
+#!/usr/bin/perl
+
+while(<>)
+{
+ # TDB
+ if ( /==== Load data/ )
+ {
+ $triples ='' ;
+ $time = '' ;
+ $rate = '' ;
+ next ;
+ }
+
+ if ( /triples: loaded/ )
+ {
+ /([0-9,]+) triples: loaded in ([0-9.,]*) seconds \[([0-9.,]*) triples\/s\]/ ;
+ ## print "$1 $2 $3\n" ;
+
+ $triples = $1 ;
+
+## $time = $2 ;
+## $rate = $3 ;
+## $triples =~ s/,//g ;
+## $rate =~ s/,//g ;
+## printf "%s in %ss @ %.2f\n",$triples, $time, $rate ;
+ next ;
+ }
+
+ if ( /Time for load/ )
+ {
+ /Time for load: ([0-9.]*)s \[([0-9.,]*) triples\/s\]/ ;
+ $time = $1 ;
+ $rate = $2 ;
+
+## $triples =~ s/,//g ;
+## $rate =~ s/,//g ;
+ printf "%-12s in %10ss @ %s TPS\n",$triples, $time, $rate ;
+ next ;
+ }
+
+ # Sesame : does not print the sizes so do manually.
+}
26 genOne
@@ -0,0 +1,26 @@
+#!/bin/bash
+
+. ./init
+
+if [ "$#" != 1 ]
+then
+ echo "Usage $0 NUM" 1>&2
+ exit 1
+ fi
+
+N="$1"
+F="data-$N"
+FF="data-$N.nt"
+
+
+[ -e "$FF" ] && { echo "$FF exists" 1>&2 ; exit 1 ; }
+[ -e "$FF.gz" ] && { echo "$FF.gz exists" 1>&2 ; exit 1 ; }
+
+echo "== Start: $( date "+%Y-%m-%d %H:%M:%S")"
+
+java -cp "$CLASSPATH" -Xmx1024M -server benchmark.generator.Generator \
+ -fc -pc "$N" -fn "$F"
+
+echo "== Compress: $( date "+%Y-%m-%d %H:%M:%S")"
+gzip "$FF"
+echo "== Finish: $( date "+%Y-%m-%d %H:%M:%S")"
26 genStats
@@ -0,0 +1,26 @@
+#!/bin/bash
+
+. ./init
+
+DIRS="50k 250k 1m 5m 25m 100m 200m"
+
+for d in $DIRS
+do
+
+ SET="$DATADIR/data-$d"
+ DB="$JENADB/DB-$d"
+ LOC="$DB/Store"
+
+ if [ ! -e "$LOC" ]
+ then
+ echo "== No such directory: $LOC" 1>&2
+ continue
+ fi
+
+ echo "== Stats ($d)"
+ tdbstats --loc "$LOC" > stats.opt
+ mv stats.opt "$LOC"
+
+ echo "== Assembler ($d)"
+ sed -e "s/SIZE/$d/" assembler-template.ttl > "$SET/assembler.ttl"
+done
88,799 givennames.txt
88,799 additions, 0 deletions not shown
0  ignoreQueries.txt
No changes.
19 init
@@ -0,0 +1,19 @@
+# Source this file.
+
+## $DATADIR/data-<SIZE>/
+DATADIR=Data
+
+## $JENADB/DB-<SIZE>
+## $JENADB/TDB-<SIZE>/DB-<SIZE>
+JENADB=TDB-DB
+
+## $SESAMEDB/Repo-<SIZE>
+SESAMEDB=Sesame-DB
+
+CLASSPATH='classes:build/classes:lib/*:lib-sys/*'
+
+if [ "$OSTYPE" = "cygwin" ]
+then
+ CLASSPATH="$(cygpath -w -p $CLASSPATH)"
+ fi
+#echo $CLASSPATH
42 ivy.xml
@@ -0,0 +1,42 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ivy-module version="2.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xmlns:mvn="http://ant.apache.org/ivy/maven"
+ xsi:noNamespaceSchemaLocation="http://ant.apache.org/ivy/schemas/ivy.xsd">
+
+ <info module="BSBM-Direct"
+ organisation="com.talis"
+ revision="0.0.0">
+ <license name="BSD"/>
+ <ivyauthor name="Talis Information Ltd" url="http://talis.com/"/>
+ <description>Berline SPARQL Benchmark modifed to call a store directly, not via HTTP</description>
+ </info>
+
+ <configurations defaultconfmapping="main->*">
+ <conf name="main"/>
+ </configurations>
+
+ <dependencies>
+
+ <!-- use Jena assemblers -->
+ <!--
+ <dependency org="com.hp.hpl.jena" name="arq" rev="2.8.2"/>
+ -->
+ <dependency org="com.hp.hpl.jena" name="tdb" rev="0.8.4"/>
+
+ <!-- If Neo4j - ->
+ <dependency org="org.neo4j" name="neo-rdf-sail" rev="0.5-SNAPSHOT"/>
+ <dependency org="org.openrdf.sesame" name="sesame-runtime" rev="2.1.1"/>
+ -->
+
+ <!-- If latest Sesame -->
+ <dependency org="org.openrdf.sesame" name="sesame-runtime" rev="2.3.0"/>
+ <dependency org="info.aduna.commons" name="aduna-commons-lang" rev="2.7.0"/>
+ <dependency org="info.aduna.commons" name="aduna-commons-net" rev="2.5.0"/>
+ <dependency org="info.aduna.commons" name="aduna-commons-io" rev="2.7.0"/>
+ <dependency org="info.aduna.commons" name="aduna-commons-text" rev="2.5.0"/>
+ <dependency org="info.aduna.commons" name="aduna-commons-xml" rev="2.5.0"/>
+
+ </dependencies>
+
+</ivy-module>
26 ivysettings.xml
@@ -0,0 +1,26 @@
+<ivysettings>
+ <!-- Resolvers for dependences -->
+ <resolvers>
+ <chain name="resolver-chain">
+
+ <ibiblio name="openrdf"
+ root="http://repo.aduna-software.org/maven2/releases/"
+ m2compatible="true"/>
+
+ <!-- neo4j -->
+ <ibiblio name="neo4j"
+ root="http://m2.neo4j.org"
+ m2compatible="true"/>
+
+ <ibiblio name="maven2" m2compatible="true" />
+
+ </chain>
+ </resolvers>
+
+ <settings defaultResolver="resolver-chain"/>
+
+ <!--
+ <caches defaultCacheDir="c:/home/afs/.ivy2/cache"/>
+ -->
+
+</ivysettings>
BIN  lib/jdom.jar
Binary file not shown
BIN  lib/ssj.jar
Binary file not shown
40 loadAll
@@ -0,0 +1,40 @@
+#!/bin/bash
+
+DATADIR="Data"
+[ -d "$DATADIR" ] || { echo "Not a directory: $DATADIR" ; exit 1 ; }
+
+DIRS="${SIZES:-50k 250k 1m 5m 25m 100m 200m}"
+#DIRS="200m"
+
+for d in $DIRS
+do
+ SET="$DATADIR/data-$d"
+ if [ ! -e "$SET/data.nt" -a ! -e "$SET/data.nt.gz" ]
+ then
+ echo "No data for $SET"
+ continue
+ fi
+ echo "==== Load data : $SET"
+
+
+ DB="$JENADB/DB-$d"
+ LOC="$DB/Store"
+ rm -rf $LOC
+
+ echo "== Load ($d)"
+ if [ -e "$SET/data.nt" ] ; then
+ echo "== Load from $SET/data.nt"
+ tdbloader --loc "$LOC" "$SET/data.nt"
+ elif [ -e "$SET/data.nt.gz" ] ; then
+ echo "== Load from $SET/data.nt.gz"
+ gzip -d < "$SET/data.nt.gz" | tdbloader --loc "$LOC" -- -
+ else
+ echo "No data.nt or data.nt.gz for $SET"
+ continue
+ fi
+ echo "== Stats ($d)"
+ tdbstats --loc "$LOC" > stats.opt
+ mv stats.opt "$LOC"
+ echo "== Assembler ($d)"
+ sed -e "s/SIZE/$d/" assembler-template.ttl > "$SET/assembler.ttl"
+done
47 loadSesame
@@ -0,0 +1,47 @@
+#!/bin/bash
+
+. ./init
+
+DATADIR="Data"
+[ -d "$DATADIR" ] || { echo "Not a directory: $DATADIR" ; exit 1 ; }
+
+DIRS="${SIZES:-50k 250k 1m 5m 25m 100m 200m}"
+DIRS="200m"
+DIRS="50k 250k 1m 5m"
+
+HEAP="1200M"
+if [ "$OSTYPE" = "cygwin" ]
+then
+ HEAP="6000M"
+ fi
+
+echo "Heap size: $HEAP"
+JVM_ARGS="-server -Xmx$HEAP"
+
+for d in $DIRS
+do
+ SET="$DATADIR/data-$d"
+ REPODIR="$SESAMEDB/Repo-$d"
+
+ if [ ! -e "$SET/data.nt" -a ! -e "$SET/data.nt.gz" ]
+ then
+ echo "No data for $SET"
+ continue
+ fi
+ echo "==== Load data : $SET"
+
+ rm -rf $REPODIR
+ mkdir -p $REPODIR
+
+ echo "== Load/openrdf ($d)"
+
+ if [ -e "$SET/data.nt" ] ; then
+ echo "== Load from $SET/data.nt"
+ java $JVM_ARGS -cp "$CP" openrdf.LoadData $REPODIR < "$SET/data.nt"
+ elif [ -e "$SET/data.nt.gz" ] ; then
+ gzip -d < "$SET/data.nt.gz" | java $JVM_ARGS -cp "$CP" openrdf.LoadData $REPODIR
+ else
+ echo "No data.nt or data.nt.gz for $SET"
+ continue
+ fi
+done
17 log.tidy
@@ -0,0 +1,17 @@
+#!/usr/bin/perl
+
+# Crude tidy up the log file to make it more readable.
+
+while(<>)
+{
+ if ( ! /^PREFIX/ )
+ {
+ s!<http://www.w3.org/1999/02/22-rdf-syntax-ns#([^>]*)>!rdf:$1! ;
+ s!<http://www.w3.org/2000/01/rdf-schema#([^>]*)>!rdfs:$1! ;
+ s!<http://www4.wiwiss.fu-berlin.de/bizer/bsbm/v01/instances/([^>]*)>!instance:$1! ;
+ s!<http://www4.wiwiss.fu-berlin.de/bizer/bsbm/v01/vocabulary/([^>]*)>!vocab:$1! ;
+ s!<urn:x-arq:DefaultGraphNode>!DFT! ;
+ }
+ print ;
+}
+
15 log4j.properties
@@ -0,0 +1,15 @@
+#log4j.rootLogger=WARN, stdout
+log4j.rootLogger=WARN, stderr
+
+log4j.appender.stdout=org.apache.log4j.ConsoleAppender
+log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
+log4j.appender.stdout.layout.ConversionPattern=%d{HH:mm:ss} %-5p %-20c{1} :: %m%n
+##log4j.appender.stdout.layout.ConversionPattern=%-5p %-20c{1} :: %m%n
+
+log4j.appender.stderr=org.apache.log4j.ConsoleAppender
+log4j.appender.stderr.target=System.err
+log4j.appender.stderr.layout=org.apache.log4j.PatternLayout
+log4j.appender.stderr.layout.ConversionPattern=%d{HH:mm:ss} %-5p %-20c{1} :: %m%n
+
+log4j.logger.benchmark=INFO
+
46 log4j.xml
@@ -0,0 +1,46 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE log4j:configuration SYSTEM "log4j.dtd">
+<!--
+log4j:WARN Continuable parsing error 36 and column 23
+log4j:WARN The content of element type "log4j:configuration" must match "(renderer*,appender*,(category|logger)*,root?,categoryFactory?)".
+-->
+<log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/">
+
+ <appender name="TheAppender" class="org.apache.log4j.FileAppender">
+ <param name="file" value="run.log" />
+ <param name="Append" value="false" />
+ <layout class="org.apache.log4j.PatternLayout">
+ <param name="ConversionPattern"
+ value="== %d{HH:mm:ss.SSS} %-5p %c: %m%n%n" />
+ </layout>
+ </appender>
+
+ <!--
+ <appender name="TheAppender" class="org.apache.log4j.ConsoleAppender">
+ <layout class="org.apache.log4j.PatternLayout">
+ <param name="ConversionPattern"
+ value="%d{ISO8601} %-5p [%t] %c: %m%n" />
+ </layout>
+ </appender>
+ -->
+
+ <logger name="com.hp.hpl.jena">
+ <level value="WARN"/>
+ </logger>
+
+ <logger name="com.hp.hpl.jena.tdb.exec">
+ <level value="INFO"/>
+ <!--<appender-ref ref="A1" />-->
+ </logger>
+
+ <logger name="com.hp.hpl.jena.tdb.info">
+ <level value="INFO"/>
+ <!--<appender-ref ref="A1" />-->
+ </logger>
+
+ <root>
+ <priority value="WARN" />
+ <appender-ref ref="TheAppender" />
+ </root>
+
+</log4j:configuration>
30 makeKey
@@ -0,0 +1,30 @@
+#!/bin/bash
+
+function makeKey
+{
+ local BASE="${1:-Key}"
+ local K="$(date +"%Y-%m-%d")"
+ local KEY="$BASE-$K"
+ typeset -i N=0
+
+ while [ -e "$KEY" ]
+ do
+ let N=N+1
+ KEY="$BASE-$K.$N"
+ done
+ echo $KEY
+}
+
+if [ "$#" != 1 ] ; then
+ echo "Usage: $0 prefix" 1>&2
+ exit
+ fi
+
+makeKey "$1"
+
+## X=$(makeKey)
+## touch $X
+## echo $X
+
+
+
16 queries/query1.txt
@@ -0,0 +1,16 @@
+PREFIX bsbm-inst: <http://www4.wiwiss.fu-berlin.de/bizer/bsbm/v01/instances/>
+PREFIX bsbm: <http://www4.wiwiss.fu-berlin.de/bizer/bsbm/v01/vocabulary/>
+PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
+PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
+
+SELECT DISTINCT ?product ?label
+WHERE {
+ ?product rdfs:label ?label .
+ ?product a %ProductType% .
+ ?product bsbm:productFeature %ProductFeature1% .
+ ?product bsbm:productFeature %ProductFeature2% .
+ ?product bsbm:productPropertyNumeric1 ?value1 .
+ FILTER (?value1 > %x%)
+ }
+ORDER BY ?label
+LIMIT 10
18 queries/query10.txt
@@ -0,0 +1,18 @@
+PREFIX bsbm: <http://www4.wiwiss.fu-berlin.de/bizer/bsbm/v01/vocabulary/>
+PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
+PREFIX dc: <http://purl.org/dc/elements/1.1/>
+
+SELECT DISTINCT ?offer ?price
+WHERE {
+ ?offer bsbm:product %ProductXYZ% .
+ ?offer bsbm:vendor ?vendor .
+ ?offer dc:publisher ?vendor .
+ ?vendor bsbm:country <http://downlode.org/rdf/iso-3166/countries#US> .
+ ?offer bsbm:deliveryDays ?deliveryDays .
+ FILTER (?deliveryDays <= 3)
+ ?offer bsbm:price ?price .
+ ?offer bsbm:validTo ?date .
+ FILTER (?date > %currentDate% )
+}
+ORDER BY xsd:double(str(?price))
+LIMIT 10
5 queries/query10desc.txt
@@ -0,0 +1,5 @@
+QueryType=Select
+
+ProductXYZ=ProductURI
+CountryXYZ=CountryURI
+currentDate=CurrentDate
1  queries/query10valid.txt
@@ -0,0 +1 @@
+price
6 queries/query11.txt
@@ -0,0 +1,6 @@
+SELECT ?property ?hasValue ?isValueOf
+WHERE {
+ { %OfferXYZ% ?property ?hasValue }
+ UNION
+ { ?isValueOf ?property %OfferXYZ% }
+}
3  queries/query11desc.txt
@@ -0,0 +1,3 @@
+QueryType=Select
+
+OfferXYZ=OfferURI
1  queries/query11valid.txt
@@ -0,0 +1 @@
+property hasValue
24 queries/query12.txt
@@ -0,0 +1,24 @@
+PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
+PREFIX rev: <http://purl.org/stuff/rev#>
+PREFIX foaf: <http://xmlns.com/foaf/0.1/>
+PREFIX bsbm: <http://www4.wiwiss.fu-berlin.de/bizer/bsbm/v01/vocabulary/>
+PREFIX bsbm-export: <http://www4.wiwiss.fu-berlin.de/bizer/bsbm/v01/vocabulary/export/>
+PREFIX dc: <http://purl.org/dc/elements/1.1/>
+
+CONSTRUCT { %OfferXYZ% bsbm-export:product ?productURI .
+ %OfferXYZ% bsbm-export:productlabel ?productlabel .
+ %OfferXYZ% bsbm-export:vendor ?vendorname .
+ %OfferXYZ% bsbm-export:vendorhomepage ?vendorhomepage .
+ %OfferXYZ% bsbm-export:offerURL ?offerURL .
+ %OfferXYZ% bsbm-export:price ?price .
+ %OfferXYZ% bsbm-export:deliveryDays ?deliveryDays .
+ %OfferXYZ% bsbm-export:validuntil ?validTo }
+WHERE { %OfferXYZ% bsbm:product ?productURI .
+ ?productURI rdfs:label ?productlabel .
+ %OfferXYZ% bsbm:vendor ?vendorURI .
+ ?vendorURI rdfs:label ?vendorname .
+ ?vendorURI foaf:homepage ?vendorhomepage .
+ %OfferXYZ% bsbm:offerWebpage ?offerURL .
+ %OfferXYZ% bsbm:price ?price .
+ %OfferXYZ% bsbm:deliveryDays ?deliveryDays .
+ %OfferXYZ% bsbm:validTo ?validTo }
3  queries/query12desc.txt
@@ -0,0 +1,3 @@
+QueryType=Construct
+
+OfferXYZ=OfferURI
0  queries/query12valid.txt
No changes.
6 queries/query1desc.txt
@@ -0,0 +1,6 @@
+QueryType=Select
+
+ProductType=ProductTypeURI
+ProductFeature1=ProductFeatureURI
+ProductFeature2=ProductFeatureURI
+x=ProductPropertyNumericValue
1  queries/query1valid.txt
@@ -0,0 +1 @@
+label
24 queries/query2.txt
@@ -0,0 +1,24 @@
+PREFIX bsbm-inst: <http://www4.wiwiss.fu-berlin.de/bizer/bsbm/v01/instances/>
+PREFIX bsbm: <http://www4.wiwiss.fu-berlin.de/bizer/bsbm/v01/vocabulary/>
+PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
+PREFIX dc: <http://purl.org/dc/elements/1.1/>
+
+SELECT ?label ?comment ?producer ?productFeature ?propertyTextual1 ?propertyTextual2 ?propertyTextual3
+ ?propertyNumeric1 ?propertyNumeric2 ?propertyTextual4 ?propertyTextual5 ?propertyNumeric4
+WHERE {
+ %ProductXYZ% rdfs:label ?label .
+ %ProductXYZ% rdfs:comment ?comment .
+ %ProductXYZ% bsbm:producer ?p .
+ ?p rdfs:label ?producer .
+ %ProductXYZ% dc:publisher ?p .
+ %ProductXYZ% bsbm:productFeature ?f .
+ ?f rdfs:label ?productFeature .
+ %ProductXYZ% bsbm:productPropertyTextual1 ?propertyTextual1 .
+ %ProductXYZ% bsbm:productPropertyTextual2 ?propertyTextual2 .
+ %ProductXYZ% bsbm:productPropertyTextual3 ?propertyTextual3 .
+ %ProductXYZ% bsbm:productPropertyNumeric1 ?propertyNumeric1 .
+ %ProductXYZ% bsbm:productPropertyNumeric2 ?propertyNumeric2 .
+ OPTIONAL { %ProductXYZ% bsbm:productPropertyTextual4 ?propertyTextual4 }
+ OPTIONAL { %ProductXYZ% bsbm:productPropertyTextual5 ?propertyTextual5 }
+ OPTIONAL { %ProductXYZ% bsbm:productPropertyNumeric4 ?propertyNumeric4 }
+}
3  queries/query2desc.txt
@@ -0,0 +1,3 @@
+QueryType=select
+
+ProductXYZ=ProductURI
1  queries/query2valid.txt
@@ -0,0 +1 @@
+label propertyNumeric1
22 queries/query3.txt
@@ -0,0 +1,22 @@
+PREFIX bsbm-inst: <http://www4.wiwiss.fu-berlin.de/bizer/bsbm/v01/instances/>
+PREFIX bsbm: <http://www4.wiwiss.fu-berlin.de/bizer/bsbm/v01/vocabulary/>
+PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
+PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
+
+SELECT ?product ?label
+WHERE {
+ ?product rdfs:label ?label .
+ ?product a %ProductType% .
+ ?product bsbm:productFeature %ProductFeature1% .
+ ?product bsbm:productPropertyNumeric1 ?p1 .
+ FILTER ( ?p1 > %x% )
+ ?product bsbm:productPropertyNumeric3 ?p3 .
+ FILTER (?p3 < %y% )
+ OPTIONAL {
+ ?product bsbm:productFeature %ProductFeature2% .
+ ?product rdfs:label ?testVar }
+ FILTER (!bound(?testVar))
+}
+ORDER BY ?label
+LIMIT 10
+
7 queries/query3desc.txt
@@ -0,0 +1,7 @@
+QueryType=Select
+
+ProductType=ProductTypeURI
+ProductFeature1=ProductFeatureURI
+ProductFeature2=ProductFeatureURI
+x=ProductPropertyNumericValue
+y=ProductPropertyNumericValue
1  queries/query3valid.txt
@@ -0,0 +1 @@
+label
28 queries/query4.txt
@@ -0,0 +1,28 @@
+PREFIX bsbm-inst: <http://www4.wiwiss.fu-berlin.de/bizer/bsbm/v01/instances/>
+PREFIX bsbm: <http://www4.wiwiss.fu-berlin.de/bizer/bsbm/v01/vocabulary/>
+PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
+PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
+
+SELECT DISTINCT ?product ?label ?propertyTextual
+WHERE {
+ {
+ ?product rdfs:label ?label .
+ ?product rdf:type %ProductType% .
+ ?product bsbm:productFeature %ProductFeature1% .
+ ?product bsbm:productFeature %ProductFeature2% .
+ ?product bsbm:productPropertyTextual1 ?propertyTextual .
+ ?product bsbm:productPropertyNumeric1 ?p1 .
+ FILTER ( ?p1 > %x% )
+ } UNION {
+ ?product rdfs:label ?label .
+ ?product rdf:type %ProductType% .
+ ?product bsbm:productFeature %ProductFeature1% .
+ ?product bsbm:productFeature %ProductFeature3% .
+ ?product bsbm:productPropertyTextual1 ?propertyTextual .
+ ?product bsbm:productPropertyNumeric2 ?p2 .
+ FILTER ( ?p2> %y% )
+ }
+}
+ORDER BY ?label
+OFFSET 5
+LIMIT 10
8 queries/query4desc.txt
@@ -0,0 +1,8 @@
+QueryType=Select
+
+ProductType=ProductTypeURI
+ProductFeature1=ProductFeatureURI
+ProductFeature2=ProductFeatureURI
+ProductFeature3=ProductFeatureURI
+x=ProductPropertyNumericValue
+y=ProductPropertyNumericValue
1  queries/query4valid.txt
@@ -0,0 +1 @@
+label
19 queries/query5.txt
@@ -0,0 +1,19 @@
+PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
+PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
+PREFIX bsbm: <http://www4.wiwiss.fu-berlin.de/bizer/bsbm/v01/vocabulary/>
+
+SELECT DISTINCT ?product ?productLabel
+WHERE {
+ ?product rdfs:label ?productLabel .
+ FILTER (%ProductXYZ% != ?product)
+ %ProductXYZ% bsbm:productFeature ?prodFeature .
+ ?product bsbm:productFeature ?prodFeature .
+ %ProductXYZ% bsbm:productPropertyNumeric1 ?origProperty1 .
+ ?product bsbm:productPropertyNumeric1 ?simProperty1 .
+ FILTER (?simProperty1 < (?origProperty1 + 120) && ?simProperty1 > (?origProperty1 - 120))
+ %ProductXYZ% bsbm:productPropertyNumeric2 ?origProperty2 .
+ ?product bsbm:productPropertyNumeric2 ?simProperty2 .
+ FILTER (?simProperty2 < (?origProperty2 + 170) && ?simProperty2 > (?origProperty2 - 170))
+}
+ORDER BY ?productLabel
+LIMIT 5
3  queries/query5desc.txt
@@ -0,0 +1,3 @@
+QueryType=Select
+
+ProductXYZ=ProductURI
1  queries/query5valid.txt
@@ -0,0 +1 @@
+productLabel
11 queries/query6.txt
@@ -0,0 +1,11 @@
+PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
+PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
+PREFIX bsbm: <http://www4.wiwiss.fu-berlin.de/bizer/bsbm/v01/vocabulary/>
+
+SELECT ?product ?label
+WHERE {
+ ?product rdfs:label ?label .
+ ?product rdf:type bsbm:Product .
+ FILTER regex(?label, "%word1%")
+}
+
3  queries/query6desc.txt
@@ -0,0 +1,3 @@
+QueryType=Select
+
+word1=Dictionary1
1  queries/query6valid.txt
@@ -0,0 +1 @@
+product
29 queries/query7.txt
@@ -0,0 +1,29 @@
+PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
+PREFIX rev: <http://purl.org/stuff/rev#>
+PREFIX foaf: <http://xmlns.com/foaf/0.1/>
+PREFIX bsbm: <http://www4.wiwiss.fu-berlin.de/bizer/bsbm/v01/vocabulary/>
+PREFIX dc: <http://purl.org/dc/elements/1.1/>
+
+SELECT ?productLabel ?offer ?price ?vendor ?vendorTitle ?review ?revTitle
+ ?reviewer ?revName ?rating1 ?rating2
+WHERE {
+ %ProductXYZ% rdfs:label ?productLabel .
+ OPTIONAL {
+ ?offer bsbm:product %ProductXYZ% .
+ ?offer bsbm:price ?price .
+ ?offer bsbm:vendor ?vendor .
+ ?vendor rdfs:label ?vendorTitle .
+ ?vendor bsbm:country <http://downlode.org/rdf/iso-3166/countries#DE> .
+ ?offer dc:publisher ?vendor .
+ ?offer bsbm:validTo ?date .
+ FILTER (?date > %currentDate% )
+ }
+ OPTIONAL {
+ ?review bsbm:reviewFor %ProductXYZ% .
+ ?review rev:reviewer ?reviewer .
+ ?reviewer foaf:name ?revName .
+ ?review dc:title ?revTitle .
+ OPTIONAL { ?review bsbm:rating1 ?rating1 . }
+ OPTIONAL { ?review bsbm:rating2 ?rating2 . }
+ }
+}
4 queries/query7desc.txt
@@ -0,0 +1,4 @@
+QueryType=Select
+
+ProductXYZ=ProductURI
+currentDate=CurrentDate
1  queries/query7valid.txt
@@ -0,0 +1 @@
+productLabel review offer
21 queries/query8.txt
@@ -0,0 +1,21 @@
+PREFIX bsbm: <http://www4.wiwiss.fu-berlin.de/bizer/bsbm/v01/vocabulary/>
+PREFIX dc: <http://purl.org/dc/elements/1.1/>
+PREFIX rev: <http://purl.org/stuff/rev#>
+PREFIX foaf: <http://xmlns.com/foaf/0.1/>
+
+SELECT ?title ?text ?reviewDate ?reviewer ?reviewerName ?rating1 ?rating2 ?rating3 ?rating4
+WHERE {
+ ?review bsbm:reviewFor %ProductXYZ% .
+ ?review dc:title ?title .
+ ?review rev:text ?text .
+ FILTER langMatches( lang(?text), "EN" )
+ ?review bsbm:reviewDate ?reviewDate .
+ ?review rev:reviewer ?reviewer .
+ ?reviewer foaf:name ?reviewerName .
+ OPTIONAL { ?review bsbm:rating1 ?rating1 . }
+ OPTIONAL { ?review bsbm:rating2 ?rating2 . }
+ OPTIONAL { ?review bsbm:rating3 ?rating3 . }
+ OPTIONAL { ?review bsbm:rating4 ?rating4 . }
+}
+ORDER BY DESC(?reviewDate)
+LIMIT 20
3  queries/query8desc.txt
@@ -0,0 +1,3 @@
+QueryType=Select
+
+ProductXYZ=ProductURI
1  queries/query8valid.txt
@@ -0,0 +1 @@
+reviewDate
4 queries/query9.txt
@@ -0,0 +1,4 @@
+PREFIX rev: <http://purl.org/stuff/rev#>
+
+DESCRIBE ?x
+WHERE { %ReviewXYZ% rev:reviewer ?x }
3  queries/query9desc.txt
@@ -0,0 +1,3 @@
+QueryType=Describe
+
+ReviewXYZ=ReviewURI
0  queries/query9valid.txt
No changes.
1  querymix.txt
@@ -0,0 +1 @@
+1 2 2 3 2 2 4 2 2 5 7 7 6 7 7 8 9 9 8 9 9 10 10 11 12
48 run-complete
@@ -0,0 +1,48 @@
+#!/bin/bash
+
+. ./init
+
+# Load and run performance suite
+
+export SIZES
+SIZES="50k 250k 1m 5m 25m 100m 200m"
+#SIZES="50k"
+RESULTS="Runs"
+
+
+# --
+BASE="${RESULTS}/"
+K="$(date +"%Y-%m-%d")"
+KEY="${BASE}$K"
+typeset -i N=0
+
+while [ -e "$KEY" ]
+ do
+ let N=N+1
+ KEY="$BASE$K.$N"
+done
+
+RUN_DIR="$KEY"
+
+echo "Results directory: $RUN_DIR"
+mkdir -p "$RUN_DIR"
+
+## The real work!
+
+cat /dev/null > "$RUN_DIR/Notes.txt"
+
+echo "Start: $(date +"%Y-%m-%d %H:%M:%S")">> "$RUN_DIR/Notes.txt"
+
+## This takes several hours, if the 100M and 200M dataset are included
+##loadAll > "$RUN_DIR/load.log"
+
+## This takes minutes although the 200M does cause some swap contention.
+runPerf > "$RUN_DIR/perf.log"
+
+mv Results "$RUN_DIR/"
+runResults "$RUN_DIR/Results"
+mv *html "$RUN_DIR/"
+# This is the important file (for me)
+cp "$RUN_DIR/bsbm_query_and_size_tables_of_stores.html" "$RUN_DIR/bsbm-results.html"
+
+echo "Finish: $(date +"%Y-%m-%d %H:%M:%S")">> "$RUN_DIR/Notes.txt"
52 runPerf
@@ -0,0 +1,52 @@
+#!/bin/bash
+
+. ./init
+
+[ -d "$JENADB" ] || { echo "Not a directory: $JENADB" ; exit 1 ; }
+
+##DIRS="50k 250k 1m 5m 25m 100m 200m"
+DIRS="${SIZES:-50k 250k 1m 5m 25m 100m 200m}"
+DIRS=50k
+
+##rm -rf Results/*
+
+## ---- Setup
+## Need to add -Xmx1024M for 32 bit
+#PROFILE="-agentpath:c:/Progra~1/YourKi~1.13/bin/win32/yjpagent.dll"
+JVM_ARGS="-Xmx1024M -server $PROFILE"
+
+# TestDriver args
+# -seed 808080
+# Need more runs
+ARGS="-runs 10 -w 10"
+
+# TDB logging.
+## **** RunBSBM.java has
+## ????TDB_ARGS="-Dtdb:logExec=true"
+
+PROGRAM=benchmark.testdriver.TestDriver
+PROGRAM=benchmark.testdriver.TestDriver
+## ----
+
+rm -rf Results
+mkdir Results
+JVM_ARGS="-Xmx1400M -server"
+
+for d in $DIRS
+do
+ SET="$DATADIR/data-$d"
+ DB="$JENADB/DB-$d"
+
+ if [ ! -e "$DB/Store" ]
+ then
+ echo "No database for "
+ continue
+ fi
+ echo "==== Performance run for $d"
+ echo "== Start: $(date +"%Y-%m-%d %H:%M:%S")"
+ java -cp "$CLASSPATH" $JVM_ARGS \
+ $PROGRAM \
+ $ARGS -idir "$SET" -o "Results/res-$d.xml" \
+ "jena:$DB/assembler.ttl"
+ echo "== Finish: $(date +"%Y-%m-%d %H:%M:%S")"
+ done
48 runPerfSesame
@@ -0,0 +1,48 @@
+#!/bin/bash
+
+. ./init
+
+##DIRS="50k 250k 1m 5m 25m 100m 200m"
+DIRS="${SIZES:-50k 250k 1m 5m 25m 100m 200m}"
+DIRS=250k
+
+HEAP="1200M"
+if [ "$OSTYPE" != "cygwin" ]
+ then
+ HEAP="6000M"
+fi
+
+echo "== Heap: $HEAP"
+
+# TestDriver args
+# -seed 808080
+# Need more runs
+ARGS="-runs 10 -w 10"
+
+JVM_ARGS="-Xmx$HEAP -server"
+
+rm -rf Results
+mkdir Results
+
+PROGRAM=benchmark.testdriver.TestDriver
+
+for d in $DIRS
+ do
+ SET="$DATADIR/data-$d"
+ REPODIR="$SESAMEDB/Repo-$d"
+
+ if [ ! -e "$REPODIR" ]
+ then
+ echo "No database for $REPODIR"
+ continue
+ fi
+
+ echo "==== Performance run for $d"
+ echo "== Start: $(date +"%Y-%m-%d %H:%M:%S")"
+ java -cp "$CLASSPATH" $JVM_ARGS \
+ $PROGRAM \
+ $ARGS -idir "$SET" -o "Results/res-$d.xml" \
+ "sesame:$REPODIR"
+ echo "== Finish: $(date +"%Y-%m-%d %H:%M:%S")"
+
+done
14 runResults
@@ -0,0 +1,14 @@
+#!/bin/bash
+
+. ./init
+
+# Expected layout:
+## StoreName/results_1m.xml (substring match to find "1m")
+
+if [ "$#" = 0 ]
+then
+ echo "No results directories given: Usage: $0 DIR" 1>&2
+ exit 1
+ fi
+
+java -cp "$CLASSPATH" -Xmx1024M -server benchmark.tools.ResultTransform "$@"
18 sizes
@@ -0,0 +1,18 @@
+#!/bin/bash
+
+ROOT="Data"
+[ -d "$ROOT" ] || { echo "Not a directory: $ROOT" ; exit 1 ; }
+
+DIRS="${SIZES:-50k 250k 1m 5m 25m 100m 200m}"
+
+for d in $DIRS
+ do
+ SET="$ROOT/data-$d"
+ if [ ! -e "$SET/data.nt" -a ! -e "$SET/data.nt.gz" ]
+ then
+ echo "No data for $SET"
+ continue
+ fi
+ echo "==== $SET"
+ gzip -d < "$SET/data.nt.gz" | wc -l
+done
4 snapshot-setup
@@ -0,0 +1,4 @@
+#!/bin/bash
+# Take a copy of scripts
+
+zip -r snapshot-$(date +"%Y-%m-%d").zip genAll loadAll runPerf runResults
8 sqlQueries/query1.txt
@@ -0,0 +1,8 @@
+SELECT distinct nr, label
+FROM product p, producttypeproduct ptp
+WHERE p.nr = ptp.product AND ptp.productType=@ProductType@
+ AND propertyNum1 > @x@
+ AND p.nr IN (SELECT distinct product FROM productfeatureproduct WHERE productFeature=@ProductFeature1@)
+ AND p.nr IN (SELECT distinct product FROM productfeatureproduct WHERE productFeature=@ProductFeature2@)
+ORDER BY label
+LIMIT 10;
7 sqlQueries/query10.txt
@@ -0,0 +1,7 @@
+SELECT distinct o.nr, o.price
+FROM offer o, vendor v
+WHERE o.product=@ProductXYZ@
+ AND o.deliveryDays<=3 AND v.country='US'
+ AND o.validTo>'@currentDate@' AND o.vendor=v.nr
+Order BY o.price
+LIMIT 10;
5 sqlQueries/query10desc.txt
@@ -0,0 +1,5 @@
+QueryType=Select
+
+ProductXYZ=ProductURI
+CountryXYZ=CountryURI
+currentDate=CurrentDate
0  sqlQueries/query10valid.txt
No changes.
3  sqlQueries/query11.txt
@@ -0,0 +1,3 @@
+Select product, producer, vendor, price, validFrom, validTo, deliveryDays, offerWebpage, publisher, publishDate
+from offer
+where nr=@OfferXYZ@;
3  sqlQueries/query11desc.txt
@@ -0,0 +1,3 @@
+QueryType=Select
+
+OfferXYZ=OfferURI
0  sqlQueries/query11valid.txt
No changes.
4 sqlQueries/query12.txt
@@ -0,0 +1,4 @@
+Select p.nr As productNr, p.label As productlabel, v.label As vendorname, v.homepage As vendorhomepage,
+ o.offerWebpage As offerURL, o.price As price, o.deliveryDays As deliveryDays, o.validTo As validTo
+From offer o, product p, vendor v
+Where o.nr=@OfferXYZ@ AND o.product=p.nr AND o.vendor=v.nr;
3  sqlQueries/query12desc.txt
@@ -0,0 +1,3 @@
+QueryType=Construct
+
+OfferXYZ=OfferURI
0  sqlQueries/query12valid.txt
No changes.
6 sqlQueries/query1desc.txt
@@ -0,0 +1,6 @@
+QueryType=Select
+
+ProductType=ProductTypeURI
+ProductFeature1=ProductFeatureURI
+ProductFeature2=ProductFeatureURI
+x=ProductPropertyNumericValue
0  sqlQueries/query1valid.txt
No changes.
4 sqlQueries/query2.txt
@@ -0,0 +1,4 @@
+SELECT pt.label, pt.comment, pt.producer, productFeature, propertyTex1, propertyTex2, propertyTex3,
+ propertyNum1, propertyNum2, propertyTex4, propertyTex5, propertyNum4
+FROM product pt, producer pr, productfeatureproduct pfp
+WHERE pt.nr=@ProductXYZ@ AND pt.nr=pfp.product AND pt.producer=pr.nr;
3  sqlQueries/query2desc.txt
@@ -0,0 +1,3 @@
+QueryType=select
+
+ProductXYZ=ProductURI
0  sqlQueries/query2valid.txt
No changes.
10 sqlQueries/query3.txt
@@ -0,0 +1,10 @@
+SELECT p.nr, p.label
+FROM product p, producttypeproduct ptp
+WHERE p.nr=ptp.product
+ AND productType=@ProductType@
+ AND propertyNum1>@x@
+ AND propertyNum3<@y@
+ AND @ProductFeature1@ IN (SELECT productFeature FROM productfeatureproduct WHERE product=p.nr)
+ AND @ProductFeature2@ NOT IN (SELECT productFeature FROM productfeatureproduct WHERE product=p.nr)
+ORDER BY p.label
+LIMIT 10;
7 sqlQueries/query3desc.txt
@@ -0,0 +1,7 @@
+QueryType=Select
+
+ProductType=ProductTypeURI
+ProductFeature1=ProductFeatureURI
+ProductFeature2=ProductFeatureURI
+x=ProductPropertyNumericValue
+y=ProductPropertyNumericValue
0  sqlQueries/query3valid.txt
No changes.
9 sqlQueries/query4.txt
@@ -0,0 +1,9 @@
+SELECT distinct p.nr, p.label, p.propertyTex1
+FROM product p, producttypeproduct ptp
+WHERE p.nr=ptp.product AND ptp.productType=@ProductType@
+ AND p.nr IN (SELECT distinct product FROM productfeatureproduct WHERE productFeature=@ProductFeature1@)
+ AND ((propertyNum1>@x@ AND p.nr IN (SELECT distinct product FROM productfeatureproduct WHERE productFeature=@ProductFeature2@)
+) OR (propertyNum2>@y@ AND p.nr IN (SELECT distinct product FROM productfeatureproduct WHERE productFeature=@ProductFeature3@)))
+ORDER BY label
+LIMIT 10
+OFFSET 5;
8 sqlQueries/query4desc.txt
@@ -0,0 +1,8 @@
+QueryType=Select
+
+ProductType=ProductTypeURI
+ProductFeature1=ProductFeatureURI
+ProductFeature2=ProductFeatureURI
+ProductFeature3=ProductFeatureURI
+x=ProductPropertyNumericValue
+y=ProductPropertyNumericValue
0  sqlQueries/query4valid.txt
No changes.
8 sqlQueries/query5.txt
@@ -0,0 +1,8 @@
+SELECT distinct p.nr, p.label
+FROM product p, product po,
+ (Select distinct pfp1.product FROM productfeatureproduct pfp1, (SELECT productFeature FROM productfeatureproduct WHERE product=@ProductXYZ@) pfp2 WHERE pfp2.productFeature=pfp1.productFeature) pfp
+ WHERE p.nr=pfp.product AND po.nr=@ProductXYZ@ AND p.nr!=po.nr
+ AND p.propertyNum1<(po.propertyNum1+120) AND p.propertyNum1>(po.propertyNum1-120)
+ AND p.propertyNum2<(po.propertyNum2+170) AND p.propertyNum2>(po.propertyNum2-170)
+ORDER BY label
+LIMIT 5;
3  sqlQueries/query5desc.txt
@@ -0,0 +1,3 @@
+QueryType=Select
+
+ProductXYZ=ProductURI
0  sqlQueries/query5valid.txt
No changes.
4 sqlQueries/query6.txt
@@ -0,0 +1,4 @@
+SELECT nr, label
+FROM product
+WHERE label like "%@word1@%";
+
3  sqlQueries/query6desc.txt
@@ -0,0 +1,3 @@
+QueryType=Select
+
+word1=Dictionary1
0  sqlQueries/query6valid.txt
No changes.
4 sqlQueries/query7.txt
@@ -0,0 +1,4 @@
+SELECT *
+FROM (select label from product where nr=@ProductXYZ@) p left join
+((select o.nr as onr, o.price, v.nr as vnr, v.label from offer o, vendor v where @ProductXYZ@=o.product AND o.vendor=v.nr AND v.country='DE' AND o.validTo>'@currentDate@') ov right join
+(select r.nr as rnr, r.title, pn.nr as pnnr, pn.name, r.rating1, r.rating2 from review r, person pn where r.product=@ProductXYZ@ AND r.person=pn.nr) rpn on (1=1)) on (1=1);
4 sqlQueries/query7desc.txt
@@ -0,0 +1,4 @@
+QueryType=Select
+
+ProductXYZ=ProductURI
+currentDate=CurrentDate
0  sqlQueries/query7valid.txt
No changes.
6 sqlQueries/query8.txt
@@ -0,0 +1,6 @@
+SELECT r.title, r.text, r.reviewDate, p.nr, p.name, r.rating1, r.rating2, r.rating3, r.rating4
+FROM review r, person p
+WHERE r.product=@ProductXYZ@ AND r.person=p.nr
+ AND r.language='en'
+ORDER BY r.reviewDate desc
+LIMIT 20;
3  sqlQueries/query8desc.txt
@@ -0,0 +1,3 @@
+QueryType=Select
+
+ProductXYZ=ProductURI
0  sqlQueries/query8valid.txt
No changes.
3  sqlQueries/query9.txt
@@ -0,0 +1,3 @@
+SELECT p.nr, p.name, p.mbox_sha1sum, p.country, r2.nr, r2.product, r2.title
+FROM review r, person p, review r2
+WHERE r.nr=@ReviewXYZ@ AND r.person=p.nr AND r2.person=p.nr;
3  sqlQueries/query9desc.txt
@@ -0,0 +1,3 @@
+QueryType=Describe
+
+ReviewXYZ=ReviewURI
0  sqlQueries/query9valid.txt
No changes.
130 src/benchmark/generator/DateGenerator.java
@@ -0,0 +1,130 @@
+package benchmark.generator;
+
+import java.util.Calendar;
+import java.util.Date;
+import java.util.GregorianCalendar;
+import java.util.Random;
+
+public class DateGenerator {
+ public static long oneDayInMillis = 24*60*60*1000;
+
+
+ private long from, to;
+ private Random ranGen;
+
+ public DateGenerator(GregorianCalendar from, GregorianCalendar to, Long seed)
+ {
+ this.from = from.getTimeInMillis();
+ this.to = to.getTimeInMillis();
+ ranGen = new Random(seed);
+ }
+
+ /*
+ * Date generator with range from - (from+toSpanInDays)
+ */
+ public DateGenerator(GregorianCalendar from, Integer toSpanInDays, Long seed)
+ {
+ this.from = from.getTimeInMillis();
+ this.to = this.from + oneDayInMillis*toSpanInDays;
+
+ ranGen = new Random(seed);
+ }
+
+ /*
+ * Date generator with range (to-fromSpanInDays) - to
+ */
+ public DateGenerator(Integer fromSpanInDays, GregorianCalendar to, Long seed)
+ {
+ this.to = to.getTimeInMillis();
+ this.from = this.to - oneDayInMillis*fromSpanInDays;
+ ranGen = new Random(seed);
+ }
+
+ public DateGenerator(Long seed)
+ {
+ this.from = 0l;
+ this.to = 0l;
+ ranGen = new Random(seed);
+ }
+
+ /*
+ * Date between from and to
+ */
+ public GregorianCalendar randomDate()
+ {
+ long date = (long)(ranGen.nextDouble()*(to-from)+from);
+ GregorianCalendar gc = new GregorianCalendar();
+ gc.setTime(new Date(date));
+
+ return gc;
+ }
+
+ /*
+ * Date between from and to
+ */
+ public Long randomDateInMillis()
+ {
+ long date = (long)(ranGen.nextDouble()*(to-from)+from);
+ GregorianCalendar gc = new GregorianCalendar();
+ gc.setTime(new Date(date));
+
+ return gc.getTimeInMillis();
+ }
+
+ /*
+ * format the date
+ */
+ public static String formatDate(GregorianCalendar c)
+ {
+ int day = c.get(Calendar.DAY_OF_MONTH);
+ int month = c.get(Calendar.MONTH)+1;
+ int year = c.get(Calendar.YEAR);
+
+ String prefixDay = "";
+ String prefixMonth = "";
+
+ if(day<10)
+ prefixDay = "0";
+
+ if(month<10)
+ prefixMonth = "0";
+
+ return year+"-"+prefixMonth+month+"-"+prefixDay+day;
+ }
+
+ /*
+ * format the date
+ */
+ public static String formatDate(Long date)
+ {
+ GregorianCalendar c = new GregorianCalendar();
+ c.setTimeInMillis(date);
+
+ return formatDate(c);
+ }
+
+ /*
+ * Format date in xsd:dateTime format
+ */
+ public static String formatDateTime(Long date) {
+ GregorianCalendar c = new GregorianCalendar();
+ c.setTimeInMillis(date);
+
+ String dateString = formatDate(c);
+ return dateString + "T00:00:00";
+ }
+
+ public static String formatDateTime(GregorianCalendar date) {
+ String dateString = formatDate(date);
+ return dateString + "T00:00:00";
+ }
+
+ public Long randomDateInMillis(Long from, Long to)
+ {
+ long date = (long)(ranGen.nextDouble()*(to-from)+from);
+ GregorianCalendar gc = new GregorianCalendar();
+ gc.setTime(new Date(date));
+
+ return gc.getTimeInMillis();
+ }
+}
974 src/benchmark/generator/Generator.java
@@ -0,0 +1,974 @@
+/*
+ * Copyright (C) 2008 Andreas Schultz
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+package benchmark.generator;
+
+import benchmark.model.*;
+import benchmark.serializer.*;
+
+import java.util.*;
+
+import benchmark.vocabulary.*;
+import java.io.File;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.io.ObjectOutputStream;
+
+public class Generator {
+ //Program parameters and default values
+ private static int productCount = 100;
+ private static boolean forwardChaining = false;
+ private static String outputDirectory = "td_data";
+ private static String outputFileName = "dataset";
+ private static String serializerType = "nt";
+
+ //Ratios of different Resources
+ static final int productsVendorsRatio = 100;
+
+ static final int avgReviewsPerProduct=10;
+ static final int avgReviewsPerPerson=20;
+ static final int avgReviewsPerRatingSite=10000;
+ static final int avgProductsPerProducer = 50;
+ static final int avgOffersPerProduct = 20;
+ static final int avgOffersPerVendor = productsVendorsRatio * avgOffersPerProduct;
+
+ static final String dictionary1File = "titlewords.txt";
+ static final String dictionary2File = "titlewords.txt";
+ static final String dictionary3File = "givennames.txt";
+
+ static final Random seedGenerator = new Random(53223436L);
+
+ static TextGenerator dictionary1;
+ static TextGenerator dictionary2;
+ static TextGenerator dictionary3;
+
+ static GregorianCalendar today = new GregorianCalendar(2008,5,20);//Date of 2008-06-20
+
+ static int producerCount;
+ static int offerCount;
+ static int reviewCount;
+ static int ratingSiteCount;
+
+ static boolean namedGraph;
+