BlazeGraph Server 2.1.4 + Java JDK 8+Maven 3.6+Python 3.5+PIP3 18+ npm 6 + node v10 + Gradle 5.1
50K+
This Blazegraph server is aiming for deployment over Container Cluster Platform such as Kubernetes, OpenShift, or other similar ones comparing to other light version of openkbs/blazegrapy. In all, this implementation supports the following deployment uses:
Image is pulling from openkbs/blazegraph
./run.sh
A successfully starting of BlazeGraph will allow you to access the following URL:
http://<ip_address>:9999/blazegraph/ to get started.
The following example shows customized command to launch container:
docker run --rm -d --name=blazegraph-docker --restart=no \
--user 1000 \
-v /home/user1/data-docker/blazegraph-docker/data:/var/lib/blazegraph/data \
-v /home/user1/data-docker/blazegraph-docker/.java:/home/developer/.java \
-v /home/user1/data-docker/blazegraph-docker/.profile:/home/developer/.profile \
-p 9999:9999 \
openkbs/blazegraph-docker
To demonstrate the Blazegraph with FreeText Search capability as powerful combination with RDF/Sparql query/search, you can load the "Hello.rdf" using the following steps after you login to Openshift/Minishift Web UI:
First, Create Project, say, ["semantics-engine"], then
click [UPDATE] tab
-> select [Choose File] button at lower-left corner
-> pick "blazegraph-docker/rdf-samples/Hello.rdf" from the pop-up file chooser, then click OK/done
-> click [Update] button at the lower center of the screen.
... You will see it is loading up the "Hello.rdf" file into Blazegraph database.
click upper-right corner [SEARCH], then type "web" then return key or hit magnify lens icon.
... You will see it returns one tuple of "www.w3schools.com" with subject.
... Congratulation! You have successfully launched, loaded, and tested the powerful RDF/FreeText Search Engine/Database - "Blazegraph"!
See docs/Kubernetes-Dashboard-Deploy-Services.png and doc/Kubernetes-Dashboard-UI.png .
(Using Minikube's Web UI Dashboard http://192.168.99.102) -> "+CREATE" -> "CREATE AN APP"
To use non-default (1GB) memory for JVM, add the run-time env vars in the configuration, e.g. 4 GB Memory
JVM_MEM=4g
Then, you will access Blazegraph Docker container like the following except port will be different for yours:
http://192.168.99.100:32721/blazegraph/
See docs/OpenShift-blazegraph-docker-deployment.png.
(Using OpenShift's Web UI) -> Deploy -> Image, wait a few seconds for docker pod to up, then Create Route to expose to external Access.
See docs/Portainer-as-Docker-Desktop.png.
Using "./run.sh"
To use non-default (e.g., 4GB) memory for JVM, add/change entry to "docker-compose.yml" file:
- JVM_MEM=4g
At this point, we only provide default host-based volume mapping persistence
(from file ./docker.env -- the "#" with no space is how "run.sh" pick up the volumes mapping you specify)
#VOLUMES_LIST="data:/var/lib/blazegraph/data .java .profile"
Then, running "./run.sh" will use the "docker.env" file's entry (as above) to create volume mapping
-v /home/<Your UserName>/data-docker/blazegraph-docker/data:/var/lib/blazegraph/data
You can build your own image locally.
./build.sh
Say, you will build the image "my/blazegraph".
docker build -t my/blazegraph .
To run your own image, say, with some-blazegraph:
mkdir ./data
docker run -d --name some-blazegraph -v $PWD/data:/data -i -t my/blazegraph
docker exec -it some-blazegraph /bin/bash
or
./shell.sh (if you use default ./run.sh -- not your local build)
Web UI: http://<ip_address>:9999/
For more information, please visit:
To use SPARQL REST API, from remote SPARQL Client:
http://<ip_address>:9999/bigdata
To run Python code
docker run --rm openkbs/blazegraph python -c 'print("Hello World")'
or,
mkdir ./data
echo "print('Hello World')" > ./data/myPyScript.py
docker run -it --rm --name some-blazegraph -v "$PWD"/data:/data openkbs/blazegraph python myPyScript.py
or,
alias dpy='docker run --rm openkbs/blazegraph python'
dpy -c 'print("Hello World")'
Remember, the default working directory, /data, inside the docker container -- treat is as "/". So, if you create subdirectory, "./data/workspace", in the host machine and the docker container will have it as "/data/workspace".
#!/bin/bash -x
mkdir ./data
cat >./data/HelloWorld.java <<-EOF
public class HelloWorld {
public static void main(String[] args) {
System.out.println("Hello, World");
}
}
EOF
cat ./data/HelloWorld.java
alias djavac='docker run -it --rm --name some-jre-mvn-py3 -v '$PWD'/data:/data openkbs/jre-mvn-py3 javac'
alias djava='docker run -it --rm --name some-jre-mvn-py3 -v '$PWD'/data:/data openkbs/jre-mvn-py3 java'
djavac HelloWorld.java
djava HelloWorld
And, the output:
Hello, World
Hence, the alias above, "djavac" and "djava" is your docker-based "javac" and "java" commands and it will work the same way as your local installed Java's "javac" and "java" commands.
Content type
Image
Digest
Size
1 GB
Last updated
about 5 years ago
docker pull openkbs/blazegraph-docker