Ejemplo n.º 1
0
 def schema(self):
     return {
         'contributors': ('/authorNames', process_contributors),
         'uris': {
             'canonicalUri': '/articleFullUrl',
             'objectUris': ('/doi', lambda x: ['http://dx.doi.org/' + x])
         },
         'title': ('/bibliographyTitle', '/blurbTitle', lambda x, y: x or y),
         'providerUpdatedDateTime': ('/published Date', lambda x: date_formatter(x)),
         'description': '/blurbText',
         'freeToRead': {
             'startDate': ('/is_free', '/published Date', lambda x, y: y if x else None)
         },
         'otherProperties': build_properties(
             ('imageURL', '/imageUrl', {'description': 'a image url'}),
             ('type', '/type'),
             ('isOpenAccess', '/isOpenAccess'),
             ('articleUrl', '/articleUrl'),
             ('articleFullUrl', '/articleFullUrl'),
             ('isFree', '/isFree'),
             ('isHighlyAccessed', '/isHighlyAccessed'),
             ('status', '/status'),
             ('abstractPath', '/abstractPath'),
             ('journal Id', '/journal Id'),
             ('article_host', '/article_host'),
             ('longCitation', '/longCitation'),
             ('is_subscription', '/is_subscription')
         )
     }
Ejemplo n.º 2
0
 def schema(self):
     return {
         'title': ('/title', lambda x: x[0] if x else ''),
         'description': ('/subtitle', lambda x: x[0]
                         if (isinstance(x, list) and x) else x or ''),
         'providerUpdatedDateTime':
         ('/issued/date-parts',
          lambda x: date_formatter(' '.join([part for part in x[0]]))),
         'uris': {
             'canonicalUri': '/URL'
         },
         'contributors': ('/author', lambda x: [
             process_contributor(*[
                 '{} {}'.format(entry.get('given'), entry.get('family')),
                 entry.get('ORCID')
             ]) for entry in x
         ]),
         'otherProperties':
         build_properties(('referenceCount', '/reference-count'),
                          ('updatePolicy', '/update-policy'),
                          ('depositedTimestamp', '/deposited/timestamp'),
                          ('Empty', '/trash/not-here'), ('Empty2', '/'))
     }
Ejemplo n.º 3
0
 def schema(self):
     return {
         'title': ('/title', lambda x: x[0] if x else ''),
         'description': ('/subtitle', lambda x: x[0] if (isinstance(x, list) and x) else x or ''),
         'providerUpdatedDateTime': ('/issued/date-parts', lambda x: date_formatter(' '.join(
             [part for part in x[0]])
         )),
         'uris': {
             'canonicalUri': '/URL'
         },
         'contributors': ('/author', lambda x: [
             process_contributor(*[
                 '{} {}'.format(entry.get('given'), entry.get('family')),
                 entry.get('ORCID')
             ]) for entry in x
         ]),
         'otherProperties': build_properties(
             ('referenceCount', '/reference-count'),
             ('updatePolicy', '/update-policy'),
             ('depositedTimestamp', '/deposited/timestamp'),
             ('Empty', '/trash/not-here'),
             ('Empty2', '/')
         )
     }