Re: [SMW-devel] Ask query in extension

2014-11-02 Thread Toni Hermoso Pulido
Hi James,

I found this link some weeks ago:
https://semantic-mediawiki.org/wiki/User:Yury_Katkov/programming_examples

Even though Semantic Tasks is unmaintained, I found some piece of code
that could inspire you as well:
https://git.wikimedia.org/blob/mediawiki%2Fextensions%2FSemanticTasks/5363a0ba564c5c3708c246a4c316260d781da1e1/SemanticTasks.classes.php

Hope it helps,

El 01/11/14 a les 19:18, James Montalvo ha escrit:
 I'm creating a parser function in which I'm going to include an ask query.
 In this particular case I'd like it just return a normal HTML table of
 results, as if I were to do:
 
 {{#ask: [[Category:Some category]]
 |? Property 1
 |? Property 2
 | limit = 10
 | sort = Property 2
 }}
 
 Once I understand this I'll probably have cases where I need to modify the
 results of the query before passing it to a result formatter or formatting
 the results manually. What is the best way to do this using existing SMW
 methods?
 
 Thanks,
 James
 

-- 
Toni Hermoso Pulido
http://www.cau.cat
http://www.similis.cc

--
___
Semediawiki-devel mailing list
Semediawiki-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/semediawiki-devel


Re: [SMW-devel] Ask query in extension

2014-11-02 Thread James HK
Hi,

 Even though Semantic Tasks is unmaintained, I found some piece of code
 that could inspire you as well:
 https://git.wikimedia.org/blob/mediawiki%2Fextensions%2FSemanticTasks/5363a0ba564c5c3708c246a4c316260d781da1e1/SemanticTasks.classes.php

Please try not follow these as general guideline because things like
[0] will not work in 1.9 or 2.0* and is a rather odd practice to
invoke the `QueryProcessor`.

If you need examples on how to use a particular class or an
integration scenario try to have a look at [1] and if you can't find
an appropriate example then add a request to [2] with a clear
description of a possible test example.

[0] 
https://git.wikimedia.org/blob/mediawiki%2Fextensions%2FSemanticTasks/5363a0ba564c5c3708c246a4c316260d781da1e1/SemanticTasks.classes.php#L321

[1] https://github.com/SemanticMediaWiki/SemanticMediaWiki/tree/master/tests

[2] https://github.com/SemanticMediaWiki/SemanticMediaWiki/issues/445

Cheers

On 11/2/14, Toni Hermoso Pulido toni...@softcatala.cat wrote:
 Hi James,

 I found this link some weeks ago:
 https://semantic-mediawiki.org/wiki/User:Yury_Katkov/programming_examples

 Even though Semantic Tasks is unmaintained, I found some piece of code
 that could inspire you as well:
 https://git.wikimedia.org/blob/mediawiki%2Fextensions%2FSemanticTasks/5363a0ba564c5c3708c246a4c316260d781da1e1/SemanticTasks.classes.php

 Hope it helps,

 El 01/11/14 a les 19:18, James Montalvo ha escrit:
 I'm creating a parser function in which I'm going to include an ask
 query.
 In this particular case I'd like it just return a normal HTML table of
 results, as if I were to do:

 {{#ask: [[Category:Some category]]
 |? Property 1
 |? Property 2
 | limit = 10
 | sort = Property 2
 }}

 Once I understand this I'll probably have cases where I need to modify
 the
 results of the query before passing it to a result formatter or
 formatting
 the results manually. What is the best way to do this using existing SMW
 methods?

 Thanks,
 James


 --
 Toni Hermoso Pulido
 http://www.cau.cat
 http://www.similis.cc

 --
 ___
 Semediawiki-devel mailing list
 Semediawiki-devel@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/semediawiki-devel


--
___
Semediawiki-devel mailing list
Semediawiki-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/semediawiki-devel


Re: [SMW-devel] Ask query in extension

2014-11-02 Thread James Montalvo
I spent a lot of time on Friday trying to figure out how to replicate an
ask query in PHP. I was pretty sure I could do something to reuse the
parser, but since I wanted to be able to manipulate the data before
displaying it I did not pursue that method. Thank you, Frank, for the way
you described. I'm sure that will come in handy in the future.

I also spent some time messing around with QueryProcessor. I agree with
Jeroen that the result data is odd, and I came to the conclusion that I
must have been doing something wrong.

This morning I looked at Yuri Katkov's examples provided by Toni [0], and
as MWJames said they do not work with SMW 2.0. Below I have modified Yuri's
all pages with the property example [1], and upon immediate inspection it
appears to be working. I plan on modifying Yuri's more complex examples to
work with SMW 2.0, but would like any input if I'm doing anything wrong
here. Also I'll make the examples do something more interesting than
print_r.


// Perform query replicating {{#ask: [[Age::23]] }}
$numberValue = new \SMWDINumber( 23 );
$queryDescription = new \SMWSomeProperty(
new \SMW\DIProperty( 'Age' ),
new \SMWValueDescription( $numberValue )
);
$query = new \SMWQuery( $queryDescription );
$store = \SMW\StoreFactory::getStore();
$result = $store-getQueryResult( $query );

print_r( $result-getResults() );


--James

[0]
https://semantic-mediawiki.org/wiki/User:Yury_Katkov/programming_examples
[1]
https://semantic-mediawiki.org/wiki/User:Yury_Katkov/programming_examples#All_pages_with_the_property


On Sun, Nov 2, 2014 at 6:25 AM, Toni Hermoso Pulido toni...@softcatala.cat
wrote:

 Thanks for the notes, James!

 El 02/11/14 a les 12:57, James HK ha escrit:
  Hi,
 
  Even though Semantic Tasks is unmaintained, I found some piece of code
  that could inspire you as well:
 
 https://git.wikimedia.org/blob/mediawiki%2Fextensions%2FSemanticTasks/5363a0ba564c5c3708c246a4c316260d781da1e1/SemanticTasks.classes.php
 
  Please try not follow these as general guideline because things like
  [0] will not work in 1.9 or 2.0* and is a rather odd practice to
  invoke the `QueryProcessor`.
 
  If you need examples on how to use a particular class or an
  integration scenario try to have a look at [1] and if you can't find
  an appropriate example then add a request to [2] with a clear
  description of a possible test example.
 
  [0]
 https://git.wikimedia.org/blob/mediawiki%2Fextensions%2FSemanticTasks/5363a0ba564c5c3708c246a4c316260d781da1e1/SemanticTasks.classes.php#L321
 
  [1]
 https://github.com/SemanticMediaWiki/SemanticMediaWiki/tree/master/tests
 
  [2] https://github.com/SemanticMediaWiki/SemanticMediaWiki/issues/445
 
  Cheers
 
  On 11/2/14, Toni Hermoso Pulido toni...@softcatala.cat wrote:
  Hi James,
 
  I found this link some weeks ago:
 
 https://semantic-mediawiki.org/wiki/User:Yury_Katkov/programming_examples
 
  Even though Semantic Tasks is unmaintained, I found some piece of code
  that could inspire you as well:
 
 https://git.wikimedia.org/blob/mediawiki%2Fextensions%2FSemanticTasks/5363a0ba564c5c3708c246a4c316260d781da1e1/SemanticTasks.classes.php
 
  Hope it helps,
 
  El 01/11/14 a les 19:18, James Montalvo ha escrit:
  I'm creating a parser function in which I'm going to include an ask
  query.
  In this particular case I'd like it just return a normal HTML table of
  results, as if I were to do:
 
  {{#ask: [[Category:Some category]]
  |? Property 1
  |? Property 2
  | limit = 10
  | sort = Property 2
  }}
 
  Once I understand this I'll probably have cases where I need to modify
  the
  results of the query before passing it to a result formatter or
  formatting
  the results manually. What is the best way to do this using existing
 SMW
  methods?
 

 --
 Toni Hermoso Pulido
 http://www.cau.cat
 http://www.similis.cc


 --
 ___
 Semediawiki-devel mailing list
 Semediawiki-devel@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/semediawiki-devel

--
___
Semediawiki-devel mailing list
Semediawiki-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/semediawiki-devel


Re: [SMW-devel] Ask query in extension

2014-11-02 Thread JoelKP
James Montalvo wrote
 I spent a lot of time on Friday trying to figure out how to replicate an
 ask query in PHP. I was pretty sure I could do something to reuse the
 parser, but since I wanted to be able to manipulate the data before
 displaying it I did not pursue that method. Thank you, Frank, for the way
 you described. I'm sure that will come in handy in the future.

There is also the following extension, which provides a simple interface for
making queries in PHP:
https://www.mediawiki.org/wiki/User:Vedmaka/Semantic_Query_Interface
https://github.com/vedmaka/SemanticQueryInterface

Even if the extension is not used directly, the code it contains is useful
in showing how querying can be done.



--
View this message in context: 
http://wikimedia.7.x6.nabble.com/Ask-query-in-extension-tp5038530p5038566.html
Sent from the Semantic Mediawiki - Development mailing list archive at 
Nabble.com.

--
___
Semediawiki-devel mailing list
Semediawiki-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/semediawiki-devel


Re: [SMW-devel] Ask query in extension

2014-11-01 Thread Jeroen De Dauw
Hey,

So you'd have something like

{{#gimmeh_datas_in_a_table: [[Category:Some category]]}}

that results in the same output as the #ask call you posted? If that's all
you're doing you can of course just use a template. Which indeed does not
work if you want to modify the result in certain ways.

Your parser function would hand the query string to the QueryProcessor, get
back the result, and then hand the result over to the formatting thing
(can't recall where this code is). And in between you could try modifying
the result. Be warned though, the result data structure is... odd... So it
might not be trivial to do this.

Cheers

--
Jeroen De Dauw - http://www.bn2vs.com
Software craftsmanship advocate
Evil software architect at Wikimedia Germany
~=[,,_,,]:3
--
___
Semediawiki-devel mailing list
Semediawiki-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/semediawiki-devel


Re: [SMW-devel] Ask 1.0 released!

2013-11-22 Thread Jeroen De Dauw
Hey,

Hopefully writing result formats will become even easier
 and more pleasant task!


Hopefully it will yes! Though this will not be brought with using the Ask
library, as the technical issues faced there are mostly disjoint from the
Ask language. That being said, having a nicer implementation of the Ask
language is likely to help facilitate a new class of result formats, much
in line with the AJAX stuff recently written about.

What do you think to do with growong number of dependencies of SMW?


These will not bother the users as they currently due, since SMW will be
one of the first MediaWiki extensions to support a real dependency manager.
More on that will be announced in due time.

It seems that by SMW 1.11 we're going to need to install Validator,
 DataValues, Ask


SMW 1.9 has been needing all of those, except Ask, already for quite some
time.

Maybe we should pack SMW tarball with these extensions?


We definitely should, and have been doing this since SMW 1.6 or 1.7, I
can't quite recall.

By the way, are there any other MW extensions that also use Validator
 and/or DataValues?


Yes. Validator is used by Maps and SubPageList, amongst others. DataValues
is used by Validator, and by many of the Wikibase related components. I'm
hoping to have automatically generated lists of these package consumers
available in the coming month. This is now possible due to having actual
package definitions ans using public package repos.

Cheers

--
Jeroen De Dauw
http://www.bn2vs.com
Don't panic. Don't be evil. ~=[,,_,,]:3
--
--
Shape the Mobile Experience: Free Subscription
Software experts and developers: Be at the forefront of tech innovation.
Intel(R) Software Adrenaline delivers strategic insight and game-changing 
conversations that shape the rapidly evolving mobile landscape. Sign up now. 
http://pubads.g.doubleclick.net/gampad/clk?id=63431311iu=/4140/ostg.clktrk___
Semediawiki-devel mailing list
Semediawiki-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/semediawiki-devel


Re: [SMW-devel] Ask 1.0 released!

2013-11-18 Thread vitalif
 Good stuff! Hopefully writing result formats will become even easier
 and more pleasant task!
 
 What do you think to do with growong number of dependencies of SMW? It
 seems that by SMW 1.11 we're going to need to install Validator,
 DataValues, Ask and maybe something else in order to install SMW. Of
 course, there is a Composer but I'm pretty sure that there's not much
 people using it. Maybe we should pack SMW tarball with these
 extensions?

+1 from me.

By the way, are there any other MW extensions that also use Validator 
and/or DataValues?

--
DreamFactory - Open Source REST  JSON Services for HTML5  Native Apps
OAuth, Users, Roles, SQL, NoSQL, BLOB Storage and External API Access
Free app hosting. Or install the open source package on any LAMP server.
Sign up and see examples for AngularJS, jQuery, Sencha Touch and Native!
http://pubads.g.doubleclick.net/gampad/clk?id=63469471iu=/4140/ostg.clktrk
___
Semediawiki-devel mailing list
Semediawiki-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/semediawiki-devel


Re: [SMW-devel] Ask 1.0 released!

2013-11-17 Thread John McClure
Hi and very nice Jeroen. Any discussion which version of smw is expected 
to have this common library? I assume it's the same syntax as before, 
minus subobjects? Any other functional differences? thanks for the hard 
work/john


On 11/17/2013 2:11 PM, Jeroen De Dauw wrote:

Hey all,

I'm happy to announce the initial release of the Ask library!

A small write-up of this release can be found at 
http://www.bn2vs.com/blog/2013/11/17/ask-1-0-released/


The library itself and its documentation resides at 
https://github.com/wmde/Ask


Cheers

--
Jeroen De Dauw
http://www.bn2vs.com
Don't panic. Don't be evil. ~=[,,_,,]:3
--


--
DreamFactory - Open Source REST  JSON Services for HTML5  Native Apps
OAuth, Users, Roles, SQL, NoSQL, BLOB Storage and External API Access
Free app hosting. Or install the open source package on any LAMP server.
Sign up and see examples for AngularJS, jQuery, Sencha Touch and Native!
http://pubads.g.doubleclick.net/gampad/clk?id=63469471iu=/4140/ostg.clktrk


___
Semediawiki-devel mailing list
Semediawiki-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/semediawiki-devel


--
DreamFactory - Open Source REST  JSON Services for HTML5  Native Apps
OAuth, Users, Roles, SQL, NoSQL, BLOB Storage and External API Access
Free app hosting. Or install the open source package on any LAMP server.
Sign up and see examples for AngularJS, jQuery, Sencha Touch and Native!
http://pubads.g.doubleclick.net/gampad/clk?id=63469471iu=/4140/ostg.clktrk___
Semediawiki-devel mailing list
Semediawiki-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/semediawiki-devel


Re: [SMW-devel] Ask 1.0 released!

2013-11-17 Thread Jeroen De Dauw
Hey John,

 Any discussion which version of smw is expected to have this common
library

There is no discussion about this, as quite some work needs to happen
before we can use Ask in SMW. All I can provide is a guess for the first
release in which SMW might realistically be using this library, which is
SMW 1.11. That is all assuming we manage to stick to our release roadmap
this time.

 I assume it's the same syntax as before, minus subobjects?

This library is a set of entities that represent data and contain some
business logic. It does not define syntax. When SMW adopts this library, it
can retain its current wikitext parsing and formatting code. Though I hope
this code will have been rewritten by that point (without functional
changes), as it is very much legacy code as well.

A library build on top of this new one provides the serialization and
deserialization code for the Ask language that will be used by the Wikidata
project. This could be used in SMWs web API instead, or as addition to, the
wikitext serialization of Ask. A release announcement of this will follow
hopefully soon.

https://github.com/wmde/AskSerialization


Cheers

--
Jeroen De Dauw
http://www.bn2vs.com
Don't panic. Don't be evil. ~=[,,_,,]:3
--
--
DreamFactory - Open Source REST  JSON Services for HTML5  Native Apps
OAuth, Users, Roles, SQL, NoSQL, BLOB Storage and External API Access
Free app hosting. Or install the open source package on any LAMP server.
Sign up and see examples for AngularJS, jQuery, Sencha Touch and Native!
http://pubads.g.doubleclick.net/gampad/clk?id=63469471iu=/4140/ostg.clktrk___
Semediawiki-devel mailing list
Semediawiki-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/semediawiki-devel


Re: [SMW-devel] Ask 1.0 released!

2013-11-17 Thread Yury Katkov
Hi Jeroen!

Good stuff! Hopefully writing result formats will become even easier
and more pleasant task!

What do you think to do with growong number of dependencies of SMW? It
seems that by SMW 1.11 we're going to need to install Validator,
DataValues, Ask and maybe something else in order to install SMW. Of
course, there is a Composer but I'm pretty sure that there's not much
people using it. Maybe we should pack SMW tarball with these
extensions?
-
Yury Katkov, WikiVote



On Mon, Nov 18, 2013 at 4:10 AM, Jeroen De Dauw jeroended...@gmail.com wrote:
 Hey John,

 Any discussion which version of smw is expected to have this common
 library

 There is no discussion about this, as quite some work needs to happen before
 we can use Ask in SMW. All I can provide is a guess for the first release in
 which SMW might realistically be using this library, which is SMW 1.11. That
 is all assuming we manage to stick to our release roadmap this time.

 I assume it's the same syntax as before, minus subobjects?

 This library is a set of entities that represent data and contain some
 business logic. It does not define syntax. When SMW adopts this library, it
 can retain its current wikitext parsing and formatting code. Though I hope
 this code will have been rewritten by that point (without functional
 changes), as it is very much legacy code as well.

 A library build on top of this new one provides the serialization and
 deserialization code for the Ask language that will be used by the Wikidata
 project. This could be used in SMWs web API instead, or as addition to, the
 wikitext serialization of Ask. A release announcement of this will follow
 hopefully soon.

 https://github.com/wmde/AskSerialization


 Cheers

 --
 Jeroen De Dauw
 http://www.bn2vs.com
 Don't panic. Don't be evil. ~=[,,_,,]:3
 --

 --
 DreamFactory - Open Source REST  JSON Services for HTML5  Native Apps
 OAuth, Users, Roles, SQL, NoSQL, BLOB Storage and External API Access
 Free app hosting. Or install the open source package on any LAMP server.
 Sign up and see examples for AngularJS, jQuery, Sencha Touch and Native!
 http://pubads.g.doubleclick.net/gampad/clk?id=63469471iu=/4140/ostg.clktrk
 ___
 Semediawiki-devel mailing list
 Semediawiki-devel@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/semediawiki-devel


--
DreamFactory - Open Source REST  JSON Services for HTML5  Native Apps
OAuth, Users, Roles, SQL, NoSQL, BLOB Storage and External API Access
Free app hosting. Or install the open source package on any LAMP server.
Sign up and see examples for AngularJS, jQuery, Sencha Touch and Native!
http://pubads.g.doubleclick.net/gampad/clk?id=63469471iu=/4140/ostg.clktrk
___
Semediawiki-devel mailing list
Semediawiki-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/semediawiki-devel


Re: [SMW-devel] ASK Query for added Special Properties

2013-11-07 Thread Jeroen De Dauw
Hey,

Yes, this query is supposed to work on the current version, at least if you
add the closing ]].

Are you sure you ran both the schema update and data refresh scripts?

Cheers

--
Jeroen De Dauw
http://www.bn2vs.com
Don't panic. Don't be evil. ~=[,,_,,]:3
--
--
November Webinars for C, C++, Fortran Developers
Accelerate application performance with scalable programming models. Explore
techniques for threading, error checking, porting, and tuning. Get the most 
from the latest Intel processors and coprocessors. See abstracts and register
http://pubads.g.doubleclick.net/gampad/clk?id=60136231iu=/4140/ostg.clktrk___
Semediawiki-devel mailing list
Semediawiki-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/semediawiki-devel


Re: [SMW-devel] ASK Query for added Special Properties

2013-11-07 Thread sumit purohit
Thanks

1. ]] is there in the actual query.
2. i followed
http://semantic-mediawiki.org/wiki/Help:Installation#Upgrading_existing_installations
and ran following commands.


php SMW_setup.php -b SMWSQLStore3

php SMW_refreshData.php -v -b SMWSQLStore3 -fp

php SMW_refreshData.php -v -b SMWSQLStore3


My *Special:Properties* page does list it as a property. Actual line i
have on that page is :


*mimetype of type Page(7 uses)*


Am i missing anything here ?


Thanks

sumit








On Thu, Nov 7, 2013 at 12:20 PM, Jeroen De Dauw jeroended...@gmail.comwrote:

 Hey,

 Yes, this query is supposed to work on the current version, at least if
 you add the closing ]].

 Are you sure you ran both the schema update and data refresh scripts?

 Cheers

 --
 Jeroen De Dauw
 http://www.bn2vs.com
 Don't panic. Don't be evil. ~=[,,_,,]:3
 --

--
November Webinars for C, C++, Fortran Developers
Accelerate application performance with scalable programming models. Explore
techniques for threading, error checking, porting, and tuning. Get the most 
from the latest Intel processors and coprocessors. See abstracts and register
http://pubads.g.doubleclick.net/gampad/clk?id=60136231iu=/4140/ostg.clktrk___
Semediawiki-devel mailing list
Semediawiki-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/semediawiki-devel


Re: [SMW-devel] ASK Query for added Special Properties

2013-11-07 Thread sumit purohit
I changed it back to SQLStore2 in LocalSettings.php and i do see some
results.

Special:Properties list 199 properties when SQLStore2 is used where as only
73 when SQLStore3 is used.
I did not see any error while migrating, but will give it a 2nd try.





On Thu, Nov 7, 2013 at 12:48 PM, sumit purohit purohitsu...@gmail.comwrote:

 Thanks

 1. ]] is there in the actual query.
 2. i followed
 http://semantic-mediawiki.org/wiki/Help:Installation#Upgrading_existing_installations
 and ran following commands.


 php SMW_setup.php -b SMWSQLStore3

 php SMW_refreshData.php -v -b SMWSQLStore3 -fp

 php SMW_refreshData.php -v -b SMWSQLStore3


 My *Special:Properties* page does list it as a property. Actual line i have 
 on that page is :


 *mimetype of type Page(7 uses)*


 Am i missing anything here ?


 Thanks

 sumit








 On Thu, Nov 7, 2013 at 12:20 PM, Jeroen De Dauw jeroended...@gmail.comwrote:

 Hey,

 Yes, this query is supposed to work on the current version, at least if
 you add the closing ]].

 Are you sure you ran both the schema update and data refresh scripts?

 Cheers

 --
 Jeroen De Dauw
 http://www.bn2vs.com
 Don't panic. Don't be evil. ~=[,,_,,]:3
 --



--
November Webinars for C, C++, Fortran Developers
Accelerate application performance with scalable programming models. Explore
techniques for threading, error checking, porting, and tuning. Get the most 
from the latest Intel processors and coprocessors. See abstracts and register
http://pubads.g.doubleclick.net/gampad/clk?id=60136231iu=/4140/ostg.clktrk___
Semediawiki-devel mailing list
Semediawiki-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/semediawiki-devel


Re: [SMW-devel] #ask for category pages not working in SMW 1.9 with Store 3

2013-05-30 Thread zehetner
Yes I did refresh and other values are returned by ask queries but it seem
the majority of data haven't reached store 3 yet and I forgot that SMW
doesn't use the MW info for categories but it's own. Will take much, much
longer to finish the SMWUpdate jobs.

Thanks.

On Wed, 29 May 2013 08:01:53 -0500, Jamie Thingelstad
ja...@thingelstad.com wrote:
 Just to make sure, did you refresh your data after moving to SqlStore3?
 You need to do that before any data will show up.
 Jamie Thingelstad
 ja...@thingelstad.com
 mobile: 612-810-3699
 find me on AIM Twitter Facebook LinkedIn
 
 On May 29, 2013, at 7:02 AM, zehetner zehet...@molgen.mpg.de wrote:
 
 Hi,
 
 in a wiki which runs
 MediaWiki1.19.1
 PHP  5.4.4 (apache2handler)
 MySQL5.5.0-m2-log
 Semantic MediaWiki (Version 1.8)
 SMW Store 2
 
 I get a list of the pages in category Maps when I use the query:
 {{#ask: [[Category:Maps]]}}
 
 and format=debug shows as SQL somethin like
 SELECT DISTINCT t2.smw_title AS t,t2.smw_namespace AS ns FROM `smw_ids`
 AS
 t2 INNER JOIN `smw_inst2` AS t0 ON t2.smw_id=t0.s_id WHERE
 (t0.o_id='1597134') ORDER BY t2.smw_sortkey ASC LIMIT 51 OFFSET 0;
 
 however, when I use the same data in a wiki which runs
 MediaWiki1.20.0
 PHP  5.4.4 (apache2handler)
 MySQL5.5.0-m2-log
 Semantic MediaWiki (Version 1.9 alpha) (c61b465)
 SMW Store 3
 
 I get no result with the same query and format=debug shows: Empty
result,
 no SQL query created.
 
 However looking in Special:Categories I see in both wikis the same
number
 of pages.
 
 Is this a bug, a changed behaviour or just temporarily not supported?
Or
 is it a local problem with Store 3?
 Is there maybe any alternative syntax for the #ask query which would
 simulate the old behaviour?
 
 Thanks
 Guenther
 

--
 Introducing AppDynamics Lite, a free troubleshooting tool for Java/.NET
 Get 100% visibility into your production application - at no cost.
 Code-level diagnostics for performance bottlenecks with 2% overhead
 Download for free and get started troubleshooting in minutes.
 http://p.sf.net/sfu/appdyn_d2d_ap1
 ___
 Semediawiki-devel mailing list
 Semediawiki-devel@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/semediawiki-devel

--
Introducing AppDynamics Lite, a free troubleshooting tool for Java/.NET
Get 100% visibility into your production application - at no cost.
Code-level diagnostics for performance bottlenecks with 2% overhead
Download for free and get started troubleshooting in minutes.
http://p.sf.net/sfu/appdyn_d2d_ap1
___
Semediawiki-devel mailing list
Semediawiki-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/semediawiki-devel


Re: [SMW-devel] #ask for category pages not working in SMW 1.9 with Store 3

2013-05-30 Thread Nischay Nahata
Yes, that is true. SMW uses a pre-defined property to represent categorical
relations.


On Thu, May 30, 2013 at 11:58 AM, zehetner zehet...@molgen.mpg.de wrote:

 Yes I did refresh and other values are returned by ask queries but it seem
 the majority of data haven't reached store 3 yet and I forgot that SMW
 doesn't use the MW info for categories but it's own. Will take much, much
 longer to finish the SMWUpdate jobs.

 Thanks.

 On Wed, 29 May 2013 08:01:53 -0500, Jamie Thingelstad
 ja...@thingelstad.com wrote:
  Just to make sure, did you refresh your data after moving to SqlStore3?
  You need to do that before any data will show up.
  Jamie Thingelstad
  ja...@thingelstad.com
  mobile: 612-810-3699
  find me on AIM Twitter Facebook LinkedIn
 
  On May 29, 2013, at 7:02 AM, zehetner zehet...@molgen.mpg.de wrote:
 
  Hi,
 
  in a wiki which runs
  MediaWiki1.19.1
  PHP  5.4.4 (apache2handler)
  MySQL5.5.0-m2-log
  Semantic MediaWiki (Version 1.8)
  SMW Store 2
 
  I get a list of the pages in category Maps when I use the query:
  {{#ask: [[Category:Maps]]}}
 
  and format=debug shows as SQL somethin like
  SELECT DISTINCT t2.smw_title AS t,t2.smw_namespace AS ns FROM `smw_ids`
  AS
  t2 INNER JOIN `smw_inst2` AS t0 ON t2.smw_id=t0.s_id WHERE
  (t0.o_id='1597134') ORDER BY t2.smw_sortkey ASC LIMIT 51 OFFSET 0;
 
  however, when I use the same data in a wiki which runs
  MediaWiki1.20.0
  PHP  5.4.4 (apache2handler)
  MySQL5.5.0-m2-log
  Semantic MediaWiki (Version 1.9 alpha) (c61b465)
  SMW Store 3
 
  I get no result with the same query and format=debug shows: Empty
 result,
  no SQL query created.
 
  However looking in Special:Categories I see in both wikis the same
 number
  of pages.
 
  Is this a bug, a changed behaviour or just temporarily not supported?
 Or
  is it a local problem with Store 3?
  Is there maybe any alternative syntax for the #ask query which would
  simulate the old behaviour?
 
  Thanks
  Guenther
 
 

 --
  Introducing AppDynamics Lite, a free troubleshooting tool for Java/.NET
  Get 100% visibility into your production application - at no cost.
  Code-level diagnostics for performance bottlenecks with 2% overhead
  Download for free and get started troubleshooting in minutes.
  http://p.sf.net/sfu/appdyn_d2d_ap1
  ___
  Semediawiki-devel mailing list
  Semediawiki-devel@lists.sourceforge.net
  https://lists.sourceforge.net/lists/listinfo/semediawiki-devel


 --
 Introducing AppDynamics Lite, a free troubleshooting tool for Java/.NET
 Get 100% visibility into your production application - at no cost.
 Code-level diagnostics for performance bottlenecks with 2% overhead
 Download for free and get started troubleshooting in minutes.
 http://p.sf.net/sfu/appdyn_d2d_ap1
 ___
 Semediawiki-devel mailing list
 Semediawiki-devel@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/semediawiki-devel




-- 
Cheers,

Nischay Nahata
nischayn22.wordpress.com
--
Introducing AppDynamics Lite, a free troubleshooting tool for Java/.NET
Get 100% visibility into your production application - at no cost.
Code-level diagnostics for performance bottlenecks with 2% overhead
Download for free and get started troubleshooting in minutes.
http://p.sf.net/sfu/appdyn_d2d_ap1___
Semediawiki-devel mailing list
Semediawiki-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/semediawiki-devel


Re: [SMW-devel] #ask for category pages not working in SMW 1.9 with Store 3

2013-05-29 Thread Jamie Thingelstad
Just to make sure, did you refresh your data after moving to SqlStore3? You 
need to do that before any data will show up.
Jamie Thingelstad
ja...@thingelstad.com
mobile: 612-810-3699
find me on AIM Twitter Facebook LinkedIn

On May 29, 2013, at 7:02 AM, zehetner zehet...@molgen.mpg.de wrote:

 Hi,
 
 in a wiki which runs
 MediaWiki 1.19.1
 PHP   5.4.4 (apache2handler)
 MySQL 5.5.0-m2-log
 Semantic MediaWiki (Version 1.8)
 SMW Store 2
 
 I get a list of the pages in category Maps when I use the query:
 {{#ask: [[Category:Maps]]}}
 
 and format=debug shows as SQL somethin like
 SELECT DISTINCT t2.smw_title AS t,t2.smw_namespace AS ns FROM `smw_ids` AS
 t2 INNER JOIN `smw_inst2` AS t0 ON t2.smw_id=t0.s_id WHERE
 (t0.o_id='1597134') ORDER BY t2.smw_sortkey ASC LIMIT 51 OFFSET 0;
 
 however, when I use the same data in a wiki which runs
 MediaWiki 1.20.0
 PHP   5.4.4 (apache2handler)
 MySQL 5.5.0-m2-log
 Semantic MediaWiki (Version 1.9 alpha) (c61b465)
 SMW Store 3
 
 I get no result with the same query and format=debug shows: Empty result,
 no SQL query created.
 
 However looking in Special:Categories I see in both wikis the same number
 of pages.
 
 Is this a bug, a changed behaviour or just temporarily not supported? Or
 is it a local problem with Store 3?
 Is there maybe any alternative syntax for the #ask query which would
 simulate the old behaviour?
 
 Thanks
 Guenther
 
 --
 Introducing AppDynamics Lite, a free troubleshooting tool for Java/.NET
 Get 100% visibility into your production application - at no cost.
 Code-level diagnostics for performance bottlenecks with 2% overhead
 Download for free and get started troubleshooting in minutes.
 http://p.sf.net/sfu/appdyn_d2d_ap1
 ___
 Semediawiki-devel mailing list
 Semediawiki-devel@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/semediawiki-devel

--
Introducing AppDynamics Lite, a free troubleshooting tool for Java/.NET
Get 100% visibility into your production application - at no cost.
Code-level diagnostics for performance bottlenecks with 2% overhead
Download for free and get started troubleshooting in minutes.
http://p.sf.net/sfu/appdyn_d2d_ap1___
Semediawiki-devel mailing list
Semediawiki-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/semediawiki-devel


Re: [SMW-devel] {{#ask}}

2008-01-01 Thread Markus Krötzsch
On Montag, 31. Dezember 2007, Sergey Chernyshev wrote:
 My point is that SMW's mission statement is to create Semantic Wikipedia -
 that's why I'm saying this. Or am I wrong?

Indeed, but we also support other use-cases (some of our features obviously do 
not address Wikipedia needs). And, regarding Ask-restrictions: a major 
Wikipedia policy certainly is to keep the servers up ;-) Just recall the 
times when even text-search was disabled for performance reasons. So 
restricting Special:Ask could also server WP, but I do not plan to work on 
this soon.

Markus


 Sergey

 On Dec 30, 2007 4:54 AM, cnit [EMAIL PROTECTED] wrote:
   I'm not sure if restricting Ask functionality is along the lines of
   Wikipedia policies - it's not a modification operation therefore it
 
  should
 
   be public, I believe.
 
  Sure, but my MW sites aren't wikipedia. Also, imagine how much resourse
  intensive would it be on the huge datasets with lots of properties and
  property values defined.
 
   I agree, that abuse bocking and request throttling might be a solution
 
  here,
 
   but in general, I wouldn't recommend restriction of access, but a
   functionality instead, e.g. limited amount of joins or something like
 
  that.
  Maybe you're right. It would be nice to have the settings mentioned by
  Markus
  $smwgQSubpropertyDepth, $smwgQEqualitySupport
  separately for anonymous and the rest of the users. The problem is, that
  such queries might be unavailable sometimes.
 
   This kind of actions is generally hard to limit and predict therefore
 
  it's
 
   quite easy to abuse. This might be a serious bottleneck in SMW adoption
 
  by
 
   Wikipedia.
 
  Dmitriy
 
 
  -
  This SF.net email is sponsored by: Microsoft
  Defy all challenges. Microsoft(R) Visual Studio 2005.
  http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/
  ___
  Semediawiki-devel mailing list
  Semediawiki-devel@lists.sourceforge.net
  https://lists.sourceforge.net/lists/listinfo/semediawiki-devel



-- 
Markus Krötzsch
Institut AIFB, Universät Karlsruhe (TH), 76128 Karlsruhe
phone +49 (0)721 608 7362fax +49 (0)721 608 5998
[EMAIL PROTECTED]www  http://korrekt.org


signature.asc
Description: This is a digitally signed message part.
-
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/___
Semediawiki-devel mailing list
Semediawiki-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/semediawiki-devel


Re: [SMW-devel] {{#ask}}

2007-12-30 Thread Sergey Chernyshev
My point is that SMW's mission statement is to create Semantic Wikipedia -
that's why I'm saying this. Or am I wrong?

Sergey


On Dec 30, 2007 4:54 AM, cnit [EMAIL PROTECTED] wrote:

  I'm not sure if restricting Ask functionality is along the lines of
  Wikipedia policies - it's not a modification operation therefore it
 should
  be public, I believe.
 Sure, but my MW sites aren't wikipedia. Also, imagine how much resourse
 intensive would it be on the huge datasets with lots of properties and
 property values defined.

  I agree, that abuse bocking and request throttling might be a solution
 here,
  but in general, I wouldn't recommend restriction of access, but a
  functionality instead, e.g. limited amount of joins or something like
 that.
 Maybe you're right. It would be nice to have the settings mentioned by
 Markus
 $smwgQSubpropertyDepth, $smwgQEqualitySupport
 separately for anonymous and the rest of the users. The problem is, that
 such queries might be unavailable sometimes.

  This kind of actions is generally hard to limit and predict therefore
 it's
  quite easy to abuse. This might be a serious bottleneck in SMW adoption
 by
  Wikipedia.
 Dmitriy


 -
 This SF.net email is sponsored by: Microsoft
 Defy all challenges. Microsoft(R) Visual Studio 2005.
 http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/
 ___
 Semediawiki-devel mailing list
 Semediawiki-devel@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/semediawiki-devel




-- 
Sergey Chernyshev
http://www.sergeychernyshev.com/
-
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/___
Semediawiki-devel mailing list
Semediawiki-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/semediawiki-devel


Re: [SMW-devel] {{#ask}}

2007-12-29 Thread cnit
 What I meant was: a simple cron-job can touch LocalSettings.php regularly to
 purge the MW cache globally. Not much interaction with MW needed for that.
Yes, that's simple.

 I guess a strong solution for that will still take some time. One could of
 course store inline queries in some table, use IDs for each, and permit
 anyone to use ask with such an (internal) ID only, whereas making custom
 queries would require further permissions. But this is some more code, and I
 am not entirely convinced of that design.

 Did you experience problems with anonymous users that access Special:Ask? On
 ontoworld it seems that a significant amount of Special:Ask requests really
 come from further results links.
Still not. It might show up later, when SMW will become common.
But maybe you're right that it doesn't worth the efforts.
Dmitriy


-
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/
___
Semediawiki-devel mailing list
Semediawiki-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/semediawiki-devel


Re: [SMW-devel] {{#ask}}

2007-12-29 Thread Sergey Chernyshev
I'm not sure if restricting Ask functionality is along the lines of
Wikipedia policies - it's not a modification operation therefore it should
be public, I believe.

I agree, that abuse bocking and request throttling might be a solution here,
but in general, I wouldn't recommend restriction of access, but a
functionality instead, e.g. limited amount of joins or something like that.

This kind of actions is generally hard to limit and predict therefore it's
quite easy to abuse. This might be a serious bottleneck in SMW adoption by
Wikipedia.

   Sergey


On Dec 29, 2007 6:01 AM, cnit [EMAIL PROTECTED] wrote:

  What I meant was: a simple cron-job can touch LocalSettings.phpregularly to
  purge the MW cache globally. Not much interaction with MW needed for
 that.
 Yes, that's simple.

  I guess a strong solution for that will still take some time. One could
 of
  course store inline queries in some table, use IDs for each, and permit
  anyone to use ask with such an (internal) ID only, whereas making custom
  queries would require further permissions. But this is some more code,
 and I
  am not entirely convinced of that design.

  Did you experience problems with anonymous users that access
 Special:Ask? On
  ontoworld it seems that a significant amount of Special:Ask requests
 really
  come from further results links.
 Still not. It might show up later, when SMW will become common.
 But maybe you're right that it doesn't worth the efforts.
 Dmitriy


-
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/___
Semediawiki-devel mailing list
Semediawiki-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/semediawiki-devel


Re: [SMW-devel] {{#ask}}

2007-12-28 Thread Markus Krötzsch
On Donnerstag, 27. Dezember 2007, cnit wrote:
  (2) Query answering is done without any caching, and this is clearly a
  problem. While inline queries are computed only once and stored in the
  parser cache afterwards, Special:Ask has no caching facility at all. This
  needs to change in the future. Targetted cache invalidation might still
  be difficult and it is not clear whether the effort is needed (one could
  enable manual cache clearing like for pages). A new query cache --
  design, architecture and implementation -- is needed here.

 Too much of caching can hurt dynamic content - it's nice to have the
 page with query being updated at least once per hour or two.

Well, that is not the case for the current parser cache, neither in MW nor in 
SMW. But if course it could be achieved with some server-side cronjobs.

 Speaking of Special:Ask I believe it should be limited to registered
 users only. It might slow down the operation 

Which is due to the lack of caching ...

 and also is suggestive 
 for hackers trying to build an exploiting query.

My strong hope is that none such query is possible. If security issues with 
queries should exist, I would like to find them rather sooner than later. 

I expected that it would be possible to limit Special page access based on 
some MW mechanism already. Is there no way of configuring MediaWiki this way?

Markus

-- 
Markus Krötzsch
Institut AIFB, Universät Karlsruhe (TH), 76128 Karlsruhe
phone +49 (0)721 608 7362fax +49 (0)721 608 5998
[EMAIL PROTECTED]www  http://korrekt.org


signature.asc
Description: This is a digitally signed message part.
-
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/___
Semediawiki-devel mailing list
Semediawiki-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/semediawiki-devel


Re: [SMW-devel] {{#ask}}

2007-12-28 Thread cnit
 Well, that is not the case for the current parser cache, neither in MW nor in
 SMW. But if course it could be achieved with some server-side cronjobs.
Ah, I didn't knew about MW cronjobs. That sounds nice. Will try to
find out some examples. Maybe you're right that such functionality
shouldn't belong to main application itself..

 Which is due to the lack of caching ...
Well, yes. Of course if someone wants to slow down the site, he could
use many different queries. But, it can be traced with apache logs and
banned by IP..

 My strong hope is that none such query is possible. If security issues with
 queries should exist, I would like to find them rather sooner than later.
I hope that, too.

 I expected that it would be possible to limit Special page access based on
 some MW mechanism already. Is there no way of configuring MediaWiki this way?
http://meta.wikimedia.org/wiki/Help:Special_page#Restricted_special_pages
e.g.
includes/SpecialBlockip.php
contains the following check:

# Permission check
if( !$wgUser-isAllowed( 'block' ) ) {
$wgOut-permissionRequired( 'block' );
return;
} 

BUT, I've remebered that further results links are Special:Ask with
query parameters. In such case, further results would be unavailable
to anonymous users, which is sad. Only if every ask query had it's own
ID, which would be passed to further results page instead of query
itself... Maybe I am asking too much and IP ban (see above) is enough.
Dmitriy


-
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/
___
Semediawiki-devel mailing list
Semediawiki-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/semediawiki-devel


Re: [SMW-devel] {{#ask}}

2007-12-28 Thread Markus Krötzsch
On Freitag, 28. Dezember 2007, cnit wrote:
  Well, that is not the case for the current parser cache, neither in MW
  nor in SMW. But if course it could be achieved with some server-side
  cronjobs.

 Ah, I didn't knew about MW cronjobs. That sounds nice. Will try to
 find out some examples. Maybe you're right that such functionality
 shouldn't belong to main application itself..

What I meant was: a simple cron-job can touch LocalSettings.php regularly to 
purge the MW cache globally. Not much interaction with MW needed for that.


  Which is due to the lack of caching ...

 Well, yes. Of course if someone wants to slow down the site, he could
 use many different queries. But, it can be traced with apache logs and
 banned by IP..

  My strong hope is that none such query is possible. If security issues
  with queries should exist, I would like to find them rather sooner than
  later.

 I hope that, too.

  I expected that it would be possible to limit Special page access based
  on some MW mechanism already. Is there no way of configuring MediaWiki
  this way?

 http://meta.wikimedia.org/wiki/Help:Special_page#Restricted_special_pages
 e.g.
 includes/SpecialBlockip.php
 contains the following check:

 # Permission check
 if( !$wgUser-isAllowed( 'block' ) ) {
 $wgOut-permissionRequired( 'block' );
 return;
 }

 BUT, I've remebered that further results links are Special:Ask with
 query parameters. In such case, further results would be unavailable
 to anonymous users, which is sad. Only if every ask query had it's own
 ID, which would be passed to further results page instead of query
 itself... Maybe I am asking too much and IP ban (see above) is enough.

I guess a strong solution for that will still take some time. One could of 
course store inline queries in some table, use IDs for each, and permit 
anyone to use ask with such an (internal) ID only, whereas making custom 
queries would require further permissions. But this is some more code, and I 
am not entirely convinced of that design.

Did you experience problems with anonymous users that access Special:Ask? On 
ontoworld it seems that a significant amount of Special:Ask requests really 
come from further results links.

Markus



-- 
Markus Krötzsch
Institut AIFB, Universät Karlsruhe (TH), 76128 Karlsruhe
phone +49 (0)721 608 7362fax +49 (0)721 608 5998
[EMAIL PROTECTED]www  http://korrekt.org


signature.asc
Description: This is a digitally signed message part.
-
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/___
Semediawiki-devel mailing list
Semediawiki-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/semediawiki-devel


Re: [SMW-devel] {{#ask}}

2007-12-16 Thread Markus Krötzsch
On Freitag, 14. Dezember 2007, Sergey Chernyshev wrote:
 Got it - if it'll speed up the process, that'll be great. Currently SMW on
 top of MW runs significantly slower then just MW which is not very good
 because it means that SMW+MW can't scale as good as MW alone.

 Can you describe in a couple of paragraphs how SMW data and queries are
 getting cached and how that cache is being invalidated, what works on the
 fly and what is served from parser cache.

 I understand it's a lot to describe, but projects with massive amount of
 data and traffic, performance can be a big show-stopper - we picked MW for
 one of our projects because of Wikipedia performance example and
 predictability and I hope that it's not too distant for SMW to inherit
 these qualities, but I'd like to understand the overall picture.

Yes, agreed. Of course we have always designed basic algorithms with regards 
to performance and scalability, and especially tried to pick features based 
on this aspect. On the other hand, caching is significantly under-developed 
in SMW as it is, since it mainly uses the existing MW caches where 
applicable. There are various types of operations that are relevant to 
performance, and each can probably be optimised/cached independently:

(1) Basic page display -- by far the most common operation.
(2) Query answering, inline and on Special:Ask
(3) Annotation parsing and page formatting.
(4) Maintenance specials such as Special:Properties.
(5) OWL/RDF export.
(6) Browsing special Special:Browse

I will sketch performance issues for each of those. For actual numbers, see 
http://ontoworld.org/profileinfo.php to find out how severe each operation is 
on ontoworld.org.

(1) is clearly the main operation, and for existing pages SMW merely uses MW's 
parser/page caches. No mechanism for cache invalidation exists, but MW 
regularly updates page caches. This allows outdated inline queries but gives 
us good hope for basic scalability in large environments.  Especially SMW 
does not hook into any operations that happen when reproducing parser cached 
pages. Even the Factbox comes from the parser cache (which is why we cannot 
readily translate it to the user's language as MW does for categories).

(2) Query answering is done without any caching, and this is clearly a 
problem. While inline queries are computed only once and stored in the parser 
cache afterwards, Special:Ask has no caching facility at all. This needs to 
change in the future. Targetted cache invalidation might still be difficult 
and it is not clear whether the effort is needed (one could enable manual 
cache clearing like for pages). A new query cache -- design, architecture and 
implementation -- is needed here.

(3) Page formatting uses very few additional DB calls, and mainly works on the 
wiki source code that was already retrieved anyway. It has no major 
performance impact (see smwfParserHook in the profile).

(4) Maintenance special can be slow, but have been designed to allow the 
caching mechanism that MW uses for its maintenance specials. This is not 
implemented, but it would be possible. One design decision, probably in more 
cases, is whether to have transparent caching in the sotrage implementation, 
or whether to trigger caching explicitly in the caller (which may help to not 
make the storage implementation even bigger than it is now).

(5) OWL/RDF export take time, but mostly depending on the export settings of 
your site. The result could be cached internally in a similar way that 
page-content is cached. External caches could be configured to cache RDF as 
well. Yet this is not to be neglected, since a number of Semantic Web 
crawlers and misguided RSS-spiders regularly visit the RDF.

(6) Special:Browse is not inefficient, but as it is a specialised form 
of What links here it also faces similar performance issues.

Finally, SMW needs practically no time to load if it is not strictly needed. 
So enabling it does hardly slow down the wiki for services that need no SMW. 


Summing up, the required caching facilities in order of relevance would 
probably be: (2) [Queries], (4) [Specials], (5) [OWL/RDF]. I do not think 
that the other parts need to much care, but analysing the current profileinfo 
may yield more insights. Concerning (2), which is by far the most severe 
performance problem, we have included many ways of restricting queries, so 
that large sites can always switch off features until it works again (SMW is 
still useful without very complex queries). At the moment this is the 
suggested procedure for large sites, and we can also offer some support for 
helping such sites to not experience major problems (things of course also 
depend a lot on the wiki's actual structure).

Best regards,

Markus


 Thank you,

   Sergey.

 On Dec 14, 2007 1:12 PM, Markus Krötzsch [EMAIL PROTECTED] wrote:
  On Freitag, 14. Dezember 2007, Sergey Chernyshev wrote:
   Markus, can you elaborate on three values - what's the 

Re: [SMW-devel] {{#ask}}

2007-12-14 Thread Markus Krötzsch
On Freitag, 14. Dezember 2007, cnit wrote:
  Indeed. This was fixed now in SVN.

 Thank you! It works!!
 And with #ask SMW has become much more powerful!

 One tought - I wonder if $smwgQEqualitySupport should be true by
 default.. It seems to speeds up a little when set false. But of course
 that's the matter of tuning and can be done by the users. Maybe just a
 notice in INSTALL file would be helpful. But anyway - not much of
 problem even if leave it as is.

I agree, it should not be true. I think I will make it three-valued, since 
only part of the feature really slows down the querying. So the values would 
be something like NONE, SOME, and FULL. This should happen before 1.0.

Markus


-- 
Markus Krötzsch
Institut AIFB, Universät Karlsruhe (TH), 76128 Karlsruhe
phone +49 (0)721 608 7362fax +49 (0)721 608 5998
[EMAIL PROTECTED]www  http://korrekt.org


signature.asc
Description: This is a digitally signed message part.
-
SF.Net email is sponsored by:
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services
for just about anything Open Source.
http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace___
Semediawiki-devel mailing list
Semediawiki-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/semediawiki-devel


Re: [SMW-devel] {{#ask}}

2007-12-14 Thread Markus Krötzsch
On Freitag, 14. Dezember 2007, Sergey Chernyshev wrote:
 Markus, can you elaborate on three values - what's the difference between
 SOME and FULL?

FULL is what used to be true in 1.0 (default)
NONE is what used to be false in all versions
SOME is new, but does basically what 0.7 did earlier.

So SOME only considers redirects for pages that appear directly in the query. 
For example, assume r1 and r2 are redirects to p. Then asking 
for [[property::r1]] yields the same results as asking 
for [[property::p]] or [[property::r1]].

This is not too hard to do. Now FULL evaluates redirects even when joining 
subqueries or asking for categories. As an example, assume that in addition 
to the above there is a page q with annotation [[property::r1]], and 
assume further that r2 is in Category2 and that p is in Category3. Then each 
of the following queries contains q in its result list:

* ask[[property::q[[Category:Category3]]/q]]/ask
* ask[[property::q[[Category:Category2]]/q]]/ask

Neither would work with SOME only. But as you can imagine, doing these 
additional considerations about redirects at query time consumes a lot of 
additional time (in particular since we use MW's redirect table that is not 
even optimised for these kind of games). 

If you make sure that properties do not point to redirects, and that redirects 
have no categories or properties, then SOME should always suffice (I think it 
was discussed earlier to have a Special page for that kind of maintenance).

-- Markus


Sergey

 On Dec 14, 2007 7:27 AM, Markus Krötzsch [EMAIL PROTECTED] wrote:
  On Freitag, 14. Dezember 2007, cnit wrote:
Indeed. This was fixed now in SVN.
  
   Thank you! It works!!
   And with #ask SMW has become much more powerful!
  
   One tought - I wonder if $smwgQEqualitySupport should be true by
   default.. It seems to speeds up a little when set false. But of course
   that's the matter of tuning and can be done by the users. Maybe just a
   notice in INSTALL file would be helpful. But anyway - not much of
   problem even if leave it as is.
 
  I agree, it should not be true. I think I will make it three-valued,
  since
  only part of the feature really slows down the querying. So the values
  would
  be something like NONE, SOME, and FULL. This should happen before 1.0.
 
  Markus
 
 
  --
  Markus Krötzsch
  Institut AIFB, Universät Karlsruhe (TH), 76128 Karlsruhe
  phone +49 (0)721 608 7362fax +49 (0)721 608 5998
  [EMAIL PROTECTED]www  http://korrekt.org
 
  -
  SF.Net email is sponsored by:
  Check out the new SourceForge.net Marketplace.
  It's the best place to buy or sell services
  for just about anything Open Source.
 
  http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketpl
 ace ___
  Semediawiki-devel mailing list
  Semediawiki-devel@lists.sourceforge.net
  https://lists.sourceforge.net/lists/listinfo/semediawiki-devel



-- 
Markus Krötzsch
Institut AIFB, Universät Karlsruhe (TH), 76128 Karlsruhe
phone +49 (0)721 608 7362fax +49 (0)721 608 5998
[EMAIL PROTECTED]www  http://korrekt.org


signature.asc
Description: This is a digitally signed message part.
-
SF.Net email is sponsored by:
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services
for just about anything Open Source.
http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace___
Semediawiki-devel mailing list
Semediawiki-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/semediawiki-devel


Re: [SMW-devel] {{#ask}}

2007-12-13 Thread Markus Krötzsch
On Donnerstag, 13. Dezember 2007, cnit wrote:
  The reason is that SMW can only sort by properties that are part of the
  core query. Print statements such as ?Date may or may not lead to one
  (or more) outputs per query result, but are not used in the initial SQL
  query (so as not to increase the number of result rows via printouts).

 Ah, I see. They separate which fields should be printed out from the
 query itself.

  So what you need to do is to add Date to the query:
 
  {{#ask: [[Category:News]] [[Date::+]] |
  ...

 Now it works, thank you. But there's still one disappointment (could
 be my misunderstanding, of course) - the further results link of this
 query doesn't sort the results :-(

Indeed. This was fixed now in SVN.

-- Markus


 SMW 0.7 further results are properly sorted.
 Dmitriy



-- 
Markus Krötzsch
Institut AIFB, Universät Karlsruhe (TH), 76128 Karlsruhe
phone +49 (0)721 608 7362fax +49 (0)721 608 5998
[EMAIL PROTECTED]www  http://korrekt.org


signature.asc
Description: This is a digitally signed message part.
-
SF.Net email is sponsored by:
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services
for just about anything Open Source.
http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace___
Semediawiki-devel mailing list
Semediawiki-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/semediawiki-devel


Re: [SMW-devel] {{#ask}}

2007-12-12 Thread cnit
Markus (or perhaps someone else),
Can you please give a hint, why with my query


{{#ask: [[Category:News]] |
?Date|
sort=Date|
order=descending|
limit=3|
format=template|
template=newsrow|
default=There was no news|
searchlabel=Browse all news...|
}}

In the SMWSQLStore::createSQLQuery()
$description is NEVER an instance of SMWSomeProperty, so it doesn't
even have a chance to set $this-m_sortfield :-(

I've either tried ?Date=*|
?Date=+|
but no luck..

So, when it gets to the
in SMW_SQLStore.php, where's the following code:

if ( $smwgQSortingSupport ) {
$order = $query-ascending ? 'ASC' : 'DESC';
if ( ($this-m_sortfield == false)  ($this-m_sortkey 
== false) ) {
$sql_options['ORDER BY'] = 
$pagetable.page_title $order ; // default
} elseif ($this-m_sortfield != false) {
$sql_options['ORDER BY'] = $this-m_sortfield . 
 $order ;
} // else: sortkey given but not found: do not sort
}


my case is always sortkey given but not found: do not sort ?

My Property:Date does exists and correctly defined, and it has the
lists of pages that use this property.
Dmitriy


-
SF.Net email is sponsored by: 
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php
___
Semediawiki-devel mailing list
Semediawiki-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/semediawiki-devel


Re: [SMW-devel] {{#ask}}

2007-12-03 Thread cnit
 And another note: {{#ask}} is in SVN (in a first version).
Thank you!

 Working example query:

 {{#ask: [[Category:Country]] [[borders::Nigeria]] |
   ?population|
   ?area#km² = ''Size''|
   format=list|
   limit = 3|
   link=all|
   intro=bTest/b_|
 }}
It seems that the category specific syntax is identical to ask tag,
parameters of the output are specified without leading questions,
starting with leading question defines the searching property, if I
got it right..

I've tried to convert my SMW 0.7 (really working) query to SMW 1.0RC3
#ask query. But I've stumbled with the problem. There's the query I
use, only the cyrillic property names and format strings are
translated (because it may be confusing to read Cyrillic to
westerners, if there's a need to get original bytecodes, I can send
them with escaped strings):

{{#ask: [[Category:News]] |
?Date|
sort=Date|
order=descending|
limit=3|
format=template|
template=newsrow|
default=There was no news|
searchlabel=Browse all news...|
}}

The results set is correct list of links to the pages where the
property Date is defined, {{{1}}} and {{{2}}} parameter are correctly
expanded in the template, but.. there's no sorting! The results were
sorted by Date field in SMW 0.7, now they aren't.

I've tried to figure out what's wrong, it must be either something had
changed with syntax of the query, or the query is incorrectly parsed.
After browsing through few nested function calls, I've found method
getQueryResult(SMWQuery $query)
in SMW_SQLStore.php, where's the following code:

if ( $smwgQSortingSupport ) {
$order = $query-ascending ? 'ASC' : 'DESC';
if ( ($this-m_sortfield == false)  ($this-m_sortkey 
== false) ) {
$sql_options['ORDER BY'] = 
$pagetable.page_title $order ; // default
} elseif ($this-m_sortfield != false) {
$sql_options['ORDER BY'] = $this-m_sortfield . 
 $order ;
} // else: sortkey given but not found: do not sort
}

My $smwgQSortingSupport is true, of course. But the content of $this
is such:

object(SMWSQLStore)#140 (3) { [m_sortkey:protected]=  string(8) 
\u0414\u0430\u0442\u0430 [m_sortfield:protected]=  bool(false) 
[m_usedtables:protected]=  array(1) { [0]=  string(5) cats1 } }
 translated version:
object(SMWSQLStore)#140 (3) { [m_sortkey:protected]=  string(8)
Date [m_sortfield:protected]=  bool(false) [m_usedtables:protected]=  
array(1) { [0]=  string(5) cats1 } }

You see, that my m_sortkey is proper (Date) - it's not false, but for
some strange reason my m_sortfield is false :-(
The following code in createSQLQuery seems to be designated for
subqueries and not being executed in my case:

if ($sub) {
$nexttables = array();
$nexttables['p' . $tablename] = $table; 
// keep only current table for reference

$this-createSQLQuery($description-getDescription(), $from, $subwhere, $db, 
$nexttables, $nary_pos);
if ($sort) {
$this-m_sortfield = 
$table.$sort;
}
if ( $subwhere != '') {
$where .= ' AND (' . $subwhere 
. ')';
}
}

So, the sql_options ORDER BY is not set..

After that, I've changed the format parameter value to debug,


here's the SQL query it tries to execute:

Generated Wiki-Query
q q+ || 
\u0418\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0435:+/q /q
Query-Size: 3
Query-Depth: 0
SQL-Query
SELECT DISTINCT `page`.page_title as title, `page`.page_namespace as namespace 
FROM `cats3`, `page` INNER JOIN `categorylinks` AS cl2 ON 
cl2.cl_from=`page`.page_id WHERE ((`page`.page_namespace='0') OR 
(`page`.page_namespace='6')) AND (cats3.title=cl2.cl_to)
SQL-Query options
LIMIT=4 OFFSET=0
Errors and Warnings

Auxilliary tables used
cats3: \u041d\u043e\u0432\u043e\u0441\u0442\u0438, 
 translated version:
Generated Wiki-Query
q q+ || Image:+/q /q
Query-Size: 3
Query-Depth: 0
SQL-Query
SELECT DISTINCT `page`.page_title as title, `page`.page_namespace as namespace 
FROM `cats3`, `page` INNER JOIN `categorylinks` AS cl2 ON 
cl2.cl_from=`page`.page_id WHERE ((`page`.page_namespace='0') OR 
(`page`.page_namespace='6')) AND (cats3.title=cl2.cl_to)
SQL-Query options
LIMIT=4 OFFSET=0
Errors and Warnings

Auxilliary tables used
cats3: News,


If you need any additional information to debug, I can provide. The
Property:Date is defined as [[has type::Type:Date]] of course.

I don't know whether it's my simple mistake with query, or a some kind of
bug in SMW..

Re: [SMW-devel] ask query format=template

2007-12-03 Thread Thomas Bleher
* cnit [EMAIL PROTECTED] [2007-12-03 16:24]:
 May I suggest another kind of ask format? Sometimes it's desirable to
 get only a simple count of rows instead of the query result rows. So,
 if there's a 5 rows in the query result, ask format=count would
 return a number 5. It may be useful to statistics, in further
 computations in templates and so on...

format=count already exists, since at least SMW 0.7.

 I really think that SMW requires a better documentation on new
 formats of queries, #ask and subqueries. Because the only
 documentation I've used is outdated:
 http://meta.wikimedia.org/wiki/Help:Substitution
 e.g. no new features, no subqueries here and so on..

??? This page mentions SMW, but it's hardly related to it.
Have you looked at ontoworld.org or http://semantic-mediawiki.org/?

I agree that the wiki pages there need improvement, and hopefully that
will happen once 1.0 is released (personally, I'm currently refraining
from doing any work on the site, because many things have changed
between 0.7 and 1.0 and it's not so easy to separate it; I hope 1.0 will
be released soon, so the old information about 0.7 can be replaced) But
such documentation doesn't write itself. Maybe you can rework the wiki
pages on semantic-mediawiki.org with the things you have already learned
about SMW 1.0.
That would surely be appreciated.

Regards,
Thomas



signature.asc
Description: Digital signature
-
SF.Net email is sponsored by: The Future of Linux Business White Paper
from Novell.  From the desktop to the data center, Linux is going
mainstream.  Let it simplify your IT future.
http://altfarm.mediaplex.com/ad/ck/8857-50307-18918-4___
Semediawiki-devel mailing list
Semediawiki-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/semediawiki-devel


Re: [SMW-devel] ask query format=template

2007-11-30 Thread Markus Krötzsch
On Montag, 12. November 2007, cnit wrote:
  Yes, I could use this as well. But this feature comes only after the
  implementation of {{#ask...}} (since this change will change the
  interaction of inline queries with MediaWiki's table creation).

 Can the implementation of {{#ask}} make possible such trick that I've
 unsuccessfully tried to perform with SMW 0.7:

 Instead of displaying a page link in ask query template (via {{{1}}})
 I've tried to display the content of resulted pages with
 {{ {{{1}}} }}
 Yet, expansion didn't work.

I expect that this works now with #ask, *BUT* there already is a format for 
what you want to do. It is called embedded and it can be customised with 
the following parameters:

* embedformat = {h1, h2, h3, ol, ul} (how to format the result list)
* embedonly = true (whether to leave away the headlines)

This must, however, be combined with noinclude so as not to import semantic 
data or category data to the page that asks the query (especially when using 
#ask). Embed also works for annotation-objects, e.g. to print the 
query [[some page]] [[links to::*]] -- then all the values of links to 
will be embedded. Other than the first column, print requests 
for embedded are usually ignored. Also, there are known ways of cyclic 
embedding that may lead to infinite inclusion loops (though in practice these 
tend to be as finite as available memory).


 If that won't be possible even with {{#ask...}}, maybe is it possible
 to make another format of ask queries, something like this:

 ask format=expandtemplate

 to display the content of resulted wiki pages instead of their titles
 with links?

 You know, imagine that performing such ask query, where the result is
 wiki page Dresden and wiki page Berlin would display the text of
 these pages instead of list of links.

Yes, I already use this for my (semi-)blog that is based on SMW :-) (not that 
I am very active as a blogger, but anyway here is the example page, mostly 
generated by a query: http://korrekt.org/index.php/Blog).

Markus


-- 
Markus Krötzsch
Institut AIFB, Universät Karlsruhe (TH), 76128 Karlsruhe
phone +49 (0)721 608 7362fax +49 (0)721 608 5998
[EMAIL PROTECTED]www  http://korrekt.org


signature.asc
Description: This is a digitally signed message part.
-
SF.Net email is sponsored by: The Future of Linux Business White Paper
from Novell.  From the desktop to the data center, Linux is going
mainstream.  Let it simplify your IT future.
http://altfarm.mediaplex.com/ad/ck/8857-50307-18918-4___
Semediawiki-devel mailing list
Semediawiki-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/semediawiki-devel


Re: [SMW-devel] {{#ask}}

2007-11-29 Thread Denny Vrandečić
Any idea how to add page and wiki-meta data to SMW? The problem is, by 
simply adding further special properties (last modified date, creation 
date, etc.) it seems to clutter the property namespace... Well, doing 
the implementation is not trivial either, but heck  :)

Cheers,
denny


Sergey Chernyshev wrote:
 I use DPL for techpresentations.org http://techpresentations.org but 
 only because it has access to page meta-data (in my case page creation 
 dates). I wasn't impressed with DPL's approach and prefer SMW approach 
 which is about semantic data storage.
 
Sergey
 
 
 On Nov 28, 2007 10:52 AM, Jim Wilson [EMAIL PROTECTED] 
 mailto:[EMAIL PROTECTED] wrote:
 
 Of course, I am THRILLED that this is coming down the pipe.
 
 Sergey, If you're planning to do something crazy, I suggest checking
 out DPL and shamelessplugRegExParserFunctions/shamelessplug.
 Combining {{#ask}} with {{#dpl}} and {{#regex}} can produce some very
 neat combinations.  Also, I'm interested to see what you come up with
 in the way of {{#ask}} queries.
 
 -- Jim
 
 On Nov 27, 2007 5:04 PM, Sergey Chernyshev
 [EMAIL PROTECTED]
 mailto:[EMAIL PROTECTED] wrote:
   Perfect - it works great for what I was planning to use it for!
 Now almost
   no barriers are there ;)
  
   Sergey
  
  
  
  
   On Nov 27, 2007 4:43 PM, Markus Krötzsch 
 [EMAIL PROTECTED] mailto:[EMAIL PROTECTED]  wrote:
   
On Dienstag, 27. November 2007, Sergey Chernyshev wrote:
 WOW! Markus, this is great present for being back from
 vacation! ;) I'll
 test it on my instances as soon as I'll get some time with
 computer
 tomorrow.
   
Great, hope you like it. Surprisingly, most of the work had to
 go into
modifying Special:Ask to allow linking to queries using
 internal links,
   and
into supporting the new separation of printout requests and
 queries (which
also makes way for some more presents). I had to adopt the
 Special:ask
interface a little to account for this. I will drop another
 short note
   about
recent changes and then be offline for a few days. I guess RC3
 would be in
order after this.
   
Markus
   
   
   
   
   

  Sergey

 On Nov 23, 2007 4:01 PM, Markus Krötzsch
 [EMAIL PROTECTED] mailto:[EMAIL PROTECTED]
   wrote:
  And another note: {{#ask}} is in SVN (in a first version).
 
  Working example query:
 
  {{#ask: [[Category:Country]] [[borders::Nigeria]] |
   ?population|
   ?area#km² = ''Size''|
   format=list|
   limit = 3|
   link=all|
   intro=bTest/b_|
  }}
 
  Moreover, it is now of course possible to use templates and
 their
   params
  rather freely in {{#ask}}. Actually even some very
 unreasonable things
  work,
  but many cool things should also be possible. One real
 issue might be
  that uninitiated users might nest {{#ask}} in order to emulate
  q-subqueries, even though the latter are much more
 efficient and
  complete. Of course nesting sometimes is desirable:
 
  {{#ask:
  [[Category:Country]]
  [[population::{{#ask:headers=hide|?Population|[[Uganda]]}}
 ]]  |
   sort=population|
   ?population
  }}
 
  This indeed works now.
 
  Here is what should hopefully work for #ask on SVN:
 
  * all printout formats other than debug (which still
 gives some
   HTML),
  * all known parameters (though some now are more flexible
 since you
   can
  use
  wiki-markup as values),
  * printout requests with the syntax ? property#unit = label,
  * basic queries, nested queries, value ranges, wildcards,
 and yet
  * ask should work as it did before (I hope).
 
  Here is what certainly does not work:
 
  * links to further results don't work in wikitext (we need
 another
  URL-scheme
  for that, but external links may be my first fix),
  * printouts of Categories do not work via ? Category yet,
  * disjunctions in queries obviously do not work yet, since
 | is
   already
  taken in templates (Sergey suggested a solution that would
 require
  queries to
  be the last #ask-parameter, but we may even get around this by
   providing
  an
  alternative syntax for ||),
  * a query with limit 0 might show a broken further results
 link,
  * templated and embedded printers may pull annotations into
 the
   article
  where
  the 

Re: [SMW-devel] {{#ask}}

2007-11-29 Thread Audra Johnson
I don't think doing the implementation would really be that hard.   
There would need to be a refreshMetaSemantics.php maintenance  
script,  and some hooks going into creating and saving pages and  
maybe some other tasks like viewing.  It should probably only keep  
metadata on pages set to have evaluated annotations as defined in  
$smwgNamespacesWithSemanticLinks. If implemented in the core, there  
should be a global settings option so keeping this information can be  
turned on or off.  But I could just as easily see this as a SMW  
extension, and it might be better that way.

Either the special properties would need to be somewhat specific to  
keep from clashing (page last modified on, page created on, page  
edited by, number of page views, number of page edits), or users  
should be allowed to specify what the property namespaces should be.  
Users should also be allowed to customize what metadata gets saved,  
because if they don't care about storing how many times a page is  
viewed, they won't want the extra database hit to update that  
semantic bit of data every time a page is viewed.

I think have a pretty clear idea of how it could be done,  
unfortunately I probably wouldn't be able to do an implementation  
until late December.  So if nobody else does one by then, feel free  
hit me up and remind me, because it's actually something I kind of  
want for myself.  Lately I've been thinking of other possible  
automatically added semantic data, too, like a user ratings system  
extension that works with SMW.

--Audra

On Nov 29, 2007, at 8:08 AM, Denny Vrandečić wrote:

 Any idea how to add page and wiki-meta data to SMW? The problem is, by
 simply adding further special properties (last modified date, creation
 date, etc.) it seems to clutter the property namespace... Well, doing
 the implementation is not trivial either, but heck  :)

 Cheers,
 denny


 Sergey Chernyshev wrote:
 I use DPL for techpresentations.org http://techpresentations.org  
 but
 only because it has access to page meta-data (in my case page  
 creation
 dates). I wasn't impressed with DPL's approach and prefer SMW  
 approach
 which is about semantic data storage.

Sergey


 On Nov 28, 2007 10:52 AM, Jim Wilson [EMAIL PROTECTED]
 mailto:[EMAIL PROTECTED] wrote:

 Of course, I am THRILLED that this is coming down the pipe.

 Sergey, If you're planning to do something crazy, I suggest  
 checking
 out DPL and shamelessplugRegExParserFunctions/shamelessplug.
 Combining {{#ask}} with {{#dpl}} and {{#regex}} can produce  
 some very
 neat combinations.  Also, I'm interested to see what you come  
 up with
 in the way of {{#ask}} queries.

 -- Jim

 On Nov 27, 2007 5:04 PM, Sergey Chernyshev
 [EMAIL PROTECTED]
 mailto:[EMAIL PROTECTED] wrote:
 Perfect - it works great for what I was planning to use it for!
 Now almost
 no barriers are there ;)

 Sergey




 On Nov 27, 2007 4:43 PM, Markus Krötzsch 
 [EMAIL PROTECTED] mailto:[EMAIL PROTECTED]   
 wrote:

 On Dienstag, 27. November 2007, Sergey Chernyshev wrote:
 WOW! Markus, this is great present for being back from
 vacation! ;) I'll
 test it on my instances as soon as I'll get some time with
 computer
 tomorrow.

 Great, hope you like it. Surprisingly, most of the work had to
 go into
 modifying Special:Ask to allow linking to queries using
 internal links,
 and
 into supporting the new separation of printout requests and
 queries (which
 also makes way for some more presents). I had to adopt the
 Special:ask
 interface a little to account for this. I will drop another
 short note
 about
 recent changes and then be offline for a few days. I guess RC3
 would be in
 order after this.

 Markus






  Sergey

 On Nov 23, 2007 4:01 PM, Markus Krötzsch
 [EMAIL PROTECTED] mailto:[EMAIL PROTECTED]
 wrote:
 And another note: {{#ask}} is in SVN (in a first version).

 Working example query:

 {{#ask: [[Category:Country]] [[borders::Nigeria]] |
  ?population|
  ?area#km² = ''Size''|
  format=list|
  limit = 3|
  link=all|
  intro=bTest/b_|
 }}

 Moreover, it is now of course possible to use templates and
 their
 params
 rather freely in {{#ask}}. Actually even some very
 unreasonable things
 work,
 but many cool things should also be possible. One real
 issue might be
 that uninitiated users might nest {{#ask}} in order to emulate
 q-subqueries, even though the latter are much more
 efficient and
 complete. Of course nesting sometimes is desirable:

 {{#ask:
 [[Category:Country]]
 [[population::{{#ask:headers=hide|?Population|[[Uganda]]}}
 ]]  |
  sort=population|
  ?population
 }}

 This indeed works now.

 Here is what should hopefully work for #ask on SVN:

 * all printout formats other than debug (which still
 gives some
 HTML),
 * all known parameters (though some now are more flexible
 since you
 can
 use
 wiki-markup as values),
 * printout 

Re: [SMW-devel] {{#ask}}

2007-11-29 Thread S Page
Denny Vrandečić wrote:
 Any idea how to add page and wiki-meta data to SMW? The problem is, by 
 simply adding further special properties (last modified date, creation 
 date, etc.) it seems to clutter the property namespace... Well, doing 
 the implementation is not trivial either, but heck  :)

Perhaps a special virtual namespace, e.g. [[ArticleMetaProperty:Last 
modified date]] ?

The SMW query code would notice this virtual namespace and retrieve the 
metadata.  For extensibility, it could call back into custom code that 
gets a particular metadatum property; though appending extra SQL code 
seems very fragile.  And doing this really ties SMW into MediaWiki 
database internals.

Some of the names you want to query on are in 
http://meta.wikimedia.org/wiki/Help:Variable, like 
{{REVISIONTIMESTAMP}}. But this missing things like username who last 
modified, page size, etc.

Hard to do, hard to maintain, hard to extend, but it would be very useful.

--
=S

-
SF.Net email is sponsored by: The Future of Linux Business White Paper
from Novell.  From the desktop to the data center, Linux is going
mainstream.  Let it simplify your IT future.
http://altfarm.mediaplex.com/ad/ck/8857-50307-18918-4
___
Semediawiki-devel mailing list
Semediawiki-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/semediawiki-devel


Re: [SMW-devel] {{#ask}}

2007-11-28 Thread Jim Wilson
Of course, I am THRILLED that this is coming down the pipe.

Sergey, If you're planning to do something crazy, I suggest checking
out DPL and shamelessplugRegExParserFunctions/shamelessplug.
Combining {{#ask}} with {{#dpl}} and {{#regex}} can produce some very
neat combinations.  Also, I'm interested to see what you come up with
in the way of {{#ask}} queries.

-- Jim

On Nov 27, 2007 5:04 PM, Sergey Chernyshev
[EMAIL PROTECTED] wrote:
 Perfect - it works great for what I was planning to use it for! Now almost
 no barriers are there ;)

 Sergey




 On Nov 27, 2007 4:43 PM, Markus Krötzsch  [EMAIL PROTECTED] wrote:
 
  On Dienstag, 27. November 2007, Sergey Chernyshev wrote:
   WOW! Markus, this is great present for being back from vacation! ;) I'll
   test it on my instances as soon as I'll get some time with computer
   tomorrow.
 
  Great, hope you like it. Surprisingly, most of the work had to go into
  modifying Special:Ask to allow linking to queries using internal links,
 and
  into supporting the new separation of printout requests and queries (which
  also makes way for some more presents). I had to adopt the Special:ask
  interface a little to account for this. I will drop another short note
 about
  recent changes and then be offline for a few days. I guess RC3 would be in
  order after this.
 
  Markus
 
 
 
 
 
  
Sergey
  
   On Nov 23, 2007 4:01 PM, Markus Krötzsch [EMAIL PROTECTED]
 wrote:
And another note: {{#ask}} is in SVN (in a first version).
   
Working example query:
   
{{#ask: [[Category:Country]] [[borders::Nigeria]] |
 ?population|
 ?area#km² = ''Size''|
 format=list|
 limit = 3|
 link=all|
 intro=bTest/b_|
}}
   
Moreover, it is now of course possible to use templates and their
 params
rather freely in {{#ask}}. Actually even some very unreasonable things
work,
but many cool things should also be possible. One real issue might be
that uninitiated users might nest {{#ask}} in order to emulate
q-subqueries, even though the latter are much more efficient and
complete. Of course nesting sometimes is desirable:
   
{{#ask:
[[Category:Country]]
[[population::{{#ask:headers=hide|?Population|[[Uganda]]}} ]]  |
 sort=population|
 ?population
}}
   
This indeed works now.
   
Here is what should hopefully work for #ask on SVN:
   
* all printout formats other than debug (which still gives some
 HTML),
* all known parameters (though some now are more flexible since you
 can
use
wiki-markup as values),
* printout requests with the syntax ? property#unit = label,
* basic queries, nested queries, value ranges, wildcards, and yet
* ask should work as it did before (I hope).
   
Here is what certainly does not work:
   
* links to further results don't work in wikitext (we need another
URL-scheme
for that, but external links may be my first fix),
* printouts of Categories do not work via ? Category yet,
* disjunctions in queries obviously do not work yet, since | is
 already
taken in templates (Sergey suggested a solution that would require
queries to
be the last #ask-parameter, but we may even get around this by
 providing
an
alternative syntax for ||),
* a query with limit 0 might show a broken further results link,
* templated and embedded printers may pull annotations into the
 article
where
the query is -- this needs some advanced fix as there is currently no
 way
for
us to distinguish #ask-printed results from the text someone entered
directly.
   
I guess there are more things, but at least most of the above should
 be
fixed
soon. Feel free to try out the devel version (otherwise it's pretty
 much
RC2,
no updates needed) and let me know what breaks/works/is still missing.
   
Cheers,
   
Markus
   
--
Markus Krötzsch
Institut AIFB, Universät Karlsruhe (TH), 76128 Karlsruhe
phone +49 (0)721 608 7362fax +49 (0)721 608 5998
[EMAIL PROTECTED]www  http://korrekt.org
 
 
 
  --
 
 
 
  Markus Krötzsch
  Institut AIFB, Universät Karlsruhe (TH), 76128 Karlsruhe
  phone +49 (0)721 608 7362fax +49 (0)721 608 5998
  [EMAIL PROTECTED]www  http://korrekt.org
 


 -
 SF.Net email is sponsored by: The Future of Linux Business White Paper
 from Novell.  From the desktop to the data center, Linux is going
 mainstream.  Let it simplify your IT future.
 http://altfarm.mediaplex.com/ad/ck/8857-50307-18918-4
 ___
 Semediawiki-devel mailing list
 Semediawiki-devel@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/semediawiki-devel



-
SF.Net email is sponsored by: The Future of Linux Business White Paper
from 

Re: [SMW-devel] {{#ask}}

2007-11-28 Thread Sergey Chernyshev
I use DPL for techpresentations.org but only because it has access to page
meta-data (in my case page creation dates). I wasn't impressed with DPL's
approach and prefer SMW approach which is about semantic data storage.

   Sergey


On Nov 28, 2007 10:52 AM, Jim Wilson [EMAIL PROTECTED] wrote:

 Of course, I am THRILLED that this is coming down the pipe.

 Sergey, If you're planning to do something crazy, I suggest checking
 out DPL and shamelessplugRegExParserFunctions/shamelessplug.
 Combining {{#ask}} with {{#dpl}} and {{#regex}} can produce some very
 neat combinations.  Also, I'm interested to see what you come up with
 in the way of {{#ask}} queries.

 -- Jim

 On Nov 27, 2007 5:04 PM, Sergey Chernyshev
 [EMAIL PROTECTED] wrote:
  Perfect - it works great for what I was planning to use it for! Now
 almost
  no barriers are there ;)
 
  Sergey
 
 
 
 
  On Nov 27, 2007 4:43 PM, Markus Krötzsch  [EMAIL PROTECTED]
 wrote:
  
   On Dienstag, 27. November 2007, Sergey Chernyshev wrote:
WOW! Markus, this is great present for being back from vacation! ;)
 I'll
test it on my instances as soon as I'll get some time with computer
tomorrow.
  
   Great, hope you like it. Surprisingly, most of the work had to go into
   modifying Special:Ask to allow linking to queries using internal
 links,
  and
   into supporting the new separation of printout requests and queries
 (which
   also makes way for some more presents). I had to adopt the
 Special:ask
   interface a little to account for this. I will drop another short note
  about
   recent changes and then be offline for a few days. I guess RC3 would
 be in
   order after this.
  
   Markus
  
  
  
  
  
   
 Sergey
   
On Nov 23, 2007 4:01 PM, Markus Krötzsch [EMAIL PROTECTED]
  wrote:
 And another note: {{#ask}} is in SVN (in a first version).

 Working example query:

 {{#ask: [[Category:Country]] [[borders::Nigeria]] |
  ?population|
  ?area#km² = ''Size''|
  format=list|
  limit = 3|
  link=all|
  intro=bTest/b_|
 }}

 Moreover, it is now of course possible to use templates and their
  params
 rather freely in {{#ask}}. Actually even some very unreasonable
 things
 work,
 but many cool things should also be possible. One real issue might
 be
 that uninitiated users might nest {{#ask}} in order to emulate
 q-subqueries, even though the latter are much more efficient and
 complete. Of course nesting sometimes is desirable:

 {{#ask:
 [[Category:Country]]
 [[population::{{#ask:headers=hide|?Population|[[Uganda]]}} ]]  |
  sort=population|
  ?population
 }}

 This indeed works now.

 Here is what should hopefully work for #ask on SVN:

 * all printout formats other than debug (which still gives some
  HTML),
 * all known parameters (though some now are more flexible since
 you
  can
 use
 wiki-markup as values),
 * printout requests with the syntax ? property#unit = label,
 * basic queries, nested queries, value ranges, wildcards, and yet
 * ask should work as it did before (I hope).

 Here is what certainly does not work:

 * links to further results don't work in wikitext (we need another
 URL-scheme
 for that, but external links may be my first fix),
 * printouts of Categories do not work via ? Category yet,
 * disjunctions in queries obviously do not work yet, since | is
  already
 taken in templates (Sergey suggested a solution that would require
 queries to
 be the last #ask-parameter, but we may even get around this by
  providing
 an
 alternative syntax for ||),
 * a query with limit 0 might show a broken further results link,
 * templated and embedded printers may pull annotations into the
  article
 where
 the query is -- this needs some advanced fix as there is currently
 no
  way
 for
 us to distinguish #ask-printed results from the text someone
 entered
 directly.

 I guess there are more things, but at least most of the above
 should
  be
 fixed
 soon. Feel free to try out the devel version (otherwise it's
 pretty
  much
 RC2,
 no updates needed) and let me know what breaks/works/is still
 missing.

 Cheers,

 Markus

 --
 Markus Krötzsch
 Institut AIFB, Universät Karlsruhe (TH), 76128 Karlsruhe
 phone +49 (0)721 608 7362fax +49 (0)721 608 5998
 [EMAIL PROTECTED]www  http://korrekt.org
  
  
  
   --
  
  
  
   Markus Krötzsch
   Institut AIFB, Universät Karlsruhe (TH), 76128 Karlsruhe
   phone +49 (0)721 608 7362fax +49 (0)721 608 5998
   [EMAIL PROTECTED]www  http://korrekt.org
  
 
 
 
 -
  SF.Net email is sponsored by: The Future of Linux Business White Paper
  from Novell.  From the desktop to the data 

Re: [SMW-devel] {{#ask}}

2007-11-27 Thread Markus Krötzsch
On Dienstag, 27. November 2007, Sergey Chernyshev wrote:
 WOW! Markus, this is great present for being back from vacation! ;) I'll
 test it on my instances as soon as I'll get some time with computer
 tomorrow.

Great, hope you like it. Surprisingly, most of the work had to go into 
modifying Special:Ask to allow linking to queries using internal links, and 
into supporting the new separation of printout requests and queries (which 
also makes way for some more presents). I had to adopt the Special:ask 
interface a little to account for this. I will drop another short note about 
recent changes and then be offline for a few days. I guess RC3 would be in 
order after this.

Markus



  Sergey

 On Nov 23, 2007 4:01 PM, Markus Krötzsch [EMAIL PROTECTED] wrote:
  And another note: {{#ask}} is in SVN (in a first version).
 
  Working example query:
 
  {{#ask: [[Category:Country]] [[borders::Nigeria]] |
   ?population|
   ?area#km² = ''Size''|
   format=list|
   limit = 3|
   link=all|
   intro=bTest/b_|
  }}
 
  Moreover, it is now of course possible to use templates and their params
  rather freely in {{#ask}}. Actually even some very unreasonable things
  work,
  but many cool things should also be possible. One real issue might be
  that uninitiated users might nest {{#ask}} in order to emulate
  q-subqueries, even though the latter are much more efficient and
  complete. Of course nesting sometimes is desirable:
 
  {{#ask:
  [[Category:Country]]
  [[population::{{#ask:headers=hide|?Population|[[Uganda]]}} ]]  |
   sort=population|
   ?population
  }}
 
  This indeed works now.
 
  Here is what should hopefully work for #ask on SVN:
 
  * all printout formats other than debug (which still gives some HTML),
  * all known parameters (though some now are more flexible since you can
  use
  wiki-markup as values),
  * printout requests with the syntax ? property#unit = label,
  * basic queries, nested queries, value ranges, wildcards, and yet
  * ask should work as it did before (I hope).
 
  Here is what certainly does not work:
 
  * links to further results don't work in wikitext (we need another
  URL-scheme
  for that, but external links may be my first fix),
  * printouts of Categories do not work via ? Category yet,
  * disjunctions in queries obviously do not work yet, since | is already
  taken in templates (Sergey suggested a solution that would require
  queries to
  be the last #ask-parameter, but we may even get around this by providing
  an
  alternative syntax for ||),
  * a query with limit 0 might show a broken further results link,
  * templated and embedded printers may pull annotations into the article
  where
  the query is -- this needs some advanced fix as there is currently no way
  for
  us to distinguish #ask-printed results from the text someone entered
  directly.
 
  I guess there are more things, but at least most of the above should be
  fixed
  soon. Feel free to try out the devel version (otherwise it's pretty much
  RC2,
  no updates needed) and let me know what breaks/works/is still missing.
 
  Cheers,
 
  Markus
 
  --
  Markus Krötzsch
  Institut AIFB, Universät Karlsruhe (TH), 76128 Karlsruhe
  phone +49 (0)721 608 7362fax +49 (0)721 608 5998
  [EMAIL PROTECTED]www  http://korrekt.org



-- 
Markus Krötzsch
Institut AIFB, Universät Karlsruhe (TH), 76128 Karlsruhe
phone +49 (0)721 608 7362fax +49 (0)721 608 5998
[EMAIL PROTECTED]www  http://korrekt.org


signature.asc
Description: This is a digitally signed message part.
-
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/___
Semediawiki-devel mailing list
Semediawiki-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/semediawiki-devel


Re: [SMW-devel] {{#ask}}

2007-11-27 Thread Sergey Chernyshev
Perfect - it works great for what I was planning to use it for! Now almost
no barriers are there ;)

Sergey


On Nov 27, 2007 4:43 PM, Markus Krötzsch [EMAIL PROTECTED] wrote:

 On Dienstag, 27. November 2007, Sergey Chernyshev wrote:
  WOW! Markus, this is great present for being back from vacation! ;) I'll
  test it on my instances as soon as I'll get some time with computer
  tomorrow.

 Great, hope you like it. Surprisingly, most of the work had to go into
 modifying Special:Ask to allow linking to queries using internal links,
 and
 into supporting the new separation of printout requests and queries (which
 also makes way for some more presents). I had to adopt the Special:ask
 interface a little to account for this. I will drop another short note
 about
 recent changes and then be offline for a few days. I guess RC3 would be in
 order after this.

 Markus


 
   Sergey
 
  On Nov 23, 2007 4:01 PM, Markus Krötzsch [EMAIL PROTECTED]
 wrote:
   And another note: {{#ask}} is in SVN (in a first version).
  
   Working example query:
  
   {{#ask: [[Category:Country]] [[borders::Nigeria]] |
?population|
?area#km² = ''Size''|
format=list|
limit = 3|
link=all|
intro=bTest/b_|
   }}
  
   Moreover, it is now of course possible to use templates and their
 params
   rather freely in {{#ask}}. Actually even some very unreasonable things
   work,
   but many cool things should also be possible. One real issue might be
   that uninitiated users might nest {{#ask}} in order to emulate
   q-subqueries, even though the latter are much more efficient and
   complete. Of course nesting sometimes is desirable:
  
   {{#ask:
   [[Category:Country]]
   [[population::{{#ask:headers=hide|?Population|[[Uganda]]}} ]]  |
sort=population|
?population
   }}
  
   This indeed works now.
  
   Here is what should hopefully work for #ask on SVN:
  
   * all printout formats other than debug (which still gives some
 HTML),
   * all known parameters (though some now are more flexible since you
 can
   use
   wiki-markup as values),
   * printout requests with the syntax ? property#unit = label,
   * basic queries, nested queries, value ranges, wildcards, and yet
   * ask should work as it did before (I hope).
  
   Here is what certainly does not work:
  
   * links to further results don't work in wikitext (we need another
   URL-scheme
   for that, but external links may be my first fix),
   * printouts of Categories do not work via ? Category yet,
   * disjunctions in queries obviously do not work yet, since | is
 already
   taken in templates (Sergey suggested a solution that would require
   queries to
   be the last #ask-parameter, but we may even get around this by
 providing
   an
   alternative syntax for ||),
   * a query with limit 0 might show a broken further results link,
   * templated and embedded printers may pull annotations into the
 article
   where
   the query is -- this needs some advanced fix as there is currently no
 way
   for
   us to distinguish #ask-printed results from the text someone entered
   directly.
  
   I guess there are more things, but at least most of the above should
 be
   fixed
   soon. Feel free to try out the devel version (otherwise it's pretty
 much
   RC2,
   no updates needed) and let me know what breaks/works/is still missing.
  
   Cheers,
  
   Markus
  
   --
   Markus Krötzsch
   Institut AIFB, Universät Karlsruhe (TH), 76128 Karlsruhe
   phone +49 (0)721 608 7362fax +49 (0)721 608 5998
   [EMAIL PROTECTED]www  http://korrekt.org



 --
 Markus Krötzsch
 Institut AIFB, Universät Karlsruhe (TH), 76128 Karlsruhe
 phone +49 (0)721 608 7362fax +49 (0)721 608 5998
 [EMAIL PROTECTED]www  http://korrekt.org

-
SF.Net email is sponsored by: The Future of Linux Business White Paper
from Novell.  From the desktop to the data center, Linux is going
mainstream.  Let it simplify your IT future.
http://altfarm.mediaplex.com/ad/ck/8857-50307-18918-4___
Semediawiki-devel mailing list
Semediawiki-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/semediawiki-devel


Re: [SMW-devel] ask query format=template

2007-11-23 Thread Markus Krötzsch
Good to hear that at least the XML-import+SMW-refresh finally worked. The 
design of MediaWiki is very fragile in many places, and I fear that there are 
much more non-common cases where extensions do not work as expected (e.g. due 
to the combination of global and non-global objects everywhere in the code).

Some minor remarks follow.


On Freitag, 9. November 2007, Sergey Chernyshev wrote:
 Yes, I ran SMW_refreshData twice - first with -p and second without.
 The problem I ran into is that Property page complained like this:

 PHP Fatal error:  Call to a member funct
 ion getText() on a non-object in /path to mw/extensions/SemanticMediaWiki
 /includes/articlepages/SMW_PropertyPage.php on line 68, referer: http://mw
 base url/index.php?title=Special%3AAllpagesfrom=namespace=102

 so I enabled SQL debug and looked at the queries and realized that only few
 of the pages that were returned by  SMW::getAllPropertySubjects had entries
 in mw_page (hmm, it seems that I got you confused saying that I lacked
 entries in mw_smw_attributes - looks like I got them referencing wrong ids
 or non-existing pages).

Ah, now I see the problem: refreshing all data will only ever delete the data 
related to existing subjects. If for some reason there are entries of 
annotations for articles that do not exist, then these are not fixed by any 
amount of refreshing. This is what happened in the above case (the title 
object did not exist).

I have now extended the storage implementation to catch this case, but we 
should also have some script that resets the SMW-tables completely.  


 I'm thinking of dropping all SMW tables and re-running the SMW_Setup.php
 and then SMW_refreshData twice. Do you think is a right approach to rebuild
 stuff from scratch? 

Yes, that should work.

 BTW, is it OK to split SMW_refreshData task to several 
 tasks and run them simultaneously for better use of multiple CPUs I have?

You can run several instances with different page IDs to start refreshing, but 
you cannot currently tell them to stop at some fixed ID other than by editing 
the script. Doing this may improve performance if CPU is a bottleneck for you 
(in some cases, DB bandwidth or working memory may be the bottleneck), and if 
your OS really distributes sub-processes between the CPUs (my observation is 
that a single wiki, even if processing many requests in parallel, often uses 
only one of our server CPUs; this may be related to the single mysql-server 
that creates DB-processes; anyway it is handy since a high-load wiki doesn't 
ever lock the whole server but only one CPU).

Markus


Sergey

 On Nov 9, 2007 7:11 AM, Markus Krötzsch [EMAIL PROTECTED] wrote:
  On Donnerstag, 8. November 2007, Sergey Chernyshev wrote:
   Not sure if it's related to this issue, but I also lost some data in
   smw_attributes table (not all of it though). The worst part is that it
   didn't reappear after I ran complete SMW_refreshData on the dataset.
   I wonder what needs to be done to repopulate SMW tables from scratch?
 
  Running SMW_refreshData twice (once with option -p and once without;
  option -v
  may also be interesting but not essential) will restore all available
  data in
  basically all cases. If the table remains incomplete, this means that the
  content of the pages does no longer require certain entries there. This
  may
  have various reasons:
 
  * The table contained old orphaned entries before, maybe due to some bug
  in
  earlier versions.
  * The table contained outdated data (e.g. after some template change)
  that just had not been refreshed yet.
  * Some annotation is no longer accepted, maybe due to (unintentional)
  syntactic changes, or due to known limitations such as the disabled
  Type:Boolean.
 
  Only case 3 should bother you, and in this case more information is
  needed:
  what exactly is it that is missing?
 
  But in any case SMW_refreshData (at least in theory) suffices to recreate
  all
  SMW data from scratch or from import. Anything not built there will not
  be built when editing pages normally either.
 
  Markus
 
   Sergey
  
   On Nov 8, 2007 8:26 AM, cnit [EMAIL PROTECTED] wrote:
 Yes, this appears to be a bug. For a quick workaround, consider
 
  using
 
the
   
 formats list, ul or ol, all of which also support the
 template-parameter for formatting (and this one certainly works
 with
   
SMW1.0).
   
 Note that with list, you can also choose the separator between
 items (parameter sep), so as to simulate template quite well.
   
Thanks for a hint, but it seems that the problem is deeper. Even
after the successfully importing XML dump, where
pageAttribute:../page
were replaced with
pageProperty:../page
   
and also these pages were placed on the top of the dump, to make sure
properties are defined before importing the pages where actual
values of properties are used..
   
But.. my smw_attributes table is empty :-( I 

Re: [SMW-devel] {{#ask}}

2007-11-23 Thread Markus Krötzsch
And another note: {{#ask}} is in SVN (in a first version).

Working example query:

{{#ask: [[Category:Country]] [[borders::Nigeria]] |
  ?population|
  ?area#km² = ''Size''|
  format=list|
  limit = 3|
  link=all|
  intro=bTest/b_|
}}

Moreover, it is now of course possible to use templates and their params 
rather freely in {{#ask}}. Actually even some very unreasonable things work, 
but many cool things should also be possible. One real issue might be that 
uninitiated users might nest {{#ask}} in order to emulate q-subqueries, 
even though the latter are much more efficient and complete. Of course 
nesting sometimes is desirable:

{{#ask:
[[Category:Country]] 
[[population::{{#ask:headers=hide|?Population|[[Uganda]]}} ]]  |
  sort=population|
  ?population
}}

This indeed works now.

Here is what should hopefully work for #ask on SVN:

* all printout formats other than debug (which still gives some HTML),
* all known parameters (though some now are more flexible since you can use 
wiki-markup as values),
* printout requests with the syntax ? property#unit = label,
* basic queries, nested queries, value ranges, wildcards, and yet
* ask should work as it did before (I hope).

Here is what certainly does not work:

* links to further results don't work in wikitext (we need another URL-scheme 
for that, but external links may be my first fix),
* printouts of Categories do not work via ? Category yet,
* disjunctions in queries obviously do not work yet, since | is already 
taken in templates (Sergey suggested a solution that would require queries to 
be the last #ask-parameter, but we may even get around this by providing an 
alternative syntax for ||),
* a query with limit 0 might show a broken further results link,
* templated and embedded printers may pull annotations into the article where 
the query is -- this needs some advanced fix as there is currently no way for 
us to distinguish #ask-printed results from the text someone entered 
directly.

I guess there are more things, but at least most of the above should be fixed 
soon. Feel free to try out the devel version (otherwise it's pretty much RC2, 
no updates needed) and let me know what breaks/works/is still missing.

Cheers,

Markus

-- 
Markus Krötzsch
Institut AIFB, Universät Karlsruhe (TH), 76128 Karlsruhe
phone +49 (0)721 608 7362fax +49 (0)721 608 5998
[EMAIL PROTECTED]www  http://korrekt.org


pgpUFTqGhe81U.pgp
Description: PGP signature
-
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/___
Semediawiki-devel mailing list
Semediawiki-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/semediawiki-devel


Re: [SMW-devel] {{#ask}}

2007-11-17 Thread Peter Clements
Hello Markus,

On Tuesday, November 6, 2007, 4:20:53 PM, you wrote:

MK On Dienstag, 6. November 2007, cnit wrote:
  The other issue that I'm having is {{#ask}} parser function - not
  having it stops almost all of my development. It's probably the most
  anticipated feature right now. Do you have any timeline or at least
  defined approach to it?

[extra stuff edited out]

 I am myself missing parser function badly, but I guess that
 complaining too often won't speed up the development, rather bore the
 developers..

MK Well, you can always add some further pressure, but our development activity
MK still is subject to various constraints that are outside our control (jobs,
MK lives, ...) ;-)

MK But maybe, since we are over it, we can start some design discussions about
MK {{#ask...}}. In particular, parser functions have a slightly different style
MK of parameters than parser hooks (ask). Our current ask has three parts:

MK (1) the query conditions,
MK (2) multiple print statements,
MK (3) a variable set of parameters.

MK Currently (1) and (2) can be mixed, although the position of print 
statements
MK relative to the query conditions has no effect. Moving to a parser function
MK seems to be a good opportunity to revise some of this design, e.g. by simply
MK making the print statements a separate parameter. In {{#ask..}}, everything
MK must be passed as a parameter anyway, so separating (1) and (2) is no
MK complication. How should an example query look like? Her is a suggested
MK example transformation:

MK ask format=table limit=12
MK  [[Category:Person]] [[lives in::Europe]] 
MK  [[lives in::*]]
MK  [[birthday::*|day of birth]] 
MK  [[height::*m²|size]]
MK /ask

MK  becomes

MK {{#ask|
MK   format=table|
MK   limit = 12|
MK   ?lives in|
MK   ?birthday = day of birth|
MK   ?height#m² = size|
MK   [[Category:Person]] [[lives in::Europe]]
MK }}

MK Basic points:
MK * The query is always the last parameter.
MK * No | appear unless they are used as separators between parameters.
MK * Printouts start with ?
MK * All the known printout modifications somehow work, but in different 
syntax.
MK * We implicitly block = in property names (should we care?)

MK Some of this syntax is not essential, but one must be careful not to collide
MK with MediaWiki syntax. ask would of course continue to work in any case,
MK but {{#ask}} would become the suggested method in the future.

MK I guess the main point of discussion would be the printout-parameters. Many
MK variations are possible, and comments are welcome.

On Monday, November 12, 2007, 9:31:03 PM, Jim Wilson wrote:

JW Although I am in favor of {{#ask:}} at the earliest possible
JW conveneince, after a cursory look through the code, I'm fairly certain
JW this extension will fail to operate as expected.

JW The first reason is that ask, which is an extension tag, will always
JW return fully qualified HTML.  The output of a parser function is
JW expected to be wikitext, which will be further processed.  The result
JW is that if the output of the {{#ask:}} call contains any links,
JW they'll be HTML links (like a
JW href=somethingsomething/a), not
JW wiki text (like [[something]]).  When the Parser reads these HTML tags
JW during subsequent processing, it'll convert the '' and '' symbols to
JW their entity equivalents 'lt;' and 'gt;' so in the browser you
JW actually see 'a href=...whatever/a', not a nice link.

JW The second reason is that one of the huge benefits of having an
JW {{#ask:}} parser function is nesting.  The idea that you could
JW {{#ask:something={{#ask:something else.  I'm not sure if SMW
JW supports nested ask tags, but if not, this would also be a failure
JW mode of the aforementioned extension.

JW Again, I would like nothing more from SMW than an {{#ask:}} template -
JW which would be a __HUGE__ improvement for advanced use cases, but I
JW don't think that this extension is the answer everyone hopes it is.

JW -- Jim R. Wilson (jimbojw)

As Jim notes, when used with {{#ask:}}, all of the Query Printers will
need to use wiki formatting rather than HTML, but that should not be
too difficult I would have thought.

Since Markus is asking about updating the parameter passing
conventions for use with queries (especially in relation to Query
Printers), I thought I would step in with some suggestions that I have
been harbouring for some time.

Extra 'top level' parameters


lastsep=

Used with format=list to control the separator between the last
pair of rows.

Currently, if you use sep=, the value you give is used between
all rows (including the last pair).

Example:

format=list sep=,_ lastsep=,_or_

suffix=

Used with all formats to add text after everything else (in the
same way that intro adds text before everything else).

Field specific parameters
=

When a field has multiple values, they are always formatted with , 
as the separator for format=list, 

Re: [SMW-devel] {{#ask}}

2007-11-15 Thread Sergey Chernyshev
Thank you, Jim. That's what I expected. I'm just hoping for 1.0 final is
close enough.

 Sergey


On Nov 12, 2007 4:31 PM, Jim Wilson [EMAIL PROTECTED] wrote:

 Although I am in favor of {{#ask:}} at the earliest possible
 conveneince, after a cursory look through the code, I'm fairly certain
 this extension will fail to operate as expected.

 The first reason is that ask, which is an extension tag, will always
 return fully qualified HTML.  The output of a parser function is
 expected to be wikitext, which will be further processed.  The result
 is that if the output of the {{#ask:}} call contains any links,
 they'll be HTML links (like a href=somethingsomething/a), not
 wiki text (like [[something]]).  When the Parser reads these HTML tags
 during subsequent processing, it'll convert the '' and '' symbols to
 their entity equivalents 'lt;' and 'gt;' so in the browser you
 actually see 'a href=...whatever/a', not a nice link.

 The second reason is that one of the huge benefits of having an
 {{#ask:}} parser function is nesting.  The idea that you could
 {{#ask:something={{#ask:something else.  I'm not sure if SMW
 supports nested ask tags, but if not, this would also be a failure
 mode of the aforementioned extension.

 Again, I would like nothing more from SMW than an {{#ask:}} template -
 which would be a __HUGE__ improvement for advanced use cases, but I
 don't think that this extension is the answer everyone hopes it is.

 -- Jim R. Wilson (jimbojw)

 On Nov 12, 2007 10:38 AM, Sergey Chernyshev
 [EMAIL PROTECTED] wrote:
  Yaron noticed that there is new inline query extension posted on
  MediaWiki.org:
 http://www.mediawiki.org/wiki/Extension:SMW_ParserFunctionAsk
 
   I'm definitely going to install it and see if it'll work for my needs,
 but
  what bothers me is the size of it - it seems to be too simple ;)
 
  I also noticed that it's not going to support '=' or '|' in the queries,
 but
  it's easy to implement it using the code I sent in before.
 
  Markus, could you please look at it and let us know if you anticipate
 any
  problems with this code?
 
   Sergey
 
 
  --
  Sergey Chernyshev
   http://www.sergeychernyshev.com/

-
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now  http://get.splunk.com/___
Semediawiki-devel mailing list
Semediawiki-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/semediawiki-devel


Re: [SMW-devel] ask query format=template

2007-11-12 Thread cnit
 Yes, I could use this as well. But this feature comes only after the
 implementation of {{#ask...}} (since this change will change the interaction
 of inline queries with MediaWiki's table creation).
Can the implementation of {{#ask}} make possible such trick that I've
unsuccessfully tried to perform with SMW 0.7:

Instead of displaying a page link in ask query template (via {{{1}}})
I've tried to display the content of resulted pages with
{{ {{{1}}} }}
Yet, expansion didn't work.

If that won't be possible even with {{#ask...}}, maybe is it possible
to make another format of ask queries, something like this:

ask format=expandtemplate

to display the content of resulted wiki pages instead of their titles
with links?

You know, imagine that performing such ask query, where the result is
wiki page Dresden and wiki page Berlin would display the text of
these pages instead of list of links.
Dmitriy


-
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now  http://get.splunk.com/
___
Semediawiki-devel mailing list
Semediawiki-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/semediawiki-devel


Re: [SMW-devel] {{#ask}}

2007-11-12 Thread Jim Wilson
Although I am in favor of {{#ask:}} at the earliest possible
conveneince, after a cursory look through the code, I'm fairly certain
this extension will fail to operate as expected.

The first reason is that ask, which is an extension tag, will always
return fully qualified HTML.  The output of a parser function is
expected to be wikitext, which will be further processed.  The result
is that if the output of the {{#ask:}} call contains any links,
they'll be HTML links (like a href=somethingsomething/a), not
wiki text (like [[something]]).  When the Parser reads these HTML tags
during subsequent processing, it'll convert the '' and '' symbols to
their entity equivalents 'lt;' and 'gt;' so in the browser you
actually see 'a href=...whatever/a', not a nice link.

The second reason is that one of the huge benefits of having an
{{#ask:}} parser function is nesting.  The idea that you could
{{#ask:something={{#ask:something else.  I'm not sure if SMW
supports nested ask tags, but if not, this would also be a failure
mode of the aforementioned extension.

Again, I would like nothing more from SMW than an {{#ask:}} template -
which would be a __HUGE__ improvement for advanced use cases, but I
don't think that this extension is the answer everyone hopes it is.

-- Jim R. Wilson (jimbojw)

On Nov 12, 2007 10:38 AM, Sergey Chernyshev
[EMAIL PROTECTED] wrote:
 Yaron noticed that there is new inline query extension posted on
 MediaWiki.org: http://www.mediawiki.org/wiki/Extension:SMW_ParserFunctionAsk

  I'm definitely going to install it and see if it'll work for my needs, but
 what bothers me is the size of it - it seems to be too simple ;)

 I also noticed that it's not going to support '=' or '|' in the queries, but
 it's easy to implement it using the code I sent in before.

 Markus, could you please look at it and let us know if you anticipate any
 problems with this code?

  Sergey


 --
 Sergey Chernyshev
  http://www.sergeychernyshev.com/
 -
 This SF.net email is sponsored by: Splunk Inc.
 Still grepping through log files to find problems?  Stop.
 Now Search log events and configuration files using AJAX and a browser.
 Download your FREE copy of Splunk now  http://get.splunk.com/
 ___
 Semediawiki-devel mailing list
 Semediawiki-devel@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/semediawiki-devel



-
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now  http://get.splunk.com/
___
Semediawiki-devel mailing list
Semediawiki-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/semediawiki-devel


Re: [SMW-devel] ask query format=template

2007-11-09 Thread Markus Krötzsch
On Donnerstag, 8. November 2007, Sergey Chernyshev wrote:
 Not sure if it's related to this issue, but I also lost some data in
 smw_attributes table (not all of it though). The worst part is that it
 didn't reappear after I ran complete SMW_refreshData on the dataset.
 I wonder what needs to be done to repopulate SMW tables from scratch?

Running SMW_refreshData twice (once with option -p and once without; option -v 
may also be interesting but not essential) will restore all available data in 
basically all cases. If the table remains incomplete, this means that the 
content of the pages does no longer require certain entries there. This may 
have various reasons:

* The table contained old orphaned entries before, maybe due to some bug in 
earlier versions.
* The table contained outdated data (e.g. after some template change) that 
just had not been refreshed yet.
* Some annotation is no longer accepted, maybe due to (unintentional) 
syntactic changes, or due to known limitations such as the disabled 
Type:Boolean.

Only case 3 should bother you, and in this case more information is needed: 
what exactly is it that is missing? 

But in any case SMW_refreshData (at least in theory) suffices to recreate all 
SMW data from scratch or from import. Anything not built there will not be 
built when editing pages normally either.

Markus


 Sergey

 On Nov 8, 2007 8:26 AM, cnit [EMAIL PROTECTED] wrote:
   Yes, this appears to be a bug. For a quick workaround, consider using
 
  the
 
   formats list, ul or ol, all of which also support the
   template-parameter for formatting (and this one certainly works with
 
  SMW1.0).
 
   Note that with list, you can also choose the separator between items
   (parameter sep), so as to simulate template quite well.
 
  Thanks for a hint, but it seems that the problem is deeper. Even
  after the successfully importing XML dump, where
  pageAttribute:../page
  were replaced with
  pageProperty:../page
 
  and also these pages were placed on the top of the dump, to make sure
  properties are defined before importing the pages where actual
  values of properties are used..
 
  But.. my smw_attributes table is empty :-( I think it's not
  correct, because I have at least two properties and many user pages
  that use them..
 
  My first guess was: that might be because the datetime class was
  completely rewritten, and the new version doeesn't accept Russian
  format of dates. But, I've made a simple test and it seems that
 
  $this-m_time = strtotime(trim($value));
 
  converts Russian formatted date
  strtotime(13.04.2007)
  to correct value.
 
  There is a page, which uses Date property with such value, yet, the
  manual Special:Ask search of
  [[Äàòà:=13.04.2007]]
  where Aaoa is a Date in Russian, like:
  [[Date:=13.04.2007]]
 
  returns nothing. Yet, the page with such property value exists in
  the wiki..
 
  The property also has it's own definition page (of course), which
  states (in Russian) that it's a special one and it's type belongs
  to standard type Date - there are mouseover popup hints. I guess that
  means that property has been defined correctly?
 
  I guess that SMW tables aren't initialized during the XML import for some
  reason?
  Dmitriy
 
 
  -
  This SF.net email is sponsored by: Splunk Inc.
  Still grepping through log files to find problems?  Stop.
  Now Search log events and configuration files using AJAX and a browser.
  Download your FREE copy of Splunk now  http://get.splunk.com/
  ___
  Semediawiki-devel mailing list
  Semediawiki-devel@lists.sourceforge.net
  https://lists.sourceforge.net/lists/listinfo/semediawiki-devel



-- 
Markus Krötzsch
Institut AIFB, Universät Karlsruhe (TH), 76128 Karlsruhe
phone +49 (0)721 608 7362fax +49 (0)721 608 5998
[EMAIL PROTECTED]www  http://korrekt.org


pgpeRtlfRESuJ.pgp
Description: PGP signature
-
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now  http://get.splunk.com/___
Semediawiki-devel mailing list
Semediawiki-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/semediawiki-devel


Re: [SMW-devel] ask query format=template

2007-11-09 Thread Markus Krötzsch
Did you ever run SMW_refreshData after the import? Plain import does probably 
bypass SMW's (save) hooks, so that this last part would be needed (twice, as 
described in INSTALL). 

SMW's tables are completely determined by the page contents of your wiki, and 
so they do not need to be imported or backuped. If they cannot be rebuilt via 
SMW_refreshData, then normal editing in the wiki would also not fill them 
properly (which is possible, but not related to the import itself).

Markus


On Donnerstag, 8. November 2007, cnit wrote:
  Yes, this appears to be a bug. For a quick workaround, consider using the
  formats list, ul or ol, all of which also support the
  template-parameter for formatting (and this one certainly works with
  SMW1.0). Note that with list, you can also choose the separator between
  items (parameter sep), so as to simulate template quite well.

 Thanks for a hint, but it seems that the problem is deeper. Even
 after the successfully importing XML dump, where
 pageAttribute:../page
 were replaced with
 pageProperty:../page

 and also these pages were placed on the top of the dump, to make sure
 properties are defined before importing the pages where actual
 values of properties are used..

 But.. my smw_attributes table is empty :-( I think it's not
 correct, because I have at least two properties and many user pages
 that use them..

 My first guess was: that might be because the datetime class was
 completely rewritten, and the new version doeesn't accept Russian
 format of dates. But, I've made a simple test and it seems that

 $this-m_time = strtotime(trim($value));

 converts Russian formatted date
 strtotime(13.04.2007)
 to correct value.

 There is a page, which uses Date property with such value, yet, the
 manual Special:Ask search of
 [[Äàòà:=13.04.2007]]
 where Aaoa is a Date in Russian, like:
 [[Date:=13.04.2007]]

 returns nothing. Yet, the page with such property value exists in
 the wiki..

 The property also has it's own definition page (of course), which
 states (in Russian) that it's a special one and it's type belongs
 to standard type Date - there are mouseover popup hints. I guess that
 means that property has been defined correctly?

 I guess that SMW tables aren't initialized during the XML import for some
 reason?
 Dmitriy



-- 
Markus Krötzsch
Institut AIFB, Universät Karlsruhe (TH), 76128 Karlsruhe
phone +49 (0)721 608 7362fax +49 (0)721 608 5998
[EMAIL PROTECTED]www  http://korrekt.org


pgpi12adRfUh8.pgp
Description: PGP signature
-
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now  http://get.splunk.com/___
Semediawiki-devel mailing list
Semediawiki-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/semediawiki-devel


Re: [SMW-devel] ask query format=template

2007-11-09 Thread Sergey Chernyshev
Yes, I ran SMW_refreshData twice - first with -p and second without.
The problem I ran into is that Property page complained like this:

PHP Fatal error:  Call to a member funct
ion getText() on a non-object in /path to mw/extensions/SemanticMediaWiki
/includes/articlepages/SMW_PropertyPage.php on line 68, referer: http://mw
base url/index.php?title=Special%3AAllpagesfrom=namespace=102

so I enabled SQL debug and looked at the queries and realized that only few
of the pages that were returned by  SMW::getAllPropertySubjects had entries
in mw_page (hmm, it seems that I got you confused saying that I lacked
entries in mw_smw_attributes - looks like I got them referencing wrong ids
or non-existing pages).

I'm thinking of dropping all SMW tables and re-running the SMW_Setup.php and
then SMW_refreshData twice. Do you think is a right approach to rebuild
stuff from scratch? BTW, is it OK to split SMW_refreshData task to several
tasks and run them simultaneously for better use of multiple CPUs I have?

   Sergey


On Nov 9, 2007 7:11 AM, Markus Krötzsch [EMAIL PROTECTED] wrote:

 On Donnerstag, 8. November 2007, Sergey Chernyshev wrote:
  Not sure if it's related to this issue, but I also lost some data in
  smw_attributes table (not all of it though). The worst part is that it
  didn't reappear after I ran complete SMW_refreshData on the dataset.
  I wonder what needs to be done to repopulate SMW tables from scratch?

 Running SMW_refreshData twice (once with option -p and once without;
 option -v
 may also be interesting but not essential) will restore all available data
 in
 basically all cases. If the table remains incomplete, this means that the
 content of the pages does no longer require certain entries there. This
 may
 have various reasons:

 * The table contained old orphaned entries before, maybe due to some bug
 in
 earlier versions.
 * The table contained outdated data (e.g. after some template change) that
 just had not been refreshed yet.
 * Some annotation is no longer accepted, maybe due to (unintentional)
 syntactic changes, or due to known limitations such as the disabled
 Type:Boolean.

 Only case 3 should bother you, and in this case more information is
 needed:
 what exactly is it that is missing?

 But in any case SMW_refreshData (at least in theory) suffices to recreate
 all
 SMW data from scratch or from import. Anything not built there will not be
 built when editing pages normally either.

 Markus

 
  Sergey
 
  On Nov 8, 2007 8:26 AM, cnit [EMAIL PROTECTED] wrote:
Yes, this appears to be a bug. For a quick workaround, consider
 using
  
   the
  
formats list, ul or ol, all of which also support the
template-parameter for formatting (and this one certainly works with
  
   SMW1.0).
  
Note that with list, you can also choose the separator between items
(parameter sep), so as to simulate template quite well.
  
   Thanks for a hint, but it seems that the problem is deeper. Even
   after the successfully importing XML dump, where
   pageAttribute:../page
   were replaced with
   pageProperty:../page
  
   and also these pages were placed on the top of the dump, to make sure
   properties are defined before importing the pages where actual
   values of properties are used..
  
   But.. my smw_attributes table is empty :-( I think it's not
   correct, because I have at least two properties and many user pages
   that use them..
  
   My first guess was: that might be because the datetime class was
   completely rewritten, and the new version doeesn't accept Russian
   format of dates. But, I've made a simple test and it seems that
  
   $this-m_time = strtotime(trim($value));
  
   converts Russian formatted date
   strtotime(13.04.2007)
   to correct value.
  
   There is a page, which uses Date property with such value, yet, the
   manual Special:Ask search of
   [[Äàòà:=13.04.2007]]
   where Aaoa is a Date in Russian, like:
   [[Date:=13.04.2007]]
  
   returns nothing. Yet, the page with such property value exists in
   the wiki..
  
   The property also has it's own definition page (of course), which
   states (in Russian) that it's a special one and it's type belongs
   to standard type Date - there are mouseover popup hints. I guess
 that
   means that property has been defined correctly?
  
   I guess that SMW tables aren't initialized during the XML import for
 some
   reason?
   Dmitriy
  
  
  
 -
   This SF.net email is sponsored by: Splunk Inc.
   Still grepping through log files to find problems?  Stop.
   Now Search log events and configuration files using AJAX and a
 browser.
   Download your FREE copy of Splunk now  http://get.splunk.com/
   ___
   Semediawiki-devel mailing list
   Semediawiki-devel@lists.sourceforge.net
   https://lists.sourceforge.net/lists/listinfo/semediawiki-devel



 --
 Markus Krötzsch
 Institut AIFB, 

Re: [SMW-devel] ask query format=template

2007-11-08 Thread cnit
 Yes, this appears to be a bug. For a quick workaround, consider using the
 formats list, ul or ol, all of which also support the 
 template-parameter for formatting (and this one certainly works with SMW1.0).
 Note that with list, you can also choose the separator between items
 (parameter sep), so as to simulate template quite well.

Thanks for a hint, but it seems that the problem is deeper. Even
after the successfully importing XML dump, where
pageAttribute:../page 
were replaced with
pageProperty:../page

and also these pages were placed on the top of the dump, to make sure
properties are defined before importing the pages where actual
values of properties are used..

But.. my smw_attributes table is empty :-( I think it's not
correct, because I have at least two properties and many user pages
that use them..

My first guess was: that might be because the datetime class was
completely rewritten, and the new version doeesn't accept Russian
format of dates. But, I've made a simple test and it seems that

$this-m_time = strtotime(trim($value));

converts Russian formatted date
strtotime(13.04.2007)
to correct value.

There is a page, which uses Date property with such value, yet, the
manual Special:Ask search of
[[Äàòà:=13.04.2007]]
where Aaoa is a Date in Russian, like:
[[Date:=13.04.2007]]

returns nothing. Yet, the page with such property value exists in
the wiki..

The property also has it's own definition page (of course), which
states (in Russian) that it's a special one and it's type belongs
to standard type Date - there are mouseover popup hints. I guess that
means that property has been defined correctly?

I guess that SMW tables aren't initialized during the XML import for some
reason?
Dmitriy


-
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now  http://get.splunk.com/
___
Semediawiki-devel mailing list
Semediawiki-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/semediawiki-devel


Re: [SMW-devel] ask query format=template

2007-11-08 Thread Sergey Chernyshev
Not sure if it's related to this issue, but I also lost some data in
smw_attributes table (not all of it though). The worst part is that it
didn't reappear after I ran complete SMW_refreshData on the dataset.
I wonder what needs to be done to repopulate SMW tables from scratch?

Sergey


On Nov 8, 2007 8:26 AM, cnit [EMAIL PROTECTED] wrote:

  Yes, this appears to be a bug. For a quick workaround, consider using
 the
  formats list, ul or ol, all of which also support the
  template-parameter for formatting (and this one certainly works with
 SMW1.0).
  Note that with list, you can also choose the separator between items
  (parameter sep), so as to simulate template quite well.

 Thanks for a hint, but it seems that the problem is deeper. Even
 after the successfully importing XML dump, where
 pageAttribute:../page
 were replaced with
 pageProperty:../page

 and also these pages were placed on the top of the dump, to make sure
 properties are defined before importing the pages where actual
 values of properties are used..

 But.. my smw_attributes table is empty :-( I think it's not
 correct, because I have at least two properties and many user pages
 that use them..

 My first guess was: that might be because the datetime class was
 completely rewritten, and the new version doeesn't accept Russian
 format of dates. But, I've made a simple test and it seems that

 $this-m_time = strtotime(trim($value));

 converts Russian formatted date
 strtotime(13.04.2007)
 to correct value.

 There is a page, which uses Date property with such value, yet, the
 manual Special:Ask search of
 [[Äàòà:=13.04.2007]]
 where Aaoa is a Date in Russian, like:
 [[Date:=13.04.2007]]

 returns nothing. Yet, the page with such property value exists in
 the wiki..

 The property also has it's own definition page (of course), which
 states (in Russian) that it's a special one and it's type belongs
 to standard type Date - there are mouseover popup hints. I guess that
 means that property has been defined correctly?

 I guess that SMW tables aren't initialized during the XML import for some
 reason?
 Dmitriy


 -
 This SF.net email is sponsored by: Splunk Inc.
 Still grepping through log files to find problems?  Stop.
 Now Search log events and configuration files using AJAX and a browser.
 Download your FREE copy of Splunk now  http://get.splunk.com/
 ___
 Semediawiki-devel mailing list
 Semediawiki-devel@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/semediawiki-devel




-- 
Sergey Chernyshev
http://www.sergeychernyshev.com/
-
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now  http://get.splunk.com/___
Semediawiki-devel mailing list
Semediawiki-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/semediawiki-devel


Re: [SMW-devel] ask query format=template

2007-11-07 Thread Markus Krötzsch
Yes, this appears to be a bug. For a quick workaround, consider using the 
formats list, ul or ol, all of which also support the 
template-parameter for formatting (and this one certainly works with SMW1.0). 
Note that with list, you can also choose the separator between items 
(parameter sep), so as to simulate template quite well.

Markus

On Mittwoch, 7. November 2007, cnit wrote:
 Hi!
 After adding additional priviledges to database (CREATE TEMPORARILY
 TABLES and DROP), my upgrade seems to work. I wonder, whether these
 additional priviledges are mentioned in INSTALL file, because older
 SMW's were happy with just ALTER.

 But there's some disappointment, my query templates don't work
 anymore. I've used to display custom HTML layout with such query:

 div class=tbl-yarsu
 !-- {{newshead}} --
 ask sort=Date order=descending limit=20 format=template
 template=newsrow default=There is no news searchlabel=Browse all news
 ... [[Date:=*]]
 [[Category:News]]
 /ask/div

 and a such simple Template:newsrow

 div class=tr-yarsu
 div class=td-yarsu yarsu-date{{{2}}}/div
 div class=td-yarsu yarsu-article{{{1}}}/div
 div class=space-line-yarsu/div
 /div


 The query works, yet the value of {{{2}}} is omitted. it's empty,
 none.. :-(

 {{{1}}} expands just fine..

 Dmitriy


 -
 This SF.net email is sponsored by: Splunk Inc.
 Still grepping through log files to find problems?  Stop.
 Now Search log events and configuration files using AJAX and a browser.
 Download your FREE copy of Splunk now  http://get.splunk.com/
 ___
 Semediawiki-devel mailing list
 Semediawiki-devel@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/semediawiki-devel



-- 
Markus Krötzsch
Institut AIFB, Universät Karlsruhe (TH), 76128 Karlsruhe
phone +49 (0)721 608 7362fax +49 (0)721 608 5998
[EMAIL PROTECTED]www  http://korrekt.org


pgpwFqCma1Oau.pgp
Description: PGP signature
-
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now  http://get.splunk.com/___
Semediawiki-devel mailing list
Semediawiki-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/semediawiki-devel


Re: [SMW-devel] {{#ask}} (Was: [Semediawiki-user] SMW1.0 RC2 available)

2007-11-06 Thread Yaron Koren
I think that's a great format for the {{ask}} parser function - it nicely
separates data from presentation; which are somewhat mixed together in
current inline queries.

Also, this is unrelated, but I discovered yesterday that inline queries in
SMW 1.0 can handle redirected pages (pages for which a property links to a
page that redirects to them now show up in query results), which is a great
feature. Thanks!

-Yaron


On Nov 6, 2007 11:20 AM, Markus Krötzsch [EMAIL PROTECTED] wrote:

 On Dienstag, 6. November 2007, cnit wrote:
   The other issue that I'm having is {{#ask}} parser function - not
   having it stops almost all of my development. It's probably the most
   anticipated feature right now. Do you have any timeline or at least
   defined approach to it?
 
  I guess that RC thing means - The development of major features is
  temporarily frozen. Only small bugfixes are accepted. That approach
  is used to make the code more stable.

 No, not quite. Two more features are scheduled for SMW1.0 final: one (as
 you
 know) is {{#ask}}, and the other is the listing of subproperties on
 property
 pages. We know that traditionally one would do RCs together with a feature
 freeze, but in a wiki one can certainly have optional features released
 also
 if they are less well-tested.

 The reasons why we have started releasing RCs are:

 * Some people started asking us whether the project was still alive ;-)
 * The developers of the Halo extension asked for an early release, so that
 they could release some code compatible with a fixed version of SMW.
 * More testing cannot hurt.

 The RC-process does not slow down our work on the aforementioned features
 --
 it would have been slow anyway.

 
  I am myself missing parser function badly, but I guess that
  complaining too often won't speed up the development, rather bore the
  developers..

 Well, you can always add some further pressure, but our development
 activity
 still is subject to various constraints that are outside our control
 (jobs,
 lives, ...) ;-)

 But maybe, since we are over it, we can start some design discussions
 about
 {{#ask...}}. In particular, parser functions have a slightly different
 style
 of parameters than parser hooks (ask). Our current ask has three
 parts:

 (1) the query conditions,
 (2) multiple print statements,
 (3) a variable set of parameters.

 Currently (1) and (2) can be mixed, although the position of print
 statements
 relative to the query conditions has no effect. Moving to a parser
 function
 seems to be a good opportunity to revise some of this design, e.g. by
 simply
 making the print statements a separate parameter. In {{#ask..}},
 everything
 must be passed as a parameter anyway, so separating (1) and (2) is no
 complication. How should an example query look like? Her is a suggested
 example transformation:

 ask format=table limit=12
  [[Category:Person]] [[lives in::Europe]]
  [[lives in::*]]
  [[birthday::*|day of birth]]
  [[height::*m²|size]]
 /ask

  becomes

 {{#ask|
  format=table|
  limit = 12|
  ?lives in|
  ?birthday = day of birth|
  ?height#m² = size|
  [[Category:Person]] [[lives in::Europe]]
 }}

 Basic points:
 * The query is always the last parameter.
 * No | appear unless they are used as separators between parameters.
 * Printouts start with ?
 * All the known printout modifications somehow work, but in different
 syntax.
 * We implicitly block = in property names (should we care?)

 Some of this syntax is not essential, but one must be careful not to
 collide
 with MediaWiki syntax. ask would of course continue to work in any case,
 but {{#ask}} would become the suggested method in the future.

 I guess the main point of discussion would be the printout-parameters.
 Many
 variations are possible, and comments are welcome.

 
  I am investigating my own upgrade, too. My temporarily solution for
  dynanical queries will be small patch I plan to make unpublished -
  just simply %FUNCTION_NAME% inside query param will be replaced
  with result of the call to according PHP function, instead of template.
  Should be easy to implement (with some security restrictions, of course
  - though my wiki is not public).
 
  When the function will be available, I'll switch to these.

 Yes, that would be a very versatile mechanism indeed.

 Cheers,

 Markus

  Dmitriy
 
 
 
 -
  This SF.net email is sponsored by: Splunk Inc.
  Still grepping through log files to find problems?  Stop.
  Now Search log events and configuration files using AJAX and a browser.
  Download your FREE copy of Splunk now  http://get.splunk.com/
  ___
  Semediawiki-devel mailing list
  Semediawiki-devel@lists.sourceforge.net
  https://lists.sourceforge.net/lists/listinfo/semediawiki-devel



 --
 Markus Krötzsch
 Institut AIFB, Universät Karlsruhe (TH), 76128 Karlsruhe
 phone +49 (0)721 608 7362fax +49 (0)721 608 

Re: [SMW-devel] {{#ask}} (Was: [Semediawiki-user] SMW1.0 RC2 available)

2007-11-06 Thread Sergey Chernyshev
Markus, thank you for the follow-up! It's great to know that {{#ask}} is
scheduled for 1.0 release!

I'm happy to participate in architectural discussion. Here're some thoughts
on the subject:

   1. it seems to be to restricting on query language to remove pipes and
   equal signs from it - who knows, maybe you'll want to have '|' characters in
   OR-like statements or '=' in filtering statements.
   2. I'm not sure if it makes a lot of sense to change the format of
   query language from old version to new one

I can propose, if not very elegant, but a solution - make a query to be a
last parameter and let's have a name for it, e.g. 'query' - all parameters
after the one that start with ~/^query\s+=/ will get joined to it using a
pipe.

In your example:
ask format=table limit=12
 [[Category:Person]] [[lives in::Europe]]
 [[lives in::*]]
 [[birthday::*|day of birth]]
 [[height::*m²|size]]
/ask

will get converted to:
{{#ask:format=table|limit=12|query=
 [[Category:Person]] [[lives in::Europe]]
 [[lives in::*]]
 [[birthday::*|day of birth]]
 [[height::*m²|size]]
}}

Here's the pseudo-code for this:
function askParserFunc ($parser)
{
$params = func_get_args();
array_shift($params); # first one is parser - we don't need it

$query = '';
$queryfound = false;

foreach ($params as $param)
{
if (!$queryfound)
{
if (preg_match('/^query\s+=/', $param))
{
$query = preg_replace('/^query\s+=/', '', $param);

// all params after this one will get appended to $query
$queryfound = true;

continue;
}

... process all the rest of params ...
}
else
{
$query.='|'.$param;
}
}

... do actual inline query work ...
}

I didn't test the code, but I used func_get_args approach and it worked for
me.

This can be used if you keep current syntax or introduce new one.
What do you think of this approach.

Sergey


On Nov 6, 2007 11:20 AM, Markus Krötzsch [EMAIL PROTECTED] wrote:

 On Dienstag, 6. November 2007, cnit wrote:
   The other issue that I'm having is {{#ask}} parser function - not
   having it stops almost all of my development. It's probably the most
   anticipated feature right now. Do you have any timeline or at least
   defined approach to it?
 
  I guess that RC thing means - The development of major features is
  temporarily frozen. Only small bugfixes are accepted. That approach
  is used to make the code more stable.

 No, not quite. Two more features are scheduled for SMW1.0 final: one (as
 you
 know) is {{#ask}}, and the other is the listing of subproperties on
 property
 pages. We know that traditionally one would do RCs together with a feature
 freeze, but in a wiki one can certainly have optional features released
 also
 if they are less well-tested.

 The reasons why we have started releasing RCs are:

 * Some people started asking us whether the project was still alive ;-)
 * The developers of the Halo extension asked for an early release, so that
 they could release some code compatible with a fixed version of SMW.
 * More testing cannot hurt.

 The RC-process does not slow down our work on the aforementioned features
 --
 it would have been slow anyway.

 
  I am myself missing parser function badly, but I guess that
  complaining too often won't speed up the development, rather bore the
  developers..

 Well, you can always add some further pressure, but our development
 activity
 still is subject to various constraints that are outside our control
 (jobs,
 lives, ...) ;-)

 But maybe, since we are over it, we can start some design discussions
 about
 {{#ask...}}. In particular, parser functions have a slightly different
 style
 of parameters than parser hooks (ask). Our current ask has three
 parts:

 (1) the query conditions,
 (2) multiple print statements,
 (3) a variable set of parameters.

 Currently (1) and (2) can be mixed, although the position of print
 statements
 relative to the query conditions has no effect. Moving to a parser
 function
 seems to be a good opportunity to revise some of this design, e.g. by
 simply
 making the print statements a separate parameter. In {{#ask..}},
 everything
 must be passed as a parameter anyway, so separating (1) and (2) is no
 complication. How should an example query look like? Her is a suggested
 example transformation:

 ask format=table limit=12
  [[Category:Person]] [[lives in::Europe]]
  [[lives in::*]]
  [[birthday::*|day of birth]]
  [[height::*m²|size]]
 /ask

  becomes

 {{#ask|
  format=table|
  limit = 12|
  ?lives in|
  ?birthday = day of birth|
  ?height#m² = size|
  [[Category:Person]] [[lives in::Europe]]
 }}

 Basic points:
 * The query is always the last parameter.
 * No | appear unless they are used as separators between parameters.
 * Printouts start with ?
 * All the known printout modifications somehow work, but in different