Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6621887
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T21:19:49+00:00 2026-05-25T21:19:49+00:00

I have an n3 file formate and i want to delete a node or

  • 0

I have an n3 file formate and i want to delete a node or triple from it how can i do it? should i use sparql query?please help me
i want to have an n3 file and want to delete a node from it.
i pass a graph that use in my parent form to this delete form and want to work with this graph that i create from an n3 file i mean i read this n3 file and convert it to a graph and send it to this form.

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using VDS.RDF;
using VDS.RDF.Parsing;
using VDS.RDF.Query;
using System.IO;
using System.Windows;
using System.Runtime.InteropServices;
using VDS.RDF.Writing;

namespace WindowsFormsApplication2
{
    public partial class delete : Form
    {
        Graph gra = new Graph();
        public delete(Graph initialValue)
        {
            InitializeComponent();
            ValueFromParent = initialValue;
        }

        private void delete_Load(object sender, EventArgs e)
        {

        }
        public Graph ValueFromParent
        {
            set
            {
                this.gra = value;
            }
        }
    }
}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T21:19:50+00:00Added an answer on May 25, 2026 at 9:19 pm

    From the documentation on Working with Graphs please see the section titled Asserting and Retracting triples which makes mention of the Assert() and Retract() methods which can be used to do what you’ve asked.

    For example to delete a specific Triple:

    //Assuming you already have the triple to delete in a variable t
    g.Retract(t);
    

    Or perhaps more usefully deleting all Triples that match a specific Node:

    g.Retract(g.GetTriplesWithSubject(g.CreateUriNode(new Uri("http://example.org"))));
    

    If you aren’t sure whether a specific Node exists you can do something like the following:

    INode n = g.GetUriNode(new Uri("http://example.org"));
    
    //If n is null then the specified Node does not exist in the Graph
    if (n != null)
    {
      g.Retract(g.GetTriplesWithSubject(n));
    }
    

    Note that you can’t directly delete a Node from the Graph other than by removing all Triples that have it in the Subject/Object position. Also note that this does not remove it from the collection provided by the Nodes property of the Graph currently.

    Yes you can also do this via SPARQL but for just removing a few triples that is very much overkill unless you need to remove triples based on some complex criteria which is not easily expressed directly using API selection and retraction methods.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have files that I want to delete. Connection can be from file sharing,
I have a transaction log file in CSV format that I want use to
I have a big html file (87000+ lines) and want to delete all occurrences
I have a file in the format below: 995957,16833579 995959,16777241 995960,16829368 995961,50431654 I want
I have an external file in php, outputed as json format I want the
I have a variable inside my php file, which I want to pass to
I have a CSV file in the following format: id,code,date,address,complete_url Example data from the
I am newer for php. I want make php page cache, query data from
I have an XML file format that contains a structure of questions: <question id=q101>
I have a file in .gz format. The java class for reading this file

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.