Fuseki 1.0.1 SPARQL Update returns 404

大兔子大兔子 提交于 2019-12-12 12:33:16

问题


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.

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

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

}

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)

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 .

Any guesses?


回答1:


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/



来源:https://stackoverflow.com/questions/21581018/fuseki-1-0-1-sparql-update-returns-404

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