%META:TOPICPARENT{name="VirtTipsAndTricksGuide"}% ---++How to clear graphs which are related to empty graphs? The following example demonstrates how to remove graphs which are related to empty graphs: PREFIX nrl: SELECT ( bif:exec(bif:sprintf("SPARQL CLEAR GRAPH<%s>", str(?mg)))) WHERE { ?mg nrl:coreGraphMetadataFor ?g . FILTER(?g in ( )) . FILTER ( !bif:exists((SELECT (1) WHERE { GRAPH ?g { ?s ?p ?o . } . })) ) . } ---+++Related * [[VirtTipsAndTricksGuide][Virtuoso Tips and Tricks Collection]]