PART 1:
These are the triplets which already exists.
<http:o1> <http:name> "name"^^xsd:string
<http:o1> <http:place> "place"^^xsd:string
<http:o1> <http:hasContained> <http:o2>
<http:o2> <http:name> "name1"^^xsd:string
<http:o2> <http:place> "place2"^^xsd:string
<http:o2> <http:hasContained> <http:o3>
<http:o3> <http:name> "name3"^^xsd:string
<http:o3> <http:place> "place3"^^xsd:string
I want to delete node properties which are 2 nodes away from the o1 node.
delete where { <http:o1> <http:hasContained>/<http:hasContained> ?s. ?s ?p ?o}
I came up with this query to remove o3 node related triplets. But when I run this query, I am getting some errors.
Malformed query: Encountered " "/" "/ "" at line 1, column 731.
Was expecting one of:
"(" ...
"[" ...
<NIL> ...
<ANON> ...
"true" ...
"false" ...
<Q_IRI_REF> ...
<PNAME_NS> ...
<PNAME_LN> ...
<BLANK_NODE_LABEL> ...
<VAR1> ...
<VAR2> ...
<INTEGER> ...
<INTEGER_POSITIVE> ...
<INTEGER_NEGATIVE> ...
<DECIMAL> ...
<DECIMAL_POSITIVE> ...
<DECIMAL_NEGATIVE> ...
<DOUBLE> ...
<DOUBLE_POSITIVE> ...
<DOUBLE_NEGATIVE> ...
<STRING_LITERAL1> ...
<STRING_LITERAL2> ...
<STRING_LITERAL_LONG1> ...
<STRING_LITERAL_LONG2> ...
With some alternate queries, I could do the job.
But what is the mistake in the above query?
Why path property query not working with delete where?
PART 2:
For the same triplets data, the query to remove all the triplets used is
delete {?s ?p ?o} where { <http:o1> (<http:hasContained>/<http:hasContained>?)? ?s. ?s ?p ?o}
which is not deleting any data from the triple store. Whereas by using construct, I am able to retrieve the data with the same where clause.
construct {?s ?p ?o} where { <http:o1> (<http:hasContained>/<http:hasContained>?)? ?s. ?s ?p ?o}
What is the issue in these queries, Am I missing something?