Giter Site home page Giter Site logo

adspipelinemsg's Issues

Direct access to attributes

In [9]: r.bibcode = 'foo'

In [10]: r
Out[10]: <adsmsg.bibrecord.BibRecord at 0x7f9f5ed9acd0>

In [11]: str(r)
Out[11]: '<adsmsg.bibrecord.BibRecord object at 0x7f9f5ed9acd0>'

In [12]: r.__str__()
Out[12]: '<adsmsg.bibrecord.BibRecord object at 0x7f9f5ed9acd0>'

In [13]: r.bibcode
Out[13]: 'foo'

In [14]: r.serialize()
---------------------------------------------------------------------------
EncodeError                               Traceback (most recent call last)
<ipython-input-14-6d620e231470> in <module>()
----> 1 r.serialize()

/dvt/workspace2/ADSPipelineMsg/adsmsg/msg.pyc in serialize(self)
     26         Returns a serialized protocol buffer message
     27         """
---> 28         return self._data.SerializeToString()
     29 
     30     def is_valid(self):

EncodeError: Message adsmsg.BibRecord is missing required fields: bibcode,JSON_fingerprint,metadata,text

so I was expecting the following to work:

r = BibRecord()
r.bibcode = 'foo'
r.serialize()

i doesn't because Msg is storing things in r._data

Also, it would be really really useful to be able to do:

r = BibRecord(bibcode='foo') # and by extension r = BibRecord(**{'bibcode': 'foo', ....})

Let's split the bibrecord

So now that I get to understand 'fullrecord' better I see it is made of several parts.

Since protobuf encourages composition (as opposed to inheritance - which is bad); and also to make it easy on devs, I'd like to ask for the following:

  1. separate bibrecord, FullTextRecord, and other records (once we have them)
  2. create a 'FullRecord' which is made of these parts (it just includes them)

renaming FullRecord into BibRecord

The 'Full' suggests that it also contains fulltext, orcid claims, citations, metrics etc.

I'd suggest calling it 'BibRecord' because it will be used by the Bibliographic pipeline and only holds metadata

Add Ned field to nonbib protobuf

nonbib data now includes NED identifiers and they are supported by AdsDataSqlSync. protobuf needs to be updated pass field to master pipeline.

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.