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: mediawiki-l@lists.wikimedia.org; semediawiki-user@lists.sourceforge.net 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
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....
--James
On Tue, Oct 23, 2018 at 9:27 AM Evans, Richard K. (GRC-H000) via Semediawiki-user semediawiki-user@lists.sourceforge.net 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: mediawiki-l@lists.wikimedia.org; semediawiki-user@lists.sourceforge.net 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 Semediawiki-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/semediawiki-user
I’ll try it with the switches as you’ve suggested and let you know. Thanks, James!
-Rich
From: James Montalvo [mailto:jamesmontalvo3@gmail.com] 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....
--James
On Tue, Oct 23, 2018 at 9:27 AM Evans, Richard K. (GRC-H000) via Semediawiki-user <semediawiki-user@lists.sourceforge.netmailto:semediawiki-user@lists.sourceforge.net> 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: mediawiki-l@lists.wikimedia.orgmailto:mediawiki-l@lists.wikimedia.org; semediawiki-user@lists.sourceforge.netmailto:semediawiki-user@lists.sourceforge.net 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 Semediawiki-user@lists.sourceforge.netmailto:Semediawiki-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/semediawiki-user
James Montalvo jamesmontalvo3@gmail.com 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....
Good catch. Thanks!
On Wed, Oct 31, 2018 at 11:55 AM Mark A. Hershberger mah@nichework.com wrote:
James Montalvo jamesmontalvo3@gmail.com 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....
-- Mark A. Hershberger NicheWork LLC 717-271-1084
mediawiki-l@lists.wikimedia.org