Menu

Uploading RDF Triples via REST interface

Help
2016-10-10
2016-10-10
  • Lawrence A. Clough

    I am having difficulty uploading RDF triples to the NanoSparqlServer

    I am evaluating Blazegraph to determine if it will be useful to a project I am working on. I downloaded the blazegraph.jar file from the Blazegraph website. I started the NanoSparqlServer via

    java -server -Xmx4g -jar blazegraph.jar &

    I have a small file of RDF triples

    <http://en.wikipedia.org/wiki/Oxford> <http://purl.org/dc/elements/1.1/title> "Oxford" .
    <http://en.wikipedia.org/wiki/Oxford> <http://purl.org/dc/elements/1.1/coverage> "Oxfordshire" . 
    <http://en.wikipedia.org/wiki/Oxford> <http://purl.org/dc/elements/1.1/publisher> "Wikipedia" .
    <http://en.wikipedia.org/wiki/Oxford> <http://www.country-regions.fake/population> "10000"^^xsd:int .
    <http://en.wikipedia.org/wiki/Oxford> <http://www.country-regions.fake/principaltown> <http://www.country-regions.fake/oxford> .
    

    When I paste these into the UPDATE window. They loaded into the database fine. I can query for their presence using the REST interface. However, when I try to upload them via the REST interface, I get nothing. I get an '200 OK' answer but no change to the databse.

    This test was performed using an empty 'kb' namespace.

    $ curl -X POST -H 'Content-type:text/plain' -X POST --data-ascii '@data.txt'  http://localhost:9999/bigdata/sparql -v -L
    * Hostname was NOT found in DNS cache
    *   Trying 127.0.0.1...
    * Connected to localhost (127.0.0.1) port 9999 (#0)
    > POST /bigdata/sparql HTTP/1.1
    > User-Agent: curl/7.35.0
    > Host: localhost:9999
    > Accept: */*
    > Content-type:text/plain
    > Content-Length: 509
    > 
    * upload completely sent off: 509 out of 509 bytes
    < HTTP/1.1 301 Moved Permanently
    < Location: http://localhost:9999/blazegraph/sparql
    < Content-Length: 0
    * Server Jetty(9.2.z-SNAPSHOT) is not blacklisted
    < Server: Jetty(9.2.z-SNAPSHOT)
    < 
    * Connection #0 to host localhost left intact
    * Issue another request to this URL: 'http://localhost:9999/blazegraph/sparql'
    * Violate RFC 2616/10.3.2 and switch from POST to GET
    * Found bundle for host localhost: 0x176aa70
    * Re-using existing connection! (#0) with host localhost
    * Connected to localhost (127.0.0.1) port 9999 (#0)
    > POST /blazegraph/sparql HTTP/1.1
    > User-Agent: curl/7.35.0
    > Host: localhost:9999
    > Accept: */*
    > Content-type:text/plain
    > 
    < HTTP/1.1 200 OK
    < Content-Type: application/xml; charset=ISO-8859-1
    < Content-Length: 58
    * Server Jetty(9.2.z-SNAPSHOT) is not blacklisted
    < Server: Jetty(9.2.z-SNAPSHOT)
    < 
    * Connection #0 to host localhost left intact
    <?xml version="1.0"?><data modified="0" milliseconds="0"/>$ 
    
     
  • Lawrence A. Clough

    That seemed to work. Was I reading the documenation incorrectly?

     

Log in to post a comment.