Re: [SMW-devel] Initial GitHub support arrived!

2013-11-04 Thread Andru Vallance
Awesome. Thanks Jeroen. Gerrit has been a stumbling block in my contributions 
more than once. With limited time to commit, the simplicity of contributing can 
be the difference between bug fixes staying in my clone or being merged to 
assist others. Here's hoping SemanticForms makes the transition too :)

Andru
--
Android is increasing in popularity, but the open development platform that
developers love is also attractive to malware creators. Download this white
paper to learn more about secure code signing practices that can help keep
Android apps secure.
http://pubads.g.doubleclick.net/gampad/clk?id=65839951iu=/4140/ostg.clktrk
___
Semediawiki-devel mailing list
Semediawiki-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/semediawiki-devel


Re: [SMW-devel] [SIO] Querying internal object properties

2013-04-22 Thread Andru Vallance

Hello Marcelo,
If I understand your requirement correctly, you can use a single query 
and use the template result format to pass the result to a template 
which sets the values of the new subobject. See the docs on the 
Template result format here: 
http://semantic-mediawiki.org/wiki/Help:Template_format


Yours
Andru






On 2013-04-20 19:05:30 +, Marcelo Chiaradía said:


Hi everyone,

I have saved an internal object which has several properties:

{{#set_internal:isInternalObjectOf
|property1=value1
|property2=value2
|name=object_name
}}

I have a situation where eventually I need to define a new internal 
object using the properties of the object saved before as values.


The way I found to do this is through semantic queries:

{{#set_internal:isInternalObjectOf
|property1={{#ask: [[-property1::[[name::object_name]] ]]}}
|property2={{#ask: [[-property2::[[name::object_name]] ]]}}
}}

The sintax may be not quite correct, just to show the idea.

The problem with this approach is that for every property, I have to 
make a new query. Is there some way to do this with only one query?


Thanks in advance.

Marcelo.
--
Precog is a next-generation analytics platform capable of advanced
analytics on semi-structured data. The platform includes APIs for building
apps and a phenomenal toolset for data science. Developers can use
our toolset for easy data analysis  visualization. Get a free account!
http://www2.precog.com/precogplatform/slashdotnewsletter
___
Semediawiki-devel mailing list
Semediawiki-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/semediawiki-devel
--
Precog is a next-generation analytics platform capable of advanced
analytics on semi-structured data. The platform includes APIs for building
apps and a phenomenal toolset for data science. Developers can use
our toolset for easy data analysis  visualization. Get a free account!
http://www2.precog.com/precogplatform/slashdotnewsletter___
Semediawiki-devel mailing list
Semediawiki-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/semediawiki-devel


[SMW-devel] Property:Modification date updated on cache changes?

2013-01-01 Thread Andru Vallance
Is it expected behavior that the special Modification date property be updated 
when MediaWiki template caches are refreshed? This is the behavior I appear to 
be experiencing. The following text from the manual page isn't entirely clear, 
and I'd assumed that the property would hold the date of the last recorded edit.

If someone can confirm that the current behavior is as intended (that is, that 
the Modification date reflects the last programmatic modification, not the date 
of the last edit in the edit history), I'd like to update the following 
documentation page for clarity:

http://semantic-mediawiki.org/wiki/Help:Special_property_Modification_date 
 The Modification date property is a special property in Semantic MediaWiki 
 with a built-in meaning: it has a fixed value that corresponds to the date of 
 the last modification of each page


Andru--
Master SQL Server Development, Administration, T-SQL, SSAS, SSIS, SSRS
and more. Get SQL Server skills now (including 2012) with LearnDevNow -
200+ hours of step-by-step video tutorials by Microsoft MVPs and experts.
SALE $99.99 this month only - learn more at:
http://p.sf.net/sfu/learnmore_122512___
Semediawiki-devel mailing list
Semediawiki-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/semediawiki-devel


[SMW-devel] Change for Multiple Instance Templates customisation

2012-12-21 Thread Andru Vallance
I've never used gerrit for the review system before, so I just stumbled 
clumsily through the process to submit a change. I think it all went as 
planned, but who knows - let me know if I screwed something up :)

This change extracts the main Multiple Instance Template logic from 
SF_FormPrinter.php into SF_MultipleTemplate.php and adds some hooks for 
overriding the html used. This makes the rendering of Multiple Templates in 
forms more transparent and possible to override without hacking the core. If 
this is accepted I'll continue using this foundation to add the table style 
display as a built-in options, as I discussed with Jeroen some weeks ago.

https://gerrit.wikimedia.org/r/#/c/39761/

Andru--
LogMeIn Rescue: Anywhere, Anytime Remote support for IT. Free Trial
Remotely access PCs and mobile devices and provide instant support
Improve your efficiency, and focus on delivering more value-add services
Discover what IT Professionals Know. Rescue delivers
http://p.sf.net/sfu/logmein_12329d2d___
Semediawiki-devel mailing list
Semediawiki-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/semediawiki-devel


Re: [SMW-devel] Dynamic filtered output

2012-10-30 Thread Andru Vallance
Hi Stephan,
I understand your preference for the speed of client-side filtering. Sadly 
that's only the case for very small data-sets. Practical Plants has over 7,000 
results to filter, so clientside filtering would require an unacceptably large 
query upfront.

I'm not at all surprised the attention the filtered format is getting, it's 
hugely useful functionality. I'll gladly give you some time to consolidate. For 
the time being I'll continue to develop my filter functionality as a separate 
extension (named Semantic Discovery), and I hope we can find a way to bring 
them together in the future. 

Yours
Andru




El 15/10/2012, a las 13:40, Stephan Gambke escribió:

 Hi,
 
 On 15 October 2012 12:10, Jeroen De Dauw jeroended...@gmail.com wrote:
 Would there be any demand for this?
 
 Yes, having dynamic filtering and continuation for result formats is pretty
 high on the wish list for result formats in general. Which is why people are
 so excited about the filtered format. I however have two concerns about this
 format:
 
 * It seems to need specific code for each result format it supports, which
 leads to less versatility and a lot more maintenance effort then some
 generic system
 * It loads all data and then does filter operations on it, which does not
 work for big datasets and for others is not always desired
 
 When I started working on this I consciously decided to do the
 filtering on the client side to reduce round trips. My reasoning was
 that you could achieve server side filtering by using the RunQuery
 special page from Semantic Formats. But I agree that in a lot of cases
 doing the round trip would be preferrable to client side filtering and
 I have some ideas on how this could be done. This might also solve the
 first problem and leverage existing formats. For simple filters it
 should be as easy as sending the query amended by the filter condition
 to the server and displaying the result. For something like e.g. the
 distance filter it might be less easy.
 
 Andrew, I very much like your stuff. I am excited (and a bit
 overwhelmed) at the attention this format gets. Right now it is still
 very much a construction area and will see a lot of changes before it
 becomes reasonably stable. There are still a lot of mechanisms in how
 stuff is handled that I want to improve. Normally I would be very
 happy to ask you to provide a patch. In this case however, to prevent
 us from having to somehow manually merge large amounts of code I would
 ask you to give me some more time to consolidate the format.
 
 Cheers,
 Stephan


--
Everyone hates slow websites. So do we.
Make your web apps faster with AppDynamics
Download AppDynamics Lite for free today:
http://p.sf.net/sfu/appdyn_sfd2d_oct
___
Semediawiki-devel mailing list
Semediawiki-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/semediawiki-devel


Re: [SMW-devel] Dynamic filtered output

2012-10-30 Thread Andru Vallance
Hi Yury,
1) You can specify a default query to run when it first loads. For practical 
plants it queries all pages with [[Show on main page search::Yes]], so we can 
define a few key plants to show upfront
2) I don't understand this question! Could you clarify?

Thanks for the kind words about the skin. It's a very complex custom skin which 
has a dependency on a companion extension, and also a number of custom 
extensions. I don't currently have any plans to release the skin itsself, but 
I'm working on releasing some of the custom extensions (I'll shortly release 
the filtered search as an extension named Semantic Discovery). So far I've made 
the following available:

Bootstrap - https://github.com/andru/mediawiki-bootstrap
This integrates Twitter Bootstrap into MediaWiki in a way compatible with the 
ResourceLoader, giving a base to build custom themes.

MoveToSkin - https://github.com/andru/mediawiki-movetoskin
This enables a {{#movetoskin}} function which moves content from the wikitext 
to predefined areas in the skin. For example, this allows me to move the TOC 
from within the content to a sidebar without relying on Javascript after the 
DOM has loaded. 

WikiSEO - https://github.com/andru/wiki-seo
A simple extension which enables a {{#seo}} function to change the page title, 
meta description, and meta keywords.


Yours
Andru


El 15/10/2012, a las 13:48, Yury Katkov escribió:

 Hi Andru! 
 
 It looks terrific and we really need similar AJAX-feature for fitered format.
 1)  Do I understand correctly that by default (with no filters turned on) you 
 show some amount of results (say 20 results)? 
 2) a question to developers: how fast are the count queries? Maybe it's good 
 to use them when the user
 And your skin is also lovely, if you have any plans to release it as open 
 source, I'll gladly help with that. 
 
 -
 Yury Katkov, WIkiVote
 
 
 
 
 On Mon, Oct 15, 2012 at 12:48 PM, Andru Vallance an...@tinymighty.com wrote:
 For the wiki I develop, I was interested in using the filtered output format, 
 but needed the results to be loaded dynamically when filters were changed, as 
 I have 7000+ results to filter.
 
 I began making changes to this effect, but under time pressure and with no 
 documentation on the filtered output plugin, I realised it would be quicker 
 to roll my own plugin which interfaces with the SMW API to create dynamic 
 filters.
 
 My plugin operates quite differently, functioning as a parser function which 
 takes a JSON object of settings to initiate rather than operating as an 
 output format for an ask query, however if there is demand I could try and 
 merge the dynamic functionality into the filtered output.
 
 You can see my plugin in action here: http://practicalplants.org/wiki/Search
 
 Would there be any demand for this? Or is it distinct enough in operation 
 that it would be preferred that I polish up my own plugin and release it as a 
 separate entity? If the former, is there any documentation on the operation 
 of output formats to assist me in integration?
 
 Ta
 Andru Vallance
 --
 Don't let slow site performance ruin your business. Deploy New Relic APM
 Deploy New Relic app performance management and know exactly
 what is happening inside your Ruby, Python, PHP, Java, and .NET app
 Try New Relic at no cost today and get our sweet Data Nerd shirt too!
 http://p.sf.net/sfu/newrelic-dev2dev
 ___
 Semediawiki-devel mailing list
 Semediawiki-devel@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/semediawiki-devel
 

--
Everyone hates slow websites. So do we.
Make your web apps faster with AppDynamics
Download AppDynamics Lite for free today:
http://p.sf.net/sfu/appdyn_sfd2d_oct___
Semediawiki-devel mailing list
Semediawiki-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/semediawiki-devel


[SMW-devel] [Semantic Forms] Modifications to multiple template instances

2012-10-30 Thread Andru Vallance
I inadvertently sent this from the wrong email account earlier, and it seems to have vanished into a black hole. I'm resending again, from the correct email account. My apologies if the other turns up as a duplicate.Hello,For my work on Practical Plants (http://practicalplants.org/wiki), I needed to be able to control the HTML which was output by multiple template instances. Currently the HTML is hardcoded within the SF parser and there are no hooks available to modify it's output. While my need may be a fringe case, I think hardcoded HTML with no way to override it encourages hacking the core files: A Very Bad Thing. I'd like to submit my changes for inclusion into SF core, so I'm looking for feedback on the changes I'm proposing. I've attached a patch for SF_FormPrinter.php and SemanticForms.php and a new class file SF_MultipleTemplate.php, at the end of this email.I've made the following SF hooks available to modify the HTML output of a multiple template instance. In order to make these hooks flexible, I wanted to be able to supply an object instance which contained information about the Multiple Template Instance being parsed. To do this, I extracted most of the logic for outputting multiple template instances into a new class SFMultipleTemplate which is responsible for defining the default HTML (which is currently hardcoded in SFFormPrinter), and forrunning the following hooks, which it passes the default html by reference to allow for modification, and the SFMultipleTemplateinstance which is calling the hook, to give access to data about the Multiple Template Instance in question.Here are the hooks I've created, based on the default HTML currently used.sfMultipleInstanceTemplateBeforeHTML(String $html, SFMultipleTemplate $template)Allows the customisation of the HTML which is output before the list of template instances.sfMultipleInstanceTemplateAfterHTML(String $html,SFMultipleTemplate$template)Allows the customisation of the HTML which is output after the list of template instances.sfMultipleInstanceTemplateHTML(String $html, String $content,SFMultipleTemplate$template)Allows the customisation of the html which wraps a multiple template instance item.sfMultipleInstanceTemplateAdderHTML(String $html, String $content,SFMultipleTemplate$template)Same as above, except this sets the hidden multiple template instance item which is cloned by the frontend _javascript_ when the add button is clicked.sfMultipleInstanceTemplateInnerHTML(String $html, String $section,SFMultipleTemplate$template)Allows the customisation of the html of the multiple template instance item. The html returned by this must contain the close and reorder icons. Passing some isolated default html for those icons, or providing get methods in SFMultipleTemplatemight be a good idea.Practical Plants Use CaseI use these hooks to render multiple template instance items as rows of a table for my references. You can see it in action here:http://practicalplants.org/w/index.php?title=Malus_domesticaaction="">This is implemented with the following hook handlers in my skin's related extension. Note that by extracting the Multiple Template Instance functionality into an object, I am able to check the template name to customise output on a per-instance basis.	function sfMultipleInstanceTemplateBeforeHTML($html, $template){		if($template-template_name === 'Reference'){			$html = '			div class="multipleTemplateWrapper"			table class="table"			theadth class="ref-type"Type/thth class="ref-id"Identifier/thth class="ref-author"Author/thth class="ref-title"Title/thth class="ref-source"Source/thth class="ref-url"URL/ISBN/thth class="ref-date"Date/thth class="ref-buttons"/th			/thead			tbody class="multipleTemplateList"';		}		return true;	}	function sfMultipleInstanceTemplateAfterHTML($html, $template){		if($template-template_name === 'Reference'){			$html = '/tbody/table';			$html .= $template-addButtonHTML();			$html .= '/div';		}		return true;	}	function sfMultipleInstanceTemplateHTML($html, $content, $template){		if($template-template_name === 'Reference'){			$html = 'tr class="multipleTemplateInstance multipleTemplate"'.$content.'/tr';		}		return true;	}	function sfMultipleInstanceTemplateAdderHTML($html, $content, $template){		if($template-template_name === 'Reference'){			$html = 'tr class="multipleTemplateStarter" style="display:none"'.$content.'/tr';		}		return true;	}	function sfMultipleInstanceTemplateInnerHTML($html, $section, $template){		global $sfgScriptPath;		if($template-template_name === 'Reference'){ //we have to str_replace some faux td elements since mediawiki doesn't allow td elements in wikitext without an enclosing table element		$html =  str_replace('-!/td!-','/td',str_replace('-!td!-', 'td', $section)).'td'. 'span class="removeButton"a class="btn btn-link remover"i class="icon-remove"/i/a/span'. 'span class="instanceRearranger"img src="" class="rearrangerImage"/span'. '/td';		}		return 

Re: [SMW-devel] [Semantic Forms] Modifications to multiple template instances

2012-10-30 Thread Andru Vallance
Hi Yaron,
The code to enable the table display on PracticalPlants resides in a separate 
skin-companion extension, but I'd be glad to extend the functionality to offer 
a table view baked into the core.

How do you envision table headers being defined? Something like

{{{for template|Reference|multiple|display=table|table 
headers=One;Two;Three;Four;Five;etc}}}

Andru


El 30/10/2012, a las 17:15, Yaron Koren escribió:

 Hi Andru,
 
 One has to register to see the form link you included, but I'm glad I did, 
 because that form looks great! Turning a multiple-instance template form 
 section into a spreadsheet-like interface is a fairly obvious enhancement 
 that I, and other people, have wanted for a long time. So however we can get 
 this functionality into SF, I think it would be great.
 
 I guess there are two issues: how to make SF's display of multiple-instance 
 templates extensible so that it can allow further customizations like yours, 
 and how to specifically add this kind of spreadsheet/table display. (You 
 could argue that there's a third issue, of how to make all of SF's HTML 
 display more extensible.)
 
 For the 2nd issue, I could imagine that there could be a new parameter, like 
 display=, so that one could call something like the following:
 
 {{{for template|Reference|multiple|display=table}}} (or spreadsheet)
 
 I only skimmed through your code, but I assume the code you added to enable 
 this specific display is outside of the SF code, and possibly hardcoded for 
 your specific data structure? If so, what do you think about the idea of 
 adding this kind of thing directly into Semantic Forms, in addition to the 
 new hooks?
 
 -Yaron
 
 On Tue, Oct 30, 2012 at 9:29 AM, Andru Vallance an...@tinymighty.com wrote:
 I inadvertently sent this from the wrong email account earlier, and it seems 
 to have vanished into a black hole. I'm resending again, from the correct 
 email account. My apologies if the other turns up as a duplicate.
 
 Hello,
 For my work on Practical Plants (http://practicalplants.org/wiki), I needed 
 to be able to control the HTML which was output by multiple template 
 instances. Currently the HTML is hardcoded within the SF parser and there are 
 no hooks available to modify it's output. While my need may be a fringe case, 
 I think hardcoded HTML with no way to override it encourages hacking the core 
 files: A Very Bad Thing. I'd like to submit my changes for inclusion into SF 
 core, so I'm looking for feedback on the changes I'm proposing. I've attached 
 a patch for SF_FormPrinter.php and SemanticForms.php and a new class file 
 SF_MultipleTemplate.php, at the end of this email. 
 
 I've made the following SF hooks available to modify the HTML output of a 
 multiple template instance. In order to make these hooks flexible, I wanted 
 to be able to supply an object instance which contained information about the 
 Multiple Template Instance being parsed. To do this, I extracted most of the 
 logic for outputting multiple template instances into a new class 
 SFMultipleTemplate which is responsible for defining the default HTML (which 
 is currently hardcoded in SFFormPrinter),  and for running the following 
 hooks, which it passes the default html by reference to allow for 
 modification, and the SFMultipleTemplate instance which is calling the hook, 
 to give access to data about the Multiple Template Instance in question.
 
 Here are the hooks I've created, based on the default HTML currently used.
 
 sfMultipleInstanceTemplateBeforeHTML (String $html, SFMultipleTemplate 
 $template)
 Allows the customisation of the HTML which is output before the list of 
 template instances. 
 
 sfMultipleInstanceTemplateAfterHTML (String $html, SFMultipleTemplate 
 $template)
 Allows the customisation of the HTML which is output after the list of 
 template instances.
 
 sfMultipleInstanceTemplateHTML (String $html, String $content, 
 SFMultipleTemplate $template)
 Allows the customisation of the html which wraps a multiple template instance 
 item.
 
 sfMultipleInstanceTemplateAdderHTML (String $html, String $content, 
 SFMultipleTemplate $template)
 Same as above, except this sets the hidden multiple template instance item 
 which is cloned by the frontend javascript when the add button is clicked.
 
 sfMultipleInstanceTemplateInnerHTML (String $html, String $section, 
 SFMultipleTemplate $template)
 Allows the customisation of the html of the multiple template instance item. 
 The html returned by this must contain the close and reorder icons. Passing 
 some isolated default html for those icons, or providing get methods in 
 SFMultipleTemplate might be a good idea.
 
 
 
 Practical Plants Use Case
 I use these hooks to render multiple template instance items as rows of a 
 table for my references. You can see it in action here:
 
 http://practicalplants.org/w/index.php?title=Malus_domesticaaction=formedit#References
 
 This is implemented with the following hook