-
Notifications
You must be signed in to change notification settings - Fork 579
Description
import rdflib
def test_clear_default():
"""Test @base directive with no slash after colon."""
graph = rdflib.ConjunctiveGraph()
graph.add((
rdflib.SDO.title,
rdflib.RDFS.subPropertyOf,
rdflib.RDFS.label,
rdflib.URIRef('https://example.org'),
))
assert list(graph)
graph.update('CLEAR DEFAULT')
assert list(graph) # Here is where the test fails
In this test, we create a ConjunctiveGraph
with a NAMED graph in it. Then, we call CLEAR DEFAULT
on the graph. Based on the definition of this statement,
Here, the
DEFAULT
keyword is used to remove all triples in the default graph of the Graph Store, theNAMED
keyword is used to remove all triples in all named graphs of the Graph Store and theALL
keyword is used to remove all triples in all graphs of the Graph Store. TheGRAPH
keyword is used to remove all triples from a graph denoted by IRIref. This operation is not required to remove the empty graphs from the Graph Store, but an implementation may decide to do so.
As far as I could understand, DEFAULT
graph is the default unnamed graph, so the triple we stored in the named graph before should not have been removed, but it apparently is.
Is perhaps this note in the same document relevant?
For services which form the default graph from the union of other graphs, CLEAR DEFAULT may have further implications which we leave unspecified here.