Exemple #1
0
        public static RdfWriter Create(string type, TextWriter output, RdfXmlWriter.Options options)
        {
            switch (RdfReader.NormalizeMimeType(type))
            {
            case "xml":
                                        #if !SILVERLIGHT
                return(new RdfXmlWriter(output, options));
                                        #else
                throw new NotSupportedException("RDF/XML output is not supported by the Silverlight build of the SemWeb library.");
                                        #endif
            case "n3":
                                        #if DOTNET2
                return(new N3Writer(output));
                                        #endif
            case "turtle":
                return(new TurtleWriter(output));

            case "nt":
            case "ntriples":
                return(new NTriplesWriter(output));

            case "dot":
                return(new GraphVizWriter(output));

            default:
                throw new ArgumentException("Unknown parser or MIME type: " + type);
            }
        }
Exemple #2
0
        public static RdfWriter Create(string type, string file)
        {
            switch (RdfReader.NormalizeMimeType(type))
            {
            case "xml":
                                        #if !SILVERLIGHT
                return(new RdfXmlWriter(file));
                                        #else
                throw new NotSupportedException("RDF/XML output is not supported by the Silverlight build of the SemWeb library.");
                                        #endif
            case "n3":
                return(new N3Writer(file));

            default:
                throw new ArgumentException("Unknown parser or MIME type: " + type);
            }
        }