public SimpleRacoonResponse InsertTripleSimple(byte[] token, InsertableTriple[] DataToInsert, string graph)
        {
            Exception            error = null;
            SimpleRacoonResponse res   = new SimpleRacoonResponse();

            if (DataToInsert.Length == 0)
            {
                res.AuthorisationOK = true;//we don't know this, but nor do we wish to trigger anything around dealing with aurthorisation problems
                res.Error           = new ArgumentException("Must pass in some data to insert");
                res.Status          = false;
                return(res);
            }
            Session currentSession;

            if (SessionStore.TryGetValidSession(token, out currentSession))
            {
                error = InsertData(DataToInsert, graph, currentSession);
                QueryExecution.SuccessResponse(res, error);
            }
            else
            {
                QueryExecution.SecurityFailureResponse(res);
            }
            return(res);
        }
        public SimpleRacoonResponse LoadLDLFile(byte[] token, string[] LDLFileContent, string[] AbsolutePosContent, string graph)
        {
            Exception            error = null;
            SimpleRacoonResponse res   = new SimpleRacoonResponse();
            Session currentSession;

            if (SessionStore.TryGetValidSession(token, out currentSession))
            {
                try
                {
                    LDLParser theParser = LDLParser.GetParser();
                    theParser.ParseText(LDLFileContent, AbsolutePosContent);
                    IEnumerable <BOTripple> tripples = theParser.GetAsTripples();
                    List <InsertableTriple> toInsert = new List <InsertableTriple>();
                    foreach (BOTripple trip in tripples)
                    {
                        toInsert.Add(new InsertableTriple(trip));
                    }
                    error = InsertTripple.InsertData(toInsert, graph, currentSession);
                }
                catch (Exception ex)
                {
                    error = ex;
                }
                QueryExecution.SuccessResponse(res, error);
            }
            else
            {
                QueryExecution.SecurityFailureResponse(res);
            }

            return(res);
        }
        public SimpleRacoonResponse InsertSingleTriple(byte[] token, string subj, string pred, string obj, string graph)
        {
            Exception            error = null;
            SimpleRacoonResponse res   = new SimpleRacoonResponse();

            Session currentSession;

            if (SessionStore.TryGetValidSession(token, out currentSession))
            {
                error = InsertSingleTripleExec(subj, pred, obj, graph, currentSession);
                QueryExecution.SuccessResponse(res, error);
            }
            else
            {
                QueryExecution.SecurityFailureResponse(res);
            }
            return(res);
        }