RAM Diego
RAM Diego

Reputation: 69

MediaWiki Ask Query

I have created two pages in a MediaWiki: John, and Category:Smith (note that the page Smith is a category page). Both pages were part of the Category:Person. When I run an Ask query to return all the pages that are under the category Person, only the page John is returned. {{#ask: [[:Category:Person]] | ?label}}. It seems to me that the Ask query does not return pages that are category pages.

Any comment or solution to this problem?

Upvotes: 1

Views: 361

Answers (1)

leo
leo

Reputation: 8541

The “Semantic MediaWiki” way to do it would be to query for properties, rather than categories. You could make both John and Category:Smith have the property [[Is a::Person]], and make a query like {{#ask:[[Is a::Person]] |?label}}.

There are valid uses for categories even with SMW, of course, but it is hard to give you advice on your semantic structure without seeing the whole picture. In your example, though, it seems to be like Smith is a surname, not a person, and thus should no be a subcategory to Category:Persons. Rather, you would normally have all persons directly in Category:Persons, and add properties like Has surname::Smith, etc, so that you could ask questions like {{#ask: [[Category:Persons]] [[Has surname::Smith]] [[Age::>36]]}}

Upvotes: 1

Related Questions