get specific fact with dump_specific_facts()

Help
Suryanto
2014-05-01
2014-05-01
  • Suryanto
    Suryanto
    2014-05-01

    Hi,

    I am trying to run the example "family_relations" coming with the downloaded pyke package. However, I modified slightly the example on fc_test() to print the all the asserted facts (i.e. specific facts)

    The modification on the fc_test() looks like following:

    def fc_test(person1 = 'bruce'):
    '''
    This function runs the forward-chaining example (fc_example.krb).
    '''
    engine.reset() # Allows us to run tests multiple times.

    start_time = time.time()
    engine.activate('fc_example')  # Runs all applicable forward-chaining rules.
    fc_end_time = time.time()
    fc_time = fc_end_time - start_time
    
    engine.get_kb('family').dump_specific_facts()
    

    However, doing these returns me nothing. Instead, I expect to have all the specific facts. Any ideas on how to do this ?

    Thanks in advance.

     
    • I'm not sure what the problem is. When I did this, just as you indicated
      in your post, it worked for me.

      -Bruce

      On Thu, May 1, 2014 at 9:59 AM, Suryanto aileron90@users.sf.net wrote:

      Hi,

      I am trying to run the example "family_relations" coming with the
      downloaded pyke package. However, I modified slightly the example on
      fc_test() to print the all the asserted facts (i.e. specific facts)

      The modification on the fc_test() looks like following:

      def fc_test(person1 = 'bruce'):
      '''
      This function runs the forward-chaining example (fc_example.krb).
      '''
      engine.reset() # Allows us to run tests multiple times.

      start_time = time.time()engine.activate('fc_example') # Runs all applicable forward-chaining rules.fc_end_time = time.time()fc_time = fc_end_time - start_time
      engine.get_kb('family').dump_specific_facts()

      However, doing these returns me nothing. Instead, I expect to have all the
      specific facts. Any ideas on how to do this ?

      Thanks in advance.

      get specific fact with dump_specific_facts()https://sourceforge.net/p/pyke/discussion/744447/thread/9a3d4bd9/?limit=25#5c43

      Sent from sourceforge.net because you indicated interest in
      https://sourceforge.net/p/pyke/discussion/744447/

      To unsubscribe from further messages, please visit
      https://sourceforge.net/auth/subscriptions/