Page MenuHomePhabricator

[Task] DataModelSerialization: create filter by language that can be applied to objects before passing to serialization
Open, MediumPublic

Description

Create filter by language that can be applied to objects before passing to serialization. Intended to be used before WikibaseDataModelSerialization. This is to replace the option on the current serialization for filtering by language.

FilterByLanguage will reside in WikibaseDataModel. It has as input an EntityDocument that has a Fingerprint, an AcceptLanguageSet, a Transliterator or something like that. It has as output the new EntityDocument.

Details

Reference
bz71512

Event Timeline

bzimport raised the priority of this task from to Medium.Nov 22 2014, 3:53 AM
bzimport set Reference to bz71512.
bzimport added a subscriber: Unknown Object (MLST).

see also bug 72038 about language fallback

Do we try to transliterate for each fall back language in the chains if that language is not present?

Do we for the possible sources of a thusly requested tranliteration try do language fall back? Probably not.
Do we recursively tranliterate? Probably not.
Find out where the current code in Wikibase for this is and see what it does.

Lydia_Pintscher removed a subscriber: Unknown Object (MLST).

@jan: a good entry point is probably LanguageFallbackChain::extractPreferredValue()

Related task: T73992 "JSON should (optionally) contain full URIs for referenced external entities"

Consider using LanguageFallbackChain as is instead of proposed AcceptLanguageSet and Tranliterator.

I suggest an EntityLocalizer service as follows:

interface EntityLocalizer {

    /**
    ** @return Entity
    **/
    public function localizeEntity( Entity $e, LanguageFallbackChain $chain );
}

That interface and its implementation would reside in WikibaseRepo.

daniel renamed this task from create filter by language that can be applied to objects before passing to serialization to DataModelSerialization: create filter by language that can be applied to objects before passing to serialization.May 12 2015, 1:41 PM

This blocks "WikibaseDataModelSerialization with what we do with WikibaseLib" and although we have totally removed the Lib Serialization I would not consider this task complete in regards to WikibaseDataModelSerialization.

I love this idea though! We need to be able to:

  • Filter by language
  • Filter by sitelink
Jonas renamed this task from DataModelSerialization: create filter by language that can be applied to objects before passing to serialization to [Task] DataModelSerialization: create filter by language that can be applied to objects before passing to serialization.Aug 15 2015, 12:25 PM