arraymap: page results with commas in the name

View: New views
13 Messages — Rating Filter:   Alert me  

arraymap: page results with commas in the name

by Scott Reed-3 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

The following query works fine, producing a bulleted list of related
pages, except with related pages that have commas in their name:

    {{#arraymap:{{#show:{{SUBJECTPAGENAME}}|?RelatedPageProperty}}|,|x|*x|\n}}

I know this must be a simple problem but I can't figure where the result
separator character is addressed in the docs. Any help would be much
appreciated.
Thanks,
  Scott
------------------------------------------------------------------------------
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
_______________________________________________
Semediawiki-user mailing list
Semediawiki-user@...
https://lists.sourceforge.net/lists/listinfo/semediawiki-user

Parent Message unknown Re: arraymap: page results with commas in the name

by lalquier :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

That is to be expected since you have a comma in the title.  Arraymap
doesn't make a difference between commas from the title and commas used as
separators.

Here is the string that worked for me :

<ul>{{#arraymap:{{{Data classes definitions|}}}|,|x|<li> [[Has data
class::x]]| }}</ul>

I forced the result of a query as a list and then replaced the separators
by a space.

Maybe you could do the same with a template instead of a list, and force
separators to something that will not appear in your titles - ever.

- Laurent

----------------------------------------
From: "Scott Reed" <sreed@...>
Sent: Tuesday, November 03, 2009 3:06 AM
To: Semediawiki-user@...
Subject: Re: [Semediawiki-user] arraymap: page results with commas in the
name

Oops. I must have misunderstood. I tried:

    {{#arraymap:{{#show:{{SUBJECTPAGENAME}}|?RelatedPageProperty}}|,|x|*x|
    }}

If #show: returns a page with title */x, y z/* then #arraymap: produces
*/x*y z/*

Scott Reed [11/3/2009 8:54 AM] wrote:

> Thank you, Laurent!!
>
> Laurent Alquier [11/3/2009 8:47 AM] wrote:
>> Replace '\n' by a white space at the end of your code. '\n' is not
>> necessary anyway since line returns are handled by the bullet list
>> anyway... and it just happens to also remove the comma at the end of
>> names.
>>
>> I found that out quite by accident while looking for the same
>> question myself.
>>
>> Good luck
>>
>> - Laurent
>>
>> ----------------------------------------
>> From: "Scott Reed"
>> Sent: Tuesday, November 03, 2009 1:23 AM
>> To: Semediawiki-user@...
>> Subject: [Semediawiki-user] arraymap: page results with commas in the
>> name
>>
>> The following query works fine, producing a bulleted list of related
>> pages, except with related pages that have commas in their name:
>>
>>    
>>
{{#arraymap:{{#show:{{SUBJECTPAGENAME}}|?RelatedPageProperty}}|,|x|*x|\n}}

>>
>>
>> I know this must be a simple problem but I can't figure where the
>> result separator character is addressed in the docs. Any help would
>> be much appreciated.
>> Thanks,
>>   Scott
>>
----------------------------------------------------------------------------
 
>>
>> --
>> Come build with us! The BlackBerry(R) Developer Conference in SF, CA
>> is the only developer event you need to attend this year. Jumpstart
your

>> developing skills, take BlackBerry mobile applications to market and
>> stay ahead of the curve. Join us from November 9 - 12, 2009. Register
>> now!
>> http://p.sf.net/sfu/devconference
>> _______________________________________________
>> Semediawiki-user mailing list
>> Semediawiki-user@...
>> https://lists.sourceforge.net/lists/listinfo/semediawiki-user
>>
>>  
>>
----------------------------------------------------------------------------
--
>>
>> Come build with us! The BlackBerry(R) Developer Conference in SF, CA
>> is the only developer event you need to attend this year. Jumpstart
your
>> developing skills, take BlackBerry mobile applications to market and
>> stay ahead of the curve. Join us from November 9 - 12, 2009. Register
>> now!
>> http://p.sf.net/sfu/devconference
>> _______________________________________________
>> Semediawiki-user mailing list
>> Semediawiki-user@...
>> https://lists.sourceforge.net/lists/listinfo/semediawiki-user
>>  
----------------------------------------------------------------------------
--
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
_______________________________________________
Semediawiki-user mailing list
Semediawiki-user@...
https://lists.sourceforge.net/lists/listinfo/semediawiki-user

 
------------------------------------------------------------------------------
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
_______________________________________________
Semediawiki-user mailing list
Semediawiki-user@...
https://lists.sourceforge.net/lists/listinfo/semediawiki-user

Re: arraymap: page results with commas in the name

by Scott Reed-3 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

   1.   It seems to me that your proposal would still break up a result
      like /*a, b c*/ into two list items: <ul><li>a<li>b c</ul>.
   2. Is your example missing </li>?
   3. *Please tell me how I can force the result separators to something
      other than comma!*


Laurent Alquier [11/3/2009 10:23 AM] wrote:

> That is to be expected since you have a comma in the title.  Arraymap
> doesn't make a difference between commas from the title and commas used as
> separators.
>
> Here is the string that worked for me :
>
> <ul>{{#arraymap:{{{Data classes definitions|}}}|,|x|<li> [[Has data
> class::x]]| }}</ul>
>
> I forced the result of a query as a list and then replaced the separators
> by a space.
>
> Maybe you could do the same with a template instead of a list, and force
> separators to something that will not appear in your titles - ever.
>
> - Laurent
>
> ----------------------------------------
> From: "Scott Reed" <sreed@...>
> Sent: Tuesday, November 03, 2009 3:06 AM
> To: Semediawiki-user@...
> Subject: Re: [Semediawiki-user] arraymap: page results with commas in the
> name
>
> Oops. I must have misunderstood. I tried:
>
>     {{#arraymap:{{#show:{{SUBJECTPAGENAME}}|?RelatedPageProperty}}|,|x|*x|
>     }}
>
> If #show: returns a page with title */x, y z/* then #arraymap: produces
> */x*y z/*
>
> Scott Reed [11/3/2009 8:54 AM] wrote:
> > Thank you, Laurent!!
> >
> > Laurent Alquier [11/3/2009 8:47 AM] wrote:
> >> Replace '\n' by a white space at the end of your code. '\n' is not
> >> necessary anyway since line returns are handled by the bullet list
> >> anyway... and it just happens to also remove the comma at the end of
> >> names.
> >>
> >> I found that out quite by accident while looking for the same
> >> question myself.
> >>
> >> Good luck
> >>
> >> - Laurent
> >>
> >> ----------------------------------------
> >> From: "Scott Reed"
> >> Sent: Tuesday, November 03, 2009 1:23 AM
> >> To: Semediawiki-user@...
> >> Subject: [Semediawiki-user] arraymap: page results with commas in the
> >> name
> >>
> >> The following query works fine, producing a bulleted list of related
> >> pages, except with related pages that have commas in their name:
> >>
> >>    
> >>
> {{#arraymap:{{#show:{{SUBJECTPAGENAME}}|?RelatedPageProperty}}|,|x|*x|\n}}
>
> >>
> >>
> >> I know this must be a simple problem but I can't figure where the
> >> result separator character is addressed in the docs. Any help would
> >> be much appreciated.
> >> Thanks,
> >>   Scott
> >>
> ----------------------------------------------------------------------------
>  
> >>
> >> --
> >> Come build with us! The BlackBerry(R) Developer Conference in SF, CA
> >> is the only developer event you need to attend this year. Jumpstart
> your
> >> developing skills, take BlackBerry mobile applications to market and
> >> stay ahead of the curve. Join us from November 9 - 12, 2009. Register
> >> now!
> >> http://p.sf.net/sfu/devconference
> >> _______________________________________________
> >> Semediawiki-user mailing list
> >> Semediawiki-user@...
> >> https://lists.sourceforge.net/lists/listinfo/semediawiki-user
> >>
> >>  
> >>
> ----------------------------------------------------------------------------
>  
------------------------------------------------------------------------------
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
_______________________________________________
Semediawiki-user mailing list
Semediawiki-user@...
https://lists.sourceforge.net/lists/listinfo/semediawiki-user

Re: arraymap: page results with commas in the name

by Yaron Koren :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Scott - the following would probably work, assuming you don't have
semicolons in any of your values:

{{#arraymap:{{#ask:[[{{SUBJECTPAGENAME}}]]|?RelatedPageProperty|format=list|sep=;}}|;|x|*x|\n}}
...of course, if you do have semicolons, you should change it to some other
character, or string... ";;" should also work.

-Yaron
On Tue, Nov 3, 2009 at 10:23 AM, Laurent Alquier <laurent@...>wrote:

> That is to be expected since you have a comma in the title.  Arraymap
> doesn't make a difference between commas from the title and commas used as
> separators.
>
> Here is the string that worked for me :
>
> <ul>{{#arraymap:{{{Data classes definitions|}}}|,|x|<li> [[Has data
> class::x]]| }}</ul>
>
> I forced the result of a query as a list and then replaced the separators
> by a space.
>
> Maybe you could do the same with a template instead of a list, and force
> separators to something that will not appear in your titles - ever.
>
> - Laurent
>
> ----------------------------------------
> From: "Scott Reed" <sreed@...>
> Sent: Tuesday, November 03, 2009 3:06 AM
> To: Semediawiki-user@...
> Subject: Re: [Semediawiki-user] arraymap: page results with commas in the
> name
>
> Oops. I must have misunderstood. I tried:
>
>    {{#arraymap:{{#show:{{SUBJECTPAGENAME}}|?RelatedPageProperty}}|,|x|*x|
>    }}
>
> If #show: returns a page with title */x, y z/* then #arraymap: produces
> */x*y z/*
>
> Scott Reed [11/3/2009 8:54 AM] wrote:
> > Thank you, Laurent!!
> >
> > Laurent Alquier [11/3/2009 8:47 AM] wrote:
> >> Replace '\n' by a white space at the end of your code. '\n' is not
> >> necessary anyway since line returns are handled by the bullet list
> >> anyway... and it just happens to also remove the comma at the end of
> >> names.
> >>
> >> I found that out quite by accident while looking for the same
> >> question myself.
> >>
> >> Good luck
> >>
> >> - Laurent
> >>
> >> ----------------------------------------
> >> From: "Scott Reed"
>  >> Sent: Tuesday, November 03, 2009 1:23 AM
> >> To: Semediawiki-user@...
> >> Subject: [Semediawiki-user] arraymap: page results with commas in the
> >> name
> >>
> >> The following query works fine, producing a bulleted list of related
> >> pages, except with related pages that have commas in their name:
> >>
> >>
> >>
> {{#arraymap:{{#show:{{SUBJECTPAGENAME}}|?RelatedPageProperty}}|,|x|*x|\n}}
>
> >>
> >>
> >> I know this must be a simple problem but I can't figure where the
> >> result separator character is addressed in the docs. Any help would
> >> be much appreciated.
> >> Thanks,
> >>   Scott
> >>
>
> ----------------------------------------------------------------------------
>
> >>
> >> --
> >> Come build with us! The BlackBerry(R) Developer Conference in SF, CA
> >> is the only developer event you need to attend this year. Jumpstart
> your
> >> developing skills, take BlackBerry mobile applications to market and
> >> stay ahead of the curve. Join us from November 9 - 12, 2009. Register
> >> now!
> >> http://p.sf.net/sfu/devconference
> >> _______________________________________________
> >> Semediawiki-user mailing list
> >> Semediawiki-user@...
> >> https://lists.sourceforge.net/lists/listinfo/semediawiki-user
> >>
> >>
> >>
>
> ----------------------------------------------------------------------------
> --
> >>
> >> Come build with us! The BlackBerry(R) Developer Conference in SF, CA
> >> is the only developer event you need to attend this year. Jumpstart
> your
> >> developing skills, take BlackBerry mobile applications to market and
> >> stay ahead of the curve. Join us from November 9 - 12, 2009. Register
> >> now!
> >> http://p.sf.net/sfu/devconference
> >> _______________________________________________
> >> Semediawiki-user mailing list
> >> Semediawiki-user@...
> >> https://lists.sourceforge.net/lists/listinfo/semediawiki-user
> >>
>
> ----------------------------------------------------------------------------
> --
> Come build with us! The BlackBerry(R) Developer Conference in SF, CA
> is the only developer event you need to attend this year. Jumpstart your
> developing skills, take BlackBerry mobile applications to market and stay
> ahead of the curve. Join us from November 9 - 12, 2009. Register now!
> http://p.sf.net/sfu/devconference
> _______________________________________________
> Semediawiki-user mailing list
> Semediawiki-user@...
> https://lists.sourceforge.net/lists/listinfo/semediawiki-user
>
>
>
> ------------------------------------------------------------------------------
>  Come build with us! The BlackBerry(R) Developer Conference in SF, CA
> is the only developer event you need to attend this year. Jumpstart your
> developing skills, take BlackBerry mobile applications to market and stay
> ahead of the curve. Join us from November 9 - 12, 2009. Register now!
> http://p.sf.net/sfu/devconference
> _______________________________________________
> Semediawiki-user mailing list
> Semediawiki-user@...
> https://lists.sourceforge.net/lists/listinfo/semediawiki-user
>
------------------------------------------------------------------------------
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
_______________________________________________
Semediawiki-user mailing list
Semediawiki-user@...
https://lists.sourceforge.net/lists/listinfo/semediawiki-user

Re: arraymap: page results with commas in the name

by Scott Reed-3 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Yaron,
The separator is not being changed to ';'. If I try just the #ask:

    {{#ask:[[{{SUBJECTPAGENAME}}]]|?RelatedPageProperty|format=list|sep=;}}

I get a single line starting with the name of the property followed by
all the results separated by commas, e.g.

    RelatedPageProperty abc def, ghi hjk, x, yz
     

(where x, yz is a correct link to a page with a coma in the title).
Since the separator is still commas, the #arraymap from ';' to '*' just
adds a bullet to the front of the result of the #ask..

I get the same results if I try

    {{#ask:[[{{SUBJECTPAGENAME}}]]|?RelatedPageProperty|format=ul}}

You can see this in our web site in a page to display the lesson plans
that address a learning objective (with property:LessonPlan) :
http://rootsup.referata.com/wiki/List_the_basic_components_of_a_solar_hot_water_system.

The template that generates that result is Template:LearnObj:
http://rootsup.referata.com/w/index.php?title=Template:LearnObj&action=edit 
<http://rootsup.referata.com/w/index.php?title=Template:LearnObj&action=edit>

Yaron Koren [11/3/2009 10:37 AM] wrote:

> Scott - the following would probably work, assuming you don't have
> semicolons in any of your values:
>
> {{#arraymap:{{#ask:[[{{SUBJECTPAGENAME}}]]|?RelatedPageProperty|format=list|sep=;}}|;|x|*x|\n}}
> ...of course, if you do have semicolons, you should change it to some other
> character, or string... ";;" should also work.
>
> -Yaron
> On Tue, Nov 3, 2009 at 10:23 AM, Laurent Alquier <laurent@...>wrote:
>
> > That is to be expected since you have a comma in the title.  Arraymap
> > doesn't make a difference between commas from the title and commas used as
> > separators.
> >
> > Here is the string that worked for me :
> >
> > <ul>{{#arraymap:{{{Data classes definitions|}}}|,|x|<li> [[Has data
> > class::x]]| }}</ul>
> >
> > I forced the result of a query as a list and then replaced the separators
> > by a space.
> >
> > Maybe you could do the same with a template instead of a list, and force
> > separators to something that will not appear in your titles - ever.
> >
> > - Laurent
> >
> > ----------------------------------------
> > From: "Scott Reed" <sreed@...>
> > Sent: Tuesday, November 03, 2009 3:06 AM
> > To: Semediawiki-user@...
> > Subject: Re: [Semediawiki-user] arraymap: page results with commas in the
> > name
> >
> > Oops. I must have misunderstood. I tried:
> >
> >    {{#arraymap:{{#show:{{SUBJECTPAGENAME}}|?RelatedPageProperty}}|,|x|*x|
> >    }}
> >
> > If #show: returns a page with title */x, y z/* then #arraymap: produces
> > */x*y z/*
> >
> > Scott Reed [11/3/2009 8:54 AM] wrote:
> > > Thank you, Laurent!!
> > >
> > > Laurent Alquier [11/3/2009 8:47 AM] wrote:
> > >> Replace '\n' by a white space at the end of your code. '\n' is not
> > >> necessary anyway since line returns are handled by the bullet list
> > >> anyway... and it just happens to also remove the comma at the end of
> > >> names.
> > >>
> > >> I found that out quite by accident while looking for the same
> > >> question myself.
> > >>
> > >> Good luck
> > >>
> > >> - Laurent
> > >>
> > >> ----------------------------------------
> > >> From: "Scott Reed"
> >  >> Sent: Tuesday, November 03, 2009 1:23 AM
> > >> To: Semediawiki-user@...
> > >> Subject: [Semediawiki-user] arraymap: page results with commas in the
> > >> name
> > >>
> > >> The following query works fine, producing a bulleted list of related
> > >> pages, except with related pages that have commas in their name:
> > >>
> > >>
> > >>
> > {{#arraymap:{{#show:{{SUBJECTPAGENAME}}|?RelatedPageProperty}}|,|x|*x|\n}}
> >
> > >>
> > >>
> > >> I know this must be a simple problem but I can't figure where the
> > >> result separator character is addressed in the docs. Any help would
> > >> be much appreciated.
> > >> Thanks,
> > >>   Scott
> > >>
> >
> > ----------------------------------------------------------------------------
> >
> > >>
> > >> --
> > >> Come build with us! The BlackBerry(R) Developer Conference in SF, CA
> > >> is the only developer event you need to attend this year. Jumpstart
> > your
> > >> developing skills, take BlackBerry mobile applications to market and
> > >> stay ahead of the curve. Join us from November 9 - 12, 2009. Register
> > >> now!
> > >> http://p.sf.net/sfu/devconference
> > >> _______________________________________________
> > >> Semediawiki-user mailing list
> > >> Semediawiki-user@...
> > >> https://lists.sourceforge.net/lists/listinfo/semediawiki-user
> > >>
> > >>
> > >>
> >
> > ----------------------------------------------------------------------------
> > --
> > >>
> > >> Come build with us! The BlackBerry(R) Developer Conference in SF, CA
> > >> is the only developer event you need to attend this year. Jumpstart
> > your
> > >> developing skills, take BlackBerry mobile applications to market and
> > >> stay ahead of the curve. Join us from November 9 - 12, 2009. Register
> > >> now!
> > >> http://p.sf.net/sfu/devconference
> > >> _______________________________________________
> > >> Semediawiki-user mailing list
> > >> Semediawiki-user@...
> > >> https://lists.sourceforge.net/lists/listinfo/semediawiki-user
> > >>
> >
> > ----------------------------------------------------------------------------
> > --
> > Come build with us! The BlackBerry(R) Developer Conference in SF, CA
> > is the only developer event you need to attend this year. Jumpstart your
> > developing skills, take BlackBerry mobile applications to market and stay
> > ahead of the curve. Join us from November 9 - 12, 2009. Register now!
> > http://p.sf.net/sfu/devconference
> > _______________________________________________
> > Semediawiki-user mailing list
> > Semediawiki-user@...
> > https://lists.sourceforge.net/lists/listinfo/semediawiki-user
> >
> >
> >
> > ------------------------------------------------------------------------------
> >  Come build with us! The BlackBerry(R) Developer Conference in SF, CA
> > is the only developer event you need to attend this year. Jumpstart your
> > developing skills, take BlackBerry mobile applications to market and stay
> > ahead of the curve. Join us from November 9 - 12, 2009. Register now!
> > http://p.sf.net/sfu/devconference
> > _______________________________________________
> > Semediawiki-user mailing list
> > Semediawiki-user@...
> > https://lists.sourceforge.net/lists/listinfo/semediawiki-user
> >
> ------------------------------------------------------------------------------
> Come build with us! The BlackBerry(R) Developer Conference in SF, CA
> is the only developer event you need to attend this year. Jumpstart your
> developing skills, take BlackBerry mobile applications to market and stay
> ahead of the curve. Join us from November 9 - 12, 2009. Register now!
> http://p.sf.net/sfu/devconference
> _______________________________________________
> Semediawiki-user mailing list
> Semediawiki-user@...
> https://lists.sourceforge.net/lists/listinfo/semediawiki-user
>  
------------------------------------------------------------------------------
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
_______________________________________________
Semediawiki-user mailing list
Semediawiki-user@...
https://lists.sourceforge.net/lists/listinfo/semediawiki-user

Re: arraymap: page results with commas in the name

by Yaron Koren :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Ah, yes, sorry about that - I forgot that the "sep" parameter doesn't affect
multiple values for the same property. I just checked the SMW code, and it
looks like that comma is hardcoded - nothing can change it. Which is a
problem. Unfortunately, I can't think of any solutions to this problem that
aren't complete hacks. What's needed is just a "delim=" parameter for the
"list" formats (list, ol, ul, template), that would set this delimiter; the
"category" format already supports this, but none of the others do. It
shouldn't be that hard to add...

-Yaron


On Tue, Nov 3, 2009 at 11:43 AM, Scott Reed <sreed@...> wrote:

> Yaron,
> The separator is not being changed to ';'. If I try just the #ask:
>
>    {{#ask:[[{{SUBJECTPAGENAME}}]]|?RelatedPageProperty|format=list|sep=;}}
>
> I get a single line starting with the name of the property followed by
> all the results separated by commas, e.g.
>
>    RelatedPageProperty abc def, ghi hjk, x, yz
>
>
> (where x, yz is a correct link to a page with a coma in the title).
> Since the separator is still commas, the #arraymap from ';' to '*' just
> adds a bullet to the front of the result of the #ask..
>
> I get the same results if I try
>
>    {{#ask:[[{{SUBJECTPAGENAME}}]]|?RelatedPageProperty|format=ul}}
>
> You can see this in our web site in a page to display the lesson plans
> that address a learning objective (with property:LessonPlan) :
>
> http://rootsup.referata.com/wiki/List_the_basic_components_of_a_solar_hot_water_system
> .
>
> The template that generates that result is Template:LearnObj:
> http://rootsup.referata.com/w/index.php?title=Template:LearnObj&action=edit
> <
> http://rootsup.referata.com/w/index.php?title=Template:LearnObj&action=edit
> >
>
> Yaron Koren [11/3/2009 10:37 AM] wrote:
> > Scott - the following would probably work, assuming you don't have
> > semicolons in any of your values:
> >
> >
> {{#arraymap:{{#ask:[[{{SUBJECTPAGENAME}}]]|?RelatedPageProperty|format=list|sep=;}}|;|x|*x|\n}}
> > ...of course, if you do have semicolons, you should change it to some
> other
> > character, or string... ";;" should also work.
> >
> > -Yaron
> > On Tue, Nov 3, 2009 at 10:23 AM, Laurent Alquier <laurent@...
> >wrote:
> >
> > > That is to be expected since you have a comma in the title.  Arraymap
> > > doesn't make a difference between commas from the title and commas used
> as
> > > separators.
> > >
> > > Here is the string that worked for me :
> > >
> > > <ul>{{#arraymap:{{{Data classes definitions|}}}|,|x|<li> [[Has data
> > > class::x]]| }}</ul>
> > >
> > > I forced the result of a query as a list and then replaced the
> separators
> > > by a space.
> > >
> > > Maybe you could do the same with a template instead of a list, and
> force
> > > separators to something that will not appear in your titles - ever.
> > >
> > > - Laurent
> > >
> > > ----------------------------------------
> > > From: "Scott Reed" <sreed@...>
> > > Sent: Tuesday, November 03, 2009 3:06 AM
> > > To: Semediawiki-user@...
> > > Subject: Re: [Semediawiki-user] arraymap: page results with commas in
> the
> > > name
> > >
> > > Oops. I must have misunderstood. I tried:
> > >
> > >
>  {{#arraymap:{{#show:{{SUBJECTPAGENAME}}|?RelatedPageProperty}}|,|x|*x|
> > >    }}
> > >
> > > If #show: returns a page with title */x, y z/* then #arraymap: produces
> > > */x*y z/*
> > >
> > > Scott Reed [11/3/2009 8:54 AM] wrote:
> > > > Thank you, Laurent!!
> > > >
> > > > Laurent Alquier [11/3/2009 8:47 AM] wrote:
> > > >> Replace '\n' by a white space at the end of your code. '\n' is not
> > > >> necessary anyway since line returns are handled by the bullet list
> > > >> anyway... and it just happens to also remove the comma at the end of
> > > >> names.
> > > >>
> > > >> I found that out quite by accident while looking for the same
> > > >> question myself.
> > > >>
> > > >> Good luck
> > > >>
> > > >> - Laurent
> > > >>
> > > >> ----------------------------------------
> > > >> From: "Scott Reed"
> > >  >> Sent: Tuesday, November 03, 2009 1:23 AM
> > > >> To: Semediawiki-user@...
> > > >> Subject: [Semediawiki-user] arraymap: page results with commas in
> the
> > > >> name
> > > >>
> > > >> The following query works fine, producing a bulleted list of related
> > > >> pages, except with related pages that have commas in their name:
> > > >>
> > > >>
> > > >>
> > >
> {{#arraymap:{{#show:{{SUBJECTPAGENAME}}|?RelatedPageProperty}}|,|x|*x|\n}}
> > >
> > > >>
> > > >>
> > > >> I know this must be a simple problem but I can't figure where the
> > > >> result separator character is addressed in the docs. Any help would
> > > >> be much appreciated.
> > > >> Thanks,
> > > >>   Scott
> > > >>
> > >
> > >
> ----------------------------------------------------------------------------
> > >
> > > >>
> > > >> --
> > > >> Come build with us! The BlackBerry(R) Developer Conference in SF, CA
> > > >> is the only developer event you need to attend this year. Jumpstart
> > > your
> > > >> developing skills, take BlackBerry mobile applications to market and
> > > >> stay ahead of the curve. Join us from November 9 - 12, 2009.
> Register
> > > >> now!
> > > >> http://p.sf.net/sfu/devconference
> > > >> _______________________________________________
> > > >> Semediawiki-user mailing list
> > > >> Semediawiki-user@...
> > > >> https://lists.sourceforge.net/lists/listinfo/semediawiki-user
> > > >>
> > > >>
> > > >>
> > >
> > >
> ----------------------------------------------------------------------------
> > > --
> > > >>
> > > >> Come build with us! The BlackBerry(R) Developer Conference in SF, CA
> > > >> is the only developer event you need to attend this year. Jumpstart
> > > your
> > > >> developing skills, take BlackBerry mobile applications to market and
> > > >> stay ahead of the curve. Join us from November 9 - 12, 2009.
> Register
> > > >> now!
> > > >> http://p.sf.net/sfu/devconference
> > > >> _______________________________________________
> > > >> Semediawiki-user mailing list
> > > >> Semediawiki-user@...
> > > >> https://lists.sourceforge.net/lists/listinfo/semediawiki-user
> > > >>
> > >
> > >
> ----------------------------------------------------------------------------
> > > --
> > > Come build with us! The BlackBerry(R) Developer Conference in SF, CA
> > > is the only developer event you need to attend this year. Jumpstart
> your
> > > developing skills, take BlackBerry mobile applications to market and
> stay
> > > ahead of the curve. Join us from November 9 - 12, 2009. Register now!
> > > http://p.sf.net/sfu/devconference
> > > _______________________________________________
> > > Semediawiki-user mailing list
> > > Semediawiki-user@...
> > > https://lists.sourceforge.net/lists/listinfo/semediawiki-user
> > >
> > >
> > >
> > >
> ------------------------------------------------------------------------------
> > >  Come build with us! The BlackBerry(R) Developer Conference in SF, CA
> > > is the only developer event you need to attend this year. Jumpstart
> your
> > > developing skills, take BlackBerry mobile applications to market and
> stay
> > > ahead of the curve. Join us from November 9 - 12, 2009. Register now!
> > > http://p.sf.net/sfu/devconference
> > > _______________________________________________
> > > Semediawiki-user mailing list
> > > Semediawiki-user@...
> > > https://lists.sourceforge.net/lists/listinfo/semediawiki-user
> > >
> >
> ------------------------------------------------------------------------------
> > Come build with us! The BlackBerry(R) Developer Conference in SF, CA
> > is the only developer event you need to attend this year. Jumpstart your
> > developing skills, take BlackBerry mobile applications to market and stay
> > ahead of the curve. Join us from November 9 - 12, 2009. Register now!
> > http://p.sf.net/sfu/devconference
> > _______________________________________________
> > Semediawiki-user mailing list
> > Semediawiki-user@...
> > https://lists.sourceforge.net/lists/listinfo/semediawiki-user
> >
>
> ------------------------------------------------------------------------------
> Come build with us! The BlackBerry(R) Developer Conference in SF, CA
> is the only developer event you need to attend this year. Jumpstart your
> developing skills, take BlackBerry mobile applications to market and stay
> ahead of the curve. Join us from November 9 - 12, 2009. Register now!
> http://p.sf.net/sfu/devconference
> _______________________________________________
> Semediawiki-user mailing list
> Semediawiki-user@...
> https://lists.sourceforge.net/lists/listinfo/semediawiki-user
>
------------------------------------------------------------------------------
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
_______________________________________________
Semediawiki-user mailing list
Semediawiki-user@...
https://lists.sourceforge.net/lists/listinfo/semediawiki-user

Re: arraymap: page results with commas in the name

by Stephan Gambke :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Scott Reed wrote:
> The following query works fine, producing a bulleted list of related
> pages, except with related pages that have commas in their name:
>
>     {{#arraymap:{{#show:{{SUBJECTPAGENAME}}|?RelatedPageProperty}}|,|x|*x|\n}}
>
> I know this must be a simple problem but I can't figure where the result
> separator character is addressed in the docs. Any help would be much
> appreciated.

I had the same problem and in the end switched from multiple value
properties to Semantic Internal Objects. Makes querying a lot easier and
should not be too hard to do if you used templates for setting the
properties.

Stephan

------------------------------------------------------------------------------
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
_______________________________________________
Semediawiki-user mailing list
Semediawiki-user@...
https://lists.sourceforge.net/lists/listinfo/semediawiki-user

Re: arraymap: page results with commas in the name

by Scott Reed-3 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

 From what I can see internal objects are similar to data objects with
fields. In my application I have an /arbitrary number /of pages
associated (as multiple values of a property) with a grouping page and I
want to list the associated pages in a bulleted list in the grouping
page. How would I do that with internal objects?

Stephan Gambke [11/3/2009 3:15 PM] wrote:

> Scott Reed wrote:
> > The following query works fine, producing a bulleted list of related
> > pages, except with related pages that have commas in their name:
> >
> >     {{#arraymap:{{#show:{{SUBJECTPAGENAME}}|?RelatedPageProperty}}|,|x|*x|\n}}
> >
> > I know this must be a simple problem but I can't figure where the result
> > separator character is addressed in the docs. Any help would be much
> > appreciated.
>
> I had the same problem and in the end switched from multiple value
> properties to Semantic Internal Objects. Makes querying a lot easier and
> should not be too hard to do if you used templates for setting the
> properties.
>
> Stephan
>  
------------------------------------------------------------------------------
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
_______________________________________________
Semediawiki-user mailing list
Semediawiki-user@...
https://lists.sourceforge.net/lists/listinfo/semediawiki-user

Re: arraymap: page results with commas in the name

by Scott Reed-3 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

I am surprised this is not possible and I'm pretty frustrated at this
point, having spent a lot of the day following instructions that didn't
work. Nevertheless, I appreciate all the help. I think we all assumed it
would be possible to allow any characters in a page name and it seems
like an obvious requirement. If anyone can see their way to fixing this
I'd really appreciate it.

Thanks,
  Scott

Yaron Koren [11/3/2009 2:05 PM] wrote:

> Ah, yes, sorry about that - I forgot that the "sep" parameter doesn't
> affect multiple values for the same property. I just checked the SMW
> code, and it looks like that comma is hardcoded - nothing can change
> it. Which is a problem. Unfortunately, I can't think of any solutions
> to this problem that aren't complete hacks. What's needed is just a
> "delim=" parameter for the "list" formats (list, ol, ul, template),
> that would set this delimiter; the "category" format already supports
> this, but none of the others do. It shouldn't be that hard to add...
>
> -Yaron
>
>
> On Tue, Nov 3, 2009 at 11:43 AM, Scott Reed <sreed@...
> <mailto:sreed@...>> wrote:
>
>     Yaron,
>     The separator is not being changed to ';'. If I try just the #ask:
>
>      
>      {{#ask:[[{{SUBJECTPAGENAME}}]]|?RelatedPageProperty|format=list|sep=;}}
>
>     I get a single line starting with the name of the property followed by
>     all the results separated by commas, e.g.
>
>        RelatedPageProperty abc def, ghi hjk, x, yz
>
>
>     (where x, yz is a correct link to a page with a coma in the title).
>     Since the separator is still commas, the #arraymap from ';' to '*'
>     just
>     adds a bullet to the front of the result of the #ask..
>
>     I get the same results if I try
>
>        {{#ask:[[{{SUBJECTPAGENAME}}]]|?RelatedPageProperty|format=ul}}
>
>     You can see this in our web site in a page to display the lesson plans
>     that address a learning objective (with property:LessonPlan) :
>     http://rootsup.referata.com/wiki/List_the_basic_components_of_a_solar_hot_water_system.
>
>     The template that generates that result is Template:LearnObj:
>     http://rootsup.referata.com/w/index.php?title=Template:LearnObj&action=edit
>     <http://rootsup.referata.com/w/index.php?title=Template:LearnObj&action=edit>
>     <http://rootsup.referata.com/w/index.php?title=Template:LearnObj&action=edit
>     <http://rootsup.referata.com/w/index.php?title=Template:LearnObj&action=edit>>
>
>     Yaron Koren [11/3/2009 10:37 AM] wrote:
>     > Scott - the following would probably work, assuming you don't have
>     > semicolons in any of your values:
>     >
>     >
>     {{#arraymap:{{#ask:[[{{SUBJECTPAGENAME}}]]|?RelatedPageProperty|format=list|sep=;}}|;|x|*x|\n}}
>     > ...of course, if you do have semicolons, you should change it to
>     some other
>     > character, or string... ";;" should also work.
>     >
>     > -Yaron
>     > On Tue, Nov 3, 2009 at 10:23 AM, Laurent Alquier
>     <laurent@... <mailto:laurent@...>>wrote:
>     >
>     > > That is to be expected since you have a comma in the title.
>      Arraymap
>     > > doesn't make a difference between commas from the title and
>     commas used as
>     > > separators.
>     > >
>     > > Here is the string that worked for me :
>     > >
>     > > <ul>{{#arraymap:{{{Data classes definitions|}}}|,|x|<li> [[Has
>     data
>     > > class::x]]| }}</ul>
>     > >
>     > > I forced the result of a query as a list and then replaced the
>     separators
>     > > by a space.
>     > >
>     > > Maybe you could do the same with a template instead of a list,
>     and force
>     > > separators to something that will not appear in your titles -
>     ever.
>     > >
>     > > - Laurent
>     > >
>     > > ----------------------------------------
>     > > From: "Scott Reed" <sreed@... <mailto:sreed@...>>
>     > > Sent: Tuesday, November 03, 2009 3:06 AM
>     > > To: Semediawiki-user@...
>     <mailto:Semediawiki-user@...>
>     > > Subject: Re: [Semediawiki-user] arraymap: page results with
>     commas in the
>     > > name
>     > >
>     > > Oops. I must have misunderstood. I tried:
>     > >
>     > >  
>      {{#arraymap:{{#show:{{SUBJECTPAGENAME}}|?RelatedPageProperty}}|,|x|*x|
>     > >    }}
>     > >
>     > > If #show: returns a page with title */x, y z/* then #arraymap:
>     produces
>     > > */x*y z/*
>     > >
>     > > Scott Reed [11/3/2009 8:54 AM] wrote:
>     > > > Thank you, Laurent!!
>     > > >
>     > > > Laurent Alquier [11/3/2009 8:47 AM] wrote:
>     > > >> Replace '\n' by a white space at the end of your code. '\n'
>     is not
>     > > >> necessary anyway since line returns are handled by the
>     bullet list
>     > > >> anyway... and it just happens to also remove the comma at
>     the end of
>     > > >> names.
>     > > >>
>     > > >> I found that out quite by accident while looking for the same
>     > > >> question myself.
>     > > >>
>     > > >> Good luck
>     > > >>
>     > > >> - Laurent
>     > > >>
>     > > >> ----------------------------------------
>     > > >> From: "Scott Reed"
>     > >  >> Sent: Tuesday, November 03, 2009 1:23 AM
>     > > >> To: Semediawiki-user@...
>     <mailto:Semediawiki-user@...>
>     > > >> Subject: [Semediawiki-user] arraymap: page results with
>     commas in the
>     > > >> name
>     > > >>
>     > > >> The following query works fine, producing a bulleted list
>     of related
>     > > >> pages, except with related pages that have commas in their
>     name:
>     > > >>
>     > > >>
>     > > >>
>     > >
>     {{#arraymap:{{#show:{{SUBJECTPAGENAME}}|?RelatedPageProperty}}|,|x|*x|\n}}
>     > >
>     > > >>
>     > > >>
>     > > >> I know this must be a simple problem but I can't figure
>     where the
>     > > >> result separator character is addressed in the docs. Any
>     help would
>     > > >> be much appreciated.
>     > > >> Thanks,
>     > > >>   Scott
>     > > >>
>     > >
>     > >
>     ----------------------------------------------------------------------------
>     > >
>     > > >>
>     > > >> --
>     > > >> Come build with us! The BlackBerry(R) Developer Conference
>     in SF, CA
>     > > >> is the only developer event you need to attend this year.
>     Jumpstart
>     > > your
>     > > >> developing skills, take BlackBerry mobile applications to
>     market and
>     > > >> stay ahead of the curve. Join us from November 9 - 12,
>     2009. Register
>     > > >> now!
>     > > >> http://p.sf.net/sfu/devconference
>     > > >> _______________________________________________
>     > > >> Semediawiki-user mailing list
>     > > >> Semediawiki-user@...
>     <mailto:Semediawiki-user@...>
>     > > >> https://lists.sourceforge.net/lists/listinfo/semediawiki-user
>     > > >>
>     > > >>
>     > > >>
>     > >
>     > >
>     ----------------------------------------------------------------------------
>     > > --
>     > > >>
>     > > >> Come build with us! The BlackBerry(R) Developer Conference
>     in SF, CA
>     > > >> is the only developer event you need to attend this year.
>     Jumpstart
>     > > your
>     > > >> developing skills, take BlackBerry mobile applications to
>     market and
>     > > >> stay ahead of the curve. Join us from November 9 - 12,
>     2009. Register
>     > > >> now!
>     > > >> http://p.sf.net/sfu/devconference
>     > > >> _______________________________________________
>     > > >> Semediawiki-user mailing list
>     > > >> Semediawiki-user@...
>     <mailto:Semediawiki-user@...>
>     > > >> https://lists.sourceforge.net/lists/listinfo/semediawiki-user
>     > > >>
>     > >
>     > >
>     ----------------------------------------------------------------------------
>     > > --
>     > > Come build with us! The BlackBerry(R) Developer Conference in
>     SF, CA
>     > > is the only developer event you need to attend this year.
>     Jumpstart your
>     > > developing skills, take BlackBerry mobile applications to
>     market and stay
>     > > ahead of the curve. Join us from November 9 - 12, 2009.
>     Register now!
>     > > http://p.sf.net/sfu/devconference
>     > > _______________________________________________
>     > > Semediawiki-user mailing list
>     > > Semediawiki-user@...
>     <mailto:Semediawiki-user@...>
>     > > https://lists.sourceforge.net/lists/listinfo/semediawiki-user
>     > >
>     > >
>     > >
>     > >
>     ------------------------------------------------------------------------------
>     > >  Come build with us! The BlackBerry(R) Developer Conference in
>     SF, CA
>     > > is the only developer event you need to attend this year.
>     Jumpstart your
>     > > developing skills, take BlackBerry mobile applications to
>     market and stay
>     > > ahead of the curve. Join us from November 9 - 12, 2009.
>     Register now!
>     > > http://p.sf.net/sfu/devconference
>     > > _______________________________________________
>     > > Semediawiki-user mailing list
>     > > Semediawiki-user@...
>     <mailto:Semediawiki-user@...>
>     > > https://lists.sourceforge.net/lists/listinfo/semediawiki-user
>     > >
>     >
>     ------------------------------------------------------------------------------
>     > Come build with us! The BlackBerry(R) Developer Conference in SF, CA
>     > is the only developer event you need to attend this year.
>     Jumpstart your
>     > developing skills, take BlackBerry mobile applications to market
>     and stay
>     > ahead of the curve. Join us from November 9 - 12, 2009. Register
>     now!
>     > http://p.sf.net/sfu/devconference
>     > _______________________________________________
>     > Semediawiki-user mailing list
>     > Semediawiki-user@...
>     <mailto:Semediawiki-user@...>
>     > https://lists.sourceforge.net/lists/listinfo/semediawiki-user
>     >
>     ------------------------------------------------------------------------------
>     Come build with us! The BlackBerry(R) Developer Conference in SF, CA
>     is the only developer event you need to attend this year.
>     Jumpstart your
>     developing skills, take BlackBerry mobile applications to market
>     and stay
>     ahead of the curve. Join us from November 9 - 12, 2009. Register now!
>     http://p.sf.net/sfu/devconference
>     _______________________________________________
>     Semediawiki-user mailing list
>     Semediawiki-user@...
>     <mailto:Semediawiki-user@...>
>     https://lists.sourceforge.net/lists/listinfo/semediawiki-user
>
>
------------------------------------------------------------------------------
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
_______________________________________________
Semediawiki-user mailing list
Semediawiki-user@...
https://lists.sourceforge.net/lists/listinfo/semediawiki-user

Re: arraymap: page results with commas in the name

by Stephan Gambke :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Scott Reed wrote:
>  From what I can see internal objects are similar to data objects with
> fields. In my application I have an /arbitrary number /of pages
> associated (as multiple values of a property) with a grouping page and I
> want to list the associated pages in a bulleted list in the grouping
> page. How would I do that with internal objects?

On the grouping page set the related pages, i.e. insert the following
for every related page:

{{#set_internal:has_grouping_page
|has_related_page=Title of a related page
}}


Then you can ask for related pages as follows:

{{#ask:[[has_grouping_page::{{SUBJECTPAGENAME}}]]
|mainlabel=-
|? has_related_page
|format=ul
}}

I am not sure, if internal objects store the namespace, though.
(If not, store it as an additional property of the internal object.)

Stephan

------------------------------------------------------------------------------
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
_______________________________________________
Semediawiki-user mailing list
Semediawiki-user@...
https://lists.sourceforge.net/lists/listinfo/semediawiki-user

Re: arraymap: page results with commas in the name

by Günther Zehetner :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

If I understand your problem correctly you can use the #sask function of the SQFT extension (http://www.mediawiki.org/wiki/Extension:SemanticQueryFormTool)

Having on page 'test1'
[[relatedpage::aaa| ]]
[[relatedpage::bbb, ccc| ]]
[[relatedpage::ddd| ]]

{{#ask:[[test1]]|?relatedpage|return=list|sep=;}}
returns
Relatedpage Aaa, Bbb, ccc, Ddd

while
{{#sask:[[test1]]|?relatedpage|return=list|sep=;|lastsep=|nospace=}}
returns
Aaa;Bbb,_ccc;Ddd

which arraymap should be able to process

Note that if property 'relatedpage' has type 'Page'
Aaa;Bbb,_ccc;Ddd
is returned while if 'relatedpage' has type 'string'
aaa;bbb, ccc;ddd is returned

Cheers,
Gu

--- On Tue, 11/3/09, Scott Reed <sreed@...> wrote:

> From: Scott Reed <sreed@...>
> Subject: Re: [Semediawiki-user] arraymap: page results with commas in the name
> To: "Yaron Koren" <yaron57@...>
> Cc: "Yaron Koren" <referata@...>, Semediawiki-user@...
> Date: Tuesday, November 3, 2009, 10:51 PM
> I am surprised this is not possible
> and I'm pretty frustrated at this
> point, having spent a lot of the day following instructions
> that didn't
> work. Nevertheless, I appreciate all the help. I think we
> all assumed it
> would be possible to allow any characters in a page name
> and it seems
> like an obvious requirement. If anyone can see their way to
> fixing this
> I'd really appreciate it.
>
> Thanks,
>   Scott
>
> Yaron Koren [11/3/2009 2:05 PM] wrote:
> > Ah, yes, sorry about that - I forgot that the "sep"
> parameter doesn't
> > affect multiple values for the same property. I just
> checked the SMW
> > code, and it looks like that comma is hardcoded -
> nothing can change
> > it. Which is a problem. Unfortunately, I can't think
> of any solutions
> > to this problem that aren't complete hacks. What's
> needed is just a
> > "delim=" parameter for the "list" formats (list, ol,
> ul, template),
> > that would set this delimiter; the "category" format
> already supports
> > this, but none of the others do. It shouldn't be that
> hard to add...
> >
> > -Yaron
> >
> >
> > On Tue, Nov 3, 2009 at 11:43 AM, Scott Reed <sreed@...
>
> > <mailto:sreed@...>>
> wrote:
> >
> >     Yaron,
> >     The separator is not being
> changed to ';'. If I try just the #ask:
> >
> >     
> >     
> {{#ask:[[{{SUBJECTPAGENAME}}]]|?RelatedPageProperty|format=list|sep=;}}
> >
> >     I get a single line starting
> with the name of the property followed by
> >     all the results separated by
> commas, e.g.
> >
> >        RelatedPageProperty abc
> def, ghi hjk, x, yz
> >
> >
> >     (where x, yz is a correct link
> to a page with a coma in the title).
> >     Since the separator is still
> commas, the #arraymap from ';' to '*'
> >     just
> >     adds a bullet to the front of
> the result of the #ask..
> >
> >     I get the same results if I
> try
> >
> >       
> {{#ask:[[{{SUBJECTPAGENAME}}]]|?RelatedPageProperty|format=ul}}
> >
> >     You can see this in our web
> site in a page to display the lesson plans
> >     that address a learning
> objective (with property:LessonPlan) :
> >     http://rootsup.referata.com/wiki/List_the_basic_components_of_a_solar_hot_water_system.
> >
> >     The template that generates
> that result is Template:LearnObj:
> >     http://rootsup.referata.com/w/index.php?title=Template:LearnObj&action=edit
> >     <http://rootsup.referata.com/w/index.php?title=Template:LearnObj&action=edit>
> >     <http://rootsup.referata.com/w/index.php?title=Template:LearnObj&action=edit
> >     <http://rootsup.referata.com/w/index.php?title=Template:LearnObj&action=edit>>
> >
> >     Yaron Koren [11/3/2009 10:37
> AM] wrote:
> >     > Scott - the following
> would probably work, assuming you don't have
> >     > semicolons in any of your
> values:
> >     >
> >     >
> > 
>    {{#arraymap:{{#ask:[[{{SUBJECTPAGENAME}}]]|?RelatedPageProperty|format=list|sep=;}}|;|x|*x|\n}}
> >     > ...of course, if you do
> have semicolons, you should change it to
> >     some other
> >     > character, or string...
> ";;" should also work.
> >     >
> >     > -Yaron
> >     > On Tue, Nov 3, 2009 at
> 10:23 AM, Laurent Alquier
> >     <laurent@...
> <mailto:laurent@...>>wrote:
> >     >
> >     > > That is to be
> expected since you have a comma in the title.
> >      Arraymap
> >     > > doesn't make a
> difference between commas from the title and
> >     commas used as
> >     > > separators.
> >     > >
> >     > > Here is the string
> that worked for me :
> >     > >
> >     > >
> <ul>{{#arraymap:{{{Data classes
> definitions|}}}|,|x|<li> [[Has
> >     data
> >     > > class::x]]|
> }}</ul>
> >     > >
> >     > > I forced the result
> of a query as a list and then replaced the
> >     separators
> >     > > by a space.
> >     > >
> >     > > Maybe you could do
> the same with a template instead of a list,
> >     and force
> >     > > separators to
> something that will not appear in your titles -
> >     ever.
> >     > >
> >     > > - Laurent
> >     > >
> >     > >
> ----------------------------------------
> >     > > From: "Scott Reed"
> <sreed@...
> <mailto:sreed@...>>
> >     > > Sent: Tuesday,
> November 03, 2009 3:06 AM
> >     > > To: Semediawiki-user@...
> >     <mailto:Semediawiki-user@...>
> >     > > Subject: Re:
> [Semediawiki-user] arraymap: page results with
> >     commas in the
> >     > > name
> >     > >
> >     > > Oops. I must have
> misunderstood. I tried:
> >     > >
> >     > > 
> >     
> {{#arraymap:{{#show:{{SUBJECTPAGENAME}}|?RelatedPageProperty}}|,|x|*x|
> >     > >    }}
> >     > >
> >     > > If #show: returns a
> page with title */x, y z/* then #arraymap:
> >     produces
> >     > > */x*y z/*
> >     > >
> >     > > Scott Reed
> [11/3/2009 8:54 AM] wrote:
> >     > > > Thank you,
> Laurent!!
> >     > > >
> >     > > > Laurent Alquier
> [11/3/2009 8:47 AM] wrote:
> >     > > >> Replace
> '\n' by a white space at the end of your code. '\n'
> >     is not
> >     > > >> necessary
> anyway since line returns are handled by the
> >     bullet list
> >     > > >> anyway...
> and it just happens to also remove the comma at
> >     the end of
> >     > > >> names.
> >     > > >>
> >     > > >> I found
> that out quite by accident while looking for the same
> >     > > >> question
> myself.
> >     > > >>
> >     > > >> Good luck
> >     > > >>
> >     > > >> - Laurent
> >     > > >>
> >     > > >>
> ----------------------------------------
> >     > > >> From:
> "Scott Reed"
> >     > >  >> Sent:
> Tuesday, November 03, 2009 1:23 AM
> >     > > >> To: Semediawiki-user@...
> >     <mailto:Semediawiki-user@...>
> >     > > >> Subject:
> [Semediawiki-user] arraymap: page results with
> >     commas in the
> >     > > >> name
> >     > > >>
> >     > > >> The
> following query works fine, producing a bulleted list
> >     of related
> >     > > >> pages,
> except with related pages that have commas in their
> >     name:
> >     > > >>
> >     > > >>
> >     > > >>
> >     > >
> > 
>    {{#arraymap:{{#show:{{SUBJECTPAGENAME}}|?RelatedPageProperty}}|,|x|*x|\n}}
> >     > >
> >     > > >>
> >     > > >>
> >     > > >> I know this
> must be a simple problem but I can't figure
> >     where the
> >     > > >> result
> separator character is addressed in the docs. Any
> >     help would
> >     > > >> be much
> appreciated.
> >     > > >> Thanks,
> >     > >
> >>   Scott
> >     > > >>
> >     > >
> >     > >
> > 
>    ----------------------------------------------------------------------------
> >     > >
> >     > > >>
> >     > > >> --
> >     > > >> Come build
> with us! The BlackBerry(R) Developer Conference
> >     in SF, CA
> >     > > >> is the only
> developer event you need to attend this year.
> >     Jumpstart
> >     > > your
> >     > > >> developing
> skills, take BlackBerry mobile applications to
> >     market and
> >     > > >> stay ahead
> of the curve. Join us from November 9 - 12,
> >     2009. Register
> >     > > >> now!
> >     > > >> http://p.sf.net/sfu/devconference
> >     > > >>
> _______________________________________________
> >     > > >>
> Semediawiki-user mailing list
> >     > > >> Semediawiki-user@...
> >     <mailto:Semediawiki-user@...>
> >     > > >> https://lists.sourceforge.net/lists/listinfo/semediawiki-user
> >     > > >>
> >     > > >>
> >     > > >>
> >     > >
> >     > >
> > 
>    ----------------------------------------------------------------------------
> >     > > --
> >     > > >>
> >     > > >> Come build
> with us! The BlackBerry(R) Developer Conference
> >     in SF, CA
> >     > > >> is the only
> developer event you need to attend this year.
> >     Jumpstart
> >     > > your
> >     > > >> developing
> skills, take BlackBerry mobile applications to
> >     market and
> >     > > >> stay ahead
> of the curve. Join us from November 9 - 12,
> >     2009. Register
> >     > > >> now!
> >     > > >> http://p.sf.net/sfu/devconference
> >     > > >>
> _______________________________________________
> >     > > >>
> Semediawiki-user mailing list
> >     > > >> Semediawiki-user@...
> >     <mailto:Semediawiki-user@...>
> >     > > >> https://lists.sourceforge.net/lists/listinfo/semediawiki-user
> >     > > >>
> >     > >
> >     > >
> > 
>    ----------------------------------------------------------------------------
> >     > > --
> >     > > Come build with us!
> The BlackBerry(R) Developer Conference in
> >     SF, CA
> >     > > is the only
> developer event you need to attend this year.
> >     Jumpstart your
> >     > > developing skills,
> take BlackBerry mobile applications to
> >     market and stay
> >     > > ahead of the curve.
> Join us from November 9 - 12, 2009.
> >     Register now!
> >     > > http://p.sf.net/sfu/devconference
> >     > >
> _______________________________________________
> >     > > Semediawiki-user
> mailing list
> >     > > Semediawiki-user@...
> >     <mailto:Semediawiki-user@...>
> >     > > https://lists.sourceforge.net/lists/listinfo/semediawiki-user
> >     > >
> >     > >
> >     > >
> >     > >
> > 
>    ------------------------------------------------------------------------------
> >     > >  Come build
> with us! The BlackBerry(R) Developer Conference in
> >     SF, CA
> >     > > is the only
> developer event you need to attend this year.
> >     Jumpstart your
> >     > > developing skills,
> take BlackBerry mobile applications to
> >     market and stay
> >     > > ahead of the curve.
> Join us from November 9 - 12, 2009.
> >     Register now!
> >     > > http://p.sf.net/sfu/devconference
> >     > >
> _______________________________________________
> >     > > Semediawiki-user
> mailing list
> >     > > Semediawiki-user@...
> >     <mailto:Semediawiki-user@...>
> >     > > https://lists.sourceforge.net/lists/listinfo/semediawiki-user
> >     > >
> >     >
> > 
>    ------------------------------------------------------------------------------
> >     > Come build with us! The
> BlackBerry(R) Developer Conference in SF, CA
> >     > is the only developer
> event you need to attend this year.
> >     Jumpstart your
> >     > developing skills, take
> BlackBerry mobile applications to market
> >     and stay
> >     > ahead of the curve. Join
> us from November 9 - 12, 2009. Register
> >     now!
> >     > http://p.sf.net/sfu/devconference
> >     >
> _______________________________________________
> >     > Semediawiki-user mailing
> list
> >     > Semediawiki-user@...
> >     <mailto:Semediawiki-user@...>
> >     > https://lists.sourceforge.net/lists/listinfo/semediawiki-user
> >     >
> > 
>    ------------------------------------------------------------------------------
> >     Come build with us! The
> BlackBerry(R) Developer Conference in SF, CA
> >     is the only developer event
> you need to attend this year.
> >     Jumpstart your
> >     developing skills, take
> BlackBerry mobile applications to market
> >     and stay
> >     ahead of the curve. Join us
> from November 9 - 12, 2009. Register now!
> >     http://p.sf.net/sfu/devconference
> > 
>    _______________________________________________
> >     Semediawiki-user mailing list
> >     Semediawiki-user@...
> >     <mailto:Semediawiki-user@...>
> >     https://lists.sourceforge.net/lists/listinfo/semediawiki-user
> >
> >
> ------------------------------------------------------------------------------
> Come build with us! The BlackBerry(R) Developer Conference
> in SF, CA
> is the only developer event you need to attend this year.
> Jumpstart your
> developing skills, take BlackBerry mobile applications to
> market and stay
> ahead of the curve. Join us from November 9 - 12, 2009.
> Register now!
> http://p.sf.net/sfu/devconference
> _______________________________________________
> Semediawiki-user mailing list
> Semediawiki-user@...
> https://lists.sourceforge.net/lists/listinfo/semediawiki-user
>


     

------------------------------------------------------------------------------
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-user mailing list
Semediawiki-user@...
https://lists.sourceforge.net/lists/listinfo/semediawiki-user

Re: arraymap: page results with commas in the name

by Scott Reed-3 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Stephan's suggestion to use internal objects instead of properties was
easy to implement as he said and it works better than other proposals
(my wikihost doesn't seem to support SemanticQueryFormTool so I can't
try Gunther's #sask suggestion). *

However, each time I load the grouping page with the set_internal
functions a new value gets added to the has_related_page field for each
of the related pages so each list item becomes a list of repeated page
titles. *This didn't happen with properties and I'm not familiar with
the internal object extension, but I suppose internal objects allow
duplicate values for a field and that semantic properties don't. Whether
or not that is so, I'd appreciate any help in fixing this.
*
* Thanks,
   Scott

Stephan Gambke [11/3/2009 5:10 PM] wrote:

> Scott Reed wrote:
> >  From what I can see internal objects are similar to data objects with
> > fields. In my application I have an /arbitrary number /of pages
> > associated (as multiple values of a property) with a grouping page and I
> > want to list the associated pages in a bulleted list in the grouping
> > page. How would I do that with internal objects?
>
> On the grouping page set the related pages, i.e. insert the following
> for every related page:
>
> {{#set_internal:has_grouping_page
> |has_related_page=Title of a related page
> }}
>
>
> Then you can ask for related pages as follows:
>
> {{#ask:[[has_grouping_page::{{SUBJECTPAGENAME}}]]
> |mainlabel=-
> |? has_related_page
> |format=ul
> }}
>
> I am not sure, if internal objects store the namespace, though.
> (If not, store it as an additional property of the internal object.)
>
> Stephan
>  
------------------------------------------------------------------------------
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-user mailing list
Semediawiki-user@...
https://lists.sourceforge.net/lists/listinfo/semediawiki-user

Re: arraymap: page results with commas in the name

by Yaron Koren :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

That sounds like a bug in SIO, if I understand it correctly - the same value
appears more than once when the results are queried? Can you put here the
call you're making to #set_internal?

-Yaron

On Wed, Nov 4, 2009 at 10:14 PM, Scott Reed <sreed@...> wrote:

> Stephan's suggestion to use internal objects instead of properties was
> easy to implement as he said and it works better than other proposals
> (my wikihost doesn't seem to support SemanticQueryFormTool so I can't
> try Gunther's #sask suggestion). *
>
> However, each time I load the grouping page with the set_internal
> functions a new value gets added to the has_related_page field for each
> of the related pages so each list item becomes a list of repeated page
> titles. *This didn't happen with properties and I'm not familiar with
> the internal object extension, but I suppose internal objects allow
> duplicate values for a field and that semantic properties don't. Whether
> or not that is so, I'd appreciate any help in fixing this.
> *
> * Thanks,
>   Scott
>
> Stephan Gambke [11/3/2009 5:10 PM] wrote:
> > Scott Reed wrote:
> > >  From what I can see internal objects are similar to data objects with
> > > fields. In my application I have an /arbitrary number /of pages
> > > associated (as multiple values of a property) with a grouping page and
> I
> > > want to list the associated pages in a bulleted list in the grouping
> > > page. How would I do that with internal objects?
> >
> > On the grouping page set the related pages, i.e. insert the following
> > for every related page:
> >
> > {{#set_internal:has_grouping_page
> > |has_related_page=Title of a related page
> > }}
> >
> >
> > Then you can ask for related pages as follows:
> >
> > {{#ask:[[has_grouping_page::{{SUBJECTPAGENAME}}]]
> > |mainlabel=-
> > |? has_related_page
> > |format=ul
> > }}
> >
> > I am not sure, if internal objects store the namespace, though.
> > (If not, store it as an additional property of the internal object.)
> >
> > Stephan
> >
>
> ------------------------------------------------------------------------------
> 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-user mailing list
> Semediawiki-user@...
> https://lists.sourceforge.net/lists/listinfo/semediawiki-user
>
------------------------------------------------------------------------------
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-user mailing list
Semediawiki-user@...
https://lists.sourceforge.net/lists/listinfo/semediawiki-user