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

Add PropertyTypeFinder (smwgFixedProperties) #2135

Merged
merged 1 commit into from Dec 31, 2016
Merged

Add PropertyTypeFinder (smwgFixedProperties) #2135

merged 1 commit into from Dec 31, 2016

Conversation

mwjames
Copy link
Contributor

@mwjames mwjames commented Dec 31, 2016

This PR is made in reference to: SemanticMediaWiki/semantic-mediawiki.org#14

This PR addresses or contains:

  • Simplify $smwgFixedProperties customizing where the type is now read from the property instead of having it declared as customizing which would create issues when the type on the property page and the $smwgFixedProperties setting are different from each other
  • Table name is no longer the complete md5 hash instead substr( base_convert( md5( $tableName ), 16, 32 ), 0, 12 ) is used to get a shorter ID
  • Property page now displays a message that any change to its type requires some admin activity
$GLOBALS['smwgFixedProperties'] = array(
	'Has fixed test'
);

image

This PR includes:

  • Tests (unit/integration)
  • CI build passed

@mwjames mwjames added the enhancement Alters an existing functionality or behaviour label Dec 31, 2016
@mwjames mwjames added this to the SMW 2.5 milestone Dec 31, 2016
@mwjames
Copy link
Contributor Author

mwjames commented Dec 31, 2016

@kghbln FYI

@mwjames mwjames merged commit cb7d267 into master Dec 31, 2016
@mwjames mwjames deleted the fix-prop branch December 31, 2016 17:42
@kghbln kghbln added the wikidocu missing Code changes (mostly features) what have not yet been documented label Jan 7, 2017
@kghbln
Copy link
Member

kghbln commented Jan 7, 2017

How awesome is this???!!! Great and many thanks!!! Just documented.

What about RDF stores? Will this work for them too? I suppose so.

@kghbln kghbln removed the wikidocu missing Code changes (mostly features) what have not yet been documented label Jan 7, 2017
@kghbln
Copy link
Member

kghbln commented Jan 7, 2017

This is a highlight thus 7f3fe52

@mwjames
Copy link
Contributor Author

mwjames commented Jan 8, 2017

This is a highlight thus 7f3fe52

At first, I just wanted to scratch an itch where a DataItem object reference would appear in the LocalSettings and I ended up fixing the whole "Fixed Properties" issue.

Property names must use underscores and not spaces or you will see MWException errors on some page actions.

Properties without an underscore do no longer cause a MWException, meaning that Has_fixed_text and Has fixed text will be handled as equivalent [0].

What about RDF stores? Will this work for them too? I suppose so.

This issue relates to the creation of extra DB tables with a RDF store not being linked to internal changes of the SQLStore therefore declaring properties as fixed table properties will have no effect on the SPARQLStore or for that matter to the RDF export.

[0] https://github.com/SemanticMediaWiki/SemanticMediaWiki/pull/2135/files#diff-53920baeff0ad9c3bad870946bb97034R221

@kghbln
Copy link
Member

kghbln commented Jan 8, 2017

Properties without an underscore do no longer cause a MWException, meaning that Has_fixed_text and Has fixed text will be handled as equivalent [0].

Good to know that there are less worries. :)

This issue relates to the creation of extra DB tables with a RDF store not being linked to internal changes of the SQLStore therefore declaring properties as fixed table properties will have no effect on the SPARQLStore or for that matter to the RDF export.

Thanks a lot for this info. I guess me having a better understanding of RDF store will be preferable in future.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Alters an existing functionality or behaviour
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants