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

Component for Wikibase API access #11

Closed
mkroetzsch opened this issue Feb 18, 2014 · 10 comments
Closed

Component for Wikibase API access #11

mkroetzsch opened this issue Feb 18, 2014 · 10 comments
Assignees
Labels

Comments

@mkroetzsch
Copy link
Member

There should be a component for accessing the functions of the Wikibase Web API. Initially, this component should only support some of the basic reading operations; other operations will be added later. It should be configured by providing the base URL of the API endpoint of the Wikibase instance to access. A JSON parser and URL manipulation libraries should be used to cleanly interact with the API.

@mkroetzsch mkroetzsch added this to the Wikidata Toolkit 0.1 milestone Feb 18, 2014
@guenthermi
Copy link
Member

I have written a class to configure the connection to the WikibaseApi and send queries. Another class should contain methods for the use cases. So I started to implement a mehtod which read out the datatype from the property-id. The API response something like "time" for P569 or "wikibase-item" for P553. Should that be converted in one of the constants from the DatatypeIdValue interface?

@mkroetzsch
Copy link
Member Author

Very good. Yes, the strings from the JSON should be represented by the corresponding datatype contents in our code.

Btw, I have also written some basic Web access components for the dump file downloading. These might be handy later on, especially for testing, since there are mock implementations of the interface. So you don't need to focus on the code that fetches string data from the web.

@eldur
Copy link

eldur commented Feb 25, 2014

... Maybe interesting for you ;-)

@mkroetzsch
Copy link
Member Author

This is very interesting indeed. Should we make use of (parts of) jwbf in out code? Or the other way around (e.g., we already have the Wikidata data model and we will implement the Wikidata JSON serialization)? Our goal is to publish such features as independent Maven modules, so one could pull in parts without pulling in everything. However, I don't know jwbf and its architecture enough to say what could work here.

@eldur
Copy link

eldur commented Feb 27, 2014

I'll offer the same points from the referenced issue - if you interested in.

JWBF is only a minimal service layer. You'll get, in your case, shortcuts for login, token handling, encoding and a few simple utils like a APIRequestBuilder (and the offered changes for API integration tests / not wikidata specific)

@fer-rum
Copy link
Member

fer-rum commented Mar 11, 2014

Via mailing list since this might interest others too:

I did a quick review of the JWBF as it was proposed to be used with
wikidata as well.

Code quality and style is pretty high, everything looks clean and
straight forward. The documentation is very sparse, but it seems to be
worked on.

Depending on how much the MediaWiki API and the Wikidata API differ
from each other it would take some coding effort to get the bots
running with the WDTK. As it looks in the github repository the
developers already tried to play around with this [0].

So I propose the following:

  • Including Wikidata access into the JWBF would be fine
  • let the JWBF-team handle the inclusion in their code, instead of
    including the JWBF into the WDTK
  • establish communication between the projects and keep both sides
    up-to date about recent developments

Reaching the first milestone of the WDTK would be a good time for a
first handshake between the projects.

Sincerly,
Fredo Erxleben

[0]
eldur/jwbf@74970a3

Zitat von Markus Krötzsch notifications@github.com:

This is very interesting indeed. Should we make use of (parts of)
jwbf in out code? Or the other way around (e.g., we already have the
Wikidata data model and we will implement the Wikidata JSON
serialization)? Our goal is to publish such features as independent
Maven modules, so one could pull in parts without pulling in
everything. However, I don't know jwbf and its architecture enough
to say what could work here.


Reply to this email directly or view it on GitHub:
#11 (comment)

@mkroetzsch mkroetzsch modified the milestones: Wikidata Toolkit 0.2, Wikidata Toolkit 0.1 Mar 18, 2014
@eldur
Copy link

eldur commented Jun 11, 2014

I tried to get the full rundtrip:

  • read a wikibase_item info from wikipedia
  • get the claim from wikidata by the given wikibase_item

but how can I map the json response to a org.wikidata.wdtk.datamodel.interfaces.Claim?

eldur/jwbf@698b478

@eldur
Copy link

eldur commented Jun 12, 2014

Hi fer-rum, thanks for your comment ... now I get a JsonException at
eldur/jwbf@82acd0d

@mkroetzsch
Copy link
Member Author

Pull request #123 introduces basic capabilities for fetching entity data via the API. It is not currently planned to add write access (JWBF would be much better suited to support the related aspects), but the code might be useful as an example on how to parse JSON data (which works well by now).

@mkroetzsch
Copy link
Member Author

Closed by merging #123.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants