Hi
Today I fixed a problem I had since a long time with SMW.
I never found a way to Query Properties from Page A and assign the same
property values to one of Page B's Property.
Now I installed the Semantic Forms extension to use the #arraymap parser
function to allow the user in over a template to assign more than one
property to a attribute in one step.
After that I wrote a template with which it's possible to convert a Query
output (format=list and links=none) into another string which is compatible
with the #arraymap parser function to assign it to a property of another
page.
The template code for my template "Query-Output assign property format" is:
<includeonly>{{#replace:{{#replace: {{#regex: {{{1|}}}|/,(?=[^()]*\))/|;}}
|(|;}} |)|}}</includeonly> (You need the extensions "RegexParserFunctions"
and "StringFunctions" for that)
What does it?
For example you use it as:
"{{Querry-Output assign property format | Daniel (2, 3, 4), Alex (4,
nothing, something), Harry (29, what?, 2200) }}"
You will get the result:
"Daniel ;2; 3; 4, Alex ;4; nothing; something, Harry ;29; what?; 2200"
As you see, this is a string which you can assign with help of #arraymap
function or another template to every property and page you want to.
For sure it's also possible to use the template with a query like:
{{ Query-Output assign property format | {{#show: Pagename |?Property name
|link=none |format=list}} }}
So, it's very helpful if you want to use the same values for a property on
one page than on a target page. And that's all the time, also when the
properties on the target page changed!!
My offer is, to include something like that directly into
Semantic-MediaWiki. For example as a new query format which will create an
output like mine or directly something like [[property::value1;1;2;3]],
[[property::value2;1;2;3]], [[property::value3;1;2;3]] and so on...
That would be much more comfortable because it's not dependent on how the
list format will print out its results. The name of the new Query format
could be "property-assign" or simply "assign" for example. I really would
appreciate that :-)
Thanks for reading this!
Daniel Werner
__________ Information from ESET Smart Security, version of virus signature
database 2740 (20071221) __________
The message was checked by ESET Smart Security.
http://www.eset.com
-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Semediawiki-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/semediawiki-devel