예제 #1
0
        internal NpletProducerNode(Context context, NpletQueryNode target, NpletFactory factory, IEnumerable<NpletTree> dependencies)
        {
            TargetQuery = target;
            _factory = factory;

            Dependencies = (from nplet in dependencies select context.CreateQueryNode(nplet)).ToArray();
            _dependencyReaders = (from dependency in Dependencies select context.CreateReader(dependency)).ToArray();
        }
예제 #2
0
        /// <inheritdoc/>
        internal override IEnumerable<NpletProducerNode> CreateProducers(NpletQueryNode query, Context context)
        {
            //creates query which will match to implication targeting the query
            var implicationQuery = NpletTree.From(Edge.Then, Edge.TempVariable(), Edge.To(query.Query));
            //fetches those implications from database
            var implications = context.Fetch(implicationQuery);

            var producers = new List<NpletProducerNode>();
            foreach (var implication in implications)
            {
                var condition = implication.GetEdge(0).TargetAsNplet;
                var producer = new NpletProducerNode(context, query, null, new[] { condition });

                producers.Add(producer);
            }

            return producers;
        }
예제 #3
0
        /// <inheritdoc/>
        internal override IEnumerable<NpletProducerNode> CreateProducers(NpletQueryNode query, Context context)
        {

            throw new NotImplementedException();
        }
예제 #4
0
 internal abstract IEnumerable<NpletProducerNode> CreateProducers(NpletQueryNode query, Context context);