Index of list (2)

From: John van Terheijden (john-foobar-nl)
Date: 01/21/04


Date: Wed, 21 Jan 2004 15:05:00 +0100

Let me describe my problem again, shorter:

With Database containing ...

[
    [
        id: 1,
        name: dog,
        legs: [
            number: 4,
            size: normal
        ],
        likes: bones
    ],
    [
        id: 2,
        name: cat,
        legs: [
            number: 4,
            size: short
        ],
        hates: water
    ]
]

... I want, after "makeIndex(Database, Index)", Index to contain ...

[
    name: [
        dog: [1], % Means: top-level element of Database with id: 1 has
the value dog here
        cat: [2]
    ],
    legs: [
        number: [
            4: [1, 2] % Both elements with id 1 and 2 have value 4 here
        ],
        size: [
            normal: [1],
            short: [2]
        ]
    ],
    likes: [
        bones: [1] % Not all properties have to be present in Database,
id:1 likes bones
    ],
    hates: [
        water: [2] % and id:2 hates water
    ]
]

Note that id is not included in the index, but instead is used to refer to
the top-level elements in Database.

Any help or sugestions on writing makeIndex/2 is appreciated.

If something isn't clear, please let me know.

Thanks,

  - John



Relevant Pages

  • Re: Primary Key & Data Entry Forms
    ... I would expect that it would at least be worth having next year's show in the same database, as it would save typing many of the exhibitor's details again. ... Breed table (one record for each breed of dog), ... If you don't have an exhibitor entering in multiple shows, you can skip this and use a single table for the exhibitor info and the entry in the show. ...
    (microsoft.public.access.tablesdbdesign)
  • Re: Fast File Searching
    ... A database can be extremely fast, because you can load all of those ... ID Filename FieldValue ... 1001.txt dog ... file every time a search request came in. ...
    (microsoft.public.dotnet.csharp.general)
  • Primary Key & Data Entry Forms
    ... I am trying to create a database for entries for a dog show the following is ... same dog, if selected always 50p per additional entry), Not_For_Competition ...
    (microsoft.public.access.tablesdbdesign)
  • Database Design
    ... I am trying to create a database for dog show entries from which the base ... SEX (for use as a drop down box lookup for selection) Male, ...
    (microsoft.public.access.tablesdbdesign)
  • Re: How to make string of numbers shorter?
    ... >I need a way to somehow express this number in shorter form. ... >and decoding way to express this number as something shorter. ... Put these in a database table. ... Assign a sequence number to each of them, ...
    (alt.php)