Comments (4)
When converting value snacks, I need to map the property IDs to some internal representation (I do not want to create a switch-case-statement for looking up magic numbers). So for now I would suggest to just create an enumeration for the mapping. This lookup is needed since different properties do have different value types, on wich in turn depends how to convert them.
from wikidata-toolkit.
I don't quite understand the comment. The property ids are represented by PropertyIdValue objects internally. One can directly create such objects from property ids using a base URL of the website that the data is for. There is an unknown number of properties and each website may have different properties, so it would be impossible to hardcode them in a switch statement anyway. ,OTOH, the type information that is provided for each primitive property value should be enough to convert the value to an object, even if the property is not known at the time. It is not necessary to evaluate that the primitive value matches the property datatype.
from wikidata-toolkit.
The conclusion we came to vis-a-vis for the record:
I overlooked, that all the property data types are also represented as strings in the dumpfile JSON value snaks.
This makes the whole thing pretty trivial.
from wikidata-toolkit.
This is largely closed now with the merge of #29. However, some details are not done correctly yet (esp. related to sitelinks; see also FIXMEs in JsonConverter.java) and need to be addressed in the future.
from wikidata-toolkit.
Related Issues (20)
- Duplicated statements with the editor.editEntityDocument api HOT 4
- Generic method to create new EntityDocument in WikibaseDataEditor
- Release? HOT 3
- Update Javadocs HOT 1
- Built-in server HOT 6
- Support EDTF HOT 5
- Migrate to <dependencyManagement> to control versions of dependencies HOT 1
- Wrong password gives unclear message HOT 2
- Deserializing a property with `localMedia` datatype fails
- Remove datatype IRI from Wikibase data model implementation HOT 1
- Rename to Wikibase-Toolkit or something else? HOT 2
- OAuth2 support
- Incorrect behavior when converting multiple non-existent filenames to mids
- Support the new Wikibase REST API HOT 2
- Why does wdt use /other/wikidata/ instead of /wikidatawiki/entities/? HOT 3
- WbGetEntitiesAction cannot search media-info for titles containing "-" HOT 3
- Editing API: return revision id on successful edit HOT 5
- Drop support for Java 8
- JSON deserialization error in RdfSerializationExample
- WmfOnlineDailyDumpFile incorrectly checks for availability HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from wikidata-toolkit.