File: simple.cs

package info (click to toggle)
semweb 1.05%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: lenny
  • size: 3,988 kB
  • ctags: 2,832
  • sloc: cs: 14,483; makefile: 180; sh: 107; perl: 20; ansic: 7
file content (20 lines) | stat: -rw-r--r-- 551 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
// This example reads an RDF/XML file on standard input
// and writes it back out in N3 format to standard output.

using System;
using SemWeb;

public class Simple {
	public static void Main() {
		MemoryStore store = new MemoryStore();
		
		store.Import(new RdfXmlReader(Console.In));
		
		// The 'using' is important because it is necessary
		// to Close or Dispose the writer once writing is
		// complete so that the final statement is closed
		// with a period.
		using (RdfWriter writer = new N3Writer(Console.Out))
			writer.Write(store);
	}
}