Hi,
I missed this request. The formatting features of wbformatvalue are rather specific to Wikibase/Wikidata. For example, all URLs are formatted in HTML as an <a> tag with "nofollow" set, as well as several CSS classes. I think most applications will want their own, direct data format that they control and adjust to their needs.
Note that Java already comes with many formatting options, e.g., for language-specific date formatting. If you need formatting only for a specific task (e.g., to convert calendar models for dates), you should also find good solutions in standard Java libraries without having to send data cross the web for each formatting you do.
If you still need the exact formatting done by the Wikidata Web API, Wikidata Toolkit could support requests to this API. Feel free to file a feature request for this with some details on what kinds of uses you envision. Wikidata Toolkit will not reimplement the Wikidata formatting in Java, since the formatting is not specified anywhere and it would be reverse engineering the Wikibase code (a moving target).
Regards,
Markus
On 06.05.2015 11:04, Lydia Pintscher wrote:
On Wed, Apr 29, 2015 at 4:57 PM, Almer Bolatov bolatov@semvox.de wrote:
Hello all,
is there an alternative to MediaWiki Api wbformatvalue function in Wikidata Toolkit?
Currently I search for items with the help of MediaWiki Api and parse them as a list of JacksonItemDocuments. Actually, at this point I already have the required information. But now I have to do another query to format the value by calling wbformatvalue. What I could do (if WikidataToolkit supports it) is extract and format the value from JacksonItemDocument already.
As I understand you are using Java? For all I know there are currently no value formatters for Java. But maybe Markus can say more wrt the Wikidata Toolkit.
Cheers Lydia