[SMW-devel] Query formats min and max

2012-11-22 Thread Markus Krötzsch
Hi,

I would like to ask about this:

http://semantic-mediawiki.org/wiki/Help:Max_format

I am afraid to say that this idea seems to be fundamentally broken. The 
above page seriously suggests to find the largest population number in 
the wiki by querying for a list of *all cities with and without 
population* and invoke PHP code that scans through this list to find the 
maximum (this is what format=max does, AFAIK). The query to do this is:

{{#ask: [[Category:City]]
| ?Population
| format=max
}}

This is an extremely slow method of producing wrong results (the results 
will be wrong as soon as there are enough pages in the wiki so that the 
one with the maximum value is after the default query limit when 
ordering results alphabetically).

What one would do instead is to ask for the one result that has the 
largest value right away, like this:

{{#ask: [[Category:City]]
| ?Population
| sort=population
| order=DESC
| limit=1
| format=max
}}

The max format in this case is obsolete, since one could also just do

{{#ask: [[Category:City]]
| ?Population=
| mainlabel=-
| sort=population
| order=DESC
| limit=1
}}

This has the big advantage that one can also use further output 
formatting on the resulting number, e.g., to get it in a plain format 
without any beautification.


I just noted these problems since there seem to be cases where PHP runs 
out of time/memory due to users following the above query anti-pattern 
[1]. My conclusion would be: let's drop max/min as soon as possible and 
change the documentation to give the efficient query pattern I gave above.

Markus

[1] https://bugzilla.wikimedia.org/show_bug.cgi?id=42347

--
Monitor your physical, virtual and cloud infrastructure from a single
web console. Get in-depth insight into apps, servers, databases, vmware,
SAP, cloud infrastructure, etc. Download 30-day Free Trial.
Pricing starts from $795 for 25 servers or applications!
http://p.sf.net/sfu/zoho_dev2dev_nov
___
Semediawiki-devel mailing list
Semediawiki-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/semediawiki-devel


Re: [SMW-devel] [News] SMW 1.8 RC1 available

2012-11-22 Thread Neill Mitchell
Hi Markus.

This is great news. Thanks to all involved!

I'll run it through my regression test suite over the next couple of days.

Best regards
Neill.
On 22/11/12 07:41, Markus Krötzsch wrote:
 Dear all,

 SMW 1.8 is close to its first stable release. We have now packaged a
 Release Candidate for download [1]. If all goes well, this will become
 SMW 1.8.0 in about a week. As usual, the package includes the required
 version of Validator.

 Major new features include:

 * New data storage: more efficient, less database activity
 * Interface improvements in Special:Ask
 * New atom and RSS printer
 * SMW now provides information about #ask queries used on the wiki [2]
 * Support for #subobjects without a name
 * Ask API now stable, with added continuation support

 Moreover, a large number of bugs have been fixed, compatibility to all
 recent MW versions has been ensured, a lot of internal improvements have
 been made, and translations have been added. A record number of people
 have contributed to this work.

 For those of you who download versions from git, there is also an
 according tag there for this RC. The master branch itself will remain in
 a stable state until 1.8 is released.

 Feedback is most welcome.

 Cheers,

 Markus


 [1]
 http://sourceforge.net/projects/semediawiki/files/semediawiki/Semantic%20MediaWiki%201.8%20RC1/
 [2] You can now query for queries. Examples:

 * The 10 largest queries used on the wiki with their size and query string:

 {{#ask:[[query string::+]]
 |?query size
 |?query string
 |sort=query size
 |order=DESC
 |limit=10
 }}

 * The number of queries that use the format list:

 {{#ask:[[query format::list]] |format=count }}

 * The number of pages that use queries that use the format list:

 {{#ask:[[has query.query format::list]] |format=count }}

 * The total number of queries:

 {{#ask:[[query size::+]] |format=count }}

 * Pages that have a query with format list and one with format table:

 {{#ask: [[has query.query format::list]] [[has query.query
 format::table]] }}

 --
 Monitor your physical, virtual and cloud infrastructure from a single
 web console. Get in-depth insight into apps, servers, databases, vmware,
 SAP, cloud infrastructure, etc. Download 30-day Free Trial.
 Pricing starts from $795 for 25 servers or applications!
 http://p.sf.net/sfu/zoho_dev2dev_nov
 ___
 Semediawiki-devel mailing list
 Semediawiki-devel@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/semediawiki-devel



--
Monitor your physical, virtual and cloud infrastructure from a single
web console. Get in-depth insight into apps, servers, databases, vmware,
SAP, cloud infrastructure, etc. Download 30-day Free Trial.
Pricing starts from $795 for 25 servers or applications!
http://p.sf.net/sfu/zoho_dev2dev_nov
___
Semediawiki-devel mailing list
Semediawiki-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/semediawiki-devel


Re: [SMW-devel] [News] SMW 1.8 RC1 available

2012-11-22 Thread Neill Mitchell
Hi all.

One thing to note. You must run the SMW_refreshData maintenance script 
after upgrading. I had a brief moment of panic as all my property values 
were empty!

Cheers
Neill.

On 22/11/12 10:00, Neill Mitchell wrote:
 Hi Markus.

 This is great news. Thanks to all involved!

 I'll run it through my regression test suite over the next couple of days.

 Best regards
 Neill.
 On 22/11/12 07:41, Markus Krötzsch wrote:
 Dear all,

 SMW 1.8 is close to its first stable release. We have now packaged a
 Release Candidate for download [1]. If all goes well, this will become
 SMW 1.8.0 in about a week. As usual, the package includes the required
 version of Validator.

 Major new features include:

 * New data storage: more efficient, less database activity
 * Interface improvements in Special:Ask
 * New atom and RSS printer
 * SMW now provides information about #ask queries used on the wiki [2]
 * Support for #subobjects without a name
 * Ask API now stable, with added continuation support

 Moreover, a large number of bugs have been fixed, compatibility to all
 recent MW versions has been ensured, a lot of internal improvements have
 been made, and translations have been added. A record number of people
 have contributed to this work.

 For those of you who download versions from git, there is also an
 according tag there for this RC. The master branch itself will remain in
 a stable state until 1.8 is released.

 Feedback is most welcome.

 Cheers,

 Markus


 [1]
 http://sourceforge.net/projects/semediawiki/files/semediawiki/Semantic%20MediaWiki%201.8%20RC1/
 [2] You can now query for queries. Examples:

 * The 10 largest queries used on the wiki with their size and query string:

 {{#ask:[[query string::+]]
 |?query size
 |?query string
 |sort=query size
 |order=DESC
 |limit=10
 }}

 * The number of queries that use the format list:

 {{#ask:[[query format::list]] |format=count }}

 * The number of pages that use queries that use the format list:

 {{#ask:[[has query.query format::list]] |format=count }}

 * The total number of queries:

 {{#ask:[[query size::+]] |format=count }}

 * Pages that have a query with format list and one with format table:

 {{#ask: [[has query.query format::list]] [[has query.query
 format::table]] }}

 --
 Monitor your physical, virtual and cloud infrastructure from a single
 web console. Get in-depth insight into apps, servers, databases, vmware,
 SAP, cloud infrastructure, etc. Download 30-day Free Trial.
 Pricing starts from $795 for 25 servers or applications!
 http://p.sf.net/sfu/zoho_dev2dev_nov
 ___
 Semediawiki-devel mailing list
 Semediawiki-devel@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/semediawiki-devel


 --
 Monitor your physical, virtual and cloud infrastructure from a single
 web console. Get in-depth insight into apps, servers, databases, vmware,
 SAP, cloud infrastructure, etc. Download 30-day Free Trial.
 Pricing starts from $795 for 25 servers or applications!
 http://p.sf.net/sfu/zoho_dev2dev_nov
 ___
 Semediawiki-devel mailing list
 Semediawiki-devel@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/semediawiki-devel



--
Monitor your physical, virtual and cloud infrastructure from a single
web console. Get in-depth insight into apps, servers, databases, vmware,
SAP, cloud infrastructure, etc. Download 30-day Free Trial.
Pricing starts from $795 for 25 servers or applications!
http://p.sf.net/sfu/zoho_dev2dev_nov
___
Semediawiki-devel mailing list
Semediawiki-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/semediawiki-devel


Re: [SMW-devel] [News] SMW 1.8 RC1 available

2012-11-22 Thread Markus Krötzsch
On 22/11/12 10:19, Neill Mitchell wrote:
 Hi all.

 One thing to note. You must run the SMW_refreshData maintenance script
 after upgrading. I had a brief moment of panic as all my property values
 were empty!

Yes, please *do* read the section about upgrading in INSTALL. I paste 
the main part of its text below, just in case you cannot find INSTALL ;-)

Also, please do not try to delete your old SQLStore2 yet (a bug has been 
discovered there today; the script won't accept the parameter that 
specifies the store, so it only let's you delete the store you currently 
use). This will be re-enabled before the release.

Markus

===

SMW 1.8 introduces a new default database layout (SMWSQLStore3). You can
continue to use the old layout (SMWSQLStore2) for transition purposes, 
but it
is strongly recommended to migrate to the new layout for future 
compatibility.

To use the old layout at first, add $smwgDefaultStore = 'SMWSQLStore2'; to
your LocalSettings.php. If you are using $smwgDefaultStore = 
'SMWSparqlStore';
already, then you should keep this line and add the following:
SMWSparqlStore::$baseStoreClass = 'SMWSQLStore2'; (after enableSemantics).
After setting these, run SMW_setup.php or Special:SMWAdmin upgrade as usual.
The wiki should now work as normal, but using the old storage structures.

To migrate to the new store, you can do a normal full refresh for the new
store. Run the following two commands (both will run a while).

php SMW_refreshData.php -v -b SMWSQLStore3 -fp
php SMW_refreshData.php -v -b SMWSQLStore3

The running wiki will not be affected by this, but the operation could 
affect
server speed. See
http://semantic-mediawiki.org/wiki/Help:Repairing_SMW%27s_data for details.

After successful migration, remove the lines with 'SMWSQLStore2' from your
LocalSettings.php to use the new store. You can always return to the old 
store
in case of problems. If the old store is no longer needed, it can be deleted
(and its memory freed) by running

...
(this does not work, as mentioned above; don't try it yet)




 Cheers
 Neill.

 On 22/11/12 10:00, Neill Mitchell wrote:
 Hi Markus.

 This is great news. Thanks to all involved!

 I'll run it through my regression test suite over the next couple of days.

 Best regards
 Neill.
 On 22/11/12 07:41, Markus Krötzsch wrote:
 Dear all,

 SMW 1.8 is close to its first stable release. We have now packaged a
 Release Candidate for download [1]. If all goes well, this will become
 SMW 1.8.0 in about a week. As usual, the package includes the required
 version of Validator.

 Major new features include:

 * New data storage: more efficient, less database activity
 * Interface improvements in Special:Ask
 * New atom and RSS printer
 * SMW now provides information about #ask queries used on the wiki [2]
 * Support for #subobjects without a name
 * Ask API now stable, with added continuation support

 Moreover, a large number of bugs have been fixed, compatibility to all
 recent MW versions has been ensured, a lot of internal improvements have
 been made, and translations have been added. A record number of people
 have contributed to this work.

 For those of you who download versions from git, there is also an
 according tag there for this RC. The master branch itself will remain in
 a stable state until 1.8 is released.

 Feedback is most welcome.

 Cheers,

 Markus


 [1]
 http://sourceforge.net/projects/semediawiki/files/semediawiki/Semantic%20MediaWiki%201.8%20RC1/
 [2] You can now query for queries. Examples:

 * The 10 largest queries used on the wiki with their size and query string:

 {{#ask:[[query string::+]]
 |?query size
 |?query string
 |sort=query size
 |order=DESC
 |limit=10
 }}

 * The number of queries that use the format list:

 {{#ask:[[query format::list]] |format=count }}

 * The number of pages that use queries that use the format list:

 {{#ask:[[has query.query format::list]] |format=count }}

 * The total number of queries:

 {{#ask:[[query size::+]] |format=count }}

 * Pages that have a query with format list and one with format table:

 {{#ask: [[has query.query format::list]] [[has query.query
 format::table]] }}

 --
 Monitor your physical, virtual and cloud infrastructure from a single
 web console. Get in-depth insight into apps, servers, databases, vmware,
 SAP, cloud infrastructure, etc. Download 30-day Free Trial.
 Pricing starts from $795 for 25 servers or applications!
 http://p.sf.net/sfu/zoho_dev2dev_nov
 ___
 Semediawiki-devel mailing list
 Semediawiki-devel@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/semediawiki-devel


 --
 Monitor your physical, virtual and cloud infrastructure from a single
 web console. Get in-depth insight into apps, servers, databases, vmware,
 SAP, cloud infrastructure, etc. Download 

Re: [SMW-devel] Query formats min and max

2012-11-22 Thread Yury Katkov
The premises are clear:
(1) the current implementation of the max parser function is slow and
(2)  there is a workaround for making max queries quicker.

The conclusion is not clear: let's drop the max ASAP.

It's not that hard to replace the current implementation of MAX format
with the faster one and save the backward compatibility there.
-
Yury Katkov, WikiVote



On Thu, Nov 22, 2012 at 1:23 PM, Markus Krötzsch
mar...@semantic-mediawiki.org wrote:
 Hi,

 I would like to ask about this:

 http://semantic-mediawiki.org/wiki/Help:Max_format

 I am afraid to say that this idea seems to be fundamentally broken. The
 above page seriously suggests to find the largest population number in
 the wiki by querying for a list of *all cities with and without
 population* and invoke PHP code that scans through this list to find the
 maximum (this is what format=max does, AFAIK). The query to do this is:

 {{#ask: [[Category:City]]
 | ?Population
 | format=max
 }}

 This is an extremely slow method of producing wrong results (the results
 will be wrong as soon as there are enough pages in the wiki so that the
 one with the maximum value is after the default query limit when
 ordering results alphabetically).

 What one would do instead is to ask for the one result that has the
 largest value right away, like this:

 {{#ask: [[Category:City]]
 | ?Population
 | sort=population
 | order=DESC
 | limit=1
 | format=max
 }}

 The max format in this case is obsolete, since one could also just do

 {{#ask: [[Category:City]]
 | ?Population=
 | mainlabel=-
 | sort=population
 | order=DESC
 | limit=1
 }}

 This has the big advantage that one can also use further output
 formatting on the resulting number, e.g., to get it in a plain format
 without any beautification.


 I just noted these problems since there seem to be cases where PHP runs
 out of time/memory due to users following the above query anti-pattern
 [1]. My conclusion would be: let's drop max/min as soon as possible and
 change the documentation to give the efficient query pattern I gave above.

 Markus

 [1] https://bugzilla.wikimedia.org/show_bug.cgi?id=42347

 --
 Monitor your physical, virtual and cloud infrastructure from a single
 web console. Get in-depth insight into apps, servers, databases, vmware,
 SAP, cloud infrastructure, etc. Download 30-day Free Trial.
 Pricing starts from $795 for 25 servers or applications!
 http://p.sf.net/sfu/zoho_dev2dev_nov
 ___
 Semediawiki-devel mailing list
 Semediawiki-devel@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/semediawiki-devel

--
Monitor your physical, virtual and cloud infrastructure from a single
web console. Get in-depth insight into apps, servers, databases, vmware,
SAP, cloud infrastructure, etc. Download 30-day Free Trial.
Pricing starts from $795 for 25 servers or applications!
http://p.sf.net/sfu/zoho_dev2dev_nov
___
Semediawiki-devel mailing list
Semediawiki-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/semediawiki-devel


Re: [SMW-devel] Query formats min and max

2012-11-22 Thread Jeroen De Dauw
Hey,

Markus, I agree with you that in most cases you're better off doing a
sorted query, and think this should be reflected in the documentation.
I however would not be to quick to conclude the max format is
completely useless. For one thing it supports recursion when dealing
with containers. People might also be relying on the result being the
max or min of the result set and not everything that matches the
query, ie querying the 10 last edited cities and getting the biggest
population of those.

So I suggest making sure the documentation is clear enough so people
don't misuse it while keeping the printer. After all, it's in SRF and
can easily be disabled. And it has not been causing serious problems
motivating removal to my knowledge.

Cheers

--
Jeroen De Dauw
http://www.bn2vs.com
Don't panic. Don't be evil.
--

--
Monitor your physical, virtual and cloud infrastructure from a single
web console. Get in-depth insight into apps, servers, databases, vmware,
SAP, cloud infrastructure, etc. Download 30-day Free Trial.
Pricing starts from $795 for 25 servers or applications!
http://p.sf.net/sfu/zoho_dev2dev_nov
___
Semediawiki-devel mailing list
Semediawiki-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/semediawiki-devel


[SMW-devel] Improving Infoboxes in SemanticMaps

2012-11-22 Thread Nischay Nahata
Hi all,

I have been working on Semantic Maps for sometime, adding support for
various shapes (polygons, rectangles, etc)
which can also be added to a page using a forminput with a map editor, and
be queried and displayed using the map format.

My next step is to add pop-ups to polygons, this is mostly like we had for
markers. But we don't have a good design for this.
The current progress can be seen at [1].

Also there has already been some work on this, which unfortunately isn't in
SemanticMaps for everyone to use, see [2].

So, my questions are -

What can be the best design for such infoboxes?
There is support for templates in infoboxes for markers, can someone give
an example of that?

Also other suggestions are welcome :)

[1] http://semantic-mediawiki.org/wiki/File:SemanticMapsPopUpExample.png
[2] http://www.organicdesign.co.nz/Google_Maps_API
-- 
Cheers,

Nischay Nahata
nischayn22.in
--
Monitor your physical, virtual and cloud infrastructure from a single
web console. Get in-depth insight into apps, servers, databases, vmware,
SAP, cloud infrastructure, etc. Download 30-day Free Trial.
Pricing starts from $795 for 25 servers or applications!
http://p.sf.net/sfu/zoho_dev2dev_nov___
Semediawiki-devel mailing list
Semediawiki-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/semediawiki-devel