Hi all, a feature announcement: the next version of SMW will allow you to control the appearance of printouts in queries in various new ways. Printouts are statements of the form "?Property" (or similar) in #ask queries. In table format, a printout leads to a new column.
One would often like to attach further parameters to printouts to control
their appearance, but #ask supported parameters only for the whole query so
far. This has changed, and it is now possible to add further parameters to a
printout by writing them in the form "|+ parameter=value" after the printout.
The following example illustrates the parameters supported so far:
{{#ask: [[Category:Country]]
|?name |+ limit=1
|?Category |+ order=ascending
|?population |+ align=right
|?president |+ index=1
}}
Here we have 4 printouts with one parameter each. The meaning is as follows:
* The parameter "limit" restricts the number of values that will be shown (a
country might have multiple alternative names, but we want to see only one
here).
* The parameter "order" causes the values to be orders. Possible values are
"ascending"/"asc" and "descending"/"desc". The default is unordered. Note that
this works also for category printouts.
* "align" is an example of a parameter that is specific to a format: when used
in tables, the respective column will be aligned as indicated. Possible values
are "left" (default), "right", and "center". This is useful here since numbers
are more readable when right-aligned.
* The parameter "index" is used to address single fields in multi-valued
properties. Imagine that "president" is a multi-valued property with entries
of the form "name; begin of office; end of office." We only want to see the
names here, and hence we state "index=1" ("index=2" would show only the begin
of office etc.).
The new feature is not perfect yet, and especially the parameters are not
supported by Special:Ask at the moment, so they are lost when clicking further
results. Moreover, "limit" is not always acting as desired: since the datatype
of the property that is used here is still some multi-valued type, many query
printers will not recognize the datatype of the selected component properly.
For example, you cannot have a timeline based on the second component of the
"president" property, since timeline looks for "Type:Date" and does not find
it in the property "president". "index" should still be a useful feature, e.g.
for templated formatting of multi-valued properties.
Cheers,
Markus
--
Markus Krötzsch <[email protected]>
* Personal page: http://korrekt.org
* Semantic MediaWiki: http://semantic-mediawiki.org
* Semantic Web textbook: http://semantic-web-book.org
--
signature.asc
Description: This is a digitally signed message part.
------------------------------------------------------------------------------ Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day trial. Simplify your report design, integration and deployment - and focus on what you do best, core application coding. Discover what's new with Crystal Reports now. http://p.sf.net/sfu/bobj-july
_______________________________________________ Semediawiki-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/semediawiki-devel
