Giter VIP home page Giter VIP logo

Comments (4)

fer-rum avatar fer-rum commented on July 17, 2024

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.

mkroetzsch avatar mkroetzsch commented on July 17, 2024

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.

fer-rum avatar fer-rum commented on July 17, 2024

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.

mkroetzsch avatar mkroetzsch commented on July 17, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.