malformed sparql delete query

﹥>﹥吖頭↗ 提交于 2019-12-25 18:38:23

问题


I would like to update a data property assertion using sparql, but I get the malformed query exception at the delete statement when I try to run this in Protege. I'm very new to sparql and I can't figure out what's wrong with this query :

PREFIX m: <http://www.semanticweb.org/exemple#>
    DELETE  { ?o owl:minQualifiedCardinality ?min. }
    INSERT { ?o owl:minQualifiedCardinality “2000”^^xsd:decimal. }
    WHERE { 
        m:Revenu rdfs:subClassOf ?o.
        ?o owl:minQualifiedCardinality ?min.
    }

回答1:


Have a look at sparql.org's update validator. When I paste your query there, and after adding the missing prefixes, I get:

Lexical error at line 10, column 45. Encountered: "\u201c" (8220), after : ""

If you look closely, you'll notice that you're using "smart quotes" (i.e., “ and ”) rather than "straight quotes" (i.e., "). If you're not using one, you may want a plain text editor for composing your queries.




回答2:


rdfs:, owl: and xsd: aren't defined prefixes.

Fixing that and the quotes, the update parses at sparql.org's update validator.

Note: the validator prints out the line number of the first error.



来源:https://stackoverflow.com/questions/30818173/malformed-sparql-delete-query

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