BlazegraphConnectorTest.Program.UpdateExampleGraph C# (CSharp) Method

UpdateExampleGraph() public method

public UpdateExampleGraph ( string uri ) : void
uri string
return void
        public void UpdateExampleGraph(string uri)
        {
            Graph newGraph = new Graph();
            newGraph.BaseUri = UriFactory.Create(uri);

            Triple triple2remove = 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))
                );
            Triple triple2add = new Triple(
                newGraph.CreateUriNode(UriFactory.Create("http://example/book1")),
                newGraph.CreateUriNode(UriFactory.Create("http://purl.org/dc/elements/1.1/title")),
                newGraph.CreateLiteralNode("Fundamentals of Compiler Design", new Uri(XmlSpecsHelper.XmlSchemaDataTypeString))
                );
            connector.UpdateGraph(
                UriFactory.Create(uri),
                new List<Triple>() { triple2add },
                new List<Triple>() { triple2remove }
                );
        }

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::UpdateExampleGraph