Пример #1
0
 /// <summary>
 /// Performs evaluation & replacement of independent sub-trees
 /// </summary>
 /// <param name="expression">The root of the expression tree.</param>
 /// <returns>A new tree with sub-trees evaluated and replaced.</returns>
 public static Expression PartialEval(Expression expression)
 {
     using (var ls = new LoggingScope("Evaluator.PartialEval1"))
     {
     return PartialEval(expression, CanBeEvaluatedLocally);
     }
 }
Пример #2
0
 /// <summary>
 /// Performs evaluation & replacement of independent sub-trees
 /// </summary>
 /// <param name="expression">The root of the expression tree.</param>
 /// <param name="fnCanBeEvaluated">A function that decides whether a given expression node can be part of the local function.</param>
 /// <returns>A new tree with sub-trees evaluated and replaced.</returns>
 public static Expression PartialEval(Expression expression, Func<Expression, bool> fnCanBeEvaluated)
 {
     using (var ls = new LoggingScope("Evaluator.PartialEval3"))
     {
         return new SubtreeEvaluator(new Nominator(fnCanBeEvaluated).Nominate(expression)).Eval(expression);
     }
 }
 public static void Add(this MemoryStore ms, OwlInstanceSupertype oc)
 {
     using (var ls = new LoggingScope("MemoryStoreExtensions.Add"))
     {
         Type t = oc.GetType();
         Console.WriteLine(oc.InstanceUri);
         PropertyInfo[] pia = t.GetProperties();
         ms.Add(new Statement((Entity)oc.InstanceUri, OntologyHelper.rdfType, (Entity)OwlClassSupertype.GetOwlClassUri(t)));
         foreach (PropertyInfo pi in pia)
         {
             if (pi.IsOntologyResource())
             {
                 AddPropertyToStore(oc, pi, ms);
             }
         }
     }
 }