0

I am beginner in SPARQL and in my current task I have to delete some triples where the subject matches a specific string. I am running this delete query on a graph in Blazegraph.

This is my query:

prefix skos: <http://www.w3.org/2004/02/skos/core#>
prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#>

delete DATA {GRAPH <http://example.org/mapping>                      
{ ?s ?p ?o}
} 
WHERE { ?s ?p ?o .FILTER regex(str(?s), "omim") .}

However, I get this error after running the above query:

Was expecting one of:
    "base" ...
    "prefix" ...
    "select" ...
    "construct" ...
    "describe" ...
    "ask" ...

How should I modify the current query to delete the triples like this below:

s                                   p           o
<https://www.omim.org/entry/202110> rdfs:label  ADRENAL HYPERPLASIA, CONGENITAL, DUE TO 17-ALPHA-HYDROXYLASE DEFICIENCY
<https://www.omim.org/entry/202110> skos:exactMatch <https://identifiers.org/meddra:10000014>

Any help is highly appreciated.

rshar
  • 1,381
  • 10
  • 28
  • the error messages indicates that the URL you used does not expect SPARQL update queries. So do you use the correct URL and did you enable SPARQL update at all on that URL? Do you use the HTTP param `update` in the request? – UninformedUser Jul 14 '23 at 23:52
  • Like `?update=DELETE {} WHERE {}` vs `?query=SELECT * WHERE {}` – UninformedUser Jul 14 '23 at 23:58

1 Answers1

0

DELETE DATA is for when you have specific triples you want to delete without any WHERE clause. You probably want DELETE { … } WHERE { … } instead.