[Clipart] SVG::Metadata Release 0.08

Bryce Harrington bryce at bryceharrington.com
Thu Jul 1 13:27:19 PDT 2004


On Thu, 1 Jul 2004, Jonadab the Unsightly One wrote:
> Bryce Harrington <bryce at bryceharrington.com> writes:
> 
> > On Mon, 28 Jun 2004, Jonadab the Unsightly One wrote:
> >> I need to clarify something: assuming the following workflow:
> >> 
> >> 1.  Create a new SVG::Metadata object
> >> 2.  Parse an SVG image with it, creating a metadata object
> >
> > Parsing just fills in the object you created in #1, not create a new
> > object.  
> 
> Ah, so if the file being uploaded is not an SVG (say, if it's a PNG or
> a tarball or something), I could just skip the parsing step...

Yup

> >> 3.  Remove existing RDF from the image
> >> 4.  Call to_rdf() on the metadata object
>    
> ... and I'd still get valid RDF here, which instead of being put into
> the SVG could be written alongside the .png or whatever with an .rdf
> extension, yes?   

Correct.  Although note that it's wrapped in <metadata> </metadata>,
which is SVG, not RDF.  We'd want to strip that out, probably.

> A couple of other tweaks would be needed; I'd have to make the
> filetest boolean, checking for either svg or rdf, so as to avoid name
> conflicts (so that we don't foo.png and foo.tar both needing foo.rdf),
> but I think the upload script should easily generalize to handle
> pretty much any type of file (except rdf, which would have a filename
> conflict with its own metadata, but I think we can live with that
> since rdf is not a common extension for clipart).

Cool.  In the future I may work on better doc management backend thingee
for us, if I have time, to handle version control, filename conflicts,
etc.  For now, this approach sounds good.

> > In future releases, as I have time, I want to replace the to_rdf()
> > routine to only emit RDF of sections it has defined values for, so
> > we don't bloat up SVG files with a lot of rarely used tags.  Longer
> > term, I also want to experiment with actually storing the loaded RDF
> > as a XML::Twig tree, and using that module to write it out.  Then,
> > in that case, it should be much closer to beings a lossless
> > operation.
> 
> If you get around to doing that before I get around to working around
> the lack of it, then I won't have to complicate the upload script ;-)

*Grin*  Okay, probably this weekend at the earliest.

> > Agreed, this is a good step to take.  I've got some routines in
> > SVG::Metadata for keyword handling, but they're not hooked up in
> > parse() and to_rdf() yet.  Once they are, you could use those for
> > doing this work.
> 
> Then I'll generalize the upload script to handle types other than SVG
> first (umm, Thursday evening maybe), and come back to this, if Alberto
> doesn't beat me to it with his nifty category-navigation thingamabob.

Okay, great.  I plan to get the keyword stuff working within the next
week (hopefully this weekend).

Bryce




More information about the clipart mailing list