本文介绍了Fuseki 1.0.1 SPARQL更新返回404的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试学习在Fuseki中更新数据,但是当我尝试时出现404错误.我显然做错了什么.也许这是我的INSERT命令?我尝试了很多.

I'm trying to learn to update data in Fuseki, but when I try I get a 404 error. I am clearly not doing something right. Perhaps it is my INSERT command? I've tried a ton of them though.

我正在/sparql.tpl使用基于Web的SPARQL界面.

I am using the web based SPARQL interface at /sparql.tpl.

我可以让SPARQL查询在同一页面上正常工作.但是第二种形式(标记为SPARQL Updates)是我用于更新的形式,这给了我错误:

I can get SPARQL Queries to work on that same page just fine. But the second form, labeled SPARQL Updates is what I'm using for my update, and that gives me errors:

PREFIX dbpedia-owl: <http://dbpedia.org/ontology/>
PREFIX booklet:  <http://www.semanticweb.org/cstepnitz/ontologies/booklet>
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX ontology: <http://dbpedia.org/ontology/>

INSERT DATA
{ <http://dbpedia.org/resource/Johnny_Got_His_Gun>
        rdf:type ontology:Book

}

这是当表单发布到url localhost:3030/bookfinder/update时出现的错误:

This is the error I get when the form posts to the url localhost:3030/bookfinder/update:

Error 404: Not Found
Fuseki - version 1.0.1 (Build date: 2014-01-18T19:01:20+0000)

这是我的TTL文件.

This is my TTL file.

@prefix :               <http://www.semanticweb.org/cstepnitz/ontologies/bookreader#> .
@prefix bibo:           <http://purl.org/ontology/bibo/> .
@prefix booklet:        <http://www.semanticweb.org/cstepnitz/ontologies/booklet> .
@prefix dbp:            <http://dbpedia.org/ontology/> .
@prefix dbpedia:        <http://dbpedia.org/ontology/> .
@prefix dbpedia-owl:    <http://dbpedia.org/ontology/> .
@prefix NS5:            <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix owl:            <http://www.w3.org/2002/07/owl#> .
@prefix rdfs:           <http://www.w3.org/2000/01/rdf-schema#> .
@prefix rdms:           <http://en.wikipedia.org/wiki/Comparison_of_relational_database_management_systems> .
@prefix owlapi:         <http://www.semanticweb.org/owlapi#> .
@prefix schema:         <http://schema.org/> .
@base <http://www.semanticweb.org/cstepnitz/ontologies/bookreader> .


<http://www.semanticweb.org/cstepnitz/ontologies/bookreader> NS5:type owl:Ontology ;
     owl:imports dbp: .
booklet:readbook NS5:type owl:ObjectProperty ;
     rdfs:range dbpedia-owl:Book ;
     rdfs:domain booklet:Reading ;
     rdfs:subPropertyOf owl:topObjectProperty .

booklet:reading NS5:type owl:ObjectProperty ;
     rdfs:domain booklet:Bookreader ;
     rdfs:range booklet:Reading .

:OWLObjectProperty_18e83c77_09cb_4d9b_90c6_93b2a5095d78 NS5:type owl:ObjectProperty ;
     rdfs:label "recommendedBooks"@en ;
     rdfs:range dbpedia-owl:Book ;
     rdfs:domain booklet:Bookreader .

:OWLObjectProperty_86497b97_bef7_4b9e_80bc_6080ce0cbfe3 NS5:type owl:ObjectProperty ;
     rdfs:label "bookrating"@en ;
     rdfs:range booklet:Bookrating ;
     rdfs:domain booklet:Reading ;
     rdfs:subPropertyOf owl:topObjectProperty .

dbpedia-owl:Book NS5:type owl:Class .
schema:Person NS5:type owl:Class .
booklet:Bookrating NS5:type owl:Class .
booklet:Bookreader NS5:type owl:Class ;
rdfs:subClassOf schema:Person .
booklet:Reading NS5:type owl:Class .

:OWLClass_38c67bca_82ba_44b7_85dd_31d0c2883702 NS5:type owl:Class ;
     rdfs:label "Poor"@en ;
     rdfs:subClassOf booklet:Bookrating .

:OWLClass_5630d470_6dda_4cd5_9596_ddf0eab29cde NS5:type owl:Class ;
     rdfs:label "Best"@en ;
     rdfs:subClassOf booklet:Bookrating .

:OWLClass_694d8a9e_5fba_45a2_81b3_f47f1a21af4d NS5:type owl:Class ;
     rdfs:label "Average"@en ;
     rdfs:subClassOf booklet:Bookrating .

:OWLClass_dfb73eb5_8a7c_4628_a423_72056e7ee81f NS5:type owl:Class ;
     rdfs:label "Good"@en ;
     rdfs:subClassOf booklet:Bookrating .

:OWLClass_f3923184_fbb7_48ec_954e_49e233454099 NS5:type owl:Class ;
     rdfs:label "Awful"@en ;
     rdfs:subClassOf booklet:Bookrating .

有什么猜想吗?

推荐答案

正如我对问题的评论中所述,问题是在启动时需要添加"--update"标志.参见 http://jena.apache.org/documentation/serving_data/

As explained in the comments on my question, the problem was the "--update" flag needed to be added at startup. See http://jena.apache.org/documentation/serving_data/

这篇关于Fuseki 1.0.1 SPARQL更新返回404的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-11 18:37