[XML-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: Generating New Knowledge by Deductive Reasoning usingSchem
On Fri, 19 Nov 2010 14:56:35 +0000, Stephen Green <stephengreenubl@gmail.com> wrote: > A very nice example, Roger. Maybe what would make it look more > useful would be to demonstrate how to chain the deductions so that > the deductions can themselves add to the 'knowledge' and further > deductions be made based on those initial deductions. This might then > provide an improved parallel methodology to the more typical OWL > or RDF knowledge-base / triple-store / inference-engine approach. > Just use the <sch:let> expressions more. You can have arbitrarily long chains of deductions, and pull all the logic out of the assert or report tests. <sch:let name="speeder-driversLicenseNumber" value="."/> <sch:let name="GunLicense" value="for $i in collection('GunLicenseFolder?select=*.xml;recurse=yes;on-error=ignore') return $i/GunLicense[.//Person/driversLicenseNumber eq $speeder-driversLicenseNumber]"/> <sch:let name="matching-drivers-license" value="$speeder-driversLicenseNumber eq $GunLicense//Person/driversLicenseNumber" /> <sch:let name="matching-gun" value="$GunLicense/registeredGun/Gun/serial eq doc('Robbery.xml')/RobberyEvent/evidence/Gun/serial" /> <sch:let name="has-gun-license" value="count($GunLicense) eq 1"/> <sch:let name="only-person-licensed" value="count($GunLicense//Person) eq 1" /> <sch:let name="is-bad-guy" value="$matching-drivers-license and $matching-gun and $has-gun-license and $only-person-licensed" /> <sch:let name="is-our-bad-guy" value="parent::Person/child::name = document('licensed-to-kill.xml')/agents/agent/name "/> <sch:report test="$is-bad-guy and not( $is-our-bad-guy)" > Therefore, <sch:value-of select="parent::Person/child::name"/> is the Robber. </sch:report> So you can add extra deductions on the same subject. (The let expressions are scoped to schema, pattern, or rules, but I don't know that this is a disadvantage.) Another way to approach this is neural net fashion: you have one Schematron schema generating individual deductions, then subsequent schemas as layers generating deductions based on the results of layer before (eg the SVRL output.) (Schematron supports an attribute "flag" to help declare the found properties of a pattern/rule/assertion too (such as "incomplete data" or "security risk found".) You can physically combine the patterns for the different layers into the same text file using the phases mechanism, if appropriate too. (Of course, command-line parameterization has been available for the last decade with Schematron, however a WWW technology may be more interested in configuration from XML documents at some URLs rather than just command line arguments.) By the way, there has been a version of Schematron that operated on RDF not XML: Schemarama used the Squish query language. However, I imagine that there are a lot of research tools available for RDF. Cheers Rick Jelliffe
[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] |
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|