Bounties: selecting pages not in category, and option for turning off category inferencing

From semantic-mediawiki.org

Does anyone have the skills to add "not in category" clauses for selecting pages in ask queries, and/or the ability to turn off category inferencing in particular ask queries?

Selecting pages not in a category seems to be something that's been requested many times before.

I'd be happy to offer $100 bounties for each these features (up to $200 total) if they're available in the next month. (And of course it'd be a great service to the SMW community.)

Thanks! Adam

01:55, 17 May 2013

Hi,

I am interested in this but I am not able to distinguish both of the tasks. Can you give an example query for this?

15:30, 17 May 2013

Sure! These are two separate things...

1) Not in category clauses: I want to be able to do something like [[!Category::Actor]] to select pages that aren't in category Actor. This should work with other parts of a clause, like [[Category::Hollywood]][[!Category::Actor]] would return pages in category Hollywood but not Actor.

I'm not sure what the best way to implement this is. I'd hope this would get accepted to the SMW codebase so I'd very much welcome feedback on what the best way to accomplish this filtering is. Maybe it's adding a NOT clause, so you could do [[Category::Hollywood]] NOT [[Category::Actor]] but the NOT clause would also add a lot of power to do other things, which would be nice for everyone in general.


2) Optionally turning off category inferencing: I'm referring to inferencing as described here. I think there should be a flag so you could do {{#ask: [[Category::Person]] | inferencing=false }} to get a list of pages only in category Person (and not pages in [[Category::Man]] or [[Category::Woman]] unless those pages are also explicitly in [[Category::Person]]). This use case doesn't make a lot of sense for Person/Man/Woman but could for other use cases. Obviously `inferencing` would be default =true since that's the existing/default bahavior.


Thanks!  : )

Adam

22:37, 17 May 2013

The first request is complex, complex as in it needs changes in a lot of places in the core query execution. The second one is relatively simple. I will write to Markus and let you know

17:16, 19 May 2013

Understood. In that case (regarding #1), would a [[NotCategory::x]] filter be easier (vs a NOT clause)?

02:48, 21 May 2013