SMW 3.0: Rework List format?

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

SMW 3.0: Rework List format?

Semantic Mediawiki - User mailing list
Hello.

TL;DR: I'd like to rework the List format. Join the discussion at https://github.com/SemanticMediaWiki/SemanticMediaWiki/issues/2488.

SMW 3.0 is coming up ([0]). This will be a major new version ([1]) allowing to introduce breaking changes. Making such changes should certainly not be an end to itself. Still, a major release provides an opportunity to introduce new features and clean-up cruft that will probably not come too soon again (SMW 2.0 was released three years ago).

With that intro, do you think it would be a good idea to rework the list format?

Here is what I would like to see:

Separate separators for values, properties and result "rows".
E.g. three separators (sep=,, propsep=;, valuesep=/) could produce the following result:

United States of America (Cities Washington / New York / Los Angeles; Neighbors Canada / Mexico), United Kingdom (Cities London / Glasgow / Manchester; Neighbors Ireland), France (Cities Paris / Marseille / Bordeaux; Neighbors Belgium / Luxemburg / Germany / Switzerland / Italy / Spain), and Germany (Cities Berlin / Frankfurt / Hamburg; Neighbors Poland / Czechia / Austria / Switzerland / France / Belgium / Luxemburg / Netherlands / Denmark)

This would also benefit the subformats (ol, ul, template, tree (in SRF))

A simpler logic of when which separator is used.
This is currently handled in [ListResultPrinter.php](https://github.com/SemanticMediaWiki/SemanticMediaWiki/blob/master/includes/queryprinters/ListResultPrinter.php#L239) and is rather confusing. I'd just reduce this to a default value ,, that may be overridden by parser function parameters. The default values should be defined in i18n messages.

Remove the final list separator (", and").
It has been gone for a while due to a bug and apparently nobody noticed.

Make the template format an alias of the list format.
When the user supplies a parser function parameter template, then just assume they want it used, even for format=list. And inversely if format=template, but the parser function parameter template is missing or empty, just print a normal list.

Rename/standardize parameters to templates.

E.g. all standard parameters start with a #:
- smw-resultquerycondition => #querycondition
- smw-resultquerylimit => #querylimit
- smw-resultqueryoffset => #resultoffset
- new: #resultcount

Add class attribute to HTML elements.
To facilitate styling.

General code clean-up and removal of legacy/deprecated functionality
To make it easier to subclass and test the list format.

What else?

Please join the discussion on GitHub (https://github.com/SemanticMediaWiki/SemanticMediaWiki/issues/2488).

Cheers
Stephan

[0] https://github.com/SemanticMediaWiki/SemanticMediaWiki/milestone/6
[0] http://semver.org/
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Semediawiki-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/semediawiki-user
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [SMW-devel] SMW 3.0: Rework List format?

Markus Krötzsch-2
Hi,

Just briefly: I support the suggested changes. Much of the current code
has been kept for legacy reasons and one can surely streamline and
systematize things now using all the experience gathered over the years.

Cheers,

Markus


On 14.06.2017 22:12, Stephan Gambke via Semediawiki-devel wrote:

> Hello.
>
> *TL;DR:* I'd like to rework the List format. Join the discussion at
> https://github.com/SemanticMediaWiki/SemanticMediaWiki/issues/2488.
>
> SMW 3.0 is coming up ([0]). This will be a major new version ([1])
> allowing to introduce breaking changes. Making such changes should
> certainly not be an end to itself. Still, a major release provides an
> opportunity to introduce new features and clean-up cruft that will
> probably not come too soon again (SMW 2.0 was released three years ago).
>
> With that intro, do you think it would be a good idea to rework the
> |list| format?
>
> Here is what I would like to see:
>
> *Separate separators for values, properties and result "rows".*
> E.g. three separators (|sep=,|, |propsep=;|, |valuesep=/|) could produce
> the following result:
>
>     United States of America (Cities Washington / New York / Los
>     Angeles; Neighbors Canada / Mexico), United Kingdom (Cities London /
>     Glasgow / Manchester; Neighbors Ireland), France (Cities Paris /
>     Marseille / Bordeaux; Neighbors Belgium / Luxemburg / Germany /
>     Switzerland / Italy / Spain), and Germany (Cities Berlin / Frankfurt
>     / Hamburg; Neighbors Poland / Czechia / Austria / Switzerland /
>     France / Belgium / Luxemburg / Netherlands / Denmark)
>
> This would also benefit the subformats (|ol|, |ul|, |template|, |tree|
> (in SRF))
>
> *A simpler logic of when which separator is used.*
> This is currently handled in ListResultPrinter.php
> <https://github.com/SemanticMediaWiki/SemanticMediaWiki/blob/master/includes/queryprinters/ListResultPrinter.php#L239>
> and is rather confusing. I'd just reduce this to a default value |,|,
> that may be overridden by parser function parameters. The default values
> should be defined in i18n messages.
>
> *Remove the final list separator (", and").*
> It has been gone for a while due to a bug and apparently nobody noticed.
>
> *Make the template format an alias of the list format.*
> When the user supplies a parser function parameter |template|, then just
> assume they want it used, even for |format=list|. And inversely if
> |format=template|, but the parser function parameter |template| is
> missing or empty, just print a normal list.
>
> *Rename/standardize parameters to templates.*
>
> E.g. all standard parameters start with a |#|:
>
>   * |smw-resultquerycondition| => |#querycondition|
>   * |smw-resultquerylimit| => |#querylimit|
>   * |smw-resultqueryoffset| => |#resultoffset|
>   * new: |#resultcount|
>
> *Add class attribute to HTML elements.*
> To facilitate styling.
>
> *General code clean-up and removal of legacy/deprecated functionality*
> To make it easier to subclass and test the |list| format.
>
> What else?
>
>
>
> Please join the discussion on GitHub
> (https://github.com/SemanticMediaWiki/SemanticMediaWiki/issues/2488).
>
> Cheers
> Stephan
>
>
> [0] https://github.com/SemanticMediaWiki/SemanticMediaWiki/milestone/6
> [0] http://semver.org/
>
>
> ------------------------------------------------------------------------------
> Check out the vibrant tech community on one of the world's most
> engaging tech sites, Slashdot.org! http://sdm.link/slashdot
>
>
>
> _______________________________________________
> Semediawiki-devel mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/semediawiki-devel
>


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Semediawiki-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/semediawiki-user
Loading...