Jump to content

Extension talk:Semantic Compound Queries

Add topic
From mediawiki.org
Latest comment: 1 year ago by Fmilk in topic Cell color doesn't work

Compound Queries in Loop

[edit]

Been banging my head today trying to get these two extensions to play nice, essentially:

{{#compound_query: {{#forargs: | key | value | [[Category:Genre]] [[{{#var: value}}]];?has_introduction| }} format=table }}

In short, I just want to loop over the query setup and populate it with items from arguments in a template. I'm pretty sure it's a formatting issue that's tripping it up. If I strip everything back to without the loop:

{{#compound_query: [[Category:Genre]] [[Trap]];?has_introduction| [[Category:Genre]] [[Dubstep]];?has_introduction| format=table }}

Then it all works perfectly fine.

I doubt that's possible... you might have better luck using Scribunto for something like that. Yaron Koren (talk) 15:19, 18 April 2013 (UTC)Reply
Ah, thanks for the tip! Rodeoclash (talk) 21:34, 18 April 2013 (UTC)Reply

Export to CSV

[edit]

Hello, does Compound Query have ability to export to CSV? I tried "format=csv", but it does not work, while it works for regular queries. Version 0.3.2. Patelmm79 (talk) 20:26, 5 November 2012 (UTC)Reply

What version of Semantic MediaWiki are you using? Yaron Koren (talk) 04:00, 6 November 2012 (UTC)Reply

SMW 1.5.1.1 breaks SCQ in MW 1.13.4

[edit]

SMW 1.5.1.1 does not fully opperate correctly with MW 1.13.4. The only thing that I have found breaks is Semantic Compound Queries. It works great with MW 1.14

--Dgennaro

Hi - what's the error message you get? Yaron Koren 18:20, 29 June 2010 (UTC)Reply
It will not show the results of any part of the query except for the final query. Hard to explain. Simple example below.
{{#compound_query: [[Category:Music Events]][[Has Date::{{#calendarstartdate:}}]][[Has Date::{{#calendarenddate:}}]]
;?Has Date;color=red;limit=500
|[[Category:Corporate Meetings]][[Has Date::{{#calendarstartdate:}}]][[Has Date::{{#calendarenddate:}}]]
;?Has Date;color=blue;limit=500
|[[Category:Marketing Events]][[Has Date::{{#calendarstartdate:}}]][[Has Date::{{#calendarenddate:}}]]
;?Has Date;color=green;limit=500
|format=calendar
}}
In this example the output would only show the Marketing Events. Also, "color" do not work, but I have been using a template to get around that.

--Dgennaro

Oh. Well, I'm guessing that this will be hard to debug - I should probably just change the SCQ documentation to say that it requires version 1.14 or later of MW. Yaron Koren 22:02, 29 June 2010 (UTC)Reply
It is not the relationship between MW 1.13.4 and SCQ...it is between MW 1.13.4 and SMW 1.5.1.1. SCQ is the only thing that I have found that breaks. When I rolled back to SMW 1.4.3 it worked fine again. So, the SMW page needs to be changed to be compatible with MW 1.14.x and newer. --Dgennaro 13:37, 30 June 2010 (UTC)Reply
But the latest SMW, by itself, works correctly with MW 1.13, no? Yaron Koren 15:50, 30 June 2010 (UTC)Reply
Yes, SCQ is the only thing that I have found so far that fails. --Dgennaro 15:51, 30 June 2010 (UTC)Reply

Similar Problem to above, only final query showing

[edit]

I have found a similar problem within my wiki I have the following code:

{{#compound_query:[[Category:Band]] [[Postcode::{{PAGENAME}}]]; ?Bandroom Location; icon=Tuba Small.png;
|[[Category:Venue]] [[Venue Postcode::{{PAGENAME}}]]; ?Venue Location; icon=Venue.png;
|height=600
|format=googlemaps
|types=normal,satellite,hybrid}}

All it is displaying is the final query.

I have the following setup

  • MediaWiki 1.16.0
  • PHP 5.2.13 (cgi)
  • MySQL 4.1.22-standard-log
  • Semantic Compound Queries (Version 0.2.6)
  • Semantic Forms (Version 2.0.1)
  • Semantic Maps (Version 0.6.6)
  • Semantic MediaWiki (Version 1.5.2)
  • Admin Links (Version 0.1.3)
  • Header Tabs (Version 0.7)
  • Hide Empty Sections (Version 1.0)
  • Maps (Version 0.6.6)
  • ParserFunctions (Version 1.3.0)
  • FCKeditor (Version fckeditor/mw-extension $Rev$ 2008)
  • Semantic Forms Input Types (Version 0.2)
  • Semantic Result Formats (Version 1.5.0)
  • Validator (Version 0.3.6 rc1)
Well, you only have two queries - are you sure that the first one works, by itself? And what happens if you change to a simpler format, like "table"? Yaron Koren 15:15, 30 September 2010 (UTC)Reply
Many thanks. They both worked by themselves. But changing it to table shown me that the co-ordinates weren't showing up for one of them and it pushed me in the right direction. Thanks again Yaron !!

Undefined Property

[edit]

Notice: Undefined property: SMWQueryResult::$display_options in /var/www/pcwiki/extensions/SemanticCompoundQueries/SCQ_QueryResult.php on line 27 any clue why this would be outputting like this? --Willjermuk 20:12, 10 September 2010 (UTC)Reply

Cannot count pages with specific values

[edit]

Hi, I want to count the associated pages where a specific value is set and show them in a piechart. In detail:

{{#vardefine:gruen| [[aktueller Status::Grün]] [[-Hat Teil::{{SUBJECTPAGENAME}}]] 
; mainlabel=Teile
; ?Aktueller Status
; format=count
;}} 

{{#vardefine:gelb| [[aktueller Status::Gelb]] [[-Hat Teil::{{SUBJECTPAGENAME}}]] 
; mainlabel=Teile
; ?Aktueller Status
; format=count
;}} 

{{#vardefine:rot| [[aktueller Status::Rot]] [[-Hat Teil::{{SUBJECTPAGENAME}}]] 
; mainlabel=Teile
; ?Aktueller Status
; format=count
;}} 

{{#compound_query:{{#var:rot}} | {{#var:gelb}} | {{#var:gruen}} | format=table}}


And the following error occurs:

Warning: Attempt to assign property of non-object in C:\<wikipath>\mediawiki\extensions\SemanticCompoundQueries\SCQ_QueryProcessor.php on line 131

Warning: Attempt to assign property of non-object in C:\<wikipath>\mediawiki\extensions\SemanticCompoundQueries\SCQ_QueryProcessor.php on line 131

Fatal error: Call to a member function getPrintRequests() on a non-object in C:\<wikipath>\mediawiki\extensions\SemanticCompoundQueries\SCQ_QueryProcessor.php on line 62

BTW: without the parser-functions #var and #vardefine in an all-in-one-query it doesn't work, too. Each single one of the 3 queries work fine! But I want the result in only one table or pie-chart... Hmm, or is there any other possibility to run such a query?!

Semantic Compound Queries with timeline

[edit]

Hi, (first of all, sorry for my english) Can I use a a timeline as format of a query?

I can make an #ask query only for a category, but I like to print in a single timeline all the events which are related to different categories.

Something like this:

{{#compound_query: [[RiguardaProgettoCantiere::{{PAGENAME}}]] ; ?HaDataInizioCantiere ; ?HaFineCantiere   
|  [[HaOggettorifFonte::{{PAGENAME}}]]; ?HaDataFonte
| format=timeline}}

--Feedmyego 18:42, 18 November 2010 (UTC)Reply

Hi - I think that should work, but I've never tried it with timeline, so I don't know for sure. Feel free to try it out. Yaron Koren 21:34, 18 November 2010 (UTC)Reply
It doesn't work, but i'm not a master in mediawiki coding, so I don't know if it's a SRF problem, or an error in my query. If anyone succeeds, let me know :) --Feedmyego 16:48, 21 November 2010 (UTC)Reply


I'm sure the code is very different for both Compound Queries and SRF/Timeline since this discussion topic was raised, but for what it's worth the following does work on my load (MW 1.20.4, SMW 1.8.0.4, SF 2.5.2, PHP 5.4.7):
{{#compound_query: 
  [[Category:Mission]] [[Mission type::ISS Increment]] [[Start date::+]];
    ?Start date;
    ?End date;
| [[Category:Mission]] [[Vehicle::Soyuz]] [[Start date::+]];
    ?Start date;
    ?End date;
| sort=Start date
| order=descending
| format=timeline
| timelinebands=MONTH,YEAR
| timelineposition=today
| timelinesize=360px
| limit=150
}}
Also, I'm currently tweaking SRF/Timeline to allow you to choose the color of event bands on the timeline. I have it working without compound queries. So this works:
{{#ask: [[Category:Mission]] [[Start date::+]]
| ?Start date = start
| ?End date = end
| sort=Start date
| order=descending
| format=timeline
| timelinebands=MONTH,YEAR
| timelineposition=today
| timelinesize=360px
| durationcolor=green
| limit=150
}}
But with Compound Queries it does not work (see next code block). Note the inclusion of "durationcolor" parameter, which is not available in the current version of Timeline. This will color all the bands green in the above query.
{{#compound_query: 
  [[Category:Mission]] [[Mission type::ISS Increment]] [[Start date::+]];
    ?Start date;
    ?End date;
    durationcolor=green;
| [[Category:Mission]] [[Vehicle::Soyuz]] [[Start date::+]];
    ?Start date;
    ?End date;
    durationcolor=orange;
| sort=Start date
| order=descending
| format=timeline
| timelinebands=MONTH,YEAR
| timelineposition=today
| timelinesize=360px
| limit=150
}}
Doing the compound query above does not give me green or orange bands. It gives the default red. Is there something special that has to be done within an extension attempting to use Compound Queries to make the extension able to pass different parameters for each sub-query? Do I have to make that "durationcolor" parameter special in some way for it to be recognized? Thanks! FYI, I will be posting a similar question on the Timeline Format talk page eventually, which will include the changes I made to be able to change event band color.
--Jamesmontalvo3 (talk) 22:04, 8 May 2013 (UTC)Reply

Problem with more than one compound query

[edit]

When I create more than one compound query on a page, the maps stops working

http://www.wikirio.com.br/Sandbox:Ipanema

Right now there's only one, to show that works ok. But stops if you duplicate:

{{#compound_query: Categoria:Restaurantes Bairro::Ipanema; ?LatLong;

   | format=googlemaps
   | height=250
   | width=100%
   | autozoom=off

}}

Hi, I don't understand - where's an example of a compound query that's not working? Yaron Koren 15:40, 2 March 2011 (UTC)Reply
Hi Yaron, http://www.wikirio.com.br/Sandbox:Ipanema
It works fine if I use compound_query only once on the artile.
Okay, I see the problem - I'm guessing that this is an issue with Semantic Maps. Yaron Koren 18:50, 2 March 2011 (UTC)Reply

incomplet result w/ [SCQ] in comparison to regular #ask ?

[edit]

hi i have this query compared to each other with two different result. the compound query has less result compared to the the regular ask syntax query. Even after a property updates the result still unchanged

{{#compound_query:[[Category:WO]][[WO status::closed]];?WO due date
|format=table
|limit=1000
}}

VS

{{#ask:[[Category:WO]][[WO status::closed]]|?WO due date
|format=table
|limit=1000
}}

any thoughts?

--Msevero 09:04, 31 March 2011 (UTC)Reply

No idea. Yaron Koren 12:05, 31 March 2011 (UTC)Reply
thanks for the reply, --Msevero 23:00, 1 April 2011 (UTC)Reply

Searchlabel

[edit]

I just noticed that the combination "limit=0" and "searchlabel=foo", as used sometimes in regular inline queries, does not work in SCQ. I think that would be worth considering as an option in future releases. Cavila 11:43, 19 May 2011 (UTC)Reply

sorting of result format broadtable

[edit]

Hi, is it possible to sort the queried results somehow? So far it shows the results are printed in ascending order but to have this in a descending order would be cool too. The regular printout statements do not seem to work.

| headers=show
| format=broadtable
| sort=property name
| order=descending

Hmm ... Cheers --[[kgh]] 13:56, 15 August 2011 (UTC)Reply

sql error after update

[edit]

i have updated semantic compound queries from 0.2.7 to 0.2.8 and my query crashed. {{#compound_query: Kategoria:Wydarzenia; [[Rozpoczęcie::>{{#calendarstartdate:}}]]; [[Rozpoczęcie::<{{#calendarenddate:}}]]; ? Rozpoczęcie; color=#dd0000; limit=1500 |format=calendar}}

error: SMWSQLStore2::getSMWPageIDandSort”. database error „1054: Unknown column 'smw_subobject' in 'where clause' (localhost)”.

What version of SMW are you using? Yaron Koren 15:11, 17 August 2011 (UTC)Reply

smw 1.6, semantic result formats 1.6, validator 0.4.9

Ah - you should comment out the other SMW-based extensions in LocalSettings.php (other than SMW), then go to Special:SMWAdmin and click the "initialise/upgrade DB" button, then uncomment the extensions. Yaron Koren 16:28, 18 August 2011 (UTC)Reply

works now,thank you

v0.2.10

[edit]

Heiya, there may I download the new version? Cheers --[[kgh]] 18:06, 4 October 2011 (UTC)Reply

I actually wanted to skip to the next version, since 0.2.10 had problems with the latest SMW. Thanks for the reminder - I just released the latest version, 0.3, where hopefully all the problems are fixed. Yaron Koren 19:41, 4 October 2011 (UTC)Reply
Ah, I see. I just stumbled over this for another reason. The new version makes me curious regarding the sorting issue I discovered. This one sounds like a fix for it which should be very cool then. Cheers --[[kgh]] 19:48, 4 October 2011 (UTC)Reply


Error

[edit]
http://www.wikirio.com.br/Sandbox:Ipanema2

I get: Fatal error: Cannot call method self::compareQueryResults() or method does not exist in /home/wikirio/public_html/extensions/SemanticCompoundQueries/SCQ_QueryProcessor.php on line 77 I had to return to the previous version

I was updating to see if the new version is fixing this old issue. The compound queries doesnt work when you select 2 in the same page:

http://www.wikirio.com.br/Sandbox:Ipanema2

Edgard

Hi - this might be an issue due to your PHP version. Could you try restoring SCQ back to the newest version, then changing line 77 from
                uasort( $results, 'self::compareQueryResults' );
to
                uasort( $results, array( 'SCQQueryProcessor', 'compareQueryResults' ) );
...and see if that fixes it? Yaron Koren 18:56, 13 November 2011 (UTC)Reply
Yaron, works fine now. Thanks! Do you know what might be the issue I have when I use two Coumpound Queries on the same page? Regards, Edgard
Cool. I don't know - it looks like the issue is coming from Semantic Maps. Yaron Koren 20:21, 13 November 2011 (UTC)Reply
Awn... Works fine when I use ASK two times. Doesnt work only for Compound Query :(
Yeah, but what if you use two non-map compound queries? Yaron Koren 20:44, 13 November 2011 (UTC)Reply
Did you guys ever get to the bottom of the error message above? I have working SMW/SM maps all over my site and downloaded 0.3 to try and get maps with different icons. Trying to recreate a (working) #ask function as a compound gave the same exception as the above. Any clues as to what I can check? I am pretty happy that all my ordinary #ask queries are fine. Thanks - and kudos for some great tools, Tim D
BTW the fix above instantly fixed the issue for me - but are there any side effects of the edit to that code? - Tim D

Cool - no, I doubt there are any side effects to it; it's just syntax that seems to work across more versions of PHP. Yaron Koren 20:20, 28 November 2011 (UTC)Reply

Sorting results?

[edit]

Are the parameters for sorting different from those in regular #ask queries? They don't seem to work here. Cavila MW 1.19.2, MySQL 5.1.66, Php 5.3.3-7, SMW 1.8, SF 1.5.1 22:43, 12 February 2013 (UTC)Reply

They should work... I don't fully remember, but I think you apply those to the overall query, not the subquery. The property/printout names should be the same for each subquery, though. Yaron Koren (talk) 03:30, 13 February 2013 (UTC)Reply
Yes, I know, that's why I was somewhat surprised. Maybe it's because I was not querying pages, but subobjects, on the basis of an inverse "Has subobject" property. Is sorting of subobjects supported in compound queries? Cavila MW 1.19.2, MySQL 5.1.66, Php 5.3.3-7, SMW 1.8, SF 1.5.1 22:51, 14 February 2013 (UTC)Reply
If it's supported in regular queries, it should work in #compound_query. Whether it's supported in regular queries, though, I don't know. Yaron Koren (talk) 01:52, 15 February 2013 (UTC)Reply
The "sort" parameter works fine in regular #ask-queries on subobjects, but not in SCQ, I'm afraid. On a more general note, the documentation does not currently make clear if the parameters for regular queries can also be used in compound queries (not to mention those that come with SRF). For instance, "limit" and "searchlabel" do not appear to be available (in fact, a "further results" link is missing altogether). Cavila
specs
MW 1.19.2, MySQL 5.1.66, Php 5.3.3-7, SMW 1.8, SF 1.5.1
16:56, 15 February 2013 (UTC) (yes, what a hideous signature - I'm looking for a less obtrusive way to do this)
I do not think that sorting is possible (see my post of 2011) or at least I have not managed to do it so far. Cheers --[[kgh]] (talk) 10:39, 24 May 2013 (UTC)Reply

Compound query with template in calendar format

[edit]

Hi Yaron,

Doesn't the compound query work with template in calendar format? When I remove the template the retrieved values appear in a calendar, but with the template they end up in a table format. With a 'ask' in stead of compound query it shows the way it should in calendar format.

Ad

That sounds like a bug - is this problem viewable somewhere? Yaron Koren (talk) 22:41, 10 March 2013 (UTC)Reply

How to increase the maximum of results displayed on a map ?

[edit]

Thanks Nicolas NALLET (talk) 21:14, 9 April 2013 (UTC)Reply

Use the "limit=" parameter. Yaron Koren (talk) 21:57, 9 April 2013 (UTC)Reply
Hi, the limit doesnt have an impact, It s a compound query on internal object (around 2700 stored in the same page) with geographic coordinates... The aim is to diplay it on a map.

See here

Ah - with that number of results, you might need to use $smwgQMaxInlineLimit. However, another possible solution is to use the "cluster" option for maps - though I don't know well it would work with SCQ. Yaron Koren (talk) 12:28, 10 April 2013 (UTC)Reply

format=csv not working

[edit]

Lsilverman (talk) 23:39, 4 February 2014 (UTC)Reply

Versions: Compound Queries 0.3.4, MW 1.22.2 and SMW 1.9.0.2.

format=csv and format=dsv don't work.

broadtable works, table works. Haven't tried others.

My example:

{{#compound_query:[[Category:Client]] [[Has paid module::{{{module}}}]]
|[[Category:Client]] [[Has unpaid module::{{{module}}}]]
|format=csv
}}

loops and images

[edit]

Hi, I am new to Semantic. I have been trying to build a basic query that will list all items in a category and their properties :

{{#ask:[[Category:items]] [[name::+]] [[size::+]] 
| ?name
| ?size#-
| ?stacklimit#-
<!-- ... -->
| ?location
| ?description#-
| mainlabel=-
| headers=plain
}}

And I keep getting several repeated over and over again, receiving some 500 items for what should have been 20. Can you point me in the right way to solve this?

Also what is the right way to list all image files in a category. I have tried using this:

{{#ask:[[Category:items images]]
| format=ul
}}

But I get a list of thumbnails and change it plain, result in a plain list of names. How can I get a list of name + links?

Thanks --87.68.255.133 00:25, 9 November 2014 (UTC)Reply

I believe you're asking in the wrong place - #ask is part of the core Semantic MediaWiki extension, while Semantic Compound Queries is a separate spinoff extension. Yaron Koren (talk) 16:00, 9 November 2014 (UTC)Reply

SCQ and template parameter

[edit]

I tried to use SCQ 0.4 with SRF calendar together with a template for formatting the calendar entries:

{{#compound_query:[[Category:Day Off Request]][[Has Requester::{{FULLPAGENAME}}]]; ?Day_Off_Date; ?Has_Requester
   |[[Category:Sprint]]; ?Start_Date; ?Sprint_ID
   |format=calendar
   |template=SrfDayOffRequest
}}

This works fine for Day Off Requests but not for Sprints. Sprints will be shown as [[SPR00008|]]. So the template seems to be used only for the first query.

Template:SrfDayOffRequest is a simple

[[{{{1|}}}|{{{3|}}}]]

I also tried the following without success:

{{#compound_query:[[Category:Day Off Request]][[Has Requester::{{FULLPAGENAME}}]]; ?Day_Off_Date; ?Has_Requester; template=SrfDayOffRequest
   |[[Category:Sprint]]; ?Start_Date; ?Sprint_ID; template=SrfDayOffRequest
   |format=calendar
}}

--Planetenxin (talk) 11:15, 28 July 2015 (UTC)Reply

Order of output based on order of sub queries?

[edit]

I was sort of hoping I could use the SCQ to order my output based on specific property values. Based on that subsequent subqueries will not return an earlier retrieved result. E.g. the following query would return a table with pages from category records with prop=A before prop=B and any pages with prop not being either A or B as last. I am seeing random order in the overall result, is there a way to set deterministically the sequence of the pages in the resulting table?

{{#compound_query:
 [[Category:records]][prop::A]]
    ;?name
    ;?prop
|[[Category:records]][prop::B]]
    ;?name
    ;?prop
|[[Category:records]]
    ;?name
    ;?prop
|format=table}}

PeterBodifee (talk) 14:59, 28 November 2016 (UTC)Reply

I think just adding "|sort=prop" after "|format=table" would fix the problem. Maybe the documentation should mention that explicitly. Yaron Koren (talk) 16:56, 28 November 2016 (UTC)Reply
Unfortunately it doesn't make any difference in the output. Closer inspection of the produced table shows the sort order is the pagename. And to be clear I don't want the table to be sorted on values of prop, I want the results from the first sub query first, then the results from the second sub query (not repeating any pages which already are returned by the first sub query), and so on. PeterBodifee (talk) 18:06, 28 November 2016 (UTC)Reply
Oh, I get it. I'm surprised that the initial #compound_query call doesn't display the results in that order; but it's been a while since I looked into it. One hack you could do is, assuming all these pages get their values stored with the same template, have the template set a 2nd property, called "Sorting prop" or something, that gets set to 1 if prop is A, 2 if prop is B, and 3 if it's anything else - you could do that with a call to #switch. Then you would just need a regular #ask query, sorting on "Sorting prop". Yaron Koren (talk) 18:15, 28 November 2016 (UTC)Reply
Thanks for the suggestion. But that is not going to work for me. First I am going to query multiple categories using [[Category:cat1||cat2||cat3]] , however the structure of the templates in all these categories are the same. However that is not the real challenge. The query is going to be parameter driven, passing on a prioritized set of values for prop (and some other properties with specific value arrays as well - why easy when we can do something advanced ;-) , so I don't know in advance what the user of this query will use as values. For our purpose we want a deterministic result of the order (1st subquery #1, 2nd subquery #2, etc), so we can apply meaning to the order (the results are architecture compliance rules where the priority is based on the order of a prioritized set of values for prop). In one template call it could be F, D and in a next call it could be E, A, H (up to 5 values for 5 sub queries). From observation it looks like that all sub query results are combined and then sorted on pagename. The workaround I can think of now is to create tables per sub query (which I could do with regular #ask), the disadvantage is that given the values for the properties on our pages (they are all arrays!), we would repeat results over the multiple tables and I would really like to avoid repetition (which attracted me to use SCQ). PeterBodifee (talk) 18:55, 28 November 2016 (UTC)Reply

how to install in 1.25.* or newer

[edit]

I just installed mw 1.28. I installed SCQ using Composer. However it does not show up in the version list. I tried to load with with "require_once" as instructed. As of version 1.25 the loading with "require_once" is replaced by wfLoadExtension. Then I tried to use that. But that results in an error: extension.json is missing.

How do I get it loaded?

thanks. Michiel

This extension is broken for MW 1.28 I'm afraid. Up to MW 1.27 you have to use version 0.4.1 and invoke it the classic way since version 1.0.0 is not working. I will file a bug for this. Cheers --[[kgh]] (talk) 00:19, 20 December 2016 (UTC)Reply
Now filed as issue 22 --[[kgh]] (talk) 00:40, 20 December 2016 (UTC)Reply
This has been fixed now with version 1.0.1 so you should be able to install the extension using Composer. --[[kgh]] (talk) 08:02, 21 December 2016 (UTC)Reply

Restrict the result on each query

[edit]
Data
A
Place1::Place A1 Place2::Place B1
PlaceName1::City PlaceName2::Kitchen
PlaceName1::Mountain PlaceName2::Bedroom
PlaceName1::Lake PlaceName2::Bathroom
B
Place1::Place C1 Place2::Place D1
PlaceName1::Livingroom PlaceName2::Big City
PlaceName1::Diningroom PlaceName2::Village
PlaceName1::Bedroom PlaceName2::Farm
Query

{{#compound_query: [[PlaceName1::Bedroom]];?Place1 | [[PlaceName2::Bedroom]];?Place2 |format=valuerank }}

Result

Place A1, Place B1, Place C1, Place D1

Question

I'd like to see only Place B1 and Place C1 in the results. is it possible?

format=count not working in 2.1.0 with MW 1.34.1

[edit]
  • MediaWiki 1.34.1 (b1f6480) 18:15, 30 April 2020
  • Semantic MediaWiki 3.1.6
  • Semantic Compound Queries 2.1.0

simple implementation of a {{#compound_query: ... |format=count}} results in empty result (not even a "0") - Revansx (talk) 20:16, 9 May 2020 (UTC)Reply

Cell color doesn't work

[edit]

I got the following query:

{{#compound_query: [[isHost::true]][[-Has subobject.Geraeteklasse::Firewall]] ;?chassisDesc
| [[isHost::true]][[-Has subobject.Geraeteklasse::Firewall]] ;?Running-Build
| [[isHost::true]][[-Has subobject.Geraeteklasse::Firewall]] ;?geraetemodell
| [[isHost::true]][[-Has subobject.Geraeteklasse::Firewall]] ;?chassisSN
| [[isHost::true]][[-Has subobject.Geraeteklasse::Firewall]] ;?invNummer
| [[isHost::true]][[-Has subobject.Geraeteklasse::Firewall]] [[Status::active]] ;?Status ;color=green
| [[isHost::true]][[-Has subobject.Geraeteklasse::Firewall]] [[Status::inactive]] ;?Status ;color=red
}}

My goal is to color the table cells depending on the status given. If the host is active - be green, if it's inactive - be red. However as for now, the color doesn't show up. There's probably something I'm missing, but I can't put my finger on it. I did something similar in the past, but I can't go the way I did because of the different data-structure I'm provided with.

It doesn't need to be compound-queries if anyone has a suggestion for an alternative. In the end I just want to color the "status"-cell depending on the given value inside of a query.

Any help would be appreciated. Fmilk (talk) 11:08, 10 March 2023 (UTC)Reply