public async Task <OntologyInfo> ExecuteGetOntologyInfo(SparqlConnection connection) { // get the ontology info information related to this connection. SimpleResultSet interrimResult = null; OntologyInfo retval = null; conf.SetServiceEndpoint(mappingPrefix + ontologyInfoDetailsEndpoint); String connectionJsonString = connection.ToJson().ToString(); this.parameterJson.Add("jsonRenderedSparqlConnection", JsonValue.CreateStringValue(connectionJsonString)); try { // talk to the service to get the ontology info details. //JsonObject obj = (JsonObject)this.Execute().Result; JsonObject objExec = (JsonObject)(await this.Execute()); interrimResult = SimpleResultSet.FromJson(objExec); interrimResult.ThrowExceptionIfUnsuccessful(); // get the actual value from the results JsonObject obj = interrimResult.GetResultJsonObject("ontologyInfo"); // build an oInfo from it. retval = new OntologyInfo(); retval.AddJson(obj); } finally { conf.SetServiceEndpoint(null); this.parameterJson.Remove("jsonRenderedSparqlConnection"); } // return the OntologyInfo return(retval); }
public async Task <SimpleResultSet> ExecuteDispatchFromNodeGroup(NodeGroup ng, JsonObject sparqlConnectionJson, JsonObject edcConstraintsJson, JsonObject runtimeConstraintsJson) { SimpleResultSet retval = null; conf.SetServiceEndpoint(mappingPrefix + dispatchFromNodegroupEndpoint); this.parameterJson.Add("jsonRenderedNodeGroup", JsonValue.CreateStringValue(ng.ToJson().ToString())); this.parameterJson.Add("sparqlConnection", JsonValue.CreateStringValue(sparqlConnectionJson.ToString())); if (edcConstraintsJson != null) { this.parameterJson.Add("externalDataConnectionConstraints", JsonValue.CreateStringValue(edcConstraintsJson.ToString())); } if (runtimeConstraintsJson != null) { this.parameterJson.Add("runtimeConstraints", JsonValue.CreateStringValue(runtimeConstraintsJson.ToString())); } try { JsonObject kObj = (JsonObject)(await this.Execute()); retval = SimpleResultSet.FromJson(kObj); retval.ThrowExceptionIfUnsuccessful(); } finally{ conf.SetServiceEndpoint(null); this.parameterJson.Remove("jsonRenderedNodeGroup"); this.parameterJson.Remove("sparqlConnection"); this.parameterJson.Remove("externalDataConnectionConstraints"); this.parameterJson.Remove("runtimeConstraints"); } return(retval); }
public async Task <SimpleResultSet> ExecuteDispatchFilterById(String nodegroupID, String targetObjectSparqlId, JsonObject sparqlConnectionJson, JsonObject edcConstraintsJson, JsonArray runtimeConstraintsJson) { SimpleResultSet retval = null; conf.SetServiceEndpoint(mappingPrefix + dispatchFilterByIdEndpoint); this.parameterJson.Add("nodeGroupId", JsonValue.CreateStringValue(nodegroupID)); this.parameterJson.Add("sparqlConnection", JsonValue.CreateStringValue(sparqlConnectionJson.ToString())); this.parameterJson.Add("targetObjectSparqlId", JsonValue.CreateStringValue(targetObjectSparqlId)); if (edcConstraintsJson != null) { this.parameterJson.Add("externalDataConnectionConstraints", JsonValue.CreateStringValue(edcConstraintsJson.ToString())); } if (runtimeConstraintsJson != null) { this.parameterJson.Add("runtimeConstraints", JsonValue.CreateStringValue(runtimeConstraintsJson.ToString())); } try { JsonObject kObj = (JsonObject)(await this.Execute()); retval = SimpleResultSet.FromJson(kObj); retval.ThrowExceptionIfUnsuccessful(); } finally{ conf.SetServiceEndpoint(null); this.parameterJson.Remove("nodeGroupId"); this.parameterJson.Remove("sparqlConnection"); this.parameterJson.Remove("externalDataConnectionConstraints"); this.parameterJson.Remove("runtimeConstraints"); this.parameterJson.Remove("targetObjectSparqlId"); } return(retval); }
public async Task <SimpleResultSet> ExecuteGetJobStatus(String jobId) { SimpleResultSet retval = null; conf.SetServiceEndpoint(mappingPrefix + jobStatusEndpoint); this.parameterJson.Add("jobID", JsonValue.CreateStringValue(jobId)); try { JsonObject kObj = (JsonObject)(await this.Execute()); retval = SimpleResultSet.FromJson(kObj); retval.ThrowExceptionIfUnsuccessful(); } finally { conf.SetServiceEndpoint(null); this.parameterJson.Remove("jobID"); } return(retval); }