public void PropertyFilterSet(SetSymbol parameterSym1, string parameter2, string parameter3, RelationSymbol returnSym) { Console.WriteLine("PropertyFilterOperator'ing..."); var pair = dereferenceOperator.ResolveReferenceTuplesIn(parameterSym1.Tuples, 0, false, "IsDefinedBy"); var triple = dereferenceOperator.ResolveReferenceTuplesIn(pair, 1, false, "RelatingPropertyDefinition"); var quadruple = dereferenceOperator.ResolveReferenceTuplesIn(triple, 2, false, "HasProperties"); var pairEntiyProp = projectorOperator.ProjectLocal(quadruple, new [] { 0, 3 }); //var predicateData1 = new AttributeFilterOperator.PredicateData() //todo // { // PropName = "name", // Compare = "=", // StringValue = parameter2 //}; //var pairAttributePresent = pairEntiyProp.Where(p => attributeFilterOperator.AttributeSetTestLocal(p[1], predicateData1)).ToArray(); //var predicateData2 = new AttributeFilterOperator.PredicateData() //{ // PropName = "nominalValue", // Compare = "=", // StringValue = parameter3 //}; //var result = pairAttributePresent.Where(p => attributeFilterOperator.AttributeSetTestLocal(p[1], predicateData2)).ToArray(); //returnSym.SetTuples(result); }
public IEnumerable <QLEntity[]> GetTuplesRelAtt(IEnumerable <QLEntity[]> tuples, int attributeIndex, string[] exAtts) { var firstPairs = dereferenceOperator.ResolveReferenceTuplesIn(tuples, attributeIndex, false, exAtts[0]); if (firstPairs.Count == 0) { return(new List <QLEntity[]>()); } //pair original second arg var secondPairs = dereferenceOperator.ResolveReferenceTuplesIn(firstPairs, firstPairs[0].Length - 1, true, mapObjectiviedRelations[exAtts[0]]); if (exAtts.Length == 1) { return(secondPairs); } var thirdPair = dereferenceOperator.ResolveReferenceTuplesIn(secondPairs, 1, true, exAtts[1]); return(dereferenceOperator.ResolveReferenceTuplesIn(thirdPair, 1, true, mapObjectiviedRelations[exAtts[1]])); }
//only symbols and simple types in operators, no nodes //symbolTable, parameterSym1, ..., returnSym public void TimeResolverRel(RelationSymbol parameterSym1, RelationSymbol returnSym) { Console.WriteLine("TimeResolver'ing..."); var index = parameterSym1.Index.Value; var tuples = deassociater.GetTuplesRelAtt(parameterSym1.Tuples, index, new [] { "ReferencedBy" }).ToArray(); var lastIndex = returnSym.Attributes.Count - 2; tuples = dereferenceOperator.ResolveReferenceTuplesIn(tuples, lastIndex, false, "TaskTime").ToArray(); var typeList = new List <Tuple <int, string> >() { new Tuple <int, string>(index, "IfcProduct"), new Tuple <int, string>(lastIndex, "IfcTask"), new Tuple <int, string>(lastIndex + 1, "IfcTaskTime"), }; //type filtering ifcTask (plus products?) var tuplesTyped = typeFilter.GetTuples(tuples, typeList.ToArray()); returnSym.SetTuples(tuplesTyped); }