sorting internal objects

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

sorting internal objects

Mirjam Beyer
Hello all,
 
I have a problem with my internal objects. I would like to list all internal objects of one Page in the same order they are listed on these page. It works fine with an easy ask-query, when I have only 9 internal objects. I get:
 
Carrot cake#1
Carrot cake#2
Carrot cake#3

usw.
 
But when I have more than 9:
 
Carrot cake#1
Carrot cake#10
Carrot cake#11
Carrot cake#2
Carrot cake#3

 
But I need 1, 2, 3,…,10,11. Any idea what I can do?
 
Thanks for help,
 
Mirjam

------------------------------------------------------------------------------
Managing the Performance of Cloud-Based Applications
Take advantage of what the Cloud has to offer - Avoid Common Pitfalls.
Read the Whitepaper.
http://pubads.g.doubleclick.net/gampad/clk?id=121054471&iu=/4140/ostg.clktrk
_______________________________________________
Semediawiki-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/semediawiki-user
Reply | Threaded
Open this post in threaded view
|

Re: sorting internal objects

Yaron Koren-2
Hi Mirjam,

My guess is that you're using version 0.7 or lower of SIO. If you update to
a later version (ideally the latest one), the names will be padded to three
digits, like "#001", to improve the sorting.

By the way, if this sorting thing is important to you, you shouldn't
upgrade SMW, because with a later version of SMW, SIO will store data using
#subobject, which means that object names will contain random hashes, not
ordered strings. It's something I've been planning to change in SIO,
because I do think it's nice to be able to sort the values.

-Yaron


On Fri, Feb 21, 2014 at 11:00 AM, Mirjam Beyer <[hidden email]> wrote:

> Hello all,
>
> I have a problem with my internal objects. I would like to list all
> internal objects of one Page in the same order they are listed on these
> page. It works fine with an easy ask-query, when I have only 9 internal
> objects. I get:
>
> Carrot cake#1
> Carrot cake#2
> Carrot cake#3
> ...
> usw.
>
> But when I have more than 9:
>
> Carrot cake#1
> Carrot cake#10
> Carrot cake#11
> Carrot cake#2
> Carrot cake#3
> ...
>
> But I need 1, 2, 3,...,10,11. Any idea what I can do?
>
> Thanks for help,
>
> Mirjam
>
>
> ------------------------------------------------------------------------------
> Managing the Performance of Cloud-Based Applications
> Take advantage of what the Cloud has to offer - Avoid Common Pitfalls.
> Read the Whitepaper.
>
> http://pubads.g.doubleclick.net/gampad/clk?id=121054471&iu=/4140/ostg.clktrk
> _______________________________________________
> Semediawiki-user mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/semediawiki-user
>



--
WikiWorks · MediaWiki Consulting · http://wikiworks.com
------------------------------------------------------------------------------
Managing the Performance of Cloud-Based Applications
Take advantage of what the Cloud has to offer - Avoid Common Pitfalls.
Read the Whitepaper.
http://pubads.g.doubleclick.net/gampad/clk?id=121054471&iu=/4140/ostg.clktrk
_______________________________________________
Semediawiki-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/semediawiki-user
Reply | Threaded
Open this post in threaded view
|

Re: sorting internal objects

Sal Quintanilla
In reply to this post by Mirjam Beyer
That is an excellent question, and I'd like to add a related question that you reminded me to ask.

It's somewhat useful to be able to move internal objects while editing them in a form using {{{for template|dumbform|multiple}}}.  But it would be much more useful if that re-ordering were reflected in an ask-query, given no sort parameter (or maybe a special parameter indicating "in-article-order").   Is that already possible, and if not, can some clever way to achieve that functionality be added?

-----Original Message-----
From: Mirjam Beyer [mailto:[hidden email]]
Sent: Friday, February 21, 2014 8:01 AM
To: [hidden email]
Subject: [Semediawiki-user] sorting internal objects

Hello all,
 
I have a problem with my internal objects. I would like to list all internal objects of one Page in the same order they are listed on these page. It works fine with an easy ask-query, when I have only 9 internal objects. I get:
 
Carrot cake#1
Carrot cake#2
Carrot cake#3

usw.
 
But when I have more than 9:
 
Carrot cake#1
Carrot cake#10
Carrot cake#11
Carrot cake#2
Carrot cake#3

 
But I need 1, 2, 3,…,10,11. Any idea what I can do?
 
Thanks for help,
 
Mirjam

------------------------------------------------------------------------------
Managing the Performance of Cloud-Based Applications Take advantage of what the Cloud has to offer - Avoid Common Pitfalls.
Read the Whitepaper.
http://pubads.g.doubleclick.net/gampad/clk?id=121054471&iu=/4140/ostg.clktrk
_______________________________________________
Semediawiki-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/semediawiki-user


------------------------------------------------------------------------------
Managing the Performance of Cloud-Based Applications
Take advantage of what the Cloud has to offer - Avoid Common Pitfalls.
Read the Whitepaper.
http://pubads.g.doubleclick.net/gampad/clk?id=121054471&iu=/4140/ostg.clktrk
_______________________________________________
Semediawiki-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/semediawiki-user
Reply | Threaded
Open this post in threaded view
|

Re: sorting internal objects

thingles
In reply to this post by Yaron Koren-2
If sorting of the subobjects is critical I would just add a property to
the subobject for to sort by. You could increment a variable and assign
a new value to each instance of the subobject being set and then on
display ask for them sorted as such. If the subobjects have dates those
can be natural sorting conditions.

In short, I would make sure that you enforce the sorting in your data
structure and not rely on the naming conventions that Semantic MediaWiki
uses for that sorting.

My $0.02...

--
  Jamie Thingelstad
  [hidden email]

On Fri, Feb 21, 2014, at 08:18 AM, Yaron Koren wrote:

> Hi Mirjam,
>
> My guess is that you're using version 0.7 or lower of SIO. If you update
> to
> a later version (ideally the latest one), the names will be padded to
> three
> digits, like "#001", to improve the sorting.
>
> By the way, if this sorting thing is important to you, you shouldn't
> upgrade SMW, because with a later version of SMW, SIO will store data
> using
> #subobject, which means that object names will contain random hashes, not
> ordered strings. It's something I've been planning to change in SIO,
> because I do think it's nice to be able to sort the values.
>
> -Yaron
>
>
> On Fri, Feb 21, 2014 at 11:00 AM, Mirjam Beyer <[hidden email]>
> wrote:
>
> > Hello all,
> >
> > I have a problem with my internal objects. I would like to list all
> > internal objects of one Page in the same order they are listed on these
> > page. It works fine with an easy ask-query, when I have only 9 internal
> > objects. I get:
> >
> > Carrot cake#1
> > Carrot cake#2
> > Carrot cake#3
> > ...
> > usw.
> >
> > But when I have more than 9:
> >
> > Carrot cake#1
> > Carrot cake#10
> > Carrot cake#11
> > Carrot cake#2
> > Carrot cake#3
> > ...
> >
> > But I need 1, 2, 3,...,10,11. Any idea what I can do?
> >
> > Thanks for help,
> >
> > Mirjam
> >
> >
> > ------------------------------------------------------------------------------
> > Managing the Performance of Cloud-Based Applications
> > Take advantage of what the Cloud has to offer - Avoid Common Pitfalls.
> > Read the Whitepaper.
> >
> > http://pubads.g.doubleclick.net/gampad/clk?id=121054471&iu=/4140/ostg.clktrk
> > _______________________________________________
> > Semediawiki-user mailing list
> > [hidden email]
> > https://lists.sourceforge.net/lists/listinfo/semediawiki-user
> >
>
>
>
> --
> WikiWorks · MediaWiki Consulting · http://wikiworks.com
> ------------------------------------------------------------------------------
> Managing the Performance of Cloud-Based Applications
> Take advantage of what the Cloud has to offer - Avoid Common Pitfalls.
> Read the Whitepaper.
> http://pubads.g.doubleclick.net/gampad/clk?id=121054471&iu=/4140/ostg.clktrk
> _______________________________________________
> Semediawiki-user mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/semediawiki-user

------------------------------------------------------------------------------
Managing the Performance of Cloud-Based Applications
Take advantage of what the Cloud has to offer - Avoid Common Pitfalls.
Read the Whitepaper.
http://pubads.g.doubleclick.net/gampad/clk?id=121054471&iu=/4140/ostg.clktrk
_______________________________________________
Semediawiki-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/semediawiki-user
Reply | Threaded
Open this post in threaded view
|

Re: sorting internal objects

James HK
In reply to this post by Yaron Koren-2
Hi,

> #subobject, which means that object names will contain random hashes, not
> ordered strings. It's something I've been planning to change in SIO,

Those "random hashes" are merely random and represent a md5 hash that
identify a single unique subject by its contents. If two entities
represent the same facts, they would also be represented by the same
hash function and ultimately being identified as an identical
subobject which will only be stored once due to the same hash-key.

As for the subobject, it is internally represented as wikipage which
also carries a "_SKEY" annotation ([0] shows a subobject with a
default "_SKEY" annotation). Until now this key has not been used nor
assigned any particular meaning during the lifetime of a subobject but
if you want to enforce some kind of sorting than you should probably
look into this field as possible candidate.

> digits, like "#001", to improve the sorting.
I would rather not use an arbitrary #number because it would be
contradictory to the idea of representing the same facts by only one
entity (see explanation above).

[0] https://semantic-mediawiki.org/w/api.php?action=browsebysubject&subject=Demo:Setting_multiple_values_using_a_separator

Cheers

On 2/22/14, Yaron Koren <[hidden email]> wrote:

> Hi Mirjam,
>
> My guess is that you're using version 0.7 or lower of SIO. If you update to
> a later version (ideally the latest one), the names will be padded to three
> digits, like "#001", to improve the sorting.
>
> By the way, if this sorting thing is important to you, you shouldn't
> upgrade SMW, because with a later version of SMW, SIO will store data using
> #subobject, which means that object names will contain random hashes, not
> ordered strings. It's something I've been planning to change in SIO,
> because I do think it's nice to be able to sort the values.
>
> -Yaron
>
>
> On Fri, Feb 21, 2014 at 11:00 AM, Mirjam Beyer <[hidden email]> wrote:
>
>> Hello all,
>>
>> I have a problem with my internal objects. I would like to list all
>> internal objects of one Page in the same order they are listed on these
>> page. It works fine with an easy ask-query, when I have only 9 internal
>> objects. I get:
>>
>> Carrot cake#1
>> Carrot cake#2
>> Carrot cake#3
>> ...
>> usw.
>>
>> But when I have more than 9:
>>
>> Carrot cake#1
>> Carrot cake#10
>> Carrot cake#11
>> Carrot cake#2
>> Carrot cake#3
>> ...
>>
>> But I need 1, 2, 3,...,10,11. Any idea what I can do?
>>
>> Thanks for help,
>>
>> Mirjam
>>
>>
>> ------------------------------------------------------------------------------
>> Managing the Performance of Cloud-Based Applications
>> Take advantage of what the Cloud has to offer - Avoid Common Pitfalls.
>> Read the Whitepaper.
>>
>> http://pubads.g.doubleclick.net/gampad/clk?id=121054471&iu=/4140/ostg.clktrk
>> _______________________________________________
>> Semediawiki-user mailing list
>> [hidden email]
>> https://lists.sourceforge.net/lists/listinfo/semediawiki-user
>>
>
>
>
> --
> WikiWorks · MediaWiki Consulting · http://wikiworks.com
> ------------------------------------------------------------------------------
> Managing the Performance of Cloud-Based Applications
> Take advantage of what the Cloud has to offer - Avoid Common Pitfalls.
> Read the Whitepaper.
> http://pubads.g.doubleclick.net/gampad/clk?id=121054471&iu=/4140/ostg.clktrk
> _______________________________________________
> Semediawiki-user mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/semediawiki-user
>

------------------------------------------------------------------------------
Managing the Performance of Cloud-Based Applications
Take advantage of what the Cloud has to offer - Avoid Common Pitfalls.
Read the Whitepaper.
http://pubads.g.doubleclick.net/gampad/clk?id=121054471&iu=/4140/ostg.clktrk
_______________________________________________
Semediawiki-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/semediawiki-user
Reply | Threaded
Open this post in threaded view
|

Re: sorting internal objects

Yaron Koren-2
Hi James,

Right, I should have said "seemingly random", not "random" - I meant only
that they result in a random sorting order. (Or pseudo-random.)

As for the issue of handling duplicate data, which hashes of course handle
differently from ordered numbering, that came up the first time (I think)
this whole thing was discussed, in June 2013:

http://wikimedia.7.x6.nabble.com/Making-subobjects-correctly-ordered-td5007553.html

Let me just restate what I told Stephan then, when he made essentially the
same argument that you're making: "in practical terms I really don't think
it matters whether the duplicate data gets stored or not. Duplicate data
just doesn't happen very much, if at all; and even when it happens, that's
an error in data entry: SMW doesn't have any obligation to fix such errors."

The "_SKEY" thing is interesting, though - if someone can implement that,
that would be great; it would be less of a hack, and it would mean having
sorting work correctly for #subobject as well.

-Yaron


On Fri, Feb 21, 2014 at 3:00 PM, James HK <[hidden email]>wrote:

> Hi,
>
> > #subobject, which means that object names will contain random hashes, not
> > ordered strings. It's something I've been planning to change in SIO,
>
> Those "random hashes" are merely random and represent a md5 hash that
> identify a single unique subject by its contents. If two entities
> represent the same facts, they would also be represented by the same
> hash function and ultimately being identified as an identical
> subobject which will only be stored once due to the same hash-key.
>
> As for the subobject, it is internally represented as wikipage which
> also carries a "_SKEY" annotation ([0] shows a subobject with a
> default "_SKEY" annotation). Until now this key has not been used nor
> assigned any particular meaning during the lifetime of a subobject but
> if you want to enforce some kind of sorting than you should probably
> look into this field as possible candidate.
>
> > digits, like "#001", to improve the sorting.
> I would rather not use an arbitrary #number because it would be
> contradictory to the idea of representing the same facts by only one
> entity (see explanation above).
>
> [0]
> https://semantic-mediawiki.org/w/api.php?action=browsebysubject&subject=Demo:Setting_multiple_values_using_a_separator
>
> Cheers
>
> On 2/22/14, Yaron Koren <[hidden email]> wrote:
> > Hi Mirjam,
> >
> > My guess is that you're using version 0.7 or lower of SIO. If you update
> to
> > a later version (ideally the latest one), the names will be padded to
> three
> > digits, like "#001", to improve the sorting.
> >
> > By the way, if this sorting thing is important to you, you shouldn't
> > upgrade SMW, because with a later version of SMW, SIO will store data
> using
> > #subobject, which means that object names will contain random hashes, not
> > ordered strings. It's something I've been planning to change in SIO,
> > because I do think it's nice to be able to sort the values.
> >
> > -Yaron
> >
> >
> > On Fri, Feb 21, 2014 at 11:00 AM, Mirjam Beyer <[hidden email]>
> wrote:
> >
> >> Hello all,
> >>
> >> I have a problem with my internal objects. I would like to list all
> >> internal objects of one Page in the same order they are listed on these
> >> page. It works fine with an easy ask-query, when I have only 9 internal
> >> objects. I get:
> >>
> >> Carrot cake#1
> >> Carrot cake#2
> >> Carrot cake#3
> >> ...
> >> usw.
> >>
> >> But when I have more than 9:
> >>
> >> Carrot cake#1
> >> Carrot cake#10
> >> Carrot cake#11
> >> Carrot cake#2
> >> Carrot cake#3
> >> ...
> >>
> >> But I need 1, 2, 3,...,10,11. Any idea what I can do?
> >>
> >> Thanks for help,
> >>
> >> Mirjam
> >>
> >>
> >>
> ------------------------------------------------------------------------------
> >> Managing the Performance of Cloud-Based Applications
> >> Take advantage of what the Cloud has to offer - Avoid Common Pitfalls.
> >> Read the Whitepaper.
> >>
> >>
> http://pubads.g.doubleclick.net/gampad/clk?id=121054471&iu=/4140/ostg.clktrk
> >> _______________________________________________
> >> Semediawiki-user mailing list
> >> [hidden email]
> >> https://lists.sourceforge.net/lists/listinfo/semediawiki-user
> >>
> >
> >
> >
> > --
> > WikiWorks · MediaWiki Consulting · http://wikiworks.com
> >
> ------------------------------------------------------------------------------
> > Managing the Performance of Cloud-Based Applications
> > Take advantage of what the Cloud has to offer - Avoid Common Pitfalls.
> > Read the Whitepaper.
> >
> http://pubads.g.doubleclick.net/gampad/clk?id=121054471&iu=/4140/ostg.clktrk
> > _______________________________________________
> > Semediawiki-user mailing list
> > [hidden email]
> > https://lists.sourceforge.net/lists/listinfo/semediawiki-user
> >
>



--
WikiWorks · MediaWiki Consulting · http://wikiworks.com
------------------------------------------------------------------------------
Managing the Performance of Cloud-Based Applications
Take advantage of what the Cloud has to offer - Avoid Common Pitfalls.
Read the Whitepaper.
http://pubads.g.doubleclick.net/gampad/clk?id=121054471&iu=/4140/ostg.clktrk
_______________________________________________
Semediawiki-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/semediawiki-user