public void NodeGroupFromConstruct() { NodeGroup ngResult = new NodeGroup(); NodeGroupExecutionClientConfig necc = new NodeGroupExecutionClientConfig("http", "fake-server.crd.ge.com", 12058); NodeGroupExecutionClient nec = new NodeGroupExecutionClient(necc); String nodeGroupId = "Logging SPARQLgraph alerts"; String connectionInfo = "{ \"name\": \"Logging SparqlGraph\", \"domain\": \"http://com.ge.research/knowledge/UsageLogging\", \"model\": [ { \"type\": \"virtuoso\", \"url\": \"http://fake-server.crd.ge.com:2420\", \"dataset\": \"http://com.ge.research/knowledge/UsageLogging/LogMaster\"} ], \"data\": [ {\"type\": \"virtuoso\", \"url\": \"http://fake-server.crd.ge.com:2420\", \"dataset\": \"http://com.ge.research/knowledge/UsageLogging/SPARQLGraph\" } ]}"; JsonObject jObject = JsonObject.Parse(connectionInfo); JsonObject jsonLD = nec.ExecuteDispatchConstructByIdToJsonLd(nodeGroupId, jObject, null, null).Result; NodeGroupResultSet ngResultSet = new NodeGroupResultSet(true); ngResultSet.ReadJson(jsonLD); ngResult = NodeGroup.FromConstructJson(ngResultSet.GetResultsJson()); Debug.WriteLine("total node count =" + ngResult.GetNodeCount()); Assert.IsTrue(ngResult.GetNodeCount() > 0); foreach (Node nCurr in ngResult.GetNodeList()) { // write some basic debug so we can see something is working. Debug.WriteLine("uri: " + nCurr.GetFullUriName() + " , instanceValue: " + nCurr.GetInstanceValue()); } }
public void TestNodeGroupExecClient() { NodeGroupExecutionClientConfig necc = new NodeGroupExecutionClientConfig("http", "fake-server.crd.ge.com", 12058); NodeGroupExecutionClient nec = new NodeGroupExecutionClient(necc); String nodeGroupId = "Logging SPARQLgraph alerts"; String connectionInfo = "{ \"name\": \"Logging SparqlGraph\", \"domain\": \"http://com.ge.research/knowledge/UsageLogging\", \"model\": [ { \"type\": \"virtuoso\", \"url\": \"http://fake-server.crd.ge.com:2420\", \"dataset\": \"http://com.ge.research/knowledge/UsageLogging/LogMaster\"} ], \"data\": [ {\"type\": \"virtuoso\", \"url\": \"http://fake-server.crd.ge.com:2420\", \"dataset\": \"http://com.ge.research/knowledge/UsageLogging/SPARQLGraph\" } ]}"; JsonObject jObject = JsonObject.Parse(connectionInfo); Table res = nec.ExecuteDispatchSelectByIdToTable(nodeGroupId, jObject, null, null).Result; int count = res.GetNumRows(); Assert.IsTrue(count > 0); }
public void NodeGroupExecutionCountTest() { NodeGroupExecutionClientConfig necc = new NodeGroupExecutionClientConfig("http", "fake-server.crd.ge.com", 12058); NodeGroupExecutionClient nec = new NodeGroupExecutionClient(necc); String nodeGroupId = "Logging SPARQLgraph alerts"; String connectionInfo = "{ \"name\": \"Logging SparqlGraph\", \"domain\": \"http://com.ge.research/knowledge/UsageLogging\", \"model\": [ { \"type\": \"virtuoso\", \"url\": \"http://fake-server.crd.ge.com:2420\", \"dataset\": \"http://com.ge.research/knowledge/UsageLogging/LogMaster\"} ], \"data\": [ {\"type\": \"virtuoso\", \"url\": \"http://fake-server.crd.ge.com:2420\", \"dataset\": \"http://com.ge.research/knowledge/UsageLogging/SPARQLGraph\" } ]}"; JsonObject jObject = JsonObject.Parse(connectionInfo); long count = nec.ExecuteDispatchCountByIdToLong(nodeGroupId, jObject, null, null).Result; Debug.WriteLine("count reported " + count + " rows as existing."); Assert.IsTrue(count > 0); }
private void InitServiceClients() { // the Ontology info client. RestClientConfig orcc = new RestClientConfig("http", this.oServerBox.Text, int.Parse(this.oPortBox.Text)); this.oisc = new OntologyInfoServiceClient(orcc); // the Nodegroup client RestClientConfig ngrcc = new RestClientConfig("http", this.ngServerBox.Text, int.Parse(this.ngPortBox.Text)); this.ngc = new NodeGroupClient(ngrcc); // the nodegroup execution client NodeGroupExecutionClientConfig ngercc = new NodeGroupExecutionClientConfig("http", eServerBox.Text, int.Parse(ePortBox.Text)); this.ngec = new NodeGroupExecutionClient(ngercc); }