- Timestamp:
- 01/25/13 11:39:25 (11 years ago)
- Location:
- SMC/trunk/SMC/src/xsl
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
SMC/trunk/SMC/src/xsl/smc2stats_datasets.xsl
r2452 r2482 40 40 <xsl:variable name="count_distinct_elems" select="count(distinct-values($cmd-terms//Term[@type='CMD_Element']/@id))" ></xsl:variable> 41 41 <xsl:variable name="count_components_datcat" select="count(distinct-values($cmd-terms//Term[@type='CMD_Component'][@datcat[not(.='')]]/@id))" ></xsl:variable> 42 42 43 <xsl:variable name="all_profiles" select="$cmd-terms//Termset" /> 43 44 44 45 <!--<xsl:template name="continue-root">--> … … 47 48 <xsl:call-template name="summary-overall"></xsl:call-template> 48 49 <xsl:call-template name="summary-profiles"></xsl:call-template> 50 <xsl:call-template name="summary-components"></xsl:call-template> 51 <xsl:call-template name="summary-datcats"></xsl:call-template> 49 52 </multiresult> 50 53 <!-- <xsl:call-template name="summary-concepts"></xsl:call-template> … … 58 61 <xsl:template name="summary-overall"> 59 62 60 <dataset key="summary" >63 <dataset key="summary" label="Summary"> 61 64 <labels> 62 <label key="creation-date">Created</label> 65 <label key="creation-date">created</label> 66 <label key="count-terms">all Terms</label> 67 <label key="profiles">Profiles</label> 68 <label key="components">Components</label> 69 <label key="distinct-components">distinct Components</label> 70 <label key="elements">Elements</label> 71 <label key="distinct-elements">distinct Elements</label> 72 73 <label key="distinct-datcats">distinct DatCats</label> 74 <label key="elems-with-datcats">Elements with DatCats</label> 75 <label key="elems-without-datcats">Elements without DatCats</label> 76 <label key="elems-without-datcats-ratio" >ratio of elements without DatCats</label> 63 77 <label key="available-concepts">available Concepts</label> 64 78 <label key="used-concepts">used Concept</label> 65 <label key="blind-concepts">blind Concepts (not in isocat)</label> 66 <label key="unused-concepts">unused Concepts</label> 67 <label key="count-terms">Term</label> 68 69 <label key="distinct-components"></label> 70 <label key="components"></label> 71 <label key="distinct-elements"></label> 72 <label key="elements"></label> 73 <label key="distinct-datcats"></label> 74 <label key="elems-with-datcats"></label> 75 <label key="elems-without-datcats"></label> 76 <label key="elems-without-datcats-ratio" ></label> 79 <label key="blind-concepts">blind Concepts (not in public ISOcat)</label> 80 <label key="unused-concepts">unused Concepts</label> 77 81 </labels> 78 <dataseries key="overall" >82 <dataseries key="overall" label="Overall"> 79 83 <value key="creation-date"><xsl:value-of select="current-date()"/></value> 80 <value key="available-concepts"><xsl:value-of select="count($dcr-terms//Concept)"/></value> 84 <value key="count-terms" ><xsl:value-of select="count($dcr-cmd-map//Term)"/></value> 85 <value key="profiles"><xsl:value-of select="count($cmd-terms//Termset)"/></value> 86 <value key="components"><xsl:value-of select="count($cmd-terms//Term[@type='CMD_Component'])"/></value> 87 <value key="distinct-components"><xsl:value-of select="$count_distinct_components"/></value> 88 <value key="elements"><xsl:value-of select="$count_elems"/></value> 89 <value key="distinct-elements"><xsl:value-of select="$count_distinct_elems"/></value> 90 <value key="elems-with-datcats"><xsl:value-of select="count(distinct-values($cmd-terms//Term[@type='CMD_Element'][@datcat[not(.='')]]/@id))"/></value> 91 <value key="elems-without-datcats"><xsl:value-of select="count(distinct-values($cmd-terms//Term[@type='CMD_Element'][@datcat='']/@id))"/></value> 92 <!--<xsl:variable name="elems-without-datcats-ratio" select="count($cmd-terms//Term[@type='CMD_Element'][@datcat='']) div $count_elems"></xsl:variable> 93 <value key="elems-without-datcats-ratio" formatted="{format-number($elems-without-datcats-ratio, '0.00 %')}"> 94 <xsl:value-of select="$elems-without-datcats-ratio"/></value>--> 95 <xsl:variable name="elems-distinct-without-datcats-ratio" select="count(distinct-values($cmd-terms//Term[@type='CMD_Element'][@datcat='']/@id)) div $count_distinct_elems"></xsl:variable> 96 <value key="elems-without-datcats-ratio" formatted="{format-number($elems-distinct-without-datcats-ratio, '0.00 %')}"> 97 <xsl:value-of select="$elems-distinct-without-datcats-ratio"/></value> 98 <value key="distinct-datcats"><xsl:value-of select="$count_distinct_datcats"/></value> 81 99 <value key="used-concepts"><xsl:value-of select="count($dcr-cmd-map//Concept)"/></value> 82 100 <value key="blind-concepts"><xsl:value-of select="count(//Concept[not(Term[@set='isocat'])])"/></value> 101 <value key="available-concepts"><xsl:value-of select="count($dcr-terms//Concept)"/></value> 83 102 <value key="unused-concepts"><xsl:value-of select="count($dcr-terms//Concept except $dcr-terms//Concept[@id=$dcr-cmd-map//Concept/@id])"/></value> 84 <value key="count-terms" ><xsl:value-of select="count($dcr-cmd-map//Term)"/></value>85 <value key="distinct-components"><xsl:value-of select="$count_distinct_components"/></value>86 <value key="components"><xsl:value-of select="count($cmd-terms//Term[@type='CMD_Component'])"/></value>87 <value key="distinct-elements"><xsl:value-of select="$count_distinct_elems"/></value>88 <value key="elements"><xsl:value-of select="$count_elems"/></value>89 <value key="distinct-datcats"><xsl:value-of select="$count_distinct_datcats"/></value>90 <value key="elems-with-datcats"><xsl:value-of select="count($cmd-terms//Term[@type='CMD_Element']/@datcat[not(.='')])"/></value>91 <value key="elems-without-datcats"><xsl:value-of select="count($cmd-terms//Term[@type='CMD_Element'][@datcat=''])"/></value>92 <xsl:variable name="elems-without-datcats-ratio" select="count($cmd-terms//Term[@type='CMD_Element'][@datcat='']) div $count_elems"></xsl:variable>93 <value key="elems-without-datcats-ratio" formatted="{format-number($elems-without-datcats-ratio, '0.00 %')}">94 <xsl:value-of select="$elems-without-datcats-ratio"/></value>95 103 </dataseries> 96 104 … … 146 154 </xsl:template> 147 155 148 149 <xsl:template name="summary-cmd">150 151 <table>152 <tbody>153 <tr><td>distinct components</td><td align="right"><xsl:value-of select="$count_distinct_components"/></td></tr>154 <tr><td>distinct standalone components</td><td align="right"><xsl:value-of select="$count_standalone_components"/></td></tr>155 <tr><td>distinct elements</td><td align="right"><xsl:value-of select="$count_distinct_elems"/></td></tr>156 <tr><td>elements with datcats </td><td align="right"><xsl:value-of select="format-number(count($cmd-terms//Term[@type='CMD_Element'][not(@datcat='')]) div $count_elems, '0.00 %')"/></td></tr>157 <tr><td>components with datcats</td><td align="right"><xsl:value-of select="$count_components_datcat"/></td></tr>158 </tbody>159 </table>160 </xsl:template>161 156 162 157 <xsl:template name="summary-profiles"> 163 158 164 <dataset key="profile s" label="Profiles" count="{count($cmd-terms//Termset)}">159 <dataset key="profile" label="Profiles" count="{count($cmd-terms//Termset)}"> 165 160 <labels> 166 161 <label key="components"></label> … … 169 164 <label key="elems-with-datcats"></label> 170 165 <label key="elems-without-datcats"></label> 171 <label key="elems-without-datcats-ratio" > </label>166 <label key="elems-without-datcats-ratio" >ratio of elements without DatCats</label> 172 167 </labels> 173 168 … … 192 187 </dataset> 193 188 </xsl:template> 194 189 190 <xsl:template name="summary-components"> 191 192 <dataset key="component" label="Components" count="{count($cmd-terms//Term[@type='CMD_Component'])}"> 193 <labels> 194 <label key="used">used in total</label> 195 <label key="profiles">used in Profiles</label> 196 <label key="components">has Components</label> 197 <label key="distinct-elems">has Elements</label> 198 <label key="elems-with-datcats">Elements with DatCats</label> 199 <label key="distinct-datcats">uses DatCats</label> 200 <label key="elems-without-datcats">Elements without DatCats</label> 201 <label key="elems-without-datcats-ratio" >ratio of elements without DatCats</label> 202 </labels> 203 204 <xsl:for-each-group select="$cmd-terms-nested//Term[@type='CMD_Component']" group-by="@id"> 205 <xsl:sort select="@name" order="ascending"/> 206 <xsl:variable name="count_usage" select="count(current-group())" ></xsl:variable> 207 <xsl:variable name="count_using_profiles" select="count(distinct-values(current-group()/ancestor::Termset/@id))" ></xsl:variable> 208 <xsl:variable name="count_distinct_elems" select="count(distinct-values(current-group()//Term[@type='CMD_Element']/@id))" ></xsl:variable> 209 <!-- <xsl:variable name="count_distinct_elem_datcats" select="count(distinct-values(current-group()//Term[@type='CMD_Element']/@datcat[not(.='')]))" ></xsl:variable>--> 210 <xsl:variable name="count_distinct_datcats" select="count(distinct-values(current-group()//Term/@datcat[not(.='')]))" ></xsl:variable> 211 212 <dataseries key="{@id}" label="{@name}" > 213 <!-- <value key="distinct-components"><xsl:value-of select="$count_distinct_components"/></value>--> 214 <value key="used"><xsl:value-of select="$count_usage"/></value> 215 <value key="profiles"><xsl:value-of select="$count_using_profiles"/></value> 216 <value key="components"><xsl:value-of select="count(distinct-values(current-group()//Term[@type='CMD_Component']/@id))"/></value> 217 <!-- <value key="distinct-elements"><xsl:value-of select="$count_distinct_elems"/></value>--> 218 <value key="distinct-elems"><xsl:value-of select="$count_distinct_elems"/></value> 219 <value key="elems-with-datcats"><xsl:value-of select="count(distinct-values(current-group()//Term[@type='CMD_Element'][@datcat[not(.='')]]/@id))"/></value> 220 <value key="distinct-datcats"><xsl:value-of select="$count_distinct_datcats"/></value> 221 <xsl:variable name="elems-without-datcats" select="count(distinct-values(current-group()//Term[@type='CMD_Element'][@datcat='']/@id))" /> 222 <value key="elems-without-datcats"><xsl:value-of select="$elems-without-datcats"/></value> 223 <xsl:variable name="elems-without-datcats-ratio" select="if ($count_distinct_elems > 0) then $elems-without-datcats div $count_distinct_elems else 0"></xsl:variable> 224 <value key="elems-without-datcats-ratio" formatted="{format-number($elems-without-datcats-ratio, '0.00 %')}"> 225 <xsl:value-of select="$elems-without-datcats-ratio"/></value> 226 </dataseries> 227 </xsl:for-each-group> 228 </dataset> 229 </xsl:template> 230 231 232 <xsl:template name="summary-datcats"> 233 234 <dataset key="datcat" label="Data Categories" count="{count($dcr-cmd-map//Concept)}"> 235 <labels> 236 <label key="def">Definition</label> 237 <label key="used-in-profiles">used in Profiles</label> 238 <label key="referenced-by-elements">referenced by Elements</label> 239 </labels> 240 241 242 <!--<Term set="cmd" type="full-path" schema="clarin.eu:cr1:p_1297242111880" 243 id="#applicationType">AnnotationTool.applicationType</Term>--> 244 <xsl:for-each select="$dcr-cmd-map//Concept" > 245 <xsl:sort select="lower-case(Term[@type='label'][1])" order="ascending"/> 246 247 <xsl:variable name="def" select="$dcr-terms//Concept[@id=current()/@id]/info[1]" ></xsl:variable> 248 <xsl:variable name="count_elems" select="count(Term[@type='full-path'])" ></xsl:variable> 249 <xsl:variable name="profiles" select="distinct-values(Term[@type='full-path']/@schema)" ></xsl:variable> 250 251 <dataseries key="{@id}" label="{Term[@type='label'][1]}" > 252 <!-- <value key="distinct-components"><xsl:value-of select="$count_distinct_components"/></value>--> 253 254 <value key="def"><xsl:value-of select="$def"/></value> 255 <value key="used-in-profiles" abs="{count($profiles)}" > 256 <list> 257 <xsl:for-each select="$profiles" > 258 <xsl:variable name="profile-name" select="$all_profiles[@id=current()]/@name"></xsl:variable> 259 <li><a href="#{.}" ><xsl:value-of select="$profile-name" /></a></li> 260 </xsl:for-each> 261 </list> 262 </value> 263 <value key="referenced-by-elements"><xsl:value-of select="$count_elems"/></value> 264 </dataseries> 265 </xsl:for-each> 266 </dataset> 267 <!-- 268 <table> 269 270 <thead><tr><th rowspan="2">id</th><th rowspan="2">name</th> 271 <th colspan="3" >count </th><th rowspan="2">elems</th></tr> 272 <tr><th>profile*</th><th >all*</th><th>elems</th> </tr> </thead> 273 <tbody> 274 <xsl:for-each-group select="$term_matrix/Term" group-by="@datcat"> 275 <xsl:sort select="lower-case(@datcat)" order="ascending"/> 276 <tr><td valign="top"><xsl:value-of select="my:shortURL(@datcat)"/></td> 277 <td valign="top"><xsl:value-of select="my:rewriteURL(@datcat)"/></td> 278 <td valign="top" align="right"> 279 <span class="term_detail_caller" ><xsl:value-of select="count(distinct-values(current-group()/@profile))"/></span> 280 <div class="term_detail" > 281 <div class="box_heading"><xsl:value-of select="my:rewriteURL(@datcat)"/></div> 282 <ul> 283 <xsl:for-each select="distinct-values(current-group()/@profile)" > 284 <li><xsl:value-of select="." /></li> 285 </xsl:for-each> 286 </ul> 287 </div> 288 </td> 289 <td valign="top" align="right"> 290 <span class="term_detail_caller" ><xsl:value-of select="count(current-group())"/></span> 291 <div class="term_detail" > 292 <div class="box_heading"><xsl:value-of select="my:rewriteURL(@datcat)"/></div> 293 <ul> 294 <xsl:for-each-group select="current-group()" group-by="@profile" > 295 <li><xsl:value-of select="@profile" /> 296 <ul> 297 <xsl:for-each select="current-group()/@comppath" > 298 <li><xsl:value-of select="." /></li> 299 </xsl:for-each> 300 </ul> 301 </li> 302 </xsl:for-each-group> 303 </ul> 304 </div> 305 </td> 306 <td valign="top" align="right"><xsl:value-of select="count(distinct-values(current-group()/@elem))"/></td> 307 308 <td width="40%"> 309 <xsl:for-each select="distinct-values(current-group()/@elem)"> 310 <xsl:sort select="." /> 311 <xsl:value-of select="."/>, 312 </xsl:for-each> 313 </td> 314 </tr> 315 </xsl:for-each-group> 316 </tbody> 317 </table>--> 318 </xsl:template> 319 320 195 321 <!-- 196 322 <table> … … 278 404 </div> 279 405 </xsl:template>--> 280 <!--281 <xsl:template name="list-datcats">282 283 <table>284 <caption>DatCats |<xsl:value-of select="count(distinct-values($term_matrix/Term/@datcat))" />| <span class="note">* Click on numbers to see detail </span></caption>285 <thead><tr><th rowspan="2">id</th><th rowspan="2">name</th>286 <th colspan="3" >count </th><th rowspan="2">elems</th></tr>287 <tr><th>profile*</th><th >all*</th><th>elems</th> </tr> </thead>288 <tbody>289 <xsl:for-each-group select="$term_matrix/Term" group-by="@datcat">290 <xsl:sort select="lower-case(@datcat)" order="ascending"/>291 <tr><td valign="top"><xsl:value-of select="my:shortURL(@datcat)"/></td>292 <td valign="top"><xsl:value-of select="my:rewriteURL(@datcat)"/></td>293 <td valign="top" align="right">294 <span class="term_detail_caller" ><xsl:value-of select="count(distinct-values(current-group()/@profile))"/></span>295 <div class="term_detail" >296 <div class="box_heading"><xsl:value-of select="my:rewriteURL(@datcat)"/></div>297 <ul>298 <xsl:for-each select="distinct-values(current-group()/@profile)" >299 <li><xsl:value-of select="." /></li>300 </xsl:for-each>301 </ul>302 </div>303 </td>304 <td valign="top" align="right">305 <span class="term_detail_caller" ><xsl:value-of select="count(current-group())"/></span>306 <div class="term_detail" >307 <div class="box_heading"><xsl:value-of select="my:rewriteURL(@datcat)"/></div>308 <ul>309 <xsl:for-each-group select="current-group()" group-by="@profile" >310 <li><xsl:value-of select="@profile" />311 <ul>312 <xsl:for-each select="current-group()/@comppath" >313 <li><xsl:value-of select="." /></li>314 </xsl:for-each>315 </ul>316 </li>317 </xsl:for-each-group>318 </ul>319 </div>320 </td>321 <td valign="top" align="right"><xsl:value-of select="count(distinct-values(current-group()/@elem))"/></td>322 323 <td width="40%">324 <xsl:for-each select="distinct-values(current-group()/@elem)">325 <xsl:sort select="." />326 <xsl:value-of select="."/>,327 </xsl:for-each>328 </td>329 </tr>330 </xsl:for-each-group>331 </tbody>332 </table>333 </xsl:template>-->334 406 335 407 </xsl:stylesheet> -
SMC/trunk/SMC/src/xsl/smc_functions.xsl
r2437 r2482 280 280 </xsl:function> 281 281 282 283 <!-- taken from cmd2graph.xsl --> 284 <xsl:function name="my:normalize"> 285 <xsl:param name="value" /> 286 <xsl:value-of select="translate($value,'*/-.'',$@={}:[]()#>< ','XZ__')" /> 287 </xsl:function> 282 288 283 289 </xsl:stylesheet>
Note: See TracChangeset
for help on using the changeset viewer.