public SparqlEndpointDescription getDataInterface(int interfaceIdx)
        {
            SparqlEndpointDescription retval = null;

            if (this.dataInterfaces.Count > interfaceIdx)
            {
                // this one will exist.
                retval = this.dataInterfaces[interfaceIdx];
            }

            return(retval);
        }
        public JsonObject ToJson()
        {
            // need a mechanism to output the connections in order to allow services to use them...
            JsonObject retval = new JsonObject();

            retval.Add("name", JsonValue.CreateStringValue(this.name));
            retval.Add("domain", JsonValue.CreateStringValue(this.domain));

            JsonArray modelArray = new JsonArray();
            JsonArray dataArray  = new JsonArray();

            for (int i = 0; i < this.modelInterfaces.Count; i++)
            {
                // get the interface.
                SparqlEndpointDescription curr = this.modelInterfaces[i];
                // create an object
                JsonObject currInterface = new JsonObject();
                currInterface.Add("type", JsonValue.CreateStringValue(curr.GetServerType()));
                currInterface.Add("url", JsonValue.CreateStringValue(curr.GetServerAndPort()));
                currInterface.Add("dataset", JsonValue.CreateStringValue(curr.GetDataset()));
                // add to the array
                modelArray.Add(currInterface);
            }

            for (int i = 0; i < this.dataInterfaces.Count; i++)
            {
                // get the interface.
                SparqlEndpointDescription curr = this.dataInterfaces[i];
                // create an object
                JsonObject currInterface = new JsonObject();
                currInterface.Add("type", JsonValue.CreateStringValue(curr.GetServerType()));
                currInterface.Add("url", JsonValue.CreateStringValue(curr.GetServerAndPort()));
                currInterface.Add("dataset", JsonValue.CreateStringValue(curr.GetDataset()));
                // add to the array
                dataArray.Add(currInterface);
            }

            retval.Add("model", modelArray);
            retval.Add("data", dataArray);

            return(retval);
        }