Blazegraph create namespace via REST API

1.2k views Asked by At

I am running Blazegraph 2.1.1 from the command line. The web interface works fine, so do many GET operations. I want to create a new namespace via the REST API. I run Blazegraph with this command:

java -server -Xmx4g -Dbigdata.propertyFile=RWStore.properties -jar blazegraph.jar

This is the POST:

http://localhost:9999/bigdata/namespace

<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE properties SYSTEM "http://java.sun.com/dtd/properties.dtd">
<properties>
<entry key="com.bigdata.rdf.sail.namespace">MY_NAMESPACE</entry>
<entry key="com.bigdata.rdf.store.AbstractTripleStore.quads">false</entry>
<entry key="com.bigdata.rdf.store.AbstractTripleStore.axiomsClass">com.bigdata.rdf.axioms.OwlAxioms</entry>
<entry key="com.bigdata.rdf.sail.truthMaintenance">true</entry>
</properties>

Whenever I run this I get as response the list of existing namespaces (same as GET), with Postman showing the response headers as:

Content-Type →application/rdf+xml
Server →Jetty(9.2.z-SNAPSHOT)
Transfer-Encoding →chunked

When I run the same POST against a Blazegraph instance deployed on Tomcat, it works as expected and the namespace is created.

Do I need to enable something in the command line version that allows creation of namespaces? I am using the same properties file as the Tomcat instance (different journal though). I also tried overriding the web.xml, but that did not make a difference either.

This is my properties file:

com.bigdata.journal.AbstractJournal.file=C:/Development/Ontology/BlazegraphServer/bigdata.jnl
com.bigdata.journal.AbstractJournal.bufferMode=DiskRW
com.bigdata.service.AbstractTransactionService.minReleaseAge=1
com.bigdata.btree.writeRetentionQueue.capacity=4000
com.bigdata.btree.BTree.branchingFactor=128
com.bigdata.journal.AbstractJournal.initialExtent=209715200
com.bigdata.journal.AbstractJournal.maximumExtent=209715200
com.bigdata.rwstore.RWStore.readBlobsAsync=false
com.bigdata.rdf.store.DataLoader.closure=None
com.bigdata.rdf.sail.truthMaintenance=true
com.bigdata.rdf.store.AbstractTripleStore.quads=false
com.bigdata.rdf.store.AbstractTripleStore.statementIdentifiers=true
com.bigdata.rdf.store.AbstractTripleStore.textIndex=true
com.bigdata.rdf.store.AbstractTripleStore.axiomsClass=com.bigdata.rdf.axioms.OwlAxioms
com.bigdata.namespace.kb.lex.com.bigdata.btree.BTree.branchingFactor=400
com.bigdata.namespace.kb.spo.com.bigdata.btree.BTree.branchingFactor=1024
1

There are 1 answers

1
Brad Bebee On BEST ANSWER

I believe that the issue may be the namespace used in the POST command. The default URL for the executable jar is /blazegraph.

Can you try the equivalent of the command below?

curl -X POST -H 'Content-type: application/xml' --data @ns.xml http://localhost:9999/blazegraph/namespace