Skip to content

Commit

Permalink
Add support for generating multiple versions of BSBM dataset
Browse files Browse the repository at this point in the history
  • Loading branch information
JPugetGil committed Jul 24, 2024
1 parent 7062bbf commit 41b441a
Show file tree
Hide file tree
Showing 3 changed files with 45 additions and 2 deletions.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ This is the Dockerized version of the Berlin SPARQL Benchmark.
## Usage
```bash
docker run -v "$PWD:/data" vcity/bsbm generate [args]
docker run -v "$PWD:/data" vcity/bsbm generate-n [args]
docker run -v "$PWD:/data" vcity/bsbm qualification [args]
docker run -v "$PWD:/data" vcity/bsbm testdriver [args]
```
Expand All @@ -18,6 +19,7 @@ If you want more information about the different arguments, please refer to the

```bash
docker run vcity/bsbm generate -help
docker run vcity/bsbm generate-n -help
docker run vcity/bsbm qualification -help
docker run vcity/bsbm testdriver -help
```
Expand Down
19 changes: 17 additions & 2 deletions entrypoint.sh
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
#!/bin/bash

if [ $# == 0 ]; then
echo "Usage: $0 [generate|testdriver|qualification] ?[args]"
echo "Usage: $0 [generate|generate-n|testdriver|qualification] ?[args]"
./generate -help
./generate-n -help
./testdriver -help
./qualification -help
exit 1
Expand All @@ -14,7 +15,21 @@ command=$1
mkdir -p /data
chmod 777 /data

if [ "$command" = "generate" ]; then
if [ "$command" = "generate" ] || [ "$command" = "generate-n" ]; then
./$@

# get the -fn parameter value, if it exists else set it to "dataset"
fn=$(echo $@ | grep -oP '(?<=-fn )[^ ]+' || echo "dataset")
# get the -s parameter value, if it exists else set it to "nt"
s=$(echo $@ | grep -oP '(?<=-s )[^ ]+' || echo "nt")
mv $fn*.$s /data

# check if the -ud parameter exists
if [[ $@ == *"-ud"* ]]; then
udf=$(echo $@ | grep -oP '(?<=-udf )[^ ]+' || echo "dataset_update")
mv $udf*.nt /data
fi
elif [ "$command" = "generate" ]; then
./$@

# get the -fn parameter value, if it exists else set it to "dataset"
Expand Down
26 changes: 26 additions & 0 deletions generate-n
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
#!/bin/bash
if [ ! -e "./generate-n" ]
then
echo "Please run this script from the exec directory"
exit 1
fi
if [ $# == 0 ]
then
echo "For generator options type ./generate-n -help"
fi
# check that $1 is a integer
if ! [[ $1 =~ ^[0-9]+$ ]]
then
echo "Please provide an integer as the first argument"
exit 1
fi

number_of_versions=$1
echo "Generating $number_of_versions versions"

# loop through the number of versions and call ./generate
for i in $(seq 1 $number_of_versions)
do
echo "Generating version $i"
./generate "${@:2}"
done

0 comments on commit 41b441a

Please sign in to comment.