Ask query updates

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

Ask query updates

AUDI IN AEV Ausbilduser 13 (I/AEV)
I have observed that an ask-query only gets updated once the page
containing the inline-query gets edited and saved again. Lets say I have
a query for all instances in category actors

<ask>[[Category:actors]] [[age:=*]] [[lives in::*]]</ask>

When I add a new actor page to this category the result of the query
does not contain this new instance unless I edit and save the page.

Is this the normal behavior? Is there a workaround? What's the point in
having dynamic querys if they are not really dynamic??

Cheers,

Nils

-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Semediawiki-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/semediawiki-user
Reply | Threaded
Open this post in threaded view
|

Re: Ask query updates

Yaron Koren
You don't need to edit and save; hitting the "Refresh" tab will
accomplish the same thing. The issue is that the ask query isn't going
to the database, it's getting the cached version of the query.

-Yaron

On 4/27/07, AUDI IN AEV Ausbilduser 13 (I/AEV)
<[hidden email]> wrote:

> I have observed that an ask-query only gets updated once the page
> containing the inline-query gets edited and saved again. Lets say I have
> a query for all instances in category actors
>
> <ask>[[Category:actors]] [[age:=*]] [[lives in::*]]</ask>
>
> When I add a new actor page to this category the result of the query
> does not contain this new instance unless I edit and save the page.
>
> Is this the normal behavior? Is there a workaround? What's the point in
> having dynamic querys if they are not really dynamic??
>
> Cheers,
>
> Nils
>
> -------------------------------------------------------------------------
> This SF.net email is sponsored by DB2 Express
> Download DB2 Express C - the FREE version of DB2 express and take
> control of your XML. No limits. Just data. Click to get it now.
> http://sourceforge.net/powerbar/db2/
> _______________________________________________
> Semediawiki-user mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/semediawiki-user
>

-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Semediawiki-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/semediawiki-user
Reply | Threaded
Open this post in threaded view
|

Re: Ask query updates

Markus Nitsche
As far as I know this answer is not correct (I just checked it again
with Mediawiki 1.10 and SMW 0.6). Up to now, ask-queries are only
executed once (this is when you save the page) and the results are then
saved and not refreshed anymore!
If you change anything that is contained in the query, a refresh or
reload of the page will NOT show these changes. Only if you edit and
save the page.
However there is a workaround:
You can either add a "?action=purge" in the adress bar after the article
name, so

http://myhost/mediawiki/index.php/Foobar

becmoes

http://myhost/mediawiki/index.php/Foobar?action=purge


or you edit the page and enter an "external" backlink to the same page
with that parameter, for example:

[http://myhost/mediawiki/index.php/Foobar?action=purge Klick to refresh]

You can then click on this link to refresh the page and update the query
results.

Kind regards,

Markus


-----Ursprüngliche Nachricht-----
Von: [hidden email]
[mailto:[hidden email]] Im Auftrag von
Yaron Koren
Gesendet: Freitag, 27. April 2007 13:35
An: AUDI IN AEV Ausbilduser 13 (I/AEV)
Cc: [hidden email]
Betreff: Re: [Semediawiki-user] Ask query updates

You don't need to edit and save; hitting the "Refresh" tab will
accomplish the same thing. The issue is that the ask query isn't going
to the database, it's getting the cached version of the query.

-Yaron

On 4/27/07, AUDI IN AEV Ausbilduser 13 (I/AEV)
<[hidden email]> wrote:
> I have observed that an ask-query only gets updated once the page
> containing the inline-query gets edited and saved again. Lets say I
have
> a query for all instances in category actors
>
> <ask>[[Category:actors]] [[age:=*]] [[lives in::*]]</ask>
>
> When I add a new actor page to this category the result of the query
> does not contain this new instance unless I edit and save the page.
>
> Is this the normal behavior? Is there a workaround? What's the point
in
> having dynamic querys if they are not really dynamic??
>
> Cheers,
>
> Nils
>
>
------------------------------------------------------------------------
-
> This SF.net email is sponsored by DB2 Express
> Download DB2 Express C - the FREE version of DB2 express and take
> control of your XML. No limits. Just data. Click to get it now.
> http://sourceforge.net/powerbar/db2/
> _______________________________________________
> Semediawiki-user mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/semediawiki-user
>

------------------------------------------------------------------------
-
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Semediawiki-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/semediawiki-user


-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Semediawiki-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/semediawiki-user
Reply | Threaded
Open this post in threaded view
|

Re: Ask query updates

AUDI IN AEV Ausbilduser 13 (I/AEV)
The "?action=purge" workaround works by uncaching the page, right?

I could not see a page refresh have any influence on the caching of pages. Is there any possibility to prevent a wiki page from caching at all? So that pages containing queries would always return up-to-date data.


-----Ursprüngliche Nachricht-----
Von: Markus Nitsche [mailto:[hidden email]]
Gesendet: Freitag, 27. April 2007 13:58
An: 'Yaron Koren'; AUDI IN AEV Ausbilduser 13 (I/AEV)
Cc: [hidden email]
Betreff: AW: [Semediawiki-user] Ask query updates


As far as I know this answer is not correct (I just checked it again
with Mediawiki 1.10 and SMW 0.6). Up to now, ask-queries are only
executed once (this is when you save the page) and the results are then
saved and not refreshed anymore!
If you change anything that is contained in the query, a refresh or
reload of the page will NOT show these changes. Only if you edit and
save the page.
However there is a workaround:
You can either add a "?action=purge" in the adress bar after the article
name, so

http://myhost/mediawiki/index.php/Foobar

becmoes

http://myhost/mediawiki/index.php/Foobar?action=purge


or you edit the page and enter an "external" backlink to the same page
with that parameter, for example:

[http://myhost/mediawiki/index.php/Foobar?action=purge Klick to refresh]

You can then click on this link to refresh the page and update the query
results.

Kind regards,

Markus


-----Ursprüngliche Nachricht-----
Von: [hidden email]
[mailto:[hidden email]] Im Auftrag von
Yaron Koren
Gesendet: Freitag, 27. April 2007 13:35
An: AUDI IN AEV Ausbilduser 13 (I/AEV)
Cc: [hidden email]
Betreff: Re: [Semediawiki-user] Ask query updates

You don't need to edit and save; hitting the "Refresh" tab will
accomplish the same thing. The issue is that the ask query isn't going
to the database, it's getting the cached version of the query.

-Yaron

On 4/27/07, AUDI IN AEV Ausbilduser 13 (I/AEV)
<[hidden email]> wrote:
> I have observed that an ask-query only gets updated once the page
> containing the inline-query gets edited and saved again. Lets say I
have
> a query for all instances in category actors
>
> <ask>[[Category:actors]] [[age:=*]] [[lives in::*]]</ask>
>
> When I add a new actor page to this category the result of the query
> does not contain this new instance unless I edit and save the page.
>
> Is this the normal behavior? Is there a workaround? What's the point
in
> having dynamic querys if they are not really dynamic??
>
> Cheers,
>
> Nils
>
>
------------------------------------------------------------------------
-
> This SF.net email is sponsored by DB2 Express
> Download DB2 Express C - the FREE version of DB2 express and take
> control of your XML. No limits. Just data. Click to get it now.
> http://sourceforge.net/powerbar/db2/
> _______________________________________________
> Semediawiki-user mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/semediawiki-user
>

------------------------------------------------------------------------
-
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Semediawiki-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/semediawiki-user


-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Semediawiki-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/semediawiki-user
Reply | Threaded
Open this post in threaded view
|

Re: Ask query updates

Yaron Koren
Sorry, I should have been clearer. The "Refresh" tab I'm talking about
isn't the "reload" button on the browser, it's a tab within the wiki
page you're looking at, alongside "edit", "history", etc. That tab is
basically just a link to the "?action=purge" query you're talking
about.

The "Refresh" tab, by default, shows up only for administrators; it's
possible that you don't see it because you're not an administrator.
There are two possible solutions that I know about:

1) (this is what's done on my site, discoursedb.org) Make the refresh
tab show up for all users, by commenting out the "if" statement in the
file "/includes/SMW_RefreshTab.php" within the SMW directory

2) (suggested by Fernando Correia) Change the line that sets
"$configdate" in the file "LocalSettings.php", in the main MW
directory, to the following:

$configdate = gmdate("M d Y H:i:s", mktime());  # Disable page cache

The first will allow anyone to refresh any page at any time; the
second will automatically refresh pages every time they're read.

-Yaron


On 4/27/07, AUDI IN AEV Ausbilduser 13 (I/AEV)
<[hidden email]> wrote:

> The "?action=purge" workaround works by uncaching the page, right?
>
> I could not see a page refresh have any influence on the caching of pages. Is there any possibility to prevent a wiki page from caching at all? So that pages containing queries would always return up-to-date data.
>
>
> -----Ursprüngliche Nachricht-----
> Von: Markus Nitsche [mailto:[hidden email]]
> Gesendet: Freitag, 27. April 2007 13:58
> An: 'Yaron Koren'; AUDI IN AEV Ausbilduser 13 (I/AEV)
> Cc: [hidden email]
> Betreff: AW: [Semediawiki-user] Ask query updates
>
>
> As far as I know this answer is not correct (I just checked it again
> with Mediawiki 1.10 and SMW 0.6). Up to now, ask-queries are only
> executed once (this is when you save the page) and the results are then
> saved and not refreshed anymore!
> If you change anything that is contained in the query, a refresh or
> reload of the page will NOT show these changes. Only if you edit and
> save the page.
> However there is a workaround:
> You can either add a "?action=purge" in the adress bar after the article
> name, so
>
> http://myhost/mediawiki/index.php/Foobar
>
> becmoes
>
> http://myhost/mediawiki/index.php/Foobar?action=purge
>
>
> or you edit the page and enter an "external" backlink to the same page
> with that parameter, for example:
>
> [http://myhost/mediawiki/index.php/Foobar?action=purge Klick to refresh]
>
> You can then click on this link to refresh the page and update the query
> results.
>
> Kind regards,
>
> Markus
>
>
> -----Ursprüngliche Nachricht-----
> Von: [hidden email]
> [mailto:[hidden email]] Im Auftrag von
> Yaron Koren
> Gesendet: Freitag, 27. April 2007 13:35
> An: AUDI IN AEV Ausbilduser 13 (I/AEV)
> Cc: [hidden email]
> Betreff: Re: [Semediawiki-user] Ask query updates
>
> You don't need to edit and save; hitting the "Refresh" tab will
> accomplish the same thing. The issue is that the ask query isn't going
> to the database, it's getting the cached version of the query.
>
> -Yaron
>
> On 4/27/07, AUDI IN AEV Ausbilduser 13 (I/AEV)
> <[hidden email]> wrote:
> > I have observed that an ask-query only gets updated once the page
> > containing the inline-query gets edited and saved again. Lets say I
> have
> > a query for all instances in category actors
> >
> > <ask>[[Category:actors]] [[age:=*]] [[lives in::*]]</ask>
> >
> > When I add a new actor page to this category the result of the query
> > does not contain this new instance unless I edit and save the page.
> >
> > Is this the normal behavior? Is there a workaround? What's the point
> in
> > having dynamic querys if they are not really dynamic??
> >
> > Cheers,
> >
> > Nils
> >
> >
> ------------------------------------------------------------------------
> -
> > This SF.net email is sponsored by DB2 Express
> > Download DB2 Express C - the FREE version of DB2 express and take
> > control of your XML. No limits. Just data. Click to get it now.
> > http://sourceforge.net/powerbar/db2/
> > _______________________________________________
> > Semediawiki-user mailing list
> > [hidden email]
> > https://lists.sourceforge.net/lists/listinfo/semediawiki-user
> >
>
> ------------------------------------------------------------------------
> -
> This SF.net email is sponsored by DB2 Express
> Download DB2 Express C - the FREE version of DB2 express and take
> control of your XML. No limits. Just data. Click to get it now.
> http://sourceforge.net/powerbar/db2/
> _______________________________________________
> Semediawiki-user mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/semediawiki-user
>
>

-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Semediawiki-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/semediawiki-user
Reply | Threaded
Open this post in threaded view
|

Re: Ask query updates

Markus Krötzsch
Yaron is perfectly right. The reason for not updating the inline queries is
MediaWiki's cache, made of various special components for the purpose of
improving performance. If you do not want a cache but prefer continuous
recomputation, you can switch it off as suggested by Yaron. This is OK on
small sites, but not on large sites (which is why it is not the default in
MediaWiki).

The "refresh" tab is hidden from normal users since it makes the interface
more complicated, but the action of clearing a page's cache is available even
to anonymous users (there just is no dedicated tab for this). Some other ways
of updating your cache are:

* Make a cron job on your server that executes "touch LocalSettings.php" every
day or so. This will cause the cache to be refreshed regularly, without
breaking it completely.
* Hide the refresh tab but provide an inline link to "update this query" on
relevant pages. This can be done by a simple template that does not need
parameters, similar to http://ontoworld.org/wiki/Template:Update.

Unfortunatelly, it is not easy to automatically find out which pages contain
queries that need to be refreshed after some change, which is why this is not
done automatically.

Cheers,

Markus

On Friday 27 April 2007 16:32, Yaron Koren wrote:

> Sorry, I should have been clearer. The "Refresh" tab I'm talking about
> isn't the "reload" button on the browser, it's a tab within the wiki
> page you're looking at, alongside "edit", "history", etc. That tab is
> basically just a link to the "?action=purge" query you're talking
> about.
>
> The "Refresh" tab, by default, shows up only for administrators; it's
> possible that you don't see it because you're not an administrator.
> There are two possible solutions that I know about:
>
> 1) (this is what's done on my site, discoursedb.org) Make the refresh
> tab show up for all users, by commenting out the "if" statement in the
> file "/includes/SMW_RefreshTab.php" within the SMW directory
>
> 2) (suggested by Fernando Correia) Change the line that sets
> "$configdate" in the file "LocalSettings.php", in the main MW
> directory, to the following:
>
> $configdate = gmdate("M d Y H:i:s", mktime());  # Disable page cache
>
> The first will allow anyone to refresh any page at any time; the
> second will automatically refresh pages every time they're read.
>
> -Yaron
>
>
> On 4/27/07, AUDI IN AEV Ausbilduser 13 (I/AEV)
>
> <[hidden email]> wrote:
> > The "?action=purge" workaround works by uncaching the page, right?
> >
> > I could not see a page refresh have any influence on the caching of
> > pages. Is there any possibility to prevent a wiki page from caching at
> > all? So that pages containing queries would always return up-to-date
> > data.
> >
> >
> > -----Ursprüngliche Nachricht-----
> > Von: Markus Nitsche [mailto:[hidden email]]
> > Gesendet: Freitag, 27. April 2007 13:58
> > An: 'Yaron Koren'; AUDI IN AEV Ausbilduser 13 (I/AEV)
> > Cc: [hidden email]
> > Betreff: AW: [Semediawiki-user] Ask query updates
> >
> >
> > As far as I know this answer is not correct (I just checked it again
> > with Mediawiki 1.10 and SMW 0.6). Up to now, ask-queries are only
> > executed once (this is when you save the page) and the results are then
> > saved and not refreshed anymore!
> > If you change anything that is contained in the query, a refresh or
> > reload of the page will NOT show these changes. Only if you edit and
> > save the page.
> > However there is a workaround:
> > You can either add a "?action=purge" in the adress bar after the article
> > name, so
> >
> > http://myhost/mediawiki/index.php/Foobar
> >
> > becmoes
> >
> > http://myhost/mediawiki/index.php/Foobar?action=purge
> >
> >
> > or you edit the page and enter an "external" backlink to the same page
> > with that parameter, for example:
> >
> > [http://myhost/mediawiki/index.php/Foobar?action=purge Klick to refresh]
> >
> > You can then click on this link to refresh the page and update the query
> > results.
> >
> > Kind regards,
> >
> > Markus
> >
> >
> > -----Ursprüngliche Nachricht-----
> > Von: [hidden email]
> > [mailto:[hidden email]] Im Auftrag von
> > Yaron Koren
> > Gesendet: Freitag, 27. April 2007 13:35
> > An: AUDI IN AEV Ausbilduser 13 (I/AEV)
> > Cc: [hidden email]
> > Betreff: Re: [Semediawiki-user] Ask query updates
> >
> > You don't need to edit and save; hitting the "Refresh" tab will
> > accomplish the same thing. The issue is that the ask query isn't going
> > to the database, it's getting the cached version of the query.
> >
> > -Yaron
> >
> > On 4/27/07, AUDI IN AEV Ausbilduser 13 (I/AEV)
> >
> > <[hidden email]> wrote:
> > > I have observed that an ask-query only gets updated once the page
> > > containing the inline-query gets edited and saved again. Lets say I
> >
> > have
> >
> > > a query for all instances in category actors
> > >
> > > <ask>[[Category:actors]] [[age:=*]] [[lives in::*]]</ask>
> > >
> > > When I add a new actor page to this category the result of the query
> > > does not contain this new instance unless I edit and save the page.
> > >
> > > Is this the normal behavior? Is there a workaround? What's the point
> >
> > in
> >
> > > having dynamic querys if they are not really dynamic??
> > >
> > > Cheers,
> > >
> > > Nils
> >
> > ------------------------------------------------------------------------
> > -
> >
> > > This SF.net email is sponsored by DB2 Express
> > > Download DB2 Express C - the FREE version of DB2 express and take
> > > control of your XML. No limits. Just data. Click to get it now.
> > > http://sourceforge.net/powerbar/db2/
> > > _______________________________________________
> > > Semediawiki-user mailing list
> > > [hidden email]
> > > https://lists.sourceforge.net/lists/listinfo/semediawiki-user
> >
> > ------------------------------------------------------------------------
> > -
> > This SF.net email is sponsored by DB2 Express
> > Download DB2 Express C - the FREE version of DB2 express and take
> > control of your XML. No limits. Just data. Click to get it now.
> > http://sourceforge.net/powerbar/db2/
> > _______________________________________________
> > Semediawiki-user mailing list
> > [hidden email]
> > https://lists.sourceforge.net/lists/listinfo/semediawiki-user
>
> -------------------------------------------------------------------------
> This SF.net email is sponsored by DB2 Express
> Download DB2 Express C - the FREE version of DB2 express and take
> control of your XML. No limits. Just data. Click to get it now.
> http://sourceforge.net/powerbar/db2/
> _______________________________________________
> Semediawiki-user mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/semediawiki-user
--
Markus Krötzsch
Institute AIFB, University of Karlsruhe, D-76128 Karlsruhe
[hidden email]        phone +49 (0)721 608 7362
www.aifb.uni-karlsruhe.de/WBS/     fax +49 (0)721 693  717

-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Semediawiki-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/semediawiki-user

attachment0 (196 bytes) Download Attachment