BrainDump
  Home arrow BrainDump arrow Page 4 - Working with Code Libraries
ASP Free Forums 
.NET  
ASP  
ASP Code  
ASP.NET  
ASP.NET Code  
BrainDump  
C#  
Code Examples  
Database  
Database Code  
IIS  
Microsoft Access  
MS SQL Server  
Silverlight  
Visual Basic.NET  
Windows Scripting  
Windows Security  
XML  
Mobile Linux 
App Generation ROI 
IBM® developerWorks 
ASP Web Hosting  
ASP.NET Web Hosting 
Windows Web Hosting
 
Weekly Newsletter
 
Developer Updates  
Free Website Content 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us Get Paid 
Request Media Kit
Contact Us 
Site Map 
Privacy Policy 
Support 
 USERNAME
 
 PASSWORD
 
 
  >>> SIGN UP!  
  Lost Password? 
BRAINDUMP

Working with Code Libraries
By: O'Reilly Media
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 4 stars4 stars4 stars4 stars4 stars / 3
    2007-08-02

    Table of Contents:
  • Working with Code Libraries
  • 4.1 Externalizing Business Rules with NxBRE
  • Using NxBRE
  • Creating rules for the Inference Engine
  • Implementing the engine

  • Rate this Article: Poor Best 
      ADD THIS ARTICLE TO:
      Del.ici.ous Digg
      Blink Simpy
      Google Spurl
      Y! MyWeb Furl
    Email Me Similar Content When Posted
    Add Developer Shed Article Feed To Your Site
    Email Article To Friend
    Print Version Of Article
    PDF Version Of Article
     
     
    ADVERTISEMENT


    Working with Code Libraries - Creating rules for the Inference Engine


    (Page 4 of 5 )

    NxBRE supports several rule formats for its Inference Engine:

    1. RuleML files, an XML-based representation of rules
    2. Microsoft Visio 2003 VDX files
    3. HRF files, a human-readable format that resembles Prolog

    RuleML is the format of choice of the Inference Engine. Not all the features are available in the other formats.

    RuleML files can be directly authored with any schema-aware XML editor. The example Rule #1 shown previously can be expressed this way:

      <Implies>
         
    <And>
             
    <Atom>
                 
    <Rel>premium</Rel>
                 
    <Var>customer</Var>
             
    </Atom>
             
    <Atom>
                 
    <Rel>regular</Rel>
                 
    <Var>product</Var>
             
    </Atom>
          </And>
          <Atom>
             
    <Rel>discount</Rel>
             
    <Var>customer</Var>
             
    <Var>product</Var>
             
    <Ind>5.0 percent</Ind>
         
    </Atom>
      </Implies>

    RuleML goes much further than simpleif/thenstatements. In fact, NxBRE’s forward-chaining Inference Engine performs pattern-matching operations and can produce combinations of matching data. See http://ruleml.org and NxBRE’s user guide for more information.

    Editing rules in Visio offers several advantages, including the possibility of organizing rules in pages (Figure 4-3) or mixing rule elements with other schema elements (Figure 4-4).


    Figure 4-3.  Designing Inference Engine rules with Visio

    HRF can be authored with any text editor. Our example Rule #1 would be written like this in HRF:

      ( premium{?customer}
      & regular{?product} )
      -> discount{?customer, ?product, 5.0 percent};

    Whatever rule format is chosen, NxBRE provides a testing console as a companion package. As shown in Figure 4-5, this console allows you to easily load, run, and trace the processing of rule bases designed for the Inference Engine.

    More BrainDump Articles
    More By O'Reilly Media


       · This article is an excerpt from the book "Windows Developer Power Tools," published...
     

    Buy this book now. This article is excerpted from chapter four of Windows Developer Power Tools, written by James Avery and Jim Holmes (O'Reilly, 2006; ISBN: 0596527543). Check it out today at your favorite bookstore. Buy this book now.

    BRAINDUMP ARTICLES

    - Introduction to Office Live Workspace
    - Using MS Excel for One-way Analysis of Varia...
    - Comparing Data Sets Using Statistical Analys...
    - Import Blogger Posts into WordPress Using Wi...
    - Download WordPress from an FTP Server and Ru...
    - Install and Run WordPress in XAMPP Local Host
    - What Windows 7 Brings to the Table
    - Virtualization and Sandbox Detection
    - Advanced Firebug Techniques in Windows XP Ho...
    - Editing CSS with Firebug in Windows XP Home
    - Using Firebug in Windows XP Home
    - Migrating to Exchange Server 2007
    - Using System Restore on a Non-Bootable PC
    - Finding Logged on Users and More Scripting S...
    - Developing Macro Commands in MS Excel





    © 2003-2009 by Developer Shed. All rights reserved. DS Cluster 4 Hosted by Hostway
    Stay green...Green IT