1

I am issuing a DELETE REST call to my local blazegraph: http://localhost:9999/blazegraph/namespace/GraphInfo

with the body:

PREFIX rsabox:<http:\/\/ibm.com\/ResultSetABox#>  
PREFIX rstbox:<http:\/\/ibm.com\/ResultSetTBox#>  
CONSTRUCT {
  ?result ?pred ?obj .
  ?resultSet rstbox:hasResult ?result .
} WHERE {
    SELECT ?result ?pred ?obj ?resultSet
    WHERE {
      ?result rdf:type rstbox:queryResult .
      ?resultSet rstbox:hasResult ?result .
      ?resultSet rdf:type rstbox:resultSet .
      ?resultSet rstbox:setID ?setID .
      FILTER (?setID = 1) .
      ?result ?pred ?obj .
      FILTER (?pred NOT IN (
        owl:topObjectProperty,
        rstbox:topObjectProperty,
        rstbox:hasRefInst,
        rstbox:resultOf,
        rdf:type
      )
    )
  }
}

but the result is the entire namespace is deleted, rather than just the subject, predicate, object entries from the construct.

The response from blazegraph is: "DELETED: GraphInfo"

Perhaps I'm not understanding the REST API correctly from here: https://wiki.blazegraph.com/wiki/index.php/REST_API#DELETE

Basically, I've created a set of results by posting text/turtle that I now want to remove from the graph (namespace). Should I POST (rather than DELETE) the same query, but rather than CONSTRUCT, use DELETE?

Also, do I need the filters or should I just delete everything that would include the inferred relationships (e.g., just using the ?result ?pred ?obj )

wnm3
  • 381
  • 3
  • 17

1 Answers1

1

I turns out, I needed to POST with a body using update= with a DELETE query as follows:

update=PREFIX rsabox:<http://ibm.com/ResultSetABox#>  
PREFIX rstbox:<http://ibm.com/ResultSetTBox#>  
DELETE {
    ?result ?pred ?obj .
    ?resultSet rstbox:hasResult ?result .
  } WHERE {
SELECT ?result ?pred ?obj ?resultSet
WHERE {
      ?result rdf:type rstbox:queryResult .
      ?resultSet rstbox:hasResult ?result .
      ?resultSet rdf:type rstbox:resultSet .
      ?resultSet rstbox:setID ?setID .
      FILTER (?setID = 1) .
      ?result ?pred ?obj .
  }
}

I'd been confused about their showing ?update on the URI and talking about issuing a query...

wnm3
  • 381
  • 3
  • 17