Title: RE: JESS: Query query...

I'm no JESS expert, but shouldn't your query match your fact template?

  (Attribute (ElementID ?elID) (AttributeName "xmlID")))

Seems to be missing: (DocumentName ?dn)

Just a thought. Not sure if that matters though.


-----Original Message-----
From:   [EMAIL PROTECTED] on behalf of James O'Brien
Sent:   Tue 2/24/2004 3:05 PM
To:     [EMAIL PROTECTED]
Cc:    
Subject:        JESS: Query query...
Hi all,

This is a really simple question but one that I'm unable to find the answer
to. I'm attempting to use a query to extract one fact from a set of nearly
identical ones. The query at the moment looks like :

(defquery find-xmlID
    "Finds the xmlID of a fact from a supplied ElementID"
    (declare (variables ?elID))
    (printout t "searching for xmlID for elID: " ?elID)
    (Attribute (ElementID ?elID) (AttributeName "xmlID")))

and some of the facts that it's working on are below. Basically I'm trying
to extract f-223 and I'm assuming that I should be doing it the way I am...
although that query is returning no results. I've toyed with a syntax of
(and ((Attribute (ElementID ?elID)) (AttributeName "xmlID")))) and that
wasn't helpful either.

f-230   (MAIN::Attribute (DocumentName "RuleBase") (ElementID 43)
(AttributeName "t_ex_t0") (Text "1990"))
f-231   (MAIN::Attribute (DocumentName "RuleBase") (ElementID 43)
(AttributeName "t_ex_t1") (Text "2000"))
f-232   (MAIN::Attribute (DocumentName "RuleBase") (ElementID 43)
(AttributeName "type") (Text "DEM"))
f-233   (MAIN::Attribute (DocumentName "RuleBase") (ElementID 43)
(AttributeName "xmlID") (Text "915"))

any hints to my (probably obvious) error,

regards,

James


Reply via email to