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

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.

Re: [SMW-devel] Ask query in extension

2014-11-02 Thread Toni Hermoso Pulido
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/5363a0ba564c5c3708c246a4c316260d7

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 guidelin

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/5363a0

Re: [SMW-devel] Ask query in extension

2014-11-02 Thread Frank Baxmann
Hi James, you can try this, works fine in similar case for me: 1) Create the ask string in php like this: /$search = "{{#ask: }}";/ 2) Create the result string which you can manipulate later: $resultString = $parser->mStripState->unstripBoth($parser->recursiveTagParse( $/search/, $frame

Re: [SMW-devel] Ask query in extension

2014-11-01 Thread Jason Ji
If your extension includes a JavaScript component, and you need to make the ask query in the JavaScript, SMW includes the ask query as an API module (action=ask or action=askargs, depending on what format you prefer to send in the query). -- Jason Ji jason.y...@gmail.com On Sat, Nov 1, 2014 at 8:

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.

[SMW-devel] Ask query in extension

2014-11-01 Thread James Montalvo
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