On Mon, Apr 15, 2013 at 12:10 PM, Bruce D'Arcus <[email protected]> wrote:
> Going this route, where the values themselves take on core logical
> semantics, and where those values themselves must be processed ..., is a 
> change in direction.

One alternative solution that relies on native XML structures would be
to introduce a new ...-match attribute for each conditional, that
controls the test logic of the conditional value list. E.g.

variable="volume issue" variable-match="all"

means that the item needs to have both "volume" and "issue". Similarly,

is-numeric="volume issue" is-numeric-match="nand"

means that the item must be missing either a volume or issue, or both.
(Frank's is-numeric-any="not:volume not:issue" confuses me a bit; is
this supposed to act as a XOR or NAND?)

Frank's unit test samples, rewritten:

          <if type="article-journal" variable="volume issue"
variable-match="all" is-numeric="volume issue" is-numeric-match="nand"
match="all">
            <text value="is an ARTICLE-JOURNAL with both VOLUME and
ISSUE, but one of them is non-numeric"/>
          </if>
          <else-if type="article-journal" variable="volume issue"
variable-match="all" is-numeric="volume issue" is-numeric-match="all"
match="all">
            <text value="is an ARTICLE-JOURNAL with both VOLUME and
ISSUE, and both of them are numeric"/>
          </else-if>
          <else-if type="article-journal" type-match="none"
variable="edition" match="all">
            <text value="is not an ARTICLE-JOURNAL, and has an EDITION"/>
          </else-if>
          <else-if type="book" variable="edition"
variable-match="none" match="all">
            <text value="is a BOOK, but has no EDITION"/>
          </else-if>
          <else-if type="chapter" variable="author" match="all">
            <text value="is a CHAPTER, and has an AUTHOR"/>
          </else-if>

It is less expressive, though. E.g. it's not possible cover the logic
encoded by something like

<if is-numeric-all="not:volume issue">

Rintze

------------------------------------------------------------------------------
Precog is a next-generation analytics platform capable of advanced
analytics on semi-structured data. The platform includes APIs for building
apps and a phenomenal toolset for data science. Developers can use
our toolset for easy data analysis & visualization. Get a free account!
http://www2.precog.com/precogplatform/slashdotnewsletter
_______________________________________________
xbiblio-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/xbiblio-devel

Reply via email to