private void truncateToolStripMenuItem_Click(object sender, EventArgs e) { if (listViewGraph.SelectedItems.Count != 1) { MessageBox.Show("no graph is selected"); return; } var graphUri = (string) listViewGraph.SelectedItems[0].Tag; if ( MessageBox.Show(string.Format("are you want to truncate {0}", graphUri), "Warning", MessageBoxButtons.YesNo) != DialogResult.Yes) return; var tabPage = GetTabPage(graphUri); if (tabPage != null) { tabControlGraph.TabPages.Remove(tabPage); } var loadUri = graphUri; if (graphUri == "default") loadUri = ""; var g = new Graph(); fuseki.LoadGraph(g, loadUri); g.Clear(); if (graphUri != "default") SetNewGraphTriple(g, graphUri); fuseki.SaveGraph(g); var graphBase64 = GraphEditor.Base64Encode(graphUri); var filePath = string.Format(@"{0}\{1}.txt", DocumentRoot, graphBase64); File.WriteAllText(filePath, ""); }