StandardRequest() public method

Most common way to talk to the server
public StandardRequest ( string method, string url, List options, string contentType ) : List
method string
url string
options List
contentType string
return List
コード例 #1
0
        /// <summary>
        /// List the triple stores at the current url
        /// </summary>
        /// <returns></returns>
        public List <string> listTripleStores(string url)
        {
            if (url != string.Empty)
            {
                this._url = url;
            }
            List <string> stores = new List <string>();

            try
            {
                Request        request = new Request();
                List <Results> rs      = new List <Results>();
                rs = request.StandardRequest("GET", this._url + @"/repositories", null, null);
                foreach (Results result in rs)
                {
                    stores.Add(result.Result.ToString());
                }
            }
            catch (Exception ex)
            {
                System.Diagnostics.Trace.WriteLine("Error in listTripleStores : " + ex.Message);
            }

            return(stores);
        }
コード例 #2
0
 /// <summary>
 /// Initialize new triple store
 /// </summary>
 /// <param name="name"></param>
 /// <param name="url"></param>
 /// <returns></returns>
 public bool createTripleStore(string name, string url)
 {
     try
     {
         if (url != string.Empty)
         {
             this._url = url;
         }
         Request request = new Request();
         request.StandardRequest("PUT", this._url + @"/repositories/" + legalizeName(name, this._url), null, null);
         return(true);
     }
     catch (Exception ex)
     {
         System.Diagnostics.Trace.WriteLine("Error in create triple store : " + ex.Message);
         return(false);
     }
 }
コード例 #3
0
 /// <summary>
 /// Initialize new triple store
 /// </summary>
 /// <param name="name"></param>
 /// <param name="url"></param>
 /// <returns></returns>
 public bool createTripleStore(string name, string url)
 {
     try
     {
         if (url != string.Empty)
         {
             this._url = url;
         }
         Request request = new Request();
         request.StandardRequest("PUT", this._url + @"/repositories/" + legalizeName(name,this._url), null, null);
         return true;
     }
     catch (Exception ex)
     {
         System.Diagnostics.Trace.WriteLine("Error in create triple store : " + ex.Message);
         return false;
     }
 }
コード例 #4
0
 /// <summary>
 ///  Federate the triple store, untested at this time
 /// </summary>
 /// <param name="name"></param>
 /// <param name="storeNames"></param>
 /// <param name="url"></param>
 /// <returns></returns>
 public bool federateTripleStores(string name, List <string> storeNames, string url)
 {
     try
     {
         if (url != string.Empty)
         {
             this._url = url;
         }
         Request request           = new Request();
         List <NameValuePairs> nvp = new List <NameValuePairs>();
         NameValuePairs        np  = new NameValuePairs();
         np.Name  = "federate";
         np.Value = (object)storeNames;
         nvp.Add(np);
         request.StandardRequest("PUT", this._url + @"/repositories/" + legalizeName(name, this._url), nvp, string.Empty);
         return(true);
     }
     catch (Exception ex)
     {
         System.Diagnostics.Trace.WriteLine("Error in federateTripleStores: " + ex.Message);
         return(false);
     }
 }
コード例 #5
0
 /// <summary>
 ///  Federate the triple store, untested at this time
 /// </summary>
 /// <param name="name"></param>
 /// <param name="storeNames"></param>
 /// <param name="url"></param>
 /// <returns></returns>
 public bool federateTripleStores(string name, List<string> storeNames, string url)
 {
     try
     {
         if (url != string.Empty)
         {
             this._url = url;
         }
         Request request = new Request();
         List<NameValuePairs> nvp = new List<NameValuePairs>();
         NameValuePairs np = new NameValuePairs();
         np.Name = "federate";
         np.Value = (object)storeNames;
         nvp.Add(np);
         request.StandardRequest("PUT", this._url + @"/repositories/" + legalizeName(name,this._url), nvp, string.Empty);
         return true;
     }
     catch (Exception ex)
     {
         System.Diagnostics.Trace.WriteLine("Error in federateTripleStores: " + ex.Message);
         return false;
     }
 }
コード例 #6
0
        /// <summary>
        /// List the triple stores at the current url
        /// </summary>
        /// <returns></returns>
        public List<string> listTripleStores(string url)
        {
            if (url != string.Empty)
            {
                this._url = url;
            }
            List<string> stores = new List<string>();
            try
            {
                Request request = new Request();
                List<Results> rs = new List<Results>();
                rs = request.StandardRequest("GET", this._url + @"/repositories", null, null);
                foreach (Results result in rs)
                {
                    stores.Add(result.Result.ToString());
                }
            }
            catch (Exception ex)
            {

                System.Diagnostics.Trace.WriteLine("Error in listTripleStores : " + ex.Message);
            }

            return stores;
        }
コード例 #7
0
        /// <summary>
        /// StandardRequest allows you to submit a basic request to the server
        /// </summary>
        /// <param name="method">Needs to be the standard REST methods: PUT, GET, etc.</param>
        /// <param name="url">URL of the server</param>
        /// <param name="options">Options to be passed in the HTTP Request</param>
        /// <param name="contentType">ContentType parameter</param>
        /// <returns></returns>
        public List <Results> StandardRequest(string method, string url, List <NameValuePairs> options, string contentType)
        {
            Request rq = new Request();

            return(rq.StandardRequest(method, url, options, contentType));
        }
コード例 #8
0
 /// <summary>
 /// StandardRequest allows you to submit a basic request to the server
 /// </summary>
 /// <param name="method">Needs to be the standard REST methods: PUT, GET, etc.</param>
 /// <param name="url">URL of the server</param>
 /// <param name="options">Options to be passed in the HTTP Request</param>
 /// <param name="contentType">ContentType parameter</param>
 /// <returns></returns>
 public List<Results> StandardRequest(string method, string url, List<NameValuePairs> options, string contentType)
 {
     Request rq = new Request();
     return rq.StandardRequest(method, url, options, contentType);
 }