Staticfree Blog

Back to the main blog

Mon, 15 Mar 2004

Lojban ↔ RDF translation

I'm certainly not the first to come up with this idea, but I think it would be pretty swell to have a LojbanRDF converter. (For those playing along at home, unaware of what I'm babbling about, I'll try and make it understandable to as wide an audience as I can).

Lojban and RDF are more alike than you might imagine. One is a constructed spoken language intended to convey ideas clearly and unambiguously, while the other is a machine-readable language for describing things and ideas. Save the "spoken" bit, they're both of the same mindset: create a way to communicate (between people, machines, whatever) without all the crap that makes communication confusing.

There are a few levels to this. First off, to the skeptics: of course one cannot directly translate any arbitrary RDF to Lojban. Both Lojban and RDF provide languages for discussing objects and ideas. However, the meaning of those languages is up to the user to interpret (but is clearly defined in dictionaries and namespace declarations). So, besides the semantics of parsing the two languages, the real meat of a project working with the two is a mapping, a translation.

The best example of this that I can immediately think of is a Lojban mapping of the FOAF namespace. Consider, for example:

RDF


  <foaf:Person rdf:ID="steve">
    <foaf:name>Steve Pomeroy</foaf:name>
    <foaf:knows>
      <foaf:Person>
         <foaf:name>Carolyn</foaf:name>
      </foaf:Person>
    </foaf:knows>
  </foaf:Person>

The English equivalent would be something like, "I am describing a person (#steve). #steve's name is Steve Pomeroy. #steve knows a person named Carolyn.". The next step is to do a similar mapping into Lojban. For this, we will use the Lojban "se slabu" (which translates to "is old/familiar/well-known to", "prenu" which means "is a person" and "cmene" for name. For convenience, I'm translating the RDF identifier rdf:ID="steve" (which can be expressed as "#steve") to the Lojban "la stiv".

Lojban

la stiv. prenu .ije la stiv.se cmene zoi gy. Steve Pomeroy gy. .ije la stiv. se slabu da .ije da prenu .ije da se cmene zoi gy. Carolyn gy.

This parses, using the ever-handy jbofihe, to:

[1(2[prenu1 (person(s)) :] la stiv. [NAME])2 [is, does] <<3prenu being person(s)>>3]1 .i `.' je and [4(5[cmene2 (named thing(s)) :] la stiv. [NAME])5 [is, does] <<6se cmene being named>>6 (7[cmene1 (name(s)) :] zoi gy Steve Pomeroy gy ?)7]4 .i `.' je and [8(9[slabu2 (observer) :] la stiv. [NAME])9 [is, does] <<10se slabu being observer(s) of familiarity>>10 (11[slabu1 (familiar thing(s)) :] da X)11]8 .i `.' je and [12(13[prenu1 (person(s)) :] da X)13 [is, does] <<14prenu being person(s)>>14]12 .i `.' je and [15(16[cmene2 (named thing(s)) :] da X)16 [is, does] <<17se cmene being named>>17 (18[cmene1 (name(s)) :] zoi gy Carolyn gy ?)18]15

You should be able to see that this isn't any where as optimized a way of saying it as possible (it doesn't make use of Lojban's subject context), but it conveys the exact same information as the RFD encoding (keeping things like "#steve" ≡ "la stiv." in mind).

The first step is to create a framework for creating direct translations between the two. Starting out with simple namespaces that can be directly mapped, as was shown above. Mappings should probably be encoded in RDF in order to please the sick and twisted. Eventually, features of Lojban and RDF will have to be taken into account and then translated/transformed. Logical constructors could be used for sequences, subjects can be omitted when redundant, etc.

trackback enabled

Comments

Re: Lojban ↔ RDF translation

arj @ Sun, 25 Apr 2004 11:57

You forgot to AND the sentences together with .ije. Without that, "da" gets reassigned each time.

Re:

Xavier @ Sun, 25 Apr 2004 14:41

whoops. Thanks.

Re: Lojban ↔ RDF translation

godnoble @ Sun, 25 Apr 2004 15:24

Why does this post keep reappearing on your LJ feed?

Re:

Xavier @ Sun, 25 Apr 2004 16:50

Because LJ's feed processing code isn't so smart sometimes. I've updated the contents of it, and so it should only change LJ's copy of the contents of it, not repost it. Sorry 'bout that.

Re: Lojban ↔ RDF translation

care @ Sun, 25 Apr 2004 20:14

just a point... you're one of those hardcore "use the LJ cut!" people... and I know you don't post these individually to LJ, but this is over a page on my screen, and you how high res it is, and I keep my browser window full screen. Just sayin'.