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

Preferred property label, refs #1865 #1879

Merged
merged 1 commit into from Oct 16, 2016
Merged

Preferred property label, refs #1865 #1879

merged 1 commit into from Oct 16, 2016

Conversation

mwjames
Copy link
Contributor

@mwjames mwjames commented Sep 25, 2016

This PR is made in reference to: #1865

This PR addresses or contains:

  • Adds support for localized preferred property labels
  • $GLOBALS['smwgDVFeatures'] adds SMW_DV_PPLB to support the use of preferred property labels and SMW_DV_PROV_LHNT to output a p hint marker on properties that use a preferred label

This PR includes:

  • Tests (unit/integration)
  • CI build passed

@mwjames mwjames added the new feature A new, or altered behaviour of an existing functionality that fundamentally impacts behaviour label Sep 25, 2016
@mwjames mwjames added this to the SMW 2.5 milestone Sep 25, 2016
@mwjames
Copy link
Contributor Author

mwjames commented Sep 25, 2016

@kghbln After a turbo sprint weekend and as stipulated, the PR is more or less finished before the SMWCon. It is nearly feature complete and only requires manual testing and CI integration tests.

As for the usage:

  • Select a property Foo
  • Add [[Has preferred property label::SomeLabel@SomeLanguage]]
  • Switching to SomeLanguage should display property Foo with SomeLabelp and pointing it to its canonical property Foo
  • If you switch to a language that has not maintained a preferred label then the "normal" canonical property label is displayed (just as before)
  • The property auto-complete function in Special:Ask and Special:SearchByProperty supports searching for localized labels which when matched will return the canonical form
  • The canonical form is expected to be used for the annotation and query process (i.e. doing a reverse match as in {{#ask: [[SomeLabel@SomeLanguage::SomeValue]] ... }} is not expected to work)

@mwjames
Copy link
Contributor Author

mwjames commented Oct 16, 2016

@kghbln This PR requires to run update.php. The following content can be used as example [0, 1] after the merge:

@mwjames mwjames merged commit 219a450 into master Oct 16, 2016
@mwjames mwjames deleted the prop-label branch October 16, 2016 22:39
@mwjames
Copy link
Contributor Author

mwjames commented Oct 16, 2016

This PR took a lot of energy ...

@kghbln kghbln added the wikidocu missing Code changes (mostly features) what have not yet been documented label Oct 17, 2016
@kghbln
Copy link
Member

kghbln commented Oct 17, 2016

This PR took a lot of energy ...

I cannot even imagine all the effort! Another great one, indeed!!

This PR requires to run update.php. The following content can be used as example [0, 1] after the merge:

I have updated the wiki and added the example pages:

The only thing that seem so cause an issue is that one can only assign one value per language so [Has preferred property label::occupation@en]] and [[Has preferred property label::profession@en]] will not work for the same property. However I think this is fine.

@mwjames
Copy link
Contributor Author

mwjames commented Oct 23, 2016

The only thing that seem so cause an issue is that one can only assign one value per language so [Has preferred property label::occupation@en]] and [[Has preferred property label::profession@en]] will not work for the same property. However I think this is fine.

As per #1865 "Borrowing on the skos:prefLabel definition, the preferred label is understood as to only have one label per given language ..." and [0], so yes this was made on purpose.

Imaging you have [[Has preferred property label::occupation@en]] and [[Has preferred property label::profession@en]] on the same property what are you going to display on an instance that referrers to that property? You require a preference as decision parameter and this is what this label represents because you don't want to display one label and next time you display another label (by chance) without changing the context.

Property:P106 (which I pulled from Wikidata) demonstrates this issue where you have competing labels for the same language with the first being registered on the property page being defined as preferred and any other label that is trying to occupy the same declarative space (with the same language) is marked as error.

image

There is a concept of alternative labels [1] but I'm not sure how helpful this is or how we would use it other than to clarify to a user that they are synonyms (we also have redirects that form equality to a property instance, expressed as sameAs).

But let's say, you would be able to do [[Has preferred property label::occupation@en]] and [[Has alternative property label::profession@en]] (using an alternative) how would we use this label? What would we do with this label?

image

image

[0] https://github.com/SemanticMediaWiki/SemanticMediaWiki/blob/master/includes/dataitems/SMW_DI_Property.php#L212-L234

[1] https://www.w3.org/TR/skos-primer/#secalt

@kghbln
Copy link
Member

kghbln commented Oct 26, 2016

so yes this was made on purpose.

I was just surprised to see all these errors. Did not guess that this was part of the demo.

Property:P106 (which I pulled from Wikidata) demonstrates this issue where you have competing labels for the same language with the fist being registered on the property page being defined as preferred and any other label that is trying to occupy the same declarative space (with the same language) are marked as error.

Yeah, now I know the reason. I think the error ensures consistency so in the end it has to be decided which one should be used -> no competition and in the end no confusion. The clarification that labels are synonyms comes from the error note telling that the "canonical" label (= label already assigned) should be used.

use it other than to clarify to a user that they are synonyms

Cannot think of anything else here.

@mwjames
Copy link
Contributor Author

mwjames commented Nov 20, 2016

(using an alternative) how would we use this label? What would we do with this label?

On the matter of alternative labels, [0] contains some examples on how to use them more broadly in defining alternatives for an entity.

[0] http://sandbox.semantic-mediawiki.org/wiki/Triacylglycerol_lipase

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
new feature A new, or altered behaviour of an existing functionality that fundamentally impacts behaviour wikidocu missing Code changes (mostly features) what have not yet been documented
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants