A famous Portuguese Perl hacker, author of the recent Acme::AsciiArt2HtmlTable module and I have been pondering the best way to classify the shapes in Acme::EyeDrops module to make them more amenable to searching and selecting.

You see, he wants, for example, to select from the many shapes available, only the faces of Perl celebrities.

I'm struggling a bit, not having much experience in this field. My first instinct was to look at the web site of a famous British Perl hacker to learn how to search his magnificent photo collection. acme seems to use some sort of keyword search, but when I typed in "perl celebrity" I was told to "Please come back later" in eight different languages.

My next instinct was to steal an idea I remember from Subversion, that of allowing arbitrary "properties" (key-value pairs), aka metadata, to be associated with a file.

And that is what I plan on implementing. That is, to allow any number of arbitrary properties to be associated with a shape. For example:

merlyn: name=Randal L Schwartz face=1 person=1 perlcelebrity=1 smiley: face=1 buffy: face=1 person=1 kermit: face=1 cartoon=1 camel: animal=1
That way, given a shape property hash reference $p, you can find all faces (even smileys and kermit) by testing each shape for:
$p->{face}
while if you only wanted human faces you would use instead:
$p->{face} && $p->{person}
and if you wanted only human Perl celebrity faces you would use instead:
$p->{face} && $p->{person} && $p->{perlcelebrity}

It seems to me the idea of attaching arbitrary properties to a file (shape, photo, whatever) is generally useful but I have little experience in this domain and little clue on how to define what the properties or keywords should be.

My current candidate property list for my shapes is:

name Name of the person in the shape cpanid cpanid of the person in the shape description description of the shape author author of the shape (ascii art) authorcpanid cpan id of the author of the shape source photo that the shape was derived from face is it a face? person is it a person? animal is it an animal? flag is it a flag? map is it a map? hbanner is it a horizontal banner? vbanner is it a vertical banner? object is it an object? (a beer bottle, say) planet is it a planet? underwear is it an item of underwear? cartoon is it a cartoon character? perlcelebrity is it a famous perl hacker?
So, if you have some bright ideas on how to tackle this problem, please let us know.


In reply to Properties, metadata and Perl celebrities by eyepopslikeamosquito

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.