It is generally not a very good idea to have a property called "category" in a wiki. However, SMW handles it well:
When you define the property called "Category" with the value "Test" [[Category::Test]] on a page and put this page in the [[Category:Test]], SMW handles it well as can be seen in the Browse Properties page: there is an attribute "Category" and it is automatically assigned property "Categories" that shows the list of categories a page is in.
The only problem is the ask query:
If you put the printout statment |?Category then it will show the lists of categories the pages of the query are in and not the property category
It can be seen here: https://sandbox.semantic-mediawiki.org/wiki/Category_Attribute
One slightly unrelated question: You are now the third person this week creating an issue without using the issue template which should be offered during the creation of the issue. Does it show up for you or must something be fixed here? When I try to create an issue I see it so I am very much confused.
Yes it shows up, but as I created the issue on sandbox before I entered the issue, I thought that it is not necessary to indicate the Versions of the sandbox wiki there. You guys know better about the sandbox versions then I do.
So in my opinion this is only necessary when filing an issue in an environment different from sandbox...
Yes it shows up, but as I created the issue on sandbox before I entered the issue,
Good to know. Creating an example is indeed part of the process. That step succeeded.
I thought that it is not necessary to indicate the Versions of the sandbox wiki there.
The software gets updated daily so yes it is still necessary. If one would like to get back to figuring out what the actual software used at the time the issue was reported it will be an extra effort if possible at all.
So in my opinion this is only necessary when filing an issue in an environment different from sandbox...
No this is the mandatory part of the template. Anyways thanks for confirming that you saw the template. I will add more text to it to make it less interpretable.
As for your issue: You are in direct conflict with SMW syntax on printing categories. See the docu. Thus the wiki is showing the expected behaviour. So I am afraid that you will have to migrate to a different property name.
OK, but it does not really make sense, that the property name shown in the factbos is "Categories" and die printout not to be used is ?Category
There should be only one name to be avoided...
You were querying for categories of the pages located in category "Test". Querying for property "Category" with value "test" yields an expected error. The name "Categories" on special page "Browse" is the French label for special page "Categories".
this page in the [[Category:Test]], SMW handles it well as can be seen in the Browse Properties page: there is
factbos is "Categories" and die printout not to be used is ?Category
Category is a reserved name in MediaWiki and the redirect in
Special:Browse to Special:Categories (there is no
Special:Category) [0] is just to make it easier for users to
understand the context and allow them to "browse" other categories.
If you put the printout statment |?Category then it will show the lists of categories the pages of the query are in and not the property category
|?Category has its behaviour codified in [1] and I'm not sure what
you expect when you use a reserved name during the output process.
It is very unlikely that we break this assumption, so I cannot see how
you will be able to the distinguish |?Category (as implied
property) from |?Category (as implied category) printout. We are
not going to implement something like "The Property:Category exists,
so maybe instead of assuming Category: the user most likely is
hinting Category:: therefore the output should use the property and
not the category and so on ..." because this just be a conjecture
based on a convention and cannot be used as basis for a decision
making on behalf of the printout.
The fact is that Category is a reserved name that classifies items
with help of the MediaWiki category instance.
There should be only one name to be avoided...
Feel free to make a proposal on how to avoid the situation or send a
PR (explicitly excluding me) that would show a different solution for
the issue and doesn't break existing assumptions including the
integration tests.
On 11/16/17, Bernhard Krabina notifications@github.com wrote:
OK, but it does not really make sense, that the property name shown in the
factbos is "Categories" and die printout not to be used is ?Category
There should be only one name to be avoided...--
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/SemanticMediaWiki/SemanticMediaWiki/issues/2835#issuecomment-344842879
I guess this thread contains all there is to know about it. Thus closing.
@krabina Some form of acknowledgment would be appreciated so we know you understood the constraints and ramifications.
My suggestion is to indicate on the page Property:Category (once a user wants to create it) that you cannot use a property called category in SMW since it is a reserved word in MediaWiki...
Similar to property pages that indicate that they are built-in properties
Haven't searched throgh the documentation of SMW for that, but we should also write about reserved words not to be used for property names somewhere. Maybe there are more than just "Category"
Haven't searched through the documentation of SMW for that, but we should also write about reserved words not to be used for property names somewhere. Maybe there are more than just "Category"
At some point a use will actually have to look at the docu. ;) We have a page on property naming that I have just updated by a section about reserved names which is purposely rather unspecific and hopefully scary.
My suggestion is to indicate on the page Property:Category (once a user wants to create it) that you cannot use a property called category in SMW since it is a reserved word in
See #2840.
Most helpful comment
See #2840.