Fuseki SPARQL INSERT produces the “Error 400: SPARQL Query: No 'query=' parameter”

谁说我不能喝 提交于 2019-11-27 08:12:58

问题


I try to insert an individual into my ontology, but get the error:

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

Fuseki - version 2.4.1 (Build date: 2016-11-04T18:59:20+0000)

This is my SPARQL INSERT query #1:

PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> 
PREFIX owl: <http://www.w3.org/2002/07/owl#>
PREFIX xsd: <http://www.w3.org/2001/XMLSchema#> 
PREFIX oo:  <http://www.test.com/test-ontology.owl#> 

INSERT { 
  oo:cap_123 rdf:type oo:MyTours .  
  oo:cap_123 oo:active true . 
  oo:cap_123 oo:title 'Text text text' . 
} 
WHERE { 
  FILTER NOT EXISTS { oo:cap_123 rdf:type oo:MyTours . 
  } 
} 

And this is my INSERT query #2:

INSERT DATA {
  oo:cap_123 rdf:type oo:MyTours .
  oo:cap_123 oo:active true .
  oo:cap_123 oo:title 'Text text text' .
}

If I insert the individual using Protégé, then it works and saves the result as follows:

<owl:NamedIndividual rdf:about="http://www.test.com/test-ontology.owl#cap_123">
    <rdf:type rdf:resource="http://www.test.com/test-ontology.owl#MyTours"/>
    <active rdf:datatype="http://www.w3.org/2001/XMLSchema#boolean">true</active>
    <title>Text text text</title>
</owl:NamedIndividual>

Both queries fail. What is wrong with them?


回答1:


What is your SPARQL endpoint address? It should end with /update (instead of /query):


Available services are listed on http://example.com/dataset.html?tab=info&ds=/<dataset_name>:

  • Configuration file is %FUSEKI_HOME%/run/configuration/<dataset_name>.ttl
  • Access might be restricted in %FUSEKI_HOME%/run/shiro.ini


来源:https://stackoverflow.com/questions/43474884/fuseki-sparql-insert-produces-the-error-400-sparql-query-no-query-paramete

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