public void TestClearTreeIndexedCollectionUpdatesKeys()
        {
            // Added as a repro for issue #188
            var indexed = new Graph();

            indexed.LoadFromString("_:s <urn:p> _:o.");

            var nonIndexed = new NonIndexedGraph();

            nonIndexed.LoadFromString("_:s <urn:p> _:o.");

            Assert.Equal(nonIndexed, indexed); // Yes

            indexed.Clear();
            nonIndexed.Clear();

            Assert.Equal(nonIndexed, indexed);               // Yes

            Assert.Empty(nonIndexed.Triples);                // Yes
            Assert.Empty(indexed.Triples);                   // Yes

            Assert.Empty(nonIndexed.Triples.SubjectNodes);   // Yes
            Assert.Empty(nonIndexed.Triples.PredicateNodes); // Yes
            Assert.Empty(nonIndexed.Triples.ObjectNodes);    // Yes

            Assert.Empty(indexed.Triples.SubjectNodes);      // No
            Assert.Empty(indexed.Triples.PredicateNodes);    // No
            Assert.Empty(indexed.Triples.ObjectNodes);       // No
        }
 private void mnuStructureView_Click(object sender, RoutedEventArgs e)
 {
     ISyntaxValidator validator = this._manager.CurrentValidator;
     if (validator != null)
     {
         ISyntaxValidationResults results = validator.Validate(textEditor.Text);
         if (results.IsValid)
         {
             if (!this._manager.CurrentSyntax.Equals("None"))
             {
                 try 
                 {
                     SyntaxDefinition def = SyntaxManager.GetDefinition(this._manager.CurrentSyntax);
                     if (def.DefaultParser != null)
                     {
                         NonIndexedGraph g = new NonIndexedGraph();
                         def.DefaultParser.Load(g, new StringReader(textEditor.Text));
                         TriplesWindow window = new TriplesWindow(g);
                         window.ShowDialog();
                     }
                     //else if (def.Validator is RdfDatasetSyntaxValidator)
                     //{
                     //    TripleStore store = new TripleStore();
                     //    StringParser.ParseDataset(store, textEditor.Text);
                     //}
                     else if (def.Validator is SparqlResultsValidator)
                     {
                         SparqlResultSet sparqlResults = new SparqlResultSet();
                         StringParser.ParseResultSet(sparqlResults, textEditor.Text);
                         if (sparqlResults.ResultsType == SparqlResultsType.VariableBindings)
                         {
                             ResultSetWindow window = new ResultSetWindow(sparqlResults);
                             window.ShowDialog();
                         }
                         else
                         {
                             MessageBox.Show("Cannot open Structured View since this form of SPARQL Results is not structured");
                         }
                     }
                     else
                     {
                         MessageBox.Show("Cannot open Structured View since this is not a syntax for which Structure view is available");
                     }
                 } 
                 catch
                 {
                     MessageBox.Show("Unable to open Structured View as could not parse the Syntax successfully for structured display");
                 }
             }
             else
             {
                 MessageBox.Show("Cannot open Structured View since this is not a syntax for which Structure view is available");
             }
         }
         else
         {
             MessageBox.Show("Cannot open Structured View as the Syntax is not valid");
         }
     }
     else
     {
         MessageBox.Show("Cannot open Structured View as you have not selected a Syntax");
     }
 }