我在执行 sparql 更新时遇到了一些麻烦。正如标题所说,问题是查询的第二个三元组中的撇号。这是错误:
Response: Error 400: Lexical error at line 20,column 229. Encountered " " (32) after: "s"
这是python中的代码:
from SPARQLWrapper import SPARQLWrapper
def Query(query):
sparql=SPARQLWrapper("http://localhost:3030/ann/update")
sparql.setQuery(query)
sparql.method='POST'
sparql.query()
query = """INSERT DATA {
<http://www.example.com> a <http://purl.org/spar/fabio/Item>;
rdfs:label 'Webpage's title'^^<http://www.w3.org/2000/01/rdf-schema#string>.
}"""
Query(query)
关于如何做的任何想法?