diff --git a/src/ulo-rdf4j/generate-ulo-rdf4j.sh b/src/ulo-rdf4j/generate-ulo-rdf4j.sh
new file mode 100755
index 0000000000000000000000000000000000000000..650dd0e2e44b7f989d23761c4fecbc70758cb30c
--- /dev/null
+++ b/src/ulo-rdf4j/generate-ulo-rdf4j.sh
@@ -0,0 +1,35 @@
+#! /bin/sh
+
+#
+# Generate ULO.java from the OWL ontology.
+# The generated file is printed to stdout.
+#
+
+set -eu
+
+# print first argument to stderr
+report() {
+    echo "$0: $1" 1>&2
+}
+
+# $workdir is the directory where we put all temp files,
+# $target_file the path for the file to generate
+workdir="$(mktemp -d)"
+target_file="$workdir/ULO.java"
+
+(
+    cd "$workdir"
+
+    report "cloning repositories..."
+
+    git clone --quiet https://github.com/ansell/rdf4j-schema-generator.git
+    git clone --quiet https://gl.mathhub.info/ulo/ulo.git ulo
+
+    report "generating $target_file..."
+
+    rdf4j-schema-generator/rdf4j-schema-generator \
+	-f application/xml -name ULO \
+	ulo/ulo.owl "$target_file" >/dev/null
+)
+
+cat "$target_file"