plt-tud / r43ples

Revision Management for the Semantic Web
Other
19 stars 16 forks source link

Insert data with curl #87

Closed webdata closed 6 years ago

webdata commented 6 years ago

Hi!

Is there a way to insert a large number of triples, probably not using the user interface (HTML form)?

I'm trying to do it with curl:

curl "http://localhost:9998/r43ples/sparql" -H 'Content-Type: application/sparql-query' -F 'query=@querymin.txt'

Where querymin.txt is:

USER "javier" MESSAGE "test commit"
INSERT DATA {
  GRAPH <http://example.org> REVISION "0" {
    <a> <b> <c> .
  }
}

But I get an error of SPARQL 1.1. parsing.

<h3>Message</h3>
    com.hp.hpl.jena.query.QueryParseException: Encountered &quot; &quot;-&quot; &quot;- &quot;&quot; at line 1, column 1.&#10;Was expecting one of:&#10;    &lt;EOF&gt; &#10;    &quot;base&quot; ...&#10;    &quot;prefix&quot; ...&#10;    &quot;insert&quot; ...&#10;    &quot;delete&quot; ...&#10;    &lt;INSERT_DATA&gt; ...&#10;    &lt;DELETE_DATA&gt; ...&#10;    &lt;DELETE_WHERE&gt; ...&#10;    &quot;load&quot; ...&#10;    &quot;clear&quot; ...&#10;    &quot;create&quot; ...&#10;    &quot;add&quot; ...&#10;    &quot;move&quot; ...&#10;    &quot;copy&quot; ...&#10;    &quot;drop&quot; ...&#10;    &quot;with&quot; ...&#10;    

    <h3>Stacktrace</h3>
      com.hp.hpl.jena.sparql.lang.ParserSPARQL11Update._parse(ParserSPARQL11Update.java:78)
      com.hp.hpl.jena.sparql.lang.ParserSPARQL11Update.parse$(ParserSPARQL11Update.java:45)

It's like your keywords are not parsed, but the same querymin.txt works for the UI interface.

Thanks! I'm looking forward using the system.

webdata commented 6 years ago

Hmm I have read another issue mentioning that one should test the master branch and not the develop. Maybe that's the problem, I will try it in a while and close the issue if that's the issue

webdata commented 6 years ago

Well, I couldn't compile the master branch, but the 0.8.7 jar worked!