Sparql insert data not working

女生的网名这么多〃 提交于 2019-12-17 20:55:20

问题


I'm a newbie to Sparql, but I am unable even to make a simple insert data query, or so it seems.

I'm using Apache Fuseki as working server; I'm in a graph, and I'm trying to make this query work:

PREFIX oa: <http://www.w3.org/ns/oa#>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>

INSERT DATA{             
  [ a 
    oa:Annotation ;                    
    rdfs:label "Title";                    
  ] .                    
}

But it doesn't matter what I do, I keep getting this error:

Error 400: SPARQL Query: No 'query=' parameter

This is even a semplified code, I tried many queries even more complex, but the result doesn't change...


回答1:


In SPARQL, query and update are different operations. In Fuseki, they reside on different endpoints (so query can be be more widely accessible than update).

You are calling the query endpoint (.../query or .../sparql usually) ; you need to call the update (.../update).




回答2:


There is a syntax error with your turtle in the SPARQL update

instead of

  [ a 
    oa:Annotation ;                    
    rdfs:label "Title";                    
  ] .     

use

  [ a 
    oa:Annotation ;                    
    rdfs:label "Title"                    
  ] . 


来源:https://stackoverflow.com/questions/32309632/sparql-insert-data-not-working

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!