Last modified: 2012-08-03 06:28:27 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T40465, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 38465 - Properties with the same name as datatypes are taken to be Special Properties
Properties with the same name as datatypes are taken to be Special Properties
Status: RESOLVED INVALID
Product: MediaWiki extensions
Classification: Unclassified
Semantic MediaWiki (Other open bugs)
unspecified
All All
: Unprioritized normal (vote)
: ---
Assigned To: Nobody - You can work on this!
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2012-07-18 05:38 UTC by Sam Wilson
Modified: 2012-08-03 06:28 UTC (History)
3 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments

Description Sam Wilson 2012-07-18 05:38:26 UTC
When a property has the same name as a datatype (e.g. 'code' or 'phone number') then the display etc. of that property conforms to that datatype, regardless of what type is defined on the property page.

For example, a property value defined with:

    The code is [[Code::123ABC]].

and the associated property page of:

    This is a [[has type::string]] property.

still displays with a preformatted box around the '123ABC'.  An example of this in action can be found at http://sandbox.semantic-mediawiki.org/wiki/Code_property_test (unless that's been refreshed since now).
Comment 1 Nischay Nahata 2012-07-18 05:47:37 UTC
This happens because of the Language Aliases in SMW_Langauage.php

I think the assignment is used to store the the name of the property
'Code' => '_cod',
Comment 2 Sam Wilson 2012-07-18 06:07:23 UTC
Is it correct behaviour then?  Should properties never be named the same as datatypes?  I mean, that seems sort of sensible, to avoid confusion...
Comment 3 Markus Krötzsch 2012-07-18 08:58:26 UTC
Yes, this is correct behaviour. It has been introduced when changing the way in which record properties are declared. The old style only required types, while the new style requires properties. To provide some compatibility, properties that are named like the types have been introduced as a default (so the old record type declarations will still work without changing wikipages).

This does not mean that you should not name properties like that (though it might indeed be confusing); it just means that you cannot change the datatype of these properties to be different from their name (which would really be confusing). If you use these properties regularly, it would be useful to (redundantly) declare their type on their wiki page anyway, to clarify the situation for other editors and to ensure that the type stays the same in all future (the default properties can change their name if, e.g., the content language is changed).
Comment 4 Sam Wilson 2012-08-03 06:28:27 UTC
Thanks for clear this up!  Makes sense.

Is this in the wiki somewhere?

(I couldn't find it; so I asked: http://semantic-mediawiki.org/wiki/Help_talk:Properties_and_types#Properties_with_the_same_names_as_datatypes )

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links