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:

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

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

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,

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.

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

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-devel] Ask 1.0 released!

2013-11-17 Thread Jeroen De Dauw
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

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

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,

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

[SMW-devel] ASK Query for added Special Properties

2013-11-07 Thread sumit purohit
Hi All, I was using SMW 1.5 ( with MW 1.15.6) and added my own special property mimetype using smwInitProperties. All the pages with this property were returned when i used ask query against them {{#ask: [[mimetype::image/jpeg]] OR [[mimetype::image/bmp }} But recently i upgraded to SMW 1.8

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 --

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

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

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

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

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

2013-05-29 Thread zehetner
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

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:

[SMW-devel] Ask queries suddenly broken

2010-08-03 Thread John Arrowwood
I ran into a problem where the ask queries were returning bogus information. So I truncated the SMW_IDS table, then re-ran SMW_setup.php, followed by SMW_refreshData.php in the SemanticMediaWiki maintenance directory. To make sure everything was good, I ran the main MediaWiki runJobs.php. There

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,

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

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

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

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

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

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

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

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

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

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

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()

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

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

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

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

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

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 :)

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

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]

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

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

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

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

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

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

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

[SMW-devel] {{#ask}}

2007-11-12 Thread Sergey Chernyshev
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

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

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

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

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

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),

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

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

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

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

[SMW-devel] Ask parser function?

2007-05-14 Thread Jim Wilson
Is there an equivalent to ask but as a parser function? Akin to {{#ask}}? Thanks in advance. -- Jim R. Wilson (jimbojw) - This SF.net email is sponsored by DB2 Express Download DB2 Express C - the FREE version of DB2