Quantcast

New query syntax for Record types

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

New query syntax for Record types

A Nicolas
Hi,

I have seen a few post around lately about the impact in the changes in SMW 1.6.x on impacting the Record types (i.e. not being positional anymore). However I haven't found yet any doc or comment about what's the new syntax for accessing Records elements, i.e. in a #show sentence, in case there's any.

Any help will be welcome as this has broken several templates in our Wiki and I would prefer to not have to switch to SIO and then back to native subobjects when they are ready for prime time.

Thanks!

Alejandro
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: New query syntax for Record types

badon
If you could give some examples of where things are broken, maybe myself or someone else can have a look at it and suggest ideas for fixing it.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: New query syntax for Record types

Victor Sergienko
In reply to this post by A Nicolas
Hi,

Not sure if it's a new query syntax or what, but I can't get a Record
field in a query output.

I have a HistoricPopulation Record type:
Has fields::Historicdate, Population
Has type::Record
(I see these in property page factbox).

where Population has type::Number.

I have a page "Ukraine" with a text:
[[historicPopulation::2005; 48000000]]

whose factbox shows:
historicPopulation  2005 (48,000,000)
(btw - why is the second attribute parenthesized?)

Now I try to issue a query:

{{#ask: [[historicPopulation:: 2005; ?]]
  | ?historicPopulation#Population  |+index=1
}}

I believe I should be getting an only result column with Population
field, correct?
I do get 2 column results - a reference to "Ukraine" page in 1st
column and nothing in the 2nd.

What's wrong?

Thank you.

------------------------------------------------------------------------------
Write once. Port to many.
Get the SDK and tools to simplify cross-platform app development. Create
new or port existing apps to sell to consumers worldwide. Explore the
Intel AppUpSM program developer opportunity. appdeveloper.intel.com/join
http://p.sf.net/sfu/intel-appdev
_______________________________________________
Semediawiki-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/semediawiki-user
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: New query syntax for Record types

badon
The parentheses are unnecessary, I agree. I made a bug report about them in another case, and if you agree they should be removed in your case too (in the factbox), please add your comments about it to this bug report:

https://bugzilla.wikimedia.org/show_bug.cgi?id=32863

About getting your query to work, I have not tried this type of property and query yet. But, I think maybe the upcoming SMW 1.7 might address this issue with its native built in support for semantic internal objects:

http://wikimedia.7.n6.nabble.com/Semantic-MediaWiki-1-7-release-candidate-1-td1943169.html

Here's the extension that SMW 1.7 will be replacing with its native #setobject:

http://www.mediawiki.org/wiki/Extension:Semantic_Internal_Objects

And here's some info about whether to use a record or an internal object:

http://semantic-mediawiki.org/wiki/Help:Type_Record#Alternatives

Sorry I wasn't able to tell you more, but I hope this info helps you discover a solution to your issue.
Loading...