Re: [xsl] Free Boredom Relief ...

Subject: Re: [xsl] Free Boredom Relief ...
From: ac <ac@xxxxxxxxxxxxx>
Date: Mon, 11 Oct 2010 01:59:22 -0400
Hi Gannon,

As a possible first draft, this is just a primitive "quick and dirty" HTML bullet list summary of your rdf file (http://www.dnaos.com/samples.html), which I just put up as a temporary dummy page, for discussion and consideration. What else did you have in mind?

Note that based solely on your rdf file content, this drops non-members (e.g. "High Seas") but would support more trade groups.

The main template I used is

<xsl:template match="dct:coverage">
<p class="left">
Trade Groups<br/>
<xsl:variable name="world" select="."/>
<ul class="grp">
<xsl:for-each select="distinct-values(admin1/@rdfs:label)">
<xsl:variable name="trade-group" select="$world/admin1[@rdfs:label eq current()][1]"/>
<xsl:variable name="trade-group-id" select="substring($trade-group/@dcam:memberOf, 2)"/>
<xsl:variable name="countries" select="(distinct-values($world/admin1[@rdfs:label eq current()]/admin2[string(dbp:Seat_of_Government/dct:title[@xml:lang eq 'en'])]/@rdfs:label))"/>
<li class="src"><b><xsl:value-of select="$trade-group-id"/></b>: <xsl:value-of select="string-join((., $trade-group/@rdf:type, '::', string(count($countries)), 'Countries' ), ' ')"/></li>
<ul class="grp">
<xsl:variable name="trade-group-name" select="."/>
<xsl:for-each select="$countries">
<xsl:variable name="trading-country-name" select="."/>
<xsl:variable name="trading-country-states" select="$world/admin1[@rdfs:label eq $trade-group-name][admin2/@rdfs:label eq current()]"/>
<xsl:for-each select="$trading-country-states[1]">
<xsl:variable name="trading-country-id" select="substring(admin2/@dcam:memberOf, 2)"/>
<xsl:variable name="membership" select="if (matches(dcam:memberOf, 'Full Member')) then 'Full' else if (matches(dcam:memberOf, 'Candidate Member')) then 'Candidate' else 'No'"/>
<xsl:for-each select="admin2/dbp:Seat_of_Government">
<li class="src"><xsl:value-of select="concat($trading-country-name, ' (', $trading-country-id, '), ', if (string(dct:title[@xml:lang eq 'en'])) then concat(dct:title[@xml:lang eq 'en'], ', [lat:', geo:lat, ', lon:', geo:lon, ', ', dbp:UTC, '], ') else '', 'Member: ', $membership, ' :: ', string(count($trading-country-states)), ' States')"/></li>
<ul class="grp">
<xsl:for-each select="$trading-country-states">
<xsl:for-each select="admin2/admin3">
<li class="src"><xsl:value-of select="concat(@rdfs:label, ' [', @dcam:memberOf, ']')"/></li>
</xsl:for-each>
</xsl:for-each>
</ul>
</xsl:for-each>
</xsl:for-each>
</xsl:for-each>
</ul>
</xsl:for-each>
</ul>
</p>
</xsl:template>


Regards,
ac



I'm trying to float an idea with the W3C eGOV IG and have an XML file begging for clever XSLT presentations.

Consensus in particular, and metadata in general breaks Relativity. When a Government issues a number (a statistic), it takes 24 hours (forward) for the world to see and a second or so (forward) for the Consensus to go back to the Government. Quantum Mechanics has particle and wave flavors, and you solve this one with waves. You compute a virtual arrival time so that the information seems to arrive at the entities in alphabetical order, then they are encouraged to shut up until it's time to vote. It sounds harder than it is (sorry). Short story: this eliminates the need for latitude and longitude when publishing statistics (they have bad personal privacy side-effects).

I posted an XML data file, and an explanation.
http://lists.w3.org/Archives/Public/public-egov-ig/2010Oct/0021.html

This has the structure of the EU, with all countries and known subdivisions. You can use XSLT to make an envelope for statistics (the inner-most<data>).

Any comments welcome, but I just get the digest so forgive me if I don't answer for 24 Hours + 1 Second.

--Gannon

Current Thread