private Boolean EvaluateHaving(IVertexView myDBObjectReadoutGroup, AExpressionDefinition complexValue, out String attributeName, out ValueDefinition simpleValue) { //VertexType graphDBType = null; attributeName = null; simpleValue = null; if (complexValue is IDChainDefinition) { if (((IDChainDefinition)complexValue).LastAttribute == null) { if (((IDChainDefinition)complexValue).Last() is ChainPartFuncDefinition) { var func = (((IDChainDefinition)complexValue).Last() as ChainPartFuncDefinition); if (func.Parameters.Count != 1) { throw new NotImplementedQLException(""); } attributeName = func.SourceParsedString; //graphDBType = func.Parameters.First().LastAttribute.GetDBType(dbContext.DBTypeManager); } else if (((IDChainDefinition)complexValue).IsUndefinedAttribute) { attributeName = ((IDChainDefinition)complexValue).UndefinedAttribute; //return new Exceptional<bool>(new Error_NotImplemented(new System.Diagnostics.StackTrace(true))); } else { //return new Exceptional<bool>(new Error_NotImplemented(new System.Diagnostics.StackTrace(true))); } } else { attributeName = ((IDChainDefinition)complexValue).LastAttribute.Name; //graphDBType = ((IDChainDefinition)complexValue).LastAttribute.GetDBType(dbContext.DBTypeManager); } } else { if (complexValue is AggregateDefinition) { var func = (complexValue as AggregateDefinition); if (func.ChainPartAggregateDefinition.Parameters.Count != 1) throw new NotImplementedQLException(""); attributeName = func.ChainPartAggregateDefinition.SourceParsedString; //graphDBType = func.ContainingIDNodes.First().LastAttribute.GetDBType(dbContext.DBTypeManager); } else { throw new NotImplementedQLException(""); } } if (myDBObjectReadoutGroup.HasProperty(attributeName)) { simpleValue = new ValueDefinition(myDBObjectReadoutGroup.GetProperty<Object>(attributeName)); return true; } return false; }
private Boolean EvaluateHaving(IVertexView myDBObjectReadoutGroup, AExpressionDefinition complexValue, out String attributeName, out ValueDefinition simpleValue) { //VertexType graphDBType = null; attributeName = null; simpleValue = null; if (complexValue is IDChainDefinition) { if (((IDChainDefinition)complexValue).LastAttribute == null) { if (((IDChainDefinition)complexValue).Last() is ChainPartFuncDefinition) { var func = (((IDChainDefinition)complexValue).Last() as ChainPartFuncDefinition); if (func.Parameters.Count != 1) { throw new NotImplementedQLException(""); } attributeName = func.SourceParsedString; //graphDBType = func.Parameters.First().LastAttribute.GetDBType(dbContext.DBTypeManager); } else if (((IDChainDefinition)complexValue).IsUndefinedAttribute) { attributeName = ((IDChainDefinition)complexValue).UndefinedAttribute; //return new Exceptional<bool>(new Error_NotImplemented(new System.Diagnostics.StackTrace(true))); } else { //return new Exceptional<bool>(new Error_NotImplemented(new System.Diagnostics.StackTrace(true))); } } else { attributeName = ((IDChainDefinition)complexValue).LastAttribute.Name; //graphDBType = ((IDChainDefinition)complexValue).LastAttribute.GetDBType(dbContext.DBTypeManager); } } else { if (complexValue is AggregateDefinition) { var func = (complexValue as AggregateDefinition); if (func.ChainPartAggregateDefinition.Parameters.Count != 1) { throw new NotImplementedQLException(""); } attributeName = func.ChainPartAggregateDefinition.SourceParsedString; //graphDBType = func.ContainingIDNodes.First().LastAttribute.GetDBType(dbContext.DBTypeManager); } else { throw new NotImplementedQLException(""); } } if (myDBObjectReadoutGroup.HasProperty(attributeName)) { simpleValue = new ValueDefinition(myDBObjectReadoutGroup.GetProperty <Object>(attributeName)); return(true); } return(false); }
private void PrintWays(IVertexView current_vertex, int lev = 0) { for (int i = 0; i < 2 * lev; ++i) Console.Write(' '); if (current_vertex.HasProperty("VertexID")) Console.WriteLine(current_vertex.GetPropertyAsString("VertexID")); if (!current_vertex.HasEdge("path")) return; foreach (var edge in current_vertex.GetHyperEdge("path").GetAllEdges()) { PrintWays(edge.GetTargetVertex(), lev + 1); } }