malformed sparql delete query

2019-09-21 18:27发布

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.
    }

2条回答
Lonely孤独者°
2楼-- · 2019-09-21 19:16

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.

查看更多
够拽才男人
3楼-- · 2019-09-21 19:21

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.

查看更多
登录 后发表回答