Any facts written to the Facilitator using writeBB() can also
be read using solve() instead of readBB(). For example, if
we do :
writeBB("noun","[emp, [emp,name,ssn,'employee id']]");
writeBB("noun", "[phone, [phone, telephone]]");
we can read the values using either
readBB("noun", "X")
or
solve("noun(X)", "[]")
When making these queries, unification is taken into account,
so you can do the kind of pattern matching you requested in your message.
For example, to get only those noun definitions that match the "meaning"
of "phone", you can do:
solve("noun([phone, X])", "[]").
-- Adam.
Stuart Lowry wrote:
>
> I was wondering if there is a slick way to do the following:
> imagine that I am issuing facts to the BB like the following:
>
> writeBB("noun",[emp, [emp,name,ssn,'employee id']]);
> writeBB("noun",[phone, [phone,'phone number',telephone]]);
>
> I would like issue a single readBB and get only the nouns that pertain
> to the "meaning" item:
>
> String phone_words = readBB("noun","[phone, X]");
> and phone_words = "[phone,'phone number',telephone]";
>
> as it stands I can only request ALL of the nouns and then I have to
> traverse all the content to find the meaning that I want:
> String phone_words = readBB("noun","X");
> and phone_words = "readBB(noun,[emp,[emp,name,ssn,'employeeid']]),
> readBB(noun,[phone, [phone,'phone number',telephone]])";
>
> Thanks in advance,
> Stuart Lowry