Creating a New Data Set with the REST API

Help
2013-01-30
2014-02-19
  • Daniel Yacob
    Daniel Yacob
    2013-01-30

    Greetings,

    I would like to create new data sets with purely the REST API but have not been able to understand the documentation in the wiki, which begins:

    "CREATE DATA SET

    POST /namespace

    Content-Type

    BODY"

    what would the BODY be for a new data set?  The documentation continues:

    "You MUST specify at least the following property in order to create a non-default data set:

    com.bigdata.rdf.sail.namespace=NAMESPACE

    where NAMESPACE is the name of the new data set."

    Is this property set in the RWStore.properties file or is it part of the BODY?  A small example would be great.

    thanks!

    -Daniel

     
  • Bryan Thompson
    Bryan Thompson
    2013-01-30

    The "BODY" is the HTTP request-entity.  The Content-Type needs to be one of those specified at  (application/xml, or text/plain).  I will update the page to provide better guidance.  See the com.bigdata.rdf.sail.webapp.client.RepositoryManager class for the Java client-side API that supports this method.

    Thanks.
    Bryan

    https://sourceforge.net/apps/mediawiki/bigdata/index.php?title=NanoSparqlServer#Property_set_data

     
  • Daniel Yacob
    Daniel Yacob
    2013-01-30

    Bryan,

    Thank you for the response and for enhancing the documentation, it definitely reads more clearly.  Is there an RWStore.properties that needs to be set to first enable Multi-Tenancy? 

    When I try the simple "DESCRIBE DATA SETS", I get a 404 for /namespace -I'm assuming it will describe the kb data set when there are no others.

    My create data set post appears as follows, I get the same 404 response.  I think I'm missing critical bit of info.

    POST /bigdata/namespace HTTP/1.1
    Content-Type: text/plain;charset=utf-8
    User-Agent: http4e/5.0.6
    Host: 10.0.10.189:8080
    Content-Length: 40

    com.bigdata.rdf.sail.namespace=hello

    thanks!

    -Daniel

     
  • Daniel Yacob
    Daniel Yacob
    2013-01-30

    I noticed now that in the WEB-INF/web.xml file that comes with Bigdata 1.2.2 there is no url-pattern entry for /namespace .  What web service should it be associated with?

     
  • Bryan Thompson
    Bryan Thompson
    2013-01-31

    The multi-tenancy API is handled by the MultiTenancyServlet.  Requests are routed to that servlet by (if I recall) the RESTSerlet.

    There are no special properties required to enable multi-tenancy mode on a Journal or Federation.

    If you are using the dev branch (branches/BIGDATA_RELEASE_1_2_0) then there are linked on the index.html page for the NSS that will list out all of the known KB namespaces and their SPARQL end points.

    Bryan 

     
  • Bryan Thompson
    Bryan Thompson
    2013-01-31

    Here is the relevant snip from index.html.

    <p>
    The following URLs should be active when deployed in the default configuration:
    </p>
    <dl>
    <dt>http://hostname:port/bigdata</dt>
    <dd>This page.</dd>
    <dt>http://hostname:port/bigdata/sparql</dt>
    <dd>The SPARQL REST API (<a href="sparql">Service Description</a>).</dd>
    <dt>http://hostname:port/bigdata/namespace</dt>
    <dd>VoID <a href="namespace">graph of available KBs</a> from this service.</dd>
    <dt>http://hostname:port/bigdata/status</dt>
    <dd>A <a href="status">status</a> page.</dd>
    <dt>http://hostname:port/bigdata/counters</dt>
    <dd>A <a href="counters"> performance counters</a> page.</dd>
    </dl>
    
     
  • Daniel Yacob
    Daniel Yacob
    2013-01-31

    Thank you for the replies.  I understand the issue now is that the multi-tenancy support was not included in the 1.2.2 war file.  The last sentence of the "Multi-Tenancy API" topic on the  front page of the Bigdata Blog "It will be part of the 1.2.2 maintenance release." had me expecting otherwise.

    I'm retrieving the branch now to have a go at building a new war.