BlazegraphConnectorTest.Program.CreateExampleGraph C# (CSharp) Method

CreateExampleGraph() public method

public CreateExampleGraph ( string uri ) : VDS.RDF.Graph
uri string
return VDS.RDF.Graph
        public Graph CreateExampleGraph(string uri)
        {
            Graph newGraph = new Graph();
            newGraph.BaseUri = UriFactory.Create(uri);

            Triple triple = new Triple(
                newGraph.CreateUriNode(UriFactory.Create("http://example/book1")),
                newGraph.CreateUriNode(UriFactory.Create("http://example.org/ns#price")),
                newGraph.CreateLiteralNode("42", new Uri(XmlSpecsHelper.XmlSchemaDataTypeInteger))
                );
            newGraph.Assert(triple);

            connector.SaveGraph(newGraph);

            return newGraph;
        }

Usage Example

Example #1
0
        static void Main(string[] args)
        {
            Program program = new Program();

            program.RemoveAllData();
            program.CreateExampleGraph("http://example/bookStore");
            program.LoadExampleGraph("http://example/bookStore");
            program.UpdateExampleGraph("http://example/bookStore");
            program.QueryExample("SELECT * { ?s ?p ?o } LIMIT 1");
            program.QueryWithTimeoutExample("SELECT * { ?s ?p ?o } LIMIT 1", 1);
            program.DeleteGraphExample("http://example/bookStore");

            Console.ReadKey();
        }
All Usage Examples Of BlazegraphConnectorTest.Program::CreateExampleGraph