wipo-gbd-transformation 1.1.62__py3-none-any.whl → 1.1.63__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of wipo-gbd-transformation might be problematic. Click here for more details.

@@ -7,14 +7,19 @@ ignore_namespace = [
7
7
  def get_entity_addr(addr):
8
8
  if not addr: return None
9
9
  return "%s %s %s" % (addr.AddressStreet, addr.AddressCity, addr.AddressPostcode)
10
- def get_entity_name(name):
11
- if not name: return
12
- if name.OrganizationName: return name.OrganizationName
13
- return "%s %s" % (name.FirstName, name.LastName )
14
- def get_entity_kind(name):
15
- if not name: return
16
- if name.OrganizationName: return 'Legal entity'
17
- return 'Natural person'
10
+
11
+ def create_full_name(name):
12
+ result = ""
13
+
14
+ if name.FirstName:
15
+ result += name.FirstName + " "
16
+ if name.LastName:
17
+ result += name.LastName
18
+ if name.OrganizationName and name.OrganizationName != name.LastName and name.OrganizationName != result:
19
+ if name.FirstName or name.LastName:
20
+ result += ", "
21
+ result += name.OrganizationName
22
+ return result
18
23
 
19
24
  # -------------------------------------------------------------
20
25
  # data translation helpers:
@@ -29,7 +34,7 @@ def translate_kind(kind):
29
34
  raise Exception('kind "%s" is not mapped.' % kind)
30
35
 
31
36
  def translate_status(status):
32
- if not status: return 'Ended'
37
+ if not status: return 'Unknown'
33
38
 
34
39
  if status == 'Registered': return 'Registered'
35
40
 
@@ -39,7 +44,14 @@ def translate_status(status):
39
44
  'Filed']:
40
45
  return 'Pending'
41
46
 
42
- raise Exception('Status "%s" unmapped' % status)
47
+ if status in ['Expired']:
48
+ return 'Expired'
49
+
50
+ if status in ['Ended']:
51
+ return 'Ended'
52
+
53
+ return 'Unknown'
54
+ #raise Exception('Status "%s" unmapped' % status)
43
55
 
44
56
  def get_termination(value, gbd_status):
45
57
  if gbd_status == 'Ended':
@@ -103,18 +103,44 @@ publications:
103
103
 
104
104
  applicants:
105
105
  {% call(Applicant) match('ApplicantDetails.Applicant', TradeMark) %}
106
- - identifier: {{ Applicant.ApplicantIdentifier }}
107
- {% call(nameline) match('FormattedNameAddress.Name.FormattedName', Applicant.ApplicantAddressBook) %}
108
- kind: {{ nameline | get_entity_kind}}
106
+ - identifier: {{ Applicant.ApplicantURI }}
107
+ kind: {{ Applicant.ApplicantLegalEntity}}
109
108
  fullName:
110
- - text: {{ nameline | get_entity_name}}
111
- languageCode: hr
109
+ {% call(nameline) match('FormattedNameAddress.Name.FormattedName', Applicant.ApplicantAddressBook) %}
110
+ - text: {{ nameline | create_full_name }}
111
+ languageCode: {{ nameline.LastName | guess_language('en') }}
112
+ {% endcall %}
113
+ firstName:
114
+ {% call(nameline) match('FormattedNameAddress.Name.FormattedName.FirstName', Applicant.ApplicantAddressBook) %}
115
+ - languageCode: {{ nameline | guess_language('en') }}
116
+ text: {{ nameline }}
117
+ {% endcall %}
118
+ lastName:
119
+ {% call(nameline) match('FormattedNameAddress.Name.FormattedName.LastName', Applicant.ApplicantAddressBook) %}
120
+ - languageCode: {{ nameline | guess_language('en') }}
121
+ text: {{ nameline }}
122
+ {% endcall %}
123
+ middleName:
124
+ {% call(nameline) match('FormattedNameAddress.Name.FormattedName.MiddleName', Applicant.ApplicantAddressBook) %}
125
+ - languageCode: {{ nameline | guess_language('en') }}
126
+ text: {{ nameline }}
127
+ {% endcall %}
128
+ organizationName:
129
+ {% call(nameline) match('FormattedNameAddress.Name.FormattedName.OrganizationName', Applicant.ApplicantAddressBook) %}
130
+ - languageCode: {{ nameline | guess_language('en') }}
131
+ text: {{ nameline }}
112
132
  {% endcall %}
113
133
  fullAddress:
114
134
  {% call(adrline) match('FormattedNameAddress.Address.FormattedAddress', Applicant.ApplicantAddressBook) %}
115
- - text: {{ adrline | get_entity_addr}}
116
- languageCode: hr
135
+ - text: {{ adrline | get_entity_addr }}
136
+ languageCode: {{ nameline | guess_language('en') }}
117
137
  {% endcall %}
138
+ detailedAddress:
139
+ - languageCode: {{ Applicant.ApplicantAddressBook.FormattedNameAddress.Address.FormattedAddress.AddressStreet | guess_language('en') }}
140
+ text: {{ Applicant.ApplicantAddressBook.FormattedNameAddress.Address.FormattedAddress.AddressStreet }}
141
+ cityName: {{ Applicant.ApplicantAddressBook.FormattedNameAddress.Address.FormattedAddress.AddressCity }}
142
+ geographicRegionName: {{ Applicant.ApplicantAddressBook.FormattedNameAddress.Address.FormattedAddress.AddressState }}
143
+ postalCode: {{ Applicant.ApplicantAddressBook.FormattedNameAddress.Address.FormattedAddress.AddressPostcode }}
118
144
  {% call(adrline) match('FormattedNameAddress.Address', Applicant.ApplicantAddressBook) %}
119
145
  countryCode: {{ adrline.AddressCountryCode }}
120
146
  {% endcall %}
@@ -123,18 +149,44 @@ applicants:
123
149
  representatives:
124
150
  {% call(Representative) match('RepresentativeDetails.Representative', TradeMark) %}
125
151
  {% if not Representative.RepresentativeIdentifier.endswith('-null') %}
126
- - identifier: {{ Representative.RepresentativeIdentifier }}
127
- {% call(nameline) match('FormattedNameAddress.Name.FormattedName', Representative.RepresentativeAddressBook) %}
128
- kind: {{ nameline | get_entity_kind}}
152
+ - identifier: {{ Representative.RepresentativeURI }}
153
+ kind: {{ Representative.RepresentativeLegalEntity}}
129
154
  fullName:
130
- - text: {{ nameline | get_entity_name}}
131
- languageCode: {{ nameline | guess_language('hr') }}
155
+ {% call(nameline) match('FormattedNameAddress.Name.FormattedName', Representative.RepresentativeAddressBook) %}
156
+ - text: {{ nameline | create_full_name }}
157
+ languageCode: {{ nameline.LastName | guess_language('en') }}
132
158
  {% endcall %}
159
+ firstName:
160
+ {% call(nameline) match('FormattedNameAddress.Name.FormattedName.FirstName', Representative.RepresentativeAddressBook) %}
161
+ - languageCode: {{ nameline | guess_language('en') }}
162
+ text: {{ nameline }}
163
+ {% endcall %}
164
+ lastName:
165
+ {% call(nameline) match('FormattedNameAddress.Name.FormattedName.LastName', Representative.RepresentativeAddressBook) %}
166
+ - languageCode: {{ nameline | guess_language('en') }}
167
+ text: {{ nameline }}
168
+ {% endcall %}
169
+ middleName:
170
+ {% call(nameline) match('FormattedNameAddress.Name.FormattedName.MiddleName', Representative.RepresentativeAddressBook) %}
171
+ - languageCode: {{ nameline | guess_language('en') }}
172
+ text: {{ nameline }}
173
+ {% endcall %}
174
+ organizationName:
175
+ {% call(nameline) match('FormattedNameAddress.Name.FormattedName.OrganizationName', Representative.RepresentativeAddressBook) %}
176
+ - languageCode: {{ nameline | guess_language('en') }}
177
+ text: {{ nameline }}
178
+ {% endcall %}
133
179
  fullAddress:
134
180
  {% call(adrline) match('FormattedNameAddress.Address.FormattedAddress', Representative.RepresentativeAddressBook) %}
135
181
  - text: {{ adrline | get_entity_addr}}
136
- languageCode: {{ adrline | guess_language('hr') }}
182
+ languageCode: {{ adrline | guess_language('en') }}
137
183
  {% endcall %}
184
+ detailedAddress:
185
+ - languageCode: {{ Representative.RepresentativeAddressBook.FormattedNameAddress.Address.FormattedAddress.AddressStreet | guess_language('en') }}
186
+ text: {{ Representative.RepresentativeAddressBook.FormattedNameAddress.Address.FormattedAddress.AddressStreet }}
187
+ cityName: {{ Representative.RepresentativeAddressBook.FormattedNameAddress.Address.FormattedAddress.AddressCity }}
188
+ geographicRegionName: {{ Representative.RepresentativeAddressBook.FormattedNameAddress.Address.FormattedAddress.AddressState }}
189
+ postalCode: {{ Representative.RepresentativeAddressBook.FormattedNameAddress.Address.FormattedAddress.AddressPostcode }}
138
190
  {% call(adrline) match('FormattedNameAddress.Address', Representative.RepresentativeAddressBook) %}
139
191
  countryCode: {{ adrline.AddressCountryCode }}
140
192
  {% endcall %}
@@ -232,9 +232,32 @@ correspondence:
232
232
  fullName:
233
233
  - languageCode:
234
234
  text:
235
+ firstName:
236
+ - languageCode:
237
+ text:
238
+ lastName:
239
+ - languageCode:
240
+ text:
241
+ middleName:
242
+ - languageCode:
243
+ text:
244
+ organizationName:
245
+ - languageCode:
246
+ text:
235
247
  fullAddress:
236
248
  - languageCode:
237
249
  text:
250
+ detailedAddress:
251
+ - languageCode:
252
+ text:
253
+ cityName:
254
+ geographicRegionName:
255
+ postalCode:
256
+ contact:
257
+ phone:
258
+ fax:
259
+ email:
260
+ url:
238
261
  countryCode:
239
262
 
240
263
  events:
@@ -7,7 +7,7 @@ def create_full_name(name):
7
7
  result += name.FirstName + " "
8
8
  if name.LastName:
9
9
  result += name.LastName
10
- if name.OrganizationName and name.OrganizationName != name.LastName and name.OrganizationName != name.FirstName + " " + name.LastName:
10
+ if name.OrganizationName and name.OrganizationName != name.LastName and name.OrganizationName != result:
11
11
  if name.FirstName or name.LastName:
12
12
  result += ", "
13
13
  result += name.OrganizationName
@@ -7,7 +7,7 @@ def create_full_name(name):
7
7
  result += name.FirstName + " "
8
8
  if name.LastName:
9
9
  result += name.LastName
10
- if name.OrganizationName and name.OrganizationName != name.LastName and name.OrganizationName != name.FirstName + " " + name.LastName:
10
+ if name.OrganizationName and name.OrganizationName != name.LastName and name.OrganizationName != result:
11
11
  if name.FirstName or name.LastName:
12
12
  result += ", "
13
13
  result += name.OrganizationName
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: wipo-gbd-transformation
3
- Version: 1.1.62
3
+ Version: 1.1.63
4
4
  Summary: GBD XML ETL package
5
5
  Home-page: https://github.com/GBD-Wipo/xmlE
6
6
  Author: WIPO GDB team
@@ -149,9 +149,9 @@ gbdtransformation/brands/gstm/filters.py,sha256=QGOXTX5HsoOoxfY9a31adtujzOS7C0KQ
149
149
  gbdtransformation/brands/gstm/template.gs.yml,sha256=tQOXTIpmurgytddfqyWvKuCx-7K6ZxALMGXLn0mjg0s,1711
150
150
  gbdtransformation/brands/gstm/template.yml,sha256=INQBe908BttDal83tMEXkpAOTasJ0vo5Myl_kFuatR8,1000
151
151
  gbdtransformation/brands/hrtm/__init__.py,sha256=UHmbQDIPDdApISBKfO9tKOX6LgUQ_Ib-IVMR5kCVMTY,86
152
- gbdtransformation/brands/hrtm/filters.py,sha256=4wUfjkWjltASWOEM0UirF-0TcgHMeVVc2DJKWrc7rsw,3612
152
+ gbdtransformation/brands/hrtm/filters.py,sha256=aJ-8yQr9VQJ2JHD5BKxMqHnhTgUl7u_gEur86VUqlyA,3853
153
153
  gbdtransformation/brands/hrtm/schema,sha256=7jQ-PC0VTx5NZ79Qf8xAZEX8sqFSUtjPwsvVYV8XZAs,1376
154
- gbdtransformation/brands/hrtm/template.yml,sha256=92MBb0X1wYln7LSxWPeEDECEswzfZKT7QLudbFUDX9k,5733
154
+ gbdtransformation/brands/hrtm/template.yml,sha256=YOCRTH-fUzaB2DLa-k7bEKeurtW67kxvyUpChj2ioLY,9162
155
155
  gbdtransformation/brands/idtm/__init__.py,sha256=MBVFGkMlqAi-s2ur7pCLYe2uxtjIxx9n9wo2bpESvxU,311
156
156
  gbdtransformation/brands/idtm/filters.py,sha256=HbcLmB9KTBFjLwHJdkJmM-u5wdE2JmxlqJvlSz1cTKk,3018
157
157
  gbdtransformation/brands/idtm/schema,sha256=TFrF4FR76cytcbtQkDWxtF74I0tCPRDIvWRFeqaJt6Q,3242
@@ -456,7 +456,7 @@ gbdtransformation/brands/wstm/tests/test.xml.gz,sha256=UKm7LTvKaETUtHMKurFGqkqXO
456
456
  gbdtransformation/brands/xxxx/__init__.py,sha256=fricc3VHm4BwGRFKIIqB0t-NtP3tTVRrEYee_gWpiFo,172
457
457
  gbdtransformation/brands/xxxx/filters.py,sha256=YCaQ6yH2LINwCQvbPHDhnORQyWglbswLlSOY6ur3KXQ,1874
458
458
  gbdtransformation/brands/xxxx/schema,sha256=g_oWkd7k2e5fAQR1BdNkPSsIgP3dkTyc7esWo_UOHQA,163
459
- gbdtransformation/brands/xxxx/template.yml,sha256=sNeTm0K7DCulgbWWgeV_5gsf9IMsyB5HDTifx6Bl4pI,5518
459
+ gbdtransformation/brands/xxxx/template.yml,sha256=OscSZDrec-rCfK0HVbOaIPmhkykZCWcxK54Zf7iZe6o,5872
460
460
  gbdtransformation/brands/zmtm/__init__.py,sha256=Mtsi_-CaLQirHkhnletNhJ4li-pZlzEZMcKjv6mEk50,256
461
461
  gbdtransformation/brands/zmtm/filters.py,sha256=FkGfv3nPiYDUy97O7bDzPp824qoDsqX-oh2Ox01NTpA,2344
462
462
  gbdtransformation/brands/zmtm/schema,sha256=TFrF4FR76cytcbtQkDWxtF74I0tCPRDIvWRFeqaJt6Q,3242
@@ -482,10 +482,10 @@ gbdtransformation/common/jprp/template.yml,sha256=cgPMMyQouaGTW-AzWCNlWcMDY8S6Cb
482
482
  gbdtransformation/commons/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
483
483
  gbdtransformation/commons/filters.py,sha256=_wBT4MmbFKgs2fTaom03BzAIdfW4NAn_KQHZQKe-EKc,117
484
484
  gbdtransformation/commons/emap/__init__.py,sha256=LPq1qlU4nPGFyKPsgKWZG9K2mV4vWR1OAZ1OGWH-NjU,16
485
- gbdtransformation/commons/emap/filters.py,sha256=FEJq2StQdWXxAieruwv2p7W0W8DYcIrmzllmX0J0tpo,456
485
+ gbdtransformation/commons/emap/filters.py,sha256=BdYFvQBOPtHNzN6nI-kxV_uLgJoJgo9zGqht3qRcfhU,426
486
486
  gbdtransformation/commons/emap/template.yml,sha256=nSYD6hEn-8FDSprvBjMVn0IS_1stJO4gg4zqLqfmfw4,2884
487
487
  gbdtransformation/commons/emrp/__init__.py,sha256=LPq1qlU4nPGFyKPsgKWZG9K2mV4vWR1OAZ1OGWH-NjU,16
488
- gbdtransformation/commons/emrp/filters.py,sha256=qZalQj8Ev0Hn-Sy_RAPVOUoVG4Z2eVp08prShSRFzvc,454
488
+ gbdtransformation/commons/emrp/filters.py,sha256=JfysDlfkWS9f285UUwFmvXRkXtScF2pvdsyhDlm1_t4,424
489
489
  gbdtransformation/commons/emrp/template.yml,sha256=bo6dfXKM-isbuZekWBvrKJ5cZ3t97oleEYSK3JoHHbQ,3076
490
490
  gbdtransformation/designs/__init__.py,sha256=0zM_Nw5d8cwxBsFq0NMxBRb21DiOUqgCb020CGJN_KY,242
491
491
  gbdtransformation/designs/filters.py,sha256=cFXAVGynjZjd5IX1CisEAfVhNLCMIZiu3xz1RUsX3zw,2584
@@ -584,9 +584,9 @@ gbdtransformation/utilities/st66.xsd,sha256=co8aFN3a5TpudllRttWmfLeiZu8ulNipfeXm
584
584
  schemas/ShazamConfig.py,sha256=D67os5B11C41h_WZ7kk54Ss0Kk7tHh8W0d_1c_aX-lY,1191
585
585
  schemas/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
586
586
  schemas/schema_extractor.py,sha256=3-ImtnI777f6b3VA0A_w-NoXdlGz5VZMzK6MnPdQQAY,10294
587
- wipo_gbd_transformation-1.1.62.dist-info/LICENSE.md,sha256=6r2dL13EwZqSt2ellLbJRFTA-6ECIDOer4YthCfkac0,35654
588
- wipo_gbd_transformation-1.1.62.dist-info/METADATA,sha256=_GIHoWnzVyq0aIHFSl0zC-MCaLM0SX7vG58hB6Q819o,577
589
- wipo_gbd_transformation-1.1.62.dist-info/WHEEL,sha256=oiQVh_5PnQM0E3gPdiz09WCNmwiHDMaGer_elqB3coM,92
590
- wipo_gbd_transformation-1.1.62.dist-info/entry_points.txt,sha256=NFLtlP3mPHUi-hEoUcz4CXa7vcpP8bbwd18HS4arbEk,223
591
- wipo_gbd_transformation-1.1.62.dist-info/top_level.txt,sha256=oU1j-JNLga18Fd-EV6Xl9wM8zxYoNVEzb7P8MDhTPJg,26
592
- wipo_gbd_transformation-1.1.62.dist-info/RECORD,,
587
+ wipo_gbd_transformation-1.1.63.dist-info/LICENSE.md,sha256=6r2dL13EwZqSt2ellLbJRFTA-6ECIDOer4YthCfkac0,35654
588
+ wipo_gbd_transformation-1.1.63.dist-info/METADATA,sha256=BOHZBEjdpx3-ubArEHArq37zMCPWLgKGt89LI4TXvY0,577
589
+ wipo_gbd_transformation-1.1.63.dist-info/WHEEL,sha256=oiQVh_5PnQM0E3gPdiz09WCNmwiHDMaGer_elqB3coM,92
590
+ wipo_gbd_transformation-1.1.63.dist-info/entry_points.txt,sha256=NFLtlP3mPHUi-hEoUcz4CXa7vcpP8bbwd18HS4arbEk,223
591
+ wipo_gbd_transformation-1.1.63.dist-info/top_level.txt,sha256=oU1j-JNLga18Fd-EV6Xl9wM8zxYoNVEzb7P8MDhTPJg,26
592
+ wipo_gbd_transformation-1.1.63.dist-info/RECORD,,