private void SerializeGraph(RDFGraph graph, RDFModelEnums.RDFFormats format) { // create file path DirectoryInfo di = Directory.CreateDirectory("graphs"); switch (format) { case RDFModelEnums.RDFFormats.NTriples: graph.ToFile(RDFModelEnums.RDFFormats.NTriples, "graphs/NTriples.txt"); break; case RDFModelEnums.RDFFormats.RdfXml: graph.ToFile(RDFModelEnums.RDFFormats.RdfXml, "graphs/RdfXml.txt"); break; case RDFModelEnums.RDFFormats.TriX: graph.ToFile(RDFModelEnums.RDFFormats.TriX, "graphs/TriX.txt"); break; case RDFModelEnums.RDFFormats.Turtle: graph.ToFile(RDFModelEnums.RDFFormats.Turtle, "graphs/Turtle.txt"); break; } }
public static void Convert(RDFModelEnums.RDFFormats formatSource, FileInfo fileSource, RDFModelEnums.RDFFormats formatDestination, FileInfo fileDestination) { RDFGraph graph = RDFGraph.FromFile(formatSource, fileSource.FullName); graph.ToFile(formatDestination, fileDestination.FullName); }