--csgZZokDzjk698W/
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

Austin Ziegler (austin / halostatue.ca) wrote:

> On Sat, 4 Oct 2003 00:17:01 +0900, Eric Hodel wrote:
> > Ruby <--> XML seems to be a poor fit, it seems XML will quickly become
> > too verbose with all the exceptions and having to resort to XPath (I've
> > seen several posts that say "oh, we'll have to use XPath for that", and
> > that wouldn't make me very happy).  Ruby <--> RDF would be a better fit,
> > especially if used as a serialization format.
> 
> I'm not sure I understand what you're saying, especially as RDF is an XML
> format.

The biggest problem I've seen above is that XML documents are just being
made up without any schemas or relationships to other documents.  The
best thing about XML is the namespaces, because you can write <clothing:tie/>
and <rope:tie/> and know that the two are different contexts.  (Even
though nobody seems to do that, which is a real shame.)

Unfortunately, there's no way to tell what way two different namespaces
are related to each other, and this is where RDF comes in.

RDF has an XML serialization format, but you can store RDF in any format
you want.  RDF's strength is its focus on relationships, and what you
can infer from the ones given.  Here's some RDF in subject, predicate,
object triples:

<urn:person:Sandra> -> name    -> Sandra
<urn:person:Sandra> -> gender  -> female
<urn:person:Sandra> -> sibling -> <urn:person:Kevin>
<urn:person:Kevin>  -> name    -> Kevin
<urn:person:Kevin>  -> gender  -> male
<urn:person:Kevin>  -> parent  -> <urn:person:Sarah>
<urn:person:Sarah>  -> name    -> Sarah
<urn:person:Sarah>  -> gender  -> female

With this data, you can easily infer that:

Sandra has a brother.
Sandra's mother's name is Sarah.
Sarah has at least two children.

And since everything can be given a namespace that maps back to the
basic RDF types, you can easily pass this information in and out of
other systems, and everybody will know what you are talking about.

Specifically, serializing Ruby objects in XML is a waste if only Ruby
can understand the generated XML.  Nobody else can understand the
relationships and easily use them into other systems.  Using RDF, the
relationships are easily parseable for use in other systems, making
them interoperable without pain.  

> I've had good results with the use of REXML for XML processing. I don't do a
> lot with XML, but I can't fault the API for that. REXML can, of course, be
> used in either "DOM" or stream/SAX mode, and if the DOM mode is too verbose
> for the purposes of processing, then the SAX mode can help -- I think.

Yes, I agree everything I've done with REXML has been straightforward
and simple.  I'm just pointing out that throwing XML into the midst of
things isn't going to necessarily give you any direct gains without a
bit of thought.

-- 
Eric Hodel - drbrain / segment7.net - http://segment7.net
All messages signed with fingerprint:
FEC2 57F1 D465 EB15 5D6E  7C11 332A 551C 796C 9F04


--csgZZokDzjk698W/
Content-Type: application/pgp-signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.2 (FreeBSD)

iD8DBQE/fefIMypVHHlsnwQRArW0AKDWL0+tgphCc+dwKTmfNJlOMr/TvgCfYeu6
5KSm56F1oH/Z7oEwen9mCRMhX
-----END PGP SIGNATURE-----

--csgZZokDzjk698W/--