Example #1
0
        protected QueryResult QueryDB(AGraphDSSharp myGraphDSSharp, String myQueryString, Boolean myWithOutput = true)
        {
            if (myWithOutput)
                Write(myQueryString + " => ");

            var GQLQuery = new GraphQLQuery(myGraphDSSharp.IGraphDBSession.DBPluginManager);
            var _QueryResult = GQLQuery.Query(myQueryString, myGraphDSSharp.IGraphDBSession);

            if (myWithOutput)
                WriteLine(_QueryResult.ResultType.ToString());

            if (_QueryResult == null)
                WriteLine("The QueryResult is invalid!\n\n");

            else if (_QueryResult.ResultType != ResultType.Successful)
                foreach (var aError in _QueryResult.Errors)
                    WriteLine(aError.GetType().ToString() + ": " + aError.ToString() + "\n\n");

            return _QueryResult;
        }
Example #2
0
        private bool ExecuteAQuery(string query, IGraphDBSession dbSession, GraphQLQuery myGQLQuery)
        {
            if (query.Length != 0)
            {
                //execute query
                QueryResult myQueryResult = myGQLQuery.Query(query, dbSession);

                WriteLine(query);

                HandleQueryResult(myQueryResult, false);

                if (myQueryResult.ResultType != ResultType.Successful)
                {
                    WriteLine(myQueryResult.GetIErrorsAsString());
                    return false;
                }
                else
                {
                    return true;
                }
            }
            else
            {
                return true;
            }
        }
Example #3
0
 private QueryResult ExecuteQuery(String myQuery, IGraphDBSession myIGraphDBSession, GraphQLQuery myGQLQuery)
 {
     return myGQLQuery.Query(myQuery, myIGraphDBSession);
 }