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.Writing; namespace dotnetrdf2 { public partial class Form1 : Form { public Form1() { InitializeComponent(); } private void Form1_Load(object sender, EventArgs e) { Graph g = new Graph(); IUriNode dotNetRDF = g.CreateUriNode(UriFactory.Create("http://www.dotnetrdf.org")); IUriNode says = g.CreateUriNode(UriFactory.Create("http://example.org/says")); ILiteralNode helloWorld = g.CreateLiteralNode("Hello World"); ILiteralNode bonjourMonde = g.CreateLiteralNode("Bonjour tout le Monde", "fr"); g.Assert(new Triple(dotNetRDF, says, helloWorld)); g.Assert(new Triple(dotNetRDF, says, bonjourMonde)); foreach (Triple t in g.Triples) { Console.WriteLine(t.ToString()); } NTriplesWriter ntwriter = new NTriplesWriter(); ntwriter.Save(g, "HelloWorld.nt"); RdfXmlWriter rdfxmlwriter = new RdfXmlWriter(); rdfxmlwriter.Save(g, "HelloWorld.rdf"); Console.ReadLine(); } } }
Console.ReadLine();
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)