[MediaWiki-l] maintenance script to perform "null edit" to all pages.

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

[MediaWiki-l] maintenance script to perform "null edit" to all pages.

rkevans
I should clarify --- I'm creating a calculated Boolean property called "is expired" and using a date calculation in the template to set it to true or false. This is ultimately what I want updated every night. Then those pages that are newly calculated as "is expired=true" can be made to go into a Category called "Expired Items" that users can then "watch" using the extension "CategoryWatch", thus generating email notifications.

Does that make sense?

Is there a maintenance script that would perform a "null-edit" of every page (or all pages in a category)?

-Rich

-----Original Message-----
From: Evans, Richard K. (GRC-H000)
Sent: Monday, October 22, 2018 2:36 PM
To: [hidden email]; [hidden email]
Subject: API call to purge all pages in a specific category

Folks,

Quick MW 1.30 question regarding remote refreshing of pages needed by a SMW application.  

Can someone tell me how to write an API call that Purges all pages in a specific category?

Background --- I have a semantic "Class" (a Form, Template, and Category set of pages that work together) called "MyTasks" that produces task tracking pages with a few date fields including one called "Property:has date needed by" (of type date)---  Within "Template:MyTasks", I have manually added an additional semantic property that is not used by the Form. It is called "Property:has days till due" (of type number). Also within the template I calculate the difference in the number of days between the current system time of the client where the page is being viewed and the "has date needed by" provided previously by the form. The goal is to be able to write a semantic query that show all tasks that are due in less than 10 days. For example: {{#ask:[[Category:MyTasks]][[has days till due::<10]]|format=ol}}

The problem is ---- I need to refresh the wiki pages in Category:MyTasks every night so that the "has days till due" value gets updated each day.

My thought is to have an API call that purge all files in a given category I can add that to a cURL command in a PHP file on the server that I can call nightly from a cron job.

Thanks!
-Rich

_______________________________________________
MediaWiki-l mailing list
To unsubscribe, go to:
https://lists.wikimedia.org/mailman/listinfo/mediawiki-l
Reply | Threaded
Open this post in threaded view
|

Re: [Semediawiki-user] maintenance script to perform "null edit" to all pages.

James Montalvo
Have you tried:

php rebuildData.php -v --categories="Some_category_name" --skip-properties

I'm not actually certain on the syntax of categories...guessing it'd be
"Some_category_name,Another_category".  The docs [1] also give the option
to do this instead of categories: --query='[[Category:SomeCategory]]'

I believe we've talked in the past that rebuildData.php wouldn't work for
your case, but I think as long as you don't include the -f option (which
wipes out all SMW data first) it should work. Also the addition of
--skip-properties may be necessary

[1]
https://www.semantic-mediawiki.org/wiki/Help:Maintenance_script_rebuildData.php

--James


On Tue, Oct 23, 2018 at 9:27 AM Evans, Richard K. (GRC-H000) via
Semediawiki-user <[hidden email]> wrote:

> I should clarify --- I'm creating a calculated Boolean property called "is
> expired" and using a date calculation in the template to set it to true or
> false. This is ultimately what I want updated every night. Then those pages
> that are newly calculated as "is expired=true" can be made to go into a
> Category called "Expired Items" that users can then "watch" using the
> extension "CategoryWatch", thus generating email notifications.
>
> Does that make sense?
>
> Is there a maintenance script that would perform a "null-edit" of every
> page (or all pages in a category)?
>
> -Rich
>
> -----Original Message-----
> From: Evans, Richard K. (GRC-H000)
> Sent: Monday, October 22, 2018 2:36 PM
> To: [hidden email];
> [hidden email]
> Subject: API call to purge all pages in a specific category
>
> Folks,
>
> Quick MW 1.30 question regarding remote refreshing of pages needed by a
> SMW application.
>
> Can someone tell me how to write an API call that Purges all pages in a
> specific category?
>
> Background --- I have a semantic "Class" (a Form, Template, and Category
> set of pages that work together) called "MyTasks" that produces task
> tracking pages with a few date fields including one called "Property:has
> date needed by" (of type date)---  Within "Template:MyTasks", I have
> manually added an additional semantic property that is not used by the
> Form. It is called "Property:has days till due" (of type number). Also
> within the template I calculate the difference in the number of days
> between the current system time of the client where the page is being
> viewed and the "has date needed by" provided previously by the form. The
> goal is to be able to write a semantic query that show all tasks that are
> due in less than 10 days. For example: {{#ask:[[Category:MyTasks]][[has
> days till due::<10]]|format=ol}}
>
> The problem is ---- I need to refresh the wiki pages in Category:MyTasks
> every night so that the "has days till due" value gets updated each day.
>
> My thought is to have an API call that purge all files in a given category
> I can add that to a cURL command in a PHP file on the server that I can
> call nightly from a cron job.
>
> Thanks!
> -Rich
>
>
> _______________________________________________
> Semediawiki-user mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/semediawiki-user
>
_______________________________________________
MediaWiki-l mailing list
To unsubscribe, go to:
https://lists.wikimedia.org/mailman/listinfo/mediawiki-l
Reply | Threaded
Open this post in threaded view
|

Re: [Semediawiki-user] maintenance script to perform "null edit" to all pages.

rkevans
I’ll try it with the switches as you’ve suggested and let you know. Thanks, James!

-Rich

From: James Montalvo [mailto:[hidden email]]
Sent: Tuesday, October 23, 2018 1:46 PM
To: Evans, Richard K. (GRC-H000)
Cc: MediaWiki announcements and site admin list; Semantic MediaWiki users
Subject: Re: [Semediawiki-user] maintenance script to perform "null edit" to all pages.

Have you tried:

php rebuildData.php -v --categories="Some_category_name" --skip-properties

I'm not actually certain on the syntax of categories...guessing it'd be "Some_category_name,Another_category".  The docs [1] also give the option to do this instead of categories: --query='[[Category:SomeCategory]]'

I believe we've talked in the past that rebuildData.php wouldn't work for your case, but I think as long as you don't include the -f option (which wipes out all SMW data first) it should work. Also the addition of --skip-properties may be necessary

[1] https://www.semantic-mediawiki.org/wiki/Help:Maintenance_script_rebuildData.php

--James


On Tue, Oct 23, 2018 at 9:27 AM Evans, Richard K. (GRC-H000) via Semediawiki-user <[hidden email]<mailto:[hidden email]>> wrote:
I should clarify --- I'm creating a calculated Boolean property called "is expired" and using a date calculation in the template to set it to true or false. This is ultimately what I want updated every night. Then those pages that are newly calculated as "is expired=true" can be made to go into a Category called "Expired Items" that users can then "watch" using the extension "CategoryWatch", thus generating email notifications.

Does that make sense?

Is there a maintenance script that would perform a "null-edit" of every page (or all pages in a category)?

-Rich

-----Original Message-----
From: Evans, Richard K. (GRC-H000)
Sent: Monday, October 22, 2018 2:36 PM
To: [hidden email]<mailto:[hidden email]>; [hidden email]<mailto:[hidden email]>
Subject: API call to purge all pages in a specific category

Folks,

Quick MW 1.30 question regarding remote refreshing of pages needed by a SMW application.

Can someone tell me how to write an API call that Purges all pages in a specific category?

Background --- I have a semantic "Class" (a Form, Template, and Category set of pages that work together) called "MyTasks" that produces task tracking pages with a few date fields including one called "Property:has date needed by" (of type date)---  Within "Template:MyTasks", I have manually added an additional semantic property that is not used by the Form. It is called "Property:has days till due" (of type number). Also within the template I calculate the difference in the number of days between the current system time of the client where the page is being viewed and the "has date needed by" provided previously by the form. The goal is to be able to write a semantic query that show all tasks that are due in less than 10 days. For example: {{#ask:[[Category:MyTasks]][[has days till due::<10]]|format=ol}}

The problem is ---- I need to refresh the wiki pages in Category:MyTasks every night so that the "has days till due" value gets updated each day.

My thought is to have an API call that purge all files in a given category I can add that to a cURL command in a PHP file on the server that I can call nightly from a cron job.

Thanks!
-Rich


_______________________________________________
Semediawiki-user mailing list
[hidden email]<mailto:[hidden email]>
https://lists.sourceforge.net/lists/listinfo/semediawiki-user
_______________________________________________
MediaWiki-l mailing list
To unsubscribe, go to:
https://lists.wikimedia.org/mailman/listinfo/mediawiki-l
Reply | Threaded
Open this post in threaded view
|

Re: [Semediawiki-user] maintenance script to perform "null edit" to all pages.

Mark A. Hershberger-4
In reply to this post by James Montalvo
James Montalvo <[hidden email]> writes:

> Have you tried:
>
> php rebuildData.php -v --categories="Some_category_name" --skip-properties
>
> I'm not actually certain on the syntax of categories...guessing it'd be
> "Some_category_name,Another_category".  The docs [1] also give the option
> to do this instead of categories: --query='[[Category:SomeCategory]]'

James,

After a user pointed me to your message and asked if it would help in
her circumstance, I found that the syntax you have doesn't focus only on
one category.

Specifically, --categories: "Will refresh only category pages (and other
explicitly named namespaces)" as [1] says.  This means the
[[Category:...]] pages themselves, not the pages in the category.

Which means that you have to use this form, instead:

    php rebuildData.php -v --query="[[Category:Some category name]]" --skip-properties

Footnotes:
[1]  https://www.semantic-mediawiki.org/wiki/Help:Maintenance_script_rebuildData.php


--
Mark A. Hershberger
NicheWork LLC
717-271-1084

_______________________________________________
MediaWiki-l mailing list
To unsubscribe, go to:
https://lists.wikimedia.org/mailman/listinfo/mediawiki-l
Reply | Threaded
Open this post in threaded view
|

Re: [Semediawiki-user] maintenance script to perform "null edit" to all pages.

James Montalvo
Good catch. Thanks!

On Wed, Oct 31, 2018 at 11:55 AM Mark A. Hershberger <[hidden email]>
wrote:

> James Montalvo <[hidden email]> writes:
>
> > Have you tried:
> >
> > php rebuildData.php -v --categories="Some_category_name"
> --skip-properties
> >
> > I'm not actually certain on the syntax of categories...guessing it'd be
> > "Some_category_name,Another_category".  The docs [1] also give the option
> > to do this instead of categories: --query='[[Category:SomeCategory]]'
>
> James,
>
> After a user pointed me to your message and asked if it would help in
> her circumstance, I found that the syntax you have doesn't focus only on
> one category.
>
> Specifically, --categories: "Will refresh only category pages (and other
> explicitly named namespaces)" as [1] says.  This means the
> [[Category:...]] pages themselves, not the pages in the category.
>
> Which means that you have to use this form, instead:
>
>     php rebuildData.php -v --query="[[Category:Some category name]]"
> --skip-properties
>
> Footnotes:
> [1]
> https://www.semantic-mediawiki.org/wiki/Help:Maintenance_script_rebuildData.php
>
>
> --
> Mark A. Hershberger
> NicheWork LLC
> 717-271-1084
>
_______________________________________________
MediaWiki-l mailing list
To unsubscribe, go to:
https://lists.wikimedia.org/mailman/listinfo/mediawiki-l