Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SMW gets confused in queries with a property named "category" #2835

Closed
krabina opened this issue Nov 15, 2017 · 12 comments

Comments

Projects
None yet
3 participants
@krabina
Copy link
Contributor

commented Nov 15, 2017

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

@kghbln

This comment has been minimized.

Copy link
Member

commented Nov 15, 2017

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.

@krabina

This comment has been minimized.

Copy link
Contributor Author

commented Nov 15, 2017

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...

@kghbln

This comment has been minimized.

Copy link
Member

commented Nov 15, 2017

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.

@kghbln

This comment has been minimized.

Copy link
Member

commented Nov 15, 2017

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.

@kghbln kghbln added the question label Nov 15, 2017

@krabina

This comment has been minimized.

Copy link
Contributor Author

commented Nov 16, 2017

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...

@kghbln

This comment has been minimized.

Copy link
Member

commented Nov 16, 2017

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".

@mwjames

This comment has been minimized.

Copy link
Contributor

commented Nov 16, 2017

@kghbln

This comment has been minimized.

Copy link
Member

commented Nov 16, 2017

I guess this thread contains all there is to know about it. Thus closing.

@kghbln kghbln closed this Nov 16, 2017

@mwjames

This comment has been minimized.

Copy link
Contributor

commented Nov 18, 2017

@krabina Some form of acknowledgment would be appreciated so we know you understood the constraints and ramifications.

@krabina

This comment has been minimized.

Copy link
Contributor Author

commented Nov 20, 2017

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"

@kghbln

This comment has been minimized.

Copy link
Member

commented Nov 20, 2017

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.

@mwjames

This comment has been minimized.

Copy link
Contributor

commented Nov 25, 2017

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.