wipo-gbd-transformation 1.1.60__py3-none-any.whl → 1.1.62__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.

@@ -70,7 +70,8 @@ def translate_feature(feature):
70
70
  if feature.capitalize() in std_features:
71
71
  return feature.capitalize()
72
72
 
73
- raise Exception('Feature "%s" unmapped' % feature)
73
+ return 'Unknown'
74
+ #raise Exception('Feature "%s" unmapped' % feature)
74
75
 
75
76
 
76
77
  def get_registration_nb(trademark, tmstatus):
@@ -106,4 +107,5 @@ def translate_status(trademark):
106
107
  if status == 'Registered': return 'Registered'
107
108
  if status == 'Registration expired': return 'Expired'
108
109
 
109
- raise Exception('Status "%s" not mapped.' % status)
110
+ return 'Unknown'
111
+ #raise Exception('Status "%s" not mapped.' % status)
@@ -7,6 +7,7 @@
7
7
 
8
8
  {% set _space = " " %}
9
9
  {% set status = TradeMark | translate_status %}
10
+ {% set st13 = TradeMark.ApplicationNumber | st13('EM') %}
10
11
 
11
12
  st13: {{ TradeMark.ApplicationNumber | st13('EM') }}
12
13
  gbdStatus: {{ status }}
@@ -108,49 +109,22 @@ appeals:
108
109
  date: {{ apeal.AppealEventDate }}
109
110
  {% endcall %}
110
111
  applicants:
111
- {% call(applicant) match('ApplicantDetails.Applicant', TradeMark) %}
112
+ {% call(applicant) match('ApplicantDetails.ApplicantKey', TradeMark) %}
112
113
  {% if not applicant._operationCode == 'Delete' %}
113
- - identifier: {{ applicant.ApplicantIdentifier }}
114
- kind: {{ applicant.ApplicantLegalEntity }}
115
- fullName:
116
- - languageCode: {{ TradeMark.ApplicationLanguageCode }}
117
- text: {{ applicant.ApplicantAddressBook.FormattedNameAddress.Name.FormattedName.OrganizationName }}
118
- fullAddress:
119
- - languageCode: {{ TradeMark.ApplicationLanguageCode }}
120
- text: {{ applicant.ApplicantAddressBook.FormattedNameAddress.Address.FormattedAddress | format_address }}
121
- contact:
122
- phone: {{ applicant.ApplicantAddressBook.ContactInformationDetails.Phone }}
123
- fax: {{ applicant.ApplicantAddressBook.ContactInformationDetails.Fax }}
124
- email: {{ applicant.ApplicantAddressBook.ContactInformationDetails.Email }}
125
- url: {{ applicant.ApplicantAddressBook.ContactInformationDetails.URL }}
126
- countryCode: {{ applicant.ApplicantAddressBook.FormattedNameAddress.Address.AddressCountryCode }}
114
+ - {{ applicant.Identifier | get_entity_from_db(TradeMark.RegistrationOfficeCode, 'APP', st13) | field_name}}
127
115
  {% endif %}
128
116
  {% endcall %}
129
117
 
130
118
  representatives:
131
- {% call(representative) match('RepresentativeDetails.Representative', TradeMark) %}
119
+ {% call(rep) match('RepresentativeDetails.RepresentativeKey', TradeMark) %}
132
120
  {% if not representative._operationCode == 'Delete' %}
133
- - identifier: {{ representative.RepresentativeIdentifier }}
134
- kind: {{representative.RepresentativeLegalEntity | append(' (') | append(representative.RepresentativeTypeCode) | append(')')}}
135
- {% call(fna) match('RepresentativeAddressBook.FormattedNameAddress', representative)%}
136
- fullName:
137
- - languageCode: {{ TradeMark.ApplicationLanguageCode }}
138
- text: {{ fna.Name.FormattedName | format_name }}
139
- fullAddress:
140
- - languageCode: {{ TradeMark.ApplicationLanguageCode }}
141
- text: {{ fna.Address.FormattedAddress | format_address }}
142
- contact:
143
- phone: {{ representative.RepresentativeAddressBook.ContactInformationDetails.Phone }}
144
- fax: {{ representative.RepresentativeAddressBook.ContactInformationDetails.Fax }}
145
- email: {{ representative.RepresentativeAddressBook.ContactInformationDetails.Email }}
146
- url: {{ representative.RepresentativeAddressBook.ContactInformationDetails.URL }}
147
- countryCode: {{ fna.Address.AddressCountryCode }}
148
- {% endcall %}
121
+ - {{ rep.Identifier | get_entity_from_db(TradeMark.RegistrationOfficeCode, 'REP', st13) | field_name}}
149
122
  {% endif %}
150
123
  {% endcall %}
124
+
151
125
  correspondence:
152
- {% call(rep) match('xxxCorrespondenceAddress', TradeMark) %}
153
- {{ rep.CorrespondenceAddressIdentifier}}
126
+ {% call(rep) match('CorrespondenceAddress', TradeMark) %}
127
+ {{ rep.CorrespondenceAddressIdentifier | get_entity_from_db('EM', rep.CorrespondenceAddressParty, st13) | field_name}}
154
128
  {% endcall %}
155
129
 
156
130
  {% endif %}
@@ -0,0 +1,3 @@
1
+ # instruction to render the output to JSON format
2
+ render = 'JSON'
3
+ source = 'national'
@@ -0,0 +1,109 @@
1
+ # namespaces defined in XML and to be ignored in procecssing
2
+ ignore_namespace = [
3
+ 'http://tmview.europa.eu/trademark/data',
4
+ 'http://www.oami.europa.eu/TM-Search'
5
+ ]
6
+
7
+ def get_entity_addr(addr):
8
+ if not addr: return None
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'
18
+
19
+ # -------------------------------------------------------------
20
+ # data translation helpers:
21
+ # translate values from office interpretation to gbd equivalent
22
+ # -------------------------------------------------------------
23
+ def translate_kind(kind):
24
+ if not kind: return ['Individual']
25
+
26
+ if kind == 'Individual': return ['Individual']
27
+ if kind == 'Collective': return ['Collective']
28
+
29
+ raise Exception('kind "%s" is not mapped.' % kind)
30
+
31
+ def translate_status(status):
32
+ if not status: return 'Ended'
33
+
34
+ if status == 'Registered': return 'Registered'
35
+
36
+ if status in ['Application published',
37
+ 'Application filed',
38
+ 'Application opposed',
39
+ 'Filed']:
40
+ return 'Pending'
41
+
42
+ raise Exception('Status "%s" unmapped' % status)
43
+
44
+ def get_termination(value, gbd_status):
45
+ if gbd_status == 'Ended':
46
+ return value
47
+ return None
48
+
49
+ def translate_feature(feature):
50
+ """translation of mark feature"""
51
+
52
+ # needed information from office
53
+ # if office cannot provide information, then agree on a way to guess (uatm)
54
+ if not feature: return 'Undefined'
55
+ feature = feature.upper()
56
+ if feature == 'COMBINED': return 'Combined'
57
+ if feature == 'WORD': return 'Word'
58
+ if feature == 'STYLIZED_CHARACTERS': return 'Stylized characters'
59
+ if feature == 'FIGURATIVE': return 'Figurative'
60
+ if feature == 'SOUND': return 'Sound'
61
+ if feature == ' 3 d': return 'Three dimensional'
62
+ if feature == '3-d': return 'Three dimensional'
63
+ if feature == '_3_D': return 'Three dimensional'
64
+ if feature == '3-D': return 'Three dimensional'
65
+ return feature.lower().capitalize()
66
+ # raise Exception to recognize unmapped values
67
+ raise Exception('Feature "%s" unmapped' % feature)
68
+
69
+ def get_registration_nb(trademark, tmstatus):
70
+ if "RegistrationNumber" in trademark and trademark.RegistrationNumber:
71
+ return trademark.RegistrationNumber
72
+
73
+ # default registration number to application number
74
+ # in case none is provided
75
+ if tmstatus in ['Registered', 'Expired']:
76
+ return trademark.ApplicationNumber
77
+
78
+ # -----------------------
79
+ # filtering empty tags
80
+ # -----------------------
81
+ def get_goods_services(goods_services):
82
+ nc_gs = {} # classified
83
+ if not goods_services:
84
+ goods_services = []
85
+
86
+ if not isinstance(goods_services, list):
87
+ goods_services = [goods_services]
88
+
89
+ for goods_service in goods_services:
90
+ code = goods_service.ClassNumber
91
+ if code and not code == '0':
92
+ nc_gs[code] = {}
93
+ desc = goods_service.GoodsServicesDescription
94
+
95
+ if hasattr(desc, '__value'):
96
+ terms = desc.__value
97
+ else:
98
+ terms = desc
99
+
100
+ if terms:
101
+ nc_gs[code]['terms'] = terms
102
+ else:
103
+ continue
104
+
105
+ if hasattr(desc, '_languageCode'):
106
+ lang = desc._languageCode
107
+ nc_gs[code]['lang'] = lang.lower()
108
+
109
+ return nc_gs
@@ -0,0 +1,43 @@
1
+ /Transaction
2
+ __/TradeMarkTransactionBody
3
+ ____/TransactionContentDetails
4
+ ______/TransactionCode
5
+ ______/TransactionData
6
+ ________/TradeMarkDetails
7
+ __________/TradeMark
8
+ ____________/ApplicantDetails
9
+ ______________/Applicant
10
+ ________________/ApplicantAddressBook
11
+ __________________/FormattedNameAddress
12
+ ____________________/Name
13
+ ______________________/FreeFormatName
14
+ ________________________/FreeFormatNameDetails
15
+ __________________________/FreeFormatNameLine
16
+ ________________/ApplicantURI
17
+ ____________/ApplicationDate
18
+ ____________/ApplicationNumber
19
+ ____________/GoodsServicesDetails
20
+ ______________/GoodsServices
21
+ ________________/ClassDescriptionDetails
22
+ __________________/ClassDescription
23
+ ____________________/ClassNumber
24
+ ____________/MarkCurrentStatusCode
25
+ ____________/MarkFeature
26
+ ____________/MarkImageDetails
27
+ ______________/MarkImage
28
+ ________________/MarkImageCategory
29
+ __________________/CategoryCodeDetails
30
+ ____________________/CategoryCode
31
+ ________________/MarkImageURI
32
+ ____________/OppositionPeriodEndDate
33
+ ____________/OppositionPeriodStartDate
34
+ ____________/RegistrationOfficeCode
35
+ ____________/TradeMarkURI
36
+ ____________/WordMarkSpecification
37
+ ______________/MarkVerbalElementText
38
+ __________/TradeMark[@operationCode=Insert]
39
+ ______/TransactionIdentifier
40
+ __/TransactionHeader
41
+ ____/SenderDetails
42
+ ______/RequestProducerDateTime
43
+ ______/TM-Search TM-Search-TradeMarkList-V1-8.xsd]
@@ -0,0 +1,144 @@
1
+ {% from 'navigation.tmpl' import match %}
2
+
3
+ {% set TradeMark = Transaction.TradeMarkTransactionBody.TransactionContentDetails.TransactionData.TradeMarkDetails.TradeMark %}
4
+ {% set status = TradeMark.MarkCurrentStatusCode | translate_status %}
5
+
6
+ st13: {{ TradeMark.ApplicationNumber | st13('HR', appdate=TradeMark.ApplicationDate) }}
7
+ gbdStatus: {{ status }}
8
+ registrationOfficeCode: {{ TradeMark.RegistrationOfficeCode }}
9
+ type: TRADEMARK
10
+
11
+ {% if not status == 'Delete' %}
12
+ kind: {{ TradeMark.KindMark | translate_kind }}
13
+ markFeature: {{ TradeMark.MarkFeature | translate_feature }}
14
+ designatedCountries:
15
+ - {{ TradeMark.RegistrationOfficeCode }}
16
+ applicationNumber: {{ TradeMark.ApplicationNumber }}
17
+ applicationDate: {{ TradeMark.ApplicationDate | convertdate('%Y-%m-%d') }}
18
+ registrationNumber: {{ TradeMark | get_registration_nb(TradeMark.MarkCurrentStatusCode) }}
19
+ registrationDate: {{ TradeMark.RegistrationDate }}
20
+ applicationLanguageCode: {{ TradeMark.ApplicationLanguageCode }}
21
+ officeStatus: {{ TradeMark.MarkCurrentStatusCode }}
22
+ statusDate: {{ TradeMark.MarkCurrentStatusDate | convertdate('%Y-%m-%d') }}
23
+
24
+ markDisclaimerDetails:
25
+ {% call(desc) match('MarkDisclaimerDetails.MarkDisclaimer', TradeMark) %}
26
+ - text: {{ desc }}
27
+ languageCode: {{ desc | guess_language(TradeMark.ApplicationLanguageCode) }}
28
+ {% endcall %}
29
+
30
+ markDescriptionDetails:
31
+ {% call(desc) match('MarkDisclaimerDetails.MarkDisclaimer', TradeMark) %}
32
+ - text: {{ desc }}
33
+ languageCode: {{ desc | guess_language(TradeMark.ApplicationLanguageCode) }}
34
+ {% endcall %}
35
+
36
+ wordMarkSpecification:
37
+ markVerbalElement:
38
+ {% call(desc) match('WordMarkSpecification.MarkVerbalElementText', TradeMark) %}
39
+ - text: {{ desc }}
40
+ languageCode: {{ desc | guess_language(TradeMark.ApplicationLanguageCode) }}
41
+ {% endcall %}
42
+
43
+ markImageDetails:
44
+ {% call(img) match('MarkImageDetails.MarkImage', TradeMark) %}
45
+ - name: {{ img.MarkImageURI }}
46
+ colourIndicator: {{ img.MarkImageColourClaimedText | get_true_or_false }}
47
+ colourClaimed:
48
+ {% call(desc) match('MarkImageColourClaimedText', img) %}
49
+ - text: {{ desc }}
50
+ languageCode: {{ desc | guess_language(TradeMark.ApplicationLanguageCode) }}
51
+ {% endcall %}
52
+ classification:
53
+ kind: Vienna
54
+ code:
55
+ {% call(code) match('MarkImageCategory.CategoryCodeDetails.CategoryCode', img) %}
56
+ - {{ code }}
57
+ {% endcall %}
58
+ {% endcall %}
59
+
60
+ markSoundDetails:
61
+ {% call(sound) match('MarkSoundDetails.MarkSound', TradeMark) %}
62
+ - filename: {{ sound.MarkSoundFilename }}
63
+ fileformat: {{ sound.MarkSoundFileFormat }}
64
+ {% endcall %}
65
+
66
+ markVideoDetails:
67
+ {% call(video) match('MarkVideoDetails.MarkVideo', TradeMark) %}
68
+ - filename: {{ video.MarkVideoFilename }}
69
+ fileformat: {{ video.MarkVideoFileFormat }}
70
+ {% endcall %}
71
+
72
+ {% set nc_gs = TradeMark.GoodsServicesDetails.GoodsServices.ClassDescriptionDetails.ClassDescription | get_goods_services %}
73
+ {% if (nc_gs.keys() | length) > 0 %}
74
+ goodsServicesClassification:
75
+ kind: Nice
76
+ version: {{ ASK_THE_OFFICE }}
77
+ class:
78
+ {% for nc in nc_gs.keys() %}
79
+ - code: {{ nc | int }}
80
+ {% if nc_gs[nc]['terms'] %}
81
+ terms:
82
+ {{ nc_gs[nc]['terms'] | guess_language(nc_gs[nc]['lang'], TradeMark.ApplicationLanguageCode) | field_name}}:
83
+ {% for gsline in nc_gs[nc]['terms'] | remove_trailing('.', '-') | split_terms %}
84
+ - {{ gsline | lower }}
85
+ {% endfor %}
86
+ {% endif %}
87
+ {% endfor %}
88
+ {% endif %}
89
+
90
+ priorities:
91
+ {% call(priority) match('PriorityDetails.Priority', TradeMark) %}
92
+ - countryCode: {{ priority.PriorityCountryCode }}
93
+ number: {{ priority.PriorityNumber }}
94
+ date: {{ priority.PriorityDate }}
95
+ {% endcall %}
96
+
97
+ publications:
98
+ {% call(publication) match('PublicationDetails.Publication', TradeMark) %}
99
+ - identifier: {{ publication.PublicationIdentifier }}
100
+ date: {{ publication.PublicationDate }}
101
+ section: {{ publication.PublicationSection }}
102
+ {% endcall %}
103
+
104
+ applicants:
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}}
109
+ fullName:
110
+ - text: {{ nameline | get_entity_name}}
111
+ languageCode: hr
112
+ {% endcall %}
113
+ fullAddress:
114
+ {% call(adrline) match('FormattedNameAddress.Address.FormattedAddress', Applicant.ApplicantAddressBook) %}
115
+ - text: {{ adrline | get_entity_addr}}
116
+ languageCode: hr
117
+ {% endcall %}
118
+ {% call(adrline) match('FormattedNameAddress.Address', Applicant.ApplicantAddressBook) %}
119
+ countryCode: {{ adrline.AddressCountryCode }}
120
+ {% endcall %}
121
+ {% endcall %}
122
+
123
+ representatives:
124
+ {% call(Representative) match('RepresentativeDetails.Representative', TradeMark) %}
125
+ {% 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}}
129
+ fullName:
130
+ - text: {{ nameline | get_entity_name}}
131
+ languageCode: {{ nameline | guess_language('hr') }}
132
+ {% endcall %}
133
+ fullAddress:
134
+ {% call(adrline) match('FormattedNameAddress.Address.FormattedAddress', Representative.RepresentativeAddressBook) %}
135
+ - text: {{ adrline | get_entity_addr}}
136
+ languageCode: {{ adrline | guess_language('hr') }}
137
+ {% endcall %}
138
+ {% call(adrline) match('FormattedNameAddress.Address', Representative.RepresentativeAddressBook) %}
139
+ countryCode: {{ adrline.AddressCountryCode }}
140
+ {% endcall %}
141
+ {% endif %}
142
+ {% endcall %}
143
+
144
+ {% endif %}
@@ -73,7 +73,7 @@ terminationDate:
73
73
  # status as is in the document
74
74
  officeStatus:
75
75
  # status as translated to gbdFormat
76
- gbdStatus: # (Ended|Expired|Pending|Registered|Unknown)
76
+ gbdStatus: # (Ended|Expired|Pending|Registered|Unknown|Delete)
77
77
  # can also be the date of the last event in markevents if given
78
78
  statusDate:
79
79
 
@@ -166,9 +166,32 @@ applicants:
166
166
  fullName:
167
167
  - languageCode:
168
168
  text:
169
+ firstName:
170
+ - languageCode:
171
+ text:
172
+ lastName:
173
+ - languageCode:
174
+ text:
175
+ middleName:
176
+ - languageCode:
177
+ text:
178
+ organizationName:
179
+ - languageCode:
180
+ text:
169
181
  fullAddress:
170
182
  - languageCode:
171
183
  text:
184
+ detailedAddress:
185
+ - languageCode:
186
+ text:
187
+ cityName:
188
+ geographicRegionName:
189
+ postalCode:
190
+ contact:
191
+ phone:
192
+ fax:
193
+ email:
194
+ url:
172
195
  countryCode: # sometimes, country name is provided instead
173
196
 
174
197
  representatives:
@@ -177,10 +200,33 @@ representatives:
177
200
  fullName:
178
201
  - languageCode:
179
202
  text:
203
+ firstName:
204
+ - languageCode:
205
+ text:
206
+ lastName:
207
+ - languageCode:
208
+ text:
209
+ middleName:
210
+ - languageCode:
211
+ text:
212
+ organizationName:
213
+ - languageCode:
214
+ text:
180
215
  fullAddress:
181
216
  - languageCode:
182
217
  text:
183
- countryCode:
218
+ detailedAddress:
219
+ - languageCode:
220
+ text:
221
+ cityName:
222
+ geographicRegionName:
223
+ postalCode:
224
+ contact:
225
+ phone:
226
+ fax:
227
+ email:
228
+ url:
229
+ countryCode: # sometimes, country name is provided instead
184
230
 
185
231
  correspondence:
186
232
  fullName:
@@ -28,8 +28,15 @@ def load_collection_package(type, collection):
28
28
  def get_entity_from_db(value, collection, e_type, st13):
29
29
  e_type = e_type[0:3].upper()
30
30
  key = "%s.%s.%s" % (collection.lower(), e_type, value)
31
+ #dynamodb = boto3.resource('dynamodb',
32
+ # endpoint_url=os.environ.get('DYNAMO_DB'))
31
33
  dynamodb = boto3.resource('dynamodb',
32
- endpoint_url=os.environ.get('DYNAMO_DB'))
34
+ endpoint_url=os.environ.get('DYDB_URL'))
35
+ #dynamodb = boto3.resource('dynamodb',
36
+ # region_name="eu-west-1",
37
+ # aws_access_key_id='anything',
38
+ # aws_secret_access_key='anything',
39
+ # endpoint_url="http://localhost:8001")
33
40
  table = dynamodb.Table('gbd_pypers_entity')
34
41
  response = table.get_item(Key={
35
42
  'entity_id': key}).get('Item', {})
@@ -1 +1,16 @@
1
- ignore_namespace = ['http://www.euipo.europa.eu/EUTM/EUTM_Download']
1
+ ignore_namespace = ['http://www.euipo.europa.eu/EUTM/EUTM_Download']
2
+
3
+ def create_full_name(name):
4
+ result = ""
5
+
6
+ if name.FirstName:
7
+ result += name.FirstName + " "
8
+ if name.LastName:
9
+ result += name.LastName
10
+ if name.OrganizationName and name.OrganizationName != name.LastName and name.OrganizationName != name.FirstName + " " + name.LastName:
11
+ if name.FirstName or name.LastName:
12
+ result += ", "
13
+ result += name.OrganizationName
14
+ return result
15
+
16
+
@@ -10,20 +10,46 @@ applicant:
10
10
  identifier: {{ Applicant.ApplicantIdentifier }}
11
11
  kind: {{ Applicant.ApplicantLegalEntity}}
12
12
  fullName:
13
+ {% call(nameline) match('FormattedNameAddress.Name.FormattedName', Applicant.ApplicantAddressBook) %}
14
+ - text: {{ nameline | create_full_name }}
15
+ languageCode: {{ nameline.LastName | guess_language('en') }}
16
+ {% endcall %}
17
+ firstName:
18
+ {% call(nameline) match('FormattedNameAddress.Name.FormattedName.FirstName', Applicant.ApplicantAddressBook) %}
19
+ - languageCode: {{ nameline | guess_language('en') }}
20
+ text: {{ nameline }}
21
+ {% endcall %}
22
+ lastName:
13
23
  {% call(nameline) match('FormattedNameAddress.Name.FormattedName.LastName', Applicant.ApplicantAddressBook) %}
14
- - text: {{ nameline }}
15
- languageCode: {{ nameline | guess_language('en') }}
24
+ - languageCode: {{ nameline | guess_language('en') }}
25
+ text: {{ nameline }}
26
+ {% endcall %}
27
+ middleName:
28
+ {% call(nameline) match('FormattedNameAddress.Name.FormattedName.MiddleName', Applicant.ApplicantAddressBook) %}
29
+ - languageCode: {{ nameline | guess_language('en') }}
30
+ text: {{ nameline }}
31
+ {% endcall %}
32
+ organizationName:
33
+ {% call(nameline) match('FormattedNameAddress.Name.FormattedName.OrganizationName', Applicant.ApplicantAddressBook) %}
34
+ - languageCode: {{ nameline | guess_language('en') }}
35
+ text: {{ nameline }}
16
36
  {% endcall %}
17
37
  fullAddress:
18
38
  {% call(adrline) match('PostalAddress', Applicant.ApplicantAddressBook) %}
19
39
  - text: {{ adrline }}
20
40
  languageCode: {{ adrline | guess_language('en') }}
21
41
  {% endcall %}
42
+ detailedAddress:
43
+ - languageCode: {{ Applicant.ApplicantAddressBook.FormattedNameAddress.Address.FormattedAddress.AddressStreet | guess_language('en') }}
44
+ text: {{ Applicant.ApplicantAddressBook.FormattedNameAddress.Address.FormattedAddress.AddressStreet }}
45
+ cityName: {{ Applicant.ApplicantAddressBook.FormattedNameAddress.Address.FormattedAddress.AddressCity }}
46
+ geographicRegionName: {{ Applicant.ApplicantAddressBook.FormattedNameAddress.Address.FormattedAddress.AddressState }}
47
+ postalCode: {{ Applicant.ApplicantAddressBook.FormattedNameAddress.Address.FormattedAddress.AddressPostcode }}
22
48
  contact:
23
49
  phone: {{ Applicant.ApplicantAddressBook.ContactInformationDetails.Phone }}
24
50
  fax: {{ Applicant.ApplicantAddressBook.ContactInformationDetails.Fax }}
25
51
  email: {{ Applicant.ApplicantAddressBook.ContactInformationDetails.Email }}
26
52
  url: {{ Applicant.ApplicantAddressBook.ContactInformationDetails.URL }}
27
- {% call(adrline) match('FormattedNameAddress.Address', Applicant.ApplicantAddressBook) %}
28
- countryCode: {{ adrline.AddressCountryCode }}
29
- {% endcall %}
53
+ countryCode: {{ Applicant.ApplicantAddressBook.FormattedNameAddress.Address.AddressCountryCode }}
54
+
55
+
@@ -1 +1,14 @@
1
- ignore_namespace = ['http://www.euipo.europa.eu/EUTM/EUTM_Download']
1
+ ignore_namespace = ['http://www.euipo.europa.eu/EUTM/EUTM_Download']
2
+
3
+ def create_full_name(name):
4
+ result = ""
5
+
6
+ if name.FirstName:
7
+ result += name.FirstName + " "
8
+ if name.LastName:
9
+ result += name.LastName
10
+ if name.OrganizationName and name.OrganizationName != name.LastName and name.OrganizationName != name.FirstName + " " + name.LastName:
11
+ if name.FirstName or name.LastName:
12
+ result += ", "
13
+ result += name.OrganizationName
14
+ return result
@@ -6,24 +6,48 @@
6
6
 
7
7
  {% from 'navigation.tmpl' import match %}
8
8
 
9
- representativ:
9
+ representative:
10
10
  identifier: {{ Representative.RepresentativeIdentifier }}
11
11
  kind: {{ Representative.RepresentativeLegalEntity}}
12
12
  fullName:
13
- {% call(nameline) match('FormattedNameAddress.Name.FormattedName.LastName', Representative.RepresentativeAddressBook) %}
14
- - text: {{ nameline }}
15
- languageCode: {{ nameline | guess_language('en') }}
13
+ {% call(nameline) match('FormattedNameAddress.Name.FormattedName', Representative.RepresentativeAddressBook) %}
14
+ - text: {{ nameline | create_full_name }}
15
+ languageCode: {{ nameline.LastName | guess_language('en') }}
16
16
  {% endcall %}
17
+ firstName:
18
+ {% call(nameline) match('FormattedNameAddress.Name.FormattedName.FirstName', Representative.RepresentativeAddressBook) %}
19
+ - languageCode: {{ nameline | guess_language('en') }}
20
+ text: {{ nameline }}
21
+ {% endcall %}
22
+ lastName:
23
+ {% call(nameline) match('FormattedNameAddress.Name.FormattedName.LastName', Representative.RepresentativeAddressBook) %}
24
+ - languageCode: {{ nameline | guess_language('en') }}
25
+ text: {{ nameline }}
26
+ {% endcall %}
27
+ middleName:
28
+ {% call(nameline) match('FormattedNameAddress.Name.FormattedName.MiddleName', Representative.RepresentativeAddressBook) %}
29
+ - languageCode: {{ nameline | guess_language('en') }}
30
+ text: {{ nameline }}
31
+ {% endcall %}
32
+ organizationName:
33
+ {% call(nameline) match('FormattedNameAddress.Name.FormattedName.OrganizationName', Representative.RepresentativeAddressBook) %}
34
+ - languageCode: {{ nameline | guess_language('en') }}
35
+ text: {{ nameline }}
36
+ {% endcall %}
17
37
  fullAddress:
18
38
  {% call(adrline) match('PostalAddress', Representative.RepresentativeAddressBook) %}
19
39
  - text: {{ adrline }}
20
40
  languageCode: {{ adrline | guess_language('en') }}
21
41
  {% endcall %}
42
+ detailedAddress:
43
+ - languageCode: {{ Representative.RepresentativeAddressBook.FormattedNameAddress.Address.FormattedAddress.AddressStreet | guess_language('en') }}
44
+ text: {{ Representative.RepresentativeAddressBook.FormattedNameAddress.Address.FormattedAddress.AddressStreet }}
45
+ cityName: {{ Representative.RepresentativeAddressBook.FormattedNameAddress.Address.FormattedAddress.AddressCity }}
46
+ geographicRegionName: {{ Representative.RepresentativeAddressBook.FormattedNameAddress.Address.FormattedAddress.AddressState }}
47
+ postalCode: {{ Representative.RepresentativeAddressBook.FormattedNameAddress.Address.FormattedAddress.AddressPostcode }}
22
48
  contact:
23
49
  phone: {{ Representative.RepresentativeAddressBook.ContactInformationDetails.Phone }}
24
50
  fax: {{ Representative.RepresentativeAddressBook.ContactInformationDetails.Fax }}
25
51
  email: {{ Representative.RepresentativeAddressBook.ContactInformationDetails.Email }}
26
52
  url: {{ Representative.RepresentativeAddressBook.ContactInformationDetails.URL }}
27
- {% call(adrline) match('FormattedNameAddress.Address', Representative.RepresentativeAddressBook) %}
28
- countryCode: {{ adrline.AddressCountryCode }}
29
- {% endcall %}
53
+ countryCode: {{ Representative.RepresentativeAddressBook.FormattedNameAddress.Address.AddressCountryCode }}
@@ -0,0 +1,3 @@
1
+ from gbdtransformation.common.filters import *
2
+
3
+ ignore_namespace = ['http://www.euipo.europa.eu/EUTM/EUTM_Download']
@@ -39,11 +39,12 @@ class Parser:
39
39
  self.type = 'brands'
40
40
  elif template_name == 'whoinn':
41
41
  self.type = 'brands'
42
-
43
42
  elif template_name.endswith('tm'):
44
43
  self.type = 'brands'
45
44
  elif template_name.endswith('id'):
46
45
  self.type = 'designs'
46
+ elif template_name == 'emap' or template_name == 'emrp':
47
+ self.type = 'commons'
47
48
  else:
48
49
  self.type = 'common'
49
50
  self.render = self.get_render()
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: wipo-gbd-transformation
3
- Version: 1.1.60
3
+ Version: 1.1.62
4
4
  Summary: GBD XML ETL package
5
5
  Home-page: https://github.com/GBD-Wipo/xmlE
6
6
  Author: WIPO GDB team
@@ -2,7 +2,7 @@ gbdtransformation/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU
2
2
  gbdtransformation/execs-nico.py,sha256=UC8E6CPLS5YwhB8AC_Z9_VIxlDGjweOv7NEMMxEVte0,24514
3
3
  gbdtransformation/execs.py,sha256=h4BBz3YrEBwPRwt312iNf2tAT_AglqLbssa1faJe1PA,25450
4
4
  gbdtransformation/gbd-transform.exec.tgz,sha256=fOcqmzJRIuAhCVtbhju3kaikTDAuQF2K16lt9xllnOE,6262
5
- gbdtransformation/parser.py,sha256=m6b1J0kJEaEDc0I8HKxzzN2nsQWKFfLlQqS3nT02kb4,7074
5
+ gbdtransformation/parser.py,sha256=AqJdd-soUJH5l6VN3aTAwPayoHaslFQT4zRuPKa52Q8,7180
6
6
  gbdtransformation/renders.py,sha256=RmvQgugnG2ErvDxP4I9yovW67gEZNpOd59nrzEYfQPI,4555
7
7
  gbdtransformation/brands/__init__.py,sha256=abDdinNkilR-qYg4dhVxP_e1-ZixCzVuHGxbFt710TE,1605
8
8
  gbdtransformation/brands/filters.py,sha256=2IbOBzLsfmgj8kfyEydmuB-VmpO4UMkvtnymVrxTIwc,3674
@@ -110,9 +110,9 @@ gbdtransformation/brands/egtm/schema,sha256=AP0MxQyD0hY4APRh8nxitlxMqJYJB4AaaTJ8
110
110
  gbdtransformation/brands/egtm/template.yml,sha256=PO7s1HDQM9ushIJuIX3z_dfWO-f62YDzBG_sYKDlnG8,34
111
111
  gbdtransformation/brands/egtm/tests/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
112
112
  gbdtransformation/brands/emtm/__init__.py,sha256=9J9MpkcIR-7PWVjbzvT-ey9F400wxdlRAQF5ZiX8FX8,91
113
- gbdtransformation/brands/emtm/filters.py,sha256=xHkvSRnkkpUxLzUcLGNfVbdReLcB9vhz0ybT0oCdeP0,3250
113
+ gbdtransformation/brands/emtm/filters.py,sha256=vUAFaOGOx2l7VhIf1DcyyNfoGpJLudBP4wYm8ukCMCM,3294
114
114
  gbdtransformation/brands/emtm/schema,sha256=CCZ2HtmgidPqBs9byleAC6ksQ6jFgclmVewH3Vnex8w,9643
115
- gbdtransformation/brands/emtm/template.yml,sha256=xNNQTLiI7aDU5or7ByodxPVMjean2kTvkzbz3L8bWgw,7135
115
+ gbdtransformation/brands/emtm/template.yml,sha256=L0pDlLO_xwksy_Bb_BiNSgorFAAysaPcojmJJnu4UZw,5561
116
116
  gbdtransformation/brands/estm/__init__.py,sha256=UHmbQDIPDdApISBKfO9tKOX6LgUQ_Ib-IVMR5kCVMTY,86
117
117
  gbdtransformation/brands/estm/filters.py,sha256=GzhXr2dnPmZ4l71q0a3ulNTJgdpLQI6qcQcNEK8E5Co,3553
118
118
  gbdtransformation/brands/estm/schema,sha256=y7ZeQPuHez-DbBs1wnQjkyPvQ3hQ2uX5eNdrimCnFh4,3334
@@ -148,6 +148,10 @@ gbdtransformation/brands/gstm/__init__.py,sha256=yqzC7OagUR0RLui3pHPWo5WxLyksznH
148
148
  gbdtransformation/brands/gstm/filters.py,sha256=QGOXTX5HsoOoxfY9a31adtujzOS7C0KQx0V9wYKIr2o,2291
149
149
  gbdtransformation/brands/gstm/template.gs.yml,sha256=tQOXTIpmurgytddfqyWvKuCx-7K6ZxALMGXLn0mjg0s,1711
150
150
  gbdtransformation/brands/gstm/template.yml,sha256=INQBe908BttDal83tMEXkpAOTasJ0vo5Myl_kFuatR8,1000
151
+ gbdtransformation/brands/hrtm/__init__.py,sha256=UHmbQDIPDdApISBKfO9tKOX6LgUQ_Ib-IVMR5kCVMTY,86
152
+ gbdtransformation/brands/hrtm/filters.py,sha256=4wUfjkWjltASWOEM0UirF-0TcgHMeVVc2DJKWrc7rsw,3612
153
+ gbdtransformation/brands/hrtm/schema,sha256=7jQ-PC0VTx5NZ79Qf8xAZEX8sqFSUtjPwsvVYV8XZAs,1376
154
+ gbdtransformation/brands/hrtm/template.yml,sha256=92MBb0X1wYln7LSxWPeEDECEswzfZKT7QLudbFUDX9k,5733
151
155
  gbdtransformation/brands/idtm/__init__.py,sha256=MBVFGkMlqAi-s2ur7pCLYe2uxtjIxx9n9wo2bpESvxU,311
152
156
  gbdtransformation/brands/idtm/filters.py,sha256=HbcLmB9KTBFjLwHJdkJmM-u5wdE2JmxlqJvlSz1cTKk,3018
153
157
  gbdtransformation/brands/idtm/schema,sha256=TFrF4FR76cytcbtQkDWxtF74I0tCPRDIvWRFeqaJt6Q,3242
@@ -452,7 +456,7 @@ gbdtransformation/brands/wstm/tests/test.xml.gz,sha256=UKm7LTvKaETUtHMKurFGqkqXO
452
456
  gbdtransformation/brands/xxxx/__init__.py,sha256=fricc3VHm4BwGRFKIIqB0t-NtP3tTVRrEYee_gWpiFo,172
453
457
  gbdtransformation/brands/xxxx/filters.py,sha256=YCaQ6yH2LINwCQvbPHDhnORQyWglbswLlSOY6ur3KXQ,1874
454
458
  gbdtransformation/brands/xxxx/schema,sha256=g_oWkd7k2e5fAQR1BdNkPSsIgP3dkTyc7esWo_UOHQA,163
455
- gbdtransformation/brands/xxxx/template.yml,sha256=asJd5FHB2g5mfneMMqIkTSR9w3w-AUROnO6YgTyaR00,4665
459
+ gbdtransformation/brands/xxxx/template.yml,sha256=sNeTm0K7DCulgbWWgeV_5gsf9IMsyB5HDTifx6Bl4pI,5518
456
460
  gbdtransformation/brands/zmtm/__init__.py,sha256=Mtsi_-CaLQirHkhnletNhJ4li-pZlzEZMcKjv6mEk50,256
457
461
  gbdtransformation/brands/zmtm/filters.py,sha256=FkGfv3nPiYDUy97O7bDzPp824qoDsqX-oh2Ox01NTpA,2344
458
462
  gbdtransformation/brands/zmtm/schema,sha256=TFrF4FR76cytcbtQkDWxtF74I0tCPRDIvWRFeqaJt6Q,3242
@@ -464,7 +468,7 @@ gbdtransformation/brands/zwtm/schema,sha256=TFrF4FR76cytcbtQkDWxtF74I0tCPRDIvWRF
464
468
  gbdtransformation/brands/zwtm/template.yml,sha256=PO7s1HDQM9ushIJuIX3z_dfWO-f62YDzBG_sYKDlnG8,34
465
469
  gbdtransformation/brands/zwtm/tests/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
466
470
  gbdtransformation/common/__init__.py,sha256=D8Pro2OHR868UAos_APlN1LhUPWMyIDXmPxP81n3HTw,12644
467
- gbdtransformation/common/filters.py,sha256=1V02GK5d1tPmUVEiwZXzvc0eu4nSB9qItusUWGkobsw,10522
471
+ gbdtransformation/common/filters.py,sha256=IRaUD7dCP-29VYrZ0Ea_YF2gesdKrLRDjPoHlXUb-PA,10845
468
472
  gbdtransformation/common/navigation.tmpl,sha256=EZtsUnfh8B1V2WzHZjH3ZRZ9c9WpCVpWYsxLhGg9-fw,346
469
473
  gbdtransformation/common/jpap/__init__.py,sha256=0zpD6c5XcsLqKBLRVgRUSImZrCQMgtYv9Na0lNV9CzU,16
470
474
  gbdtransformation/common/jpap/filters.py,sha256=78tglb02rkiOvGn-DipzrBpkFsmYF8pKOIan6j99QWs,2209
@@ -476,12 +480,13 @@ gbdtransformation/common/jprp/__init__.py,sha256=0zpD6c5XcsLqKBLRVgRUSImZrCQMgtY
476
480
  gbdtransformation/common/jprp/filters.py,sha256=89NR8ZgekoeGnRfhPkXjzasDfWLolsGs7rpcT_BSANc,2234
477
481
  gbdtransformation/common/jprp/template.yml,sha256=cgPMMyQouaGTW-AzWCNlWcMDY8S6CbJCd9w-SyT1uds,1459
478
482
  gbdtransformation/commons/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
483
+ gbdtransformation/commons/filters.py,sha256=_wBT4MmbFKgs2fTaom03BzAIdfW4NAn_KQHZQKe-EKc,117
479
484
  gbdtransformation/commons/emap/__init__.py,sha256=LPq1qlU4nPGFyKPsgKWZG9K2mV4vWR1OAZ1OGWH-NjU,16
480
- gbdtransformation/commons/emap/filters.py,sha256=CA7FRKxuhP1QVlB7hh6uIf7EVBXr1MkJ_NKAaP7nqBo,68
481
- gbdtransformation/commons/emap/template.yml,sha256=acb3nyjhNFSZa89KjIwrAhcc7Em2MrgjPgkvy-nBnYo,1308
485
+ gbdtransformation/commons/emap/filters.py,sha256=FEJq2StQdWXxAieruwv2p7W0W8DYcIrmzllmX0J0tpo,456
486
+ gbdtransformation/commons/emap/template.yml,sha256=nSYD6hEn-8FDSprvBjMVn0IS_1stJO4gg4zqLqfmfw4,2884
482
487
  gbdtransformation/commons/emrp/__init__.py,sha256=LPq1qlU4nPGFyKPsgKWZG9K2mV4vWR1OAZ1OGWH-NjU,16
483
- gbdtransformation/commons/emrp/filters.py,sha256=CA7FRKxuhP1QVlB7hh6uIf7EVBXr1MkJ_NKAaP7nqBo,68
484
- gbdtransformation/commons/emrp/template.yml,sha256=Zor0npqNLZfY9oFs7Ts-bwbsLlUJGmZMHi1cb35MQmI,1402
488
+ gbdtransformation/commons/emrp/filters.py,sha256=qZalQj8Ev0Hn-Sy_RAPVOUoVG4Z2eVp08prShSRFzvc,454
489
+ gbdtransformation/commons/emrp/template.yml,sha256=bo6dfXKM-isbuZekWBvrKJ5cZ3t97oleEYSK3JoHHbQ,3076
485
490
  gbdtransformation/designs/__init__.py,sha256=0zM_Nw5d8cwxBsFq0NMxBRb21DiOUqgCb020CGJN_KY,242
486
491
  gbdtransformation/designs/filters.py,sha256=cFXAVGynjZjd5IX1CisEAfVhNLCMIZiu3xz1RUsX3zw,2584
487
492
  gbdtransformation/designs/alid/__init__.py,sha256=U1i1Qng034s7l_2No1yJKbHvUSnMWl66ZLSinKMMS7Y,95
@@ -579,9 +584,9 @@ gbdtransformation/utilities/st66.xsd,sha256=co8aFN3a5TpudllRttWmfLeiZu8ulNipfeXm
579
584
  schemas/ShazamConfig.py,sha256=D67os5B11C41h_WZ7kk54Ss0Kk7tHh8W0d_1c_aX-lY,1191
580
585
  schemas/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
581
586
  schemas/schema_extractor.py,sha256=3-ImtnI777f6b3VA0A_w-NoXdlGz5VZMzK6MnPdQQAY,10294
582
- wipo_gbd_transformation-1.1.60.dist-info/LICENSE.md,sha256=6r2dL13EwZqSt2ellLbJRFTA-6ECIDOer4YthCfkac0,35654
583
- wipo_gbd_transformation-1.1.60.dist-info/METADATA,sha256=7iqsd2Pnis4i0u0NUVK4b9cETsQaV7HB91EKdWxwCMI,577
584
- wipo_gbd_transformation-1.1.60.dist-info/WHEEL,sha256=oiQVh_5PnQM0E3gPdiz09WCNmwiHDMaGer_elqB3coM,92
585
- wipo_gbd_transformation-1.1.60.dist-info/entry_points.txt,sha256=NFLtlP3mPHUi-hEoUcz4CXa7vcpP8bbwd18HS4arbEk,223
586
- wipo_gbd_transformation-1.1.60.dist-info/top_level.txt,sha256=oU1j-JNLga18Fd-EV6Xl9wM8zxYoNVEzb7P8MDhTPJg,26
587
- wipo_gbd_transformation-1.1.60.dist-info/RECORD,,
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,,