Quantcast

Querying for the values of an array, using a template.

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

Querying for the values of an array, using a template.

Pike Robert D
Classification: Unclassified
Subsequent to a previous question about querying for pages that match any one value of a semantic property and some helpful ideas from Hans Oleander.

I have a semantic property Subjects_are which may have multiple values.
I want to query for any page that has a value in Subjects_are that matches the value of Subjects_are in my basic template.
I have defined an array Relevant_Subjects using a semantic query.
I have created a template that takes values from Relevant_Subjects and returns them in a format suitable for a query.

The template looks like this:

<includeonly>
[[{{{Namespace}}}:+]] [[Subjects_are::{{{Subject}}}]] OR&#32;
</includeonly>

However, the [[{{{Namespace}}}:+]] argument is returned from the template as a page link, which breaks my query. How can I restrict the query to a particular namespace, given that each OR for the query has to include the namespace parameter?

Thanks,

Rob Pike MBPsS
Senior Knowledge & Information Agent
[dstl] Defence Science and Technology Laboratory
' Tel: +44 (0) 2392 537110
' Military: 6803 7110


"This e-mail and any attachment(s) is intended for the recipient only.   Its unauthorised use,
disclosure, storage or copying is not permitted.  Communications with Dstl are monitored and/or
recorded for system efficiency and other lawful purposes, including business intelligence, business
metrics and training.  Any views or opinions expressed in this e-mail do not necessarily reflect Dstl policy."

"If you are not the intended recipient, please remove it from your system and notify the author of
the email and [hidden email]"
------------------------------------------------------------------------------
Flow-based real-time traffic analytics software. Cisco certified tool.
Monitor traffic, SLAs, QoS, Medianet, WAAS etc. with NetFlow Analyzer
Customize your own dashboards, set traffic alerts and generate reports.
Network behavioral analysis & security monitoring. All-in-one tool.
http://pubads.g.doubleclick.net/gampad/clk?id=126839071&iu=/4140/ostg.clktrk
_______________________________________________
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: Querying for the values of an array, using a template.

andys
Hi Robert

"However, the [[{{{Namespace}}}:+]] argument is returned from the template as a page link, which breaks my query. How can I restrict the query to a particular namespace, given that each OR for the query has to include the namespace parameter? "


It may not be best practice and someone else may have a better answer but in this case I would set up a mirror property that has type::Text.

So, if you had :

[[Namespace::Red]] defined in the page currently where "Red" is currently a page, I would set up :

[[QNamespace::Red]] as a property where property QNamespace is defined as type text. I would then query on QNamespace, rather than Namespace.


Andy

andy@childrenarewelcome.co.uk
Loading...