1

I find that these are two different query languages: SPARQL-QUERY and SPARQL-UPDATE.

What other types I could see in SPRARQL?

And I am looking for a syntax where I can replace a particular element property with a new value.

But, using insert query, I can only see that the new value is being added as additional value of the property instead of replacing the whole values of the property.

So, is there any other language for this purpose, like sparql-update something?

Also, I can see that delete option is there. But I don't want to specify a particular value, but to delete the whole pattern. Of course, we can specify the pattern I guess. But I just wonder, if there is a specific language for this purpose.

EDIT:

And in the following query, I don't find the purpose of using where clause at all. It always inserts specified value as a new value, but is not replacing it. We need to use the delete clause specifically. Then what's the purpose of where clause here?

    PREFIX dc: <http://purl.org/dc/elements/1.1/>
    PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
    PREFIX indexing: <http://fedora.info/definitions/v4/indexing#>
    PREFIX custom: <http://namespaces.info/custom#>
    DELETE {
    }
    INSERT {
    <> indexing:hasIndexingTransformation "default";
    rdf:type indexing:Indexable;
    dc:title "title3";
    custom:ownerId "owner6";
    dc:identifier "test:10";
    }
    WHERE { 
    <>
    custom:ownerId "owner1";
    }
GP92
  • 433
  • 1
  • 12
  • 30
  • There is just one SPARQL just like SQL. You can query or update just like SQL. – Natan Cox Apr 05 '16 at 12:55
  • @NatanCox ok, but I couldn't find even an insert word in its main documentation page: https://www.w3.org/TR/rdf-sparql-query/...there are separate pages: https://www.w3.org/TR/sparql11-update and other https://www.w3.org/TR/sparql11-query – GP92 Apr 05 '16 at 13:06
  • @NatanCox i have added as edit1 specifying the issue I am facing. – GP92 Apr 05 '16 at 13:10

1 Answers1

1

The SPARQL recommendation is separated into separate documents, see SPARQL 1.1 Overview from W3C.

The WHERE clause can be empty, but also look into INSERT DATA, which takes a set of triple specifications (not patterns - no variables) and inserts them. No WHERE clause id needed int that case. Same for deleting triple specifications with DELETE DATA.

scotthenninger
  • 3,921
  • 1
  • 15
  • 24
  • Hi, one quick question, so insert and insert data both same? and also, I am hoping you help on this question too: http://stackoverflow.com/questions/36424525/sparql-insert-not-working-with-put-method-why – GP92 Apr 05 '16 at 13:20
  • No, `insert` will work with variables (i.e.. `?value`), and `insert data` can only use triple specification (i.e. URIs and literals). – scotthenninger Apr 05 '16 at 13:24
  • and I am guessing, may be the syntax has changed. I cant use the '@en', but just using the query word alone is identifying the records – GP92 Apr 05 '16 at 13:25