Re: XML, Topic Maps and Everything (was Re: [xml-dev] Relationships [was RE: James Clark: XML versus the Web]

Jan Schreiber <[email protected]>
Newsgroups gmane.text.xml.xtm.general,gmane.text.xml.devel
Message-ID <[email protected]>
Hi Andrew,

thanks for your great post! I've done some work with TMRM earlier, so this was very interesting.

> <snip>
> Each label is a symbol referencing another Subject Proxy, and all you need to do to declare a Subject Proxy is reference it.

I never got that right. Where does TMRM say that a reference to a proxy is enough to declare a proxy? For some reasons, I always thought that I only can use declared proxies as property values... This works fine until you try to interpret the result of some path expressions as a subject map.

> <snip>
> For example, you could represent the TMRM specification itself very simply in JSON as:

Cool. My libtmrm [1] (early alpha and probably no longer maintained) used YAML to import and export subject maps. I put a lot of effort in libtmrm to limit the number of proxies referenced in my ledgend. In the YAML import, there is only one "magic" proxy, libtmrm_bottom which is used for bootstrapping. Based on this proxy, I defined a little bootstrap-ontology that gives me type, instance, superclass and subclass proxies and some metainformation about the bootstrap ontology:

---
subject_map: 'bootstrap'
proxies:
    libtmrm_bottom: {libtmrm_bottom: libtmrm_bottom}
    ontology: {libtmrm_bottom: 'libtmrm:ontology'}
    ontology_version_major: {libtmrm_bottom: 'libtmrm:ontology-version-major'}
    ontology_version_minor: {libtmrm_bottom: 'libtmrm:ontology-version-minor'}
    bootstrap:
        ontology: 'bootstrap'
        ontology_version_major: 0
        ontology_version_minor: 1
    superclass: {libtmrm_bottom: 'libtmrm:superclass'}
    subclass: {libtmrm_bottom: 'libtmrm:subclass'}
    type: {libtmrm_bottom: 'libtmrm:type'}
    instance: {libtmrm_bottom: 'libtmrm:instance'}
...

Every time you create a new subject map, this boot strap ontology is automatically imported. libtmrm caches the proxies for superclass, subclass, type and instance and uses them as part of the path expressions. Internally, labels are just integers (or they could even be memory addresses if the subject map was kept in memory). Libtmrm uses the bootstrap-proxy and the literal values e.g. 'libtmrm:superclass' to query for the subclass proxy. The bootstrap proxy always has the internal label 0. Otherwise there are no special proxies known to the library. 

I'm not sure if this makes sense anymore, it's probably not the right way to go. Declaring a proxy by referencing it would change a lot...

- Jan


[1] http://code.google.com/p/libtmrm
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.