GP92
GP92

Reputation: 435

sparql-query and sparql-update both are not the same?

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";
    }

Upvotes: 1

Views: 241

Answers (1)

scotthenninger
scotthenninger

Reputation: 4001

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.

Upvotes: 1

Related Questions