Forum: Ruby on Rails XML Storage?

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
unknown (Guest)
on 2006-03-27 22:15
(Received via mailing list)
Hey Folks,

        Now that all the fun and games of learning Rails has almost sunk
in it's time to build something useful.  I am tasked with building a
system to control and search our large (and I mean large 1.5 million +
and
growing) photograph collection.  I have been building databases for
years
and after thinking about the situation we decided that trying to store
the
information about individual photos in a relational system is
masochistic
to say the least (the number of one-to-many as well as many-many
relations
would make it a real headache to manage).  XML to the rescue.  We could
really simplify things by creating an XML record for each photo (we will
be using modified Dublin Core www.dublincore.org for fields and
descriptions).  We have tried and failed to get a relational system to
work well - too many "what if's" and exceptions to the rules to deal
with
using a relation system.

Since this is the Rails mailing list you can assume that I would like to
do this using Rails.  However, searching high a low I cannot find a
starting point for a storage and retrieval method using Rails and XML
data.  Searching this list I see that the eXist project has been
mentioned
and I think this is the way to go (soon MySQL will have the ability to
store and query XML - but it's not there yet).  Since Ruby and Rails is
fairly new to me any pointers about conversing with eXist or any other
XML
storage solution (XML-RPC? REST? never used these so go easy) would be
greatly appreciated, also any tips or pointers about building the XML
would also be helpful.  Builder seems to be best and easiest method -
but
how to get it from builder to the database - aye there's the rub.

Once this is all figured out it could become a very powerful method for
storing and retrieving data - one XPath or XQuery and all is yours.  No
more fiddling with relations and so on - just where to start.

Thanks for any help or pointers.... Cheers.

P.S. I have, for development purposes, thought about building the XML
and
storing it in a MySQL field (the whole record is an XML document) - I am
not worried about the searching at the moment (but I could build queries
to violently rip out what I needed using regex - slow but it would
work).
But how would I build the XML from a form and slap the whole thing into
MySQL - sorry different issue than above, but again any help for this
(hopefully) temporary solution would again be greatly appreciate.


Andrew Macdonald
New Media Officer / Agent des nouveaux médias
Canada Aviation Museum / Musée de l'aviation du Canada
Phone / Téléphone : (613) 998-5689
Fax / Télécopie : (613) 990-3655
Website: www.aviation.technomuses.ca
Email: removed_email_address@domain.invalid
Brez! !. (Guest)
on 2006-03-27 22:51
> and after thinking about the situation we decided that trying to store
> the
> information about individual photos in a relational system is
> masochistic
> to say the least (the number of one-to-many as well as many-many
> relations
> would make it a real headache to manage).  XML to the rescue.  We could
> really simplify things by creating an XML record for each photo (we will
> be using modified Dublin Core www.dublincore.org for fields and
> descriptions).  We have tried and failed to get a relational system to
> work well - too many "what if's" and exceptions to the rules to deal
> with
> using a relation system.
>

Not really related to your original question - but you might consider
using RDF to describe your metadata [which can leveage DC]:

"Describing and retrieving photos using RDF and HTTP"
http://www.w3.org/TR/photo-rdf/#the-dublin

RDF can be describe in XML btw [there's also another format called N3]
Andrew Macdonald (Guest)
on 2006-03-28 00:26
> Not really related to your original question - but you might consider
> using RDF to describe your metadata [which can leveage DC]:
>
> "Describing and retrieving photos using RDF and HTTP"
> http://www.w3.org/TR/photo-rdf/#the-dublin
>
> RDF can be describe in XML btw [there's also another format called N3]

Thanks, how the data is stored is still being determined (Is the type of
Aircraft a subject? or do we make a separate field for that?).  We are
looking at RDF, EAD, even MARC for some data.  The nice thing about XML
(and its flavors) is that we can create crosswalks to move the data from
one format to the other.  Once we have a storage solution and a method
to query and pull the data out - we can create filters (crosswalks) that
will give you whatever you want.  Put Z39.50 into the mix and you have
so many posiblities to export and share the data...

Now just to get it all working.... :-)

Andrew Macdonald
This topic is locked and can not be replied to.