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

Files changed (54) hide show
  1. gbdtransformation/.DS_Store +0 -0
  2. gbdtransformation/brands/brtm/filters.py +66 -3
  3. gbdtransformation/brands/brtm/template.yml +21 -0
  4. gbdtransformation/brands/emtm/filters.py +1 -1
  5. gbdtransformation/brands/estm/filters.py +4 -3
  6. gbdtransformation/brands/estm/template.yml +1 -1
  7. gbdtransformation/brands/filters.py +7 -2
  8. gbdtransformation/brands/gbtm/filters.py +10 -3
  9. gbdtransformation/brands/gbtm/template.yml +3 -3
  10. gbdtransformation/brands/ipas/filters.py +10 -1
  11. gbdtransformation/brands/ipas/template.yml +9 -2
  12. gbdtransformation/brands/mctm/filters.py +1 -1
  13. gbdtransformation/brands/rotm/__init__.py +3 -0
  14. gbdtransformation/brands/rotm/filters.py +82 -0
  15. gbdtransformation/brands/rotm/schema +128 -0
  16. gbdtransformation/brands/rotm/template.yml +121 -0
  17. gbdtransformation/brands/rutm/__init__.py +1 -0
  18. gbdtransformation/brands/rutm/filters.py +26 -23
  19. gbdtransformation/brands/rutm/template.yml +38 -33
  20. gbdtransformation/brands/sgtm/filters.py +1 -1
  21. gbdtransformation/brands/sttm/__init__.py +16 -0
  22. gbdtransformation/brands/sttm/filters.py +70 -0
  23. gbdtransformation/brands/sttm/schema +83 -0
  24. gbdtransformation/brands/sttm/template.yml +1 -0
  25. gbdtransformation/brands/sttm/tests/__init__.py +0 -0
  26. gbdtransformation/brands/ustm/filters.py +1 -3
  27. gbdtransformation/brands/vntm/__init__.py +2 -1
  28. gbdtransformation/brands/vntm/filters.py +14 -6
  29. gbdtransformation/brands/xxtm/__init__.py +2 -0
  30. gbdtransformation/brands/xxtm/filters.py +60 -0
  31. gbdtransformation/brands/xxtm/schema +4 -0
  32. gbdtransformation/brands/xxtm/template.yml +183 -0
  33. gbdtransformation/common/filters.py +9 -3
  34. gbdtransformation/designs/alid/__init__.py +5 -0
  35. gbdtransformation/designs/alid/filters.py +56 -0
  36. gbdtransformation/designs/alid/schema +89 -0
  37. gbdtransformation/designs/alid/template.yml +1 -0
  38. gbdtransformation/designs/bnid/__init__.py +5 -0
  39. gbdtransformation/designs/bnid/filters.py +57 -0
  40. gbdtransformation/designs/bnid/schema +80 -0
  41. gbdtransformation/designs/bnid/template.yml +1 -0
  42. gbdtransformation/designs/ipas/__init__.py +0 -0
  43. gbdtransformation/designs/ipas/filters.py +99 -0
  44. gbdtransformation/designs/ipas/template.yml +163 -0
  45. gbdtransformation/designs/xxid/__init__.py +2 -0
  46. gbdtransformation/designs/xxid/filters.py +60 -0
  47. gbdtransformation/designs/xxid/schema +4 -0
  48. gbdtransformation/designs/xxid/template.yml +146 -0
  49. {wipo_gbd_transformation-1.1.35.dist-info → wipo_gbd_transformation-1.1.37.dist-info}/METADATA +1 -4
  50. {wipo_gbd_transformation-1.1.35.dist-info → wipo_gbd_transformation-1.1.37.dist-info}/RECORD +54 -25
  51. {wipo_gbd_transformation-1.1.35.dist-info → wipo_gbd_transformation-1.1.37.dist-info}/WHEEL +1 -1
  52. {wipo_gbd_transformation-1.1.35.dist-info → wipo_gbd_transformation-1.1.37.dist-info}/entry_points.txt +0 -1
  53. {wipo_gbd_transformation-1.1.35.dist-info → wipo_gbd_transformation-1.1.37.dist-info}/top_level.txt +0 -0
  54. {wipo_gbd_transformation-1.1.35.dist-info → wipo_gbd_transformation-1.1.37.dist-info}/LICENSE.md +0 -0
@@ -0,0 +1,121 @@
1
+ {% from 'navigation.tmpl' import match %}
2
+ {% set TradeMark = Transaction.TradeMarkTransactionBody.TransactionContentDetails.TransactionData.TradeMarkDetails.TradeMark %}
3
+
4
+ {% set status = TradeMark.MarkCurrentStatusCode | translate_status %}
5
+ type: TRADEMARK
6
+ kind: {{ TradeMark.KindMark | translate_kind }}
7
+ st13: {{ TradeMark.ApplicationNumber | st13('RO', appdate=TradeMark.ApplicationDate) }}
8
+ gbdStatus: {{ status }}
9
+ markFeature: {{ TradeMark.MarkFeature | translate_feature }}
10
+ registrationOfficeCode: RO
11
+ designatedCountries:
12
+ - RO
13
+ applicationNumber: {{ TradeMark.ApplicationNumber }}
14
+ applicationDate: {{ TradeMark.ApplicationDate | convertdate('%Y-%m-%d') }}
15
+ registrationNumber: {{ TradeMark.RegistrationNumber}}
16
+ registrationDate: {{ TradeMark.RegistrationDate }}
17
+ applicationLanguageCode: 'ro'
18
+ officeStatus: {{ TradeMark.MarkCurrentStatusCode }}
19
+ statusDate: {{ TradeMark.MarkCurrentStatusDate | convertdate('%Y-%m-%d') }}
20
+ expiryDate: {{ TradeMark.ExpiryDate }}
21
+ {% if status == 'Ended' %}
22
+ terminationDate: {{ TradeMark.MarkCurrentStatusDate }}
23
+ {% endif %}
24
+ markDisclaimerDetails:
25
+ {% call(desc) match('MarkDisclaimerDetails.MarkDisclaimer', TradeMark) %}
26
+ - text: {{ desc }}
27
+ languageCode: {{ desc | guess_language('ro') }}
28
+ {% endcall %}
29
+ wordMarkSpecification:
30
+ markVerbalElement:
31
+ {% call(desc) match('WordMarkSpecification.MarkVerbalElementText', TradeMark) %}
32
+ - text: {{ desc }}
33
+ languageCode: {{ desc | guess_language('ro') }}
34
+ {% endcall %}
35
+ markImageDetails:
36
+ {% call(img) match('MarkImageDetails.MarkImage', TradeMark) %}
37
+ - name: {{ img.MarkImageFilename }}
38
+ colourIndicator: {{ img.MarkImageColourClaimedText | get_true_or_false }}
39
+ colourClaimed:
40
+ {% call(desc) match('MarkImageColourClaimedText', img) %}
41
+ - text: {{ desc }}
42
+ languageCode: {{ desc | guess_language(desc._languageCode, 'ro') }}
43
+ {% endcall %}
44
+ classification:
45
+ kind: Vienna
46
+ version: {{ ASK_THE_OFFICE }}
47
+ code:
48
+ {% call(code) match('MarkImageCategory.CategoryCodeDetails.CategoryCode', img) %}
49
+ - {{ code }}
50
+ {% endcall %}
51
+ {% endcall %}
52
+
53
+ {% call(nc_gs) match('GoodsServicesDetails.GoodsServices', TradeMark) %}
54
+ goodsServicesClassification:
55
+ kind: Nice
56
+ version: {{ ASK_THE_OFFICE }}
57
+ class:
58
+ {% call(nice) match('ClassDescriptionDetails.ClassDescription', nc_gs) %}
59
+ - code: {{ nice.ClassNumber | int }}
60
+ terms:
61
+ {% if nice.GoodsServicesDescription | has_value %}
62
+ {% call(desc) match('GoodsServicesDescription', nice) %}
63
+ {{ desc | guess_language(desc._languageCode, 'ro') | field_name }}:
64
+ {% for gsline in desc | remove_trailing('.') | split_terms %}
65
+ - {{ gsline | lower }}
66
+ {% endfor %}
67
+ {% endcall %}
68
+ {% endif %}
69
+ {% endcall %}
70
+ {% endcall %}
71
+
72
+ priorities:
73
+ {% call(priority) match('PriorityDetails.Priority', TradeMark) %}
74
+ - countryCode: {{ priority.PriorityCountryCode }}
75
+ number: {{ priority.PriorityNumber }}
76
+ date: {{ priority.PriorityDate }}
77
+ {% endcall %}
78
+
79
+ publications:
80
+ {% call(publication) match('PublicationDetails.Publication', TradeMark) %}
81
+ - identifier: {{ publication.PublicationIdentifier }}
82
+ section: {{ publication.PublicationSection }}
83
+ {% endcall %}
84
+
85
+ applicants:
86
+ {% call(Applicant) match('ApplicantDetails.Applicant', TradeMark) %}
87
+ - identifier: {{ Applicant.ApplicantIdentifier }}
88
+ {% call(nameline) match('FormattedNameAddress.Name.FormattedName', Applicant.ApplicantAddressBook) %}
89
+ fullName:
90
+ - text: {{ nameline | get_entity_name }}
91
+ languageCode: {{ nameline | guess_language('ro') }}
92
+ {% endcall %}
93
+ fullAddress:
94
+ {% call(adrline) match('FormattedNameAddress.Address.FormattedAddress', Applicant.ApplicantAddressBook) %}
95
+ - text: {{ adrline | get_entity_addr}}
96
+ languageCode: {{ adrline | get_entity_addr | guess_language('ro') }}
97
+ {% endcall %}
98
+ {% call(adrline) match('FormattedNameAddress.Address', Applicant.ApplicantAddressBook) %}
99
+ countryCode: {{ adrline.AddressCountryCode }}
100
+ {% endcall %}
101
+ {% endcall %}
102
+ representatives:
103
+ {% call(Representative) match('RepresentativeDetails.Representative', TradeMark) %}
104
+ - identifier: {{ Representative.RepresentativeIdentifier }}
105
+ {% call(nameline) match('FormattedNameAddress.Name.FormattedName', Representative.RepresentativeAddressBook) %}
106
+ kind: {{ nameline | get_entity_kind}}
107
+ fullName:
108
+ - text: {{ nameline | get_entity_name}}
109
+ languageCode: {{ nameline | get_entity_name | guess_language('ro') }}
110
+ {% endcall %}
111
+ fullAddress:
112
+ {% call(adrline) match('FormattedNameAddress.Address.FormattedAddress', Representative.RepresentativeAddressBook) %}
113
+ - text: {{ adrline | get_entity_addr}}
114
+ languageCode: {{ adrline | get_entity_addr | guess_language('ro') }}
115
+ {% endcall %}
116
+ {% call(adrline) match('FormattedNameAddress.Address', Representative.RepresentativeAddressBook) %}
117
+ countryCode: {{ adrline.AddressCountryCode }}
118
+ {% endcall %}
119
+ {% endcall %}
120
+ extra:
121
+ id: {{ TradeMark.ID }}
@@ -2,6 +2,7 @@
2
2
  render = 'JSON'
3
3
  source = 'national'
4
4
 
5
+
5
6
  # 201302148
6
7
  # 95711885
7
8
  # 141807
@@ -1,5 +1,9 @@
1
1
  # namespaces defined in XML and to be ignored in procecssing
2
- ignore_namespace = []
2
+ ignore_namespace = [
3
+ 'http://www.wipo.int/standards/XMLSchema/ST96/Common',
4
+ 'http://www.wipo.int/standards/XMLSchema/ST96/Trademark',
5
+ 'urn:ru:rupto:trademark'
6
+ ]
3
7
 
4
8
 
5
9
  # -------------------------------------------------------------
@@ -7,11 +11,10 @@ ignore_namespace = []
7
11
  # translate values from office interpretation to gbd equivalent
8
12
  # -------------------------------------------------------------
9
13
  def translate_kind(kind):
10
- if not kind: return ['Individual']
11
14
 
12
- if kind == 'Individual': return ['Individual']
13
- if kind == 'Collective': return ['Collective']
14
- if kind == 'Certificate': return ['Certificate']
15
+ if kind == 'Trademark': return ['Individual']
16
+ if kind == 'Collective trademark ': return ['Collective']
17
+ if kind == 'Certification mark ': return ['Certificate']
15
18
 
16
19
  raise Exception('kind "%s" is not mapped.' % kind)
17
20
 
@@ -31,15 +34,12 @@ def get_path(path, data):
31
34
 
32
35
 
33
36
  def get_trademark(data):
34
- if data.TradeMarkDetails:
35
- if isinstance(data.TradeMarkDetails.TradeMark, list):
36
- trademark = data.TradeMarkDetails.TradeMark[0]
37
- for transaction in data.TradeMarkDetails.TradeMark[1:]:
38
- trademark.update(transaction)
39
- else:
40
- trademark = data.TradeMarkDetails.TradeMark
37
+ if data.TrademarkBag:
38
+ trademark = data.TrademarkBag.Trademark
41
39
  status = 'Registered'
42
- if get_path('MarkRecordDetails.MarkRecord[-1].BasicRecord.BasicRecordKind', trademark) == 'Non Renewal':
40
+ if get_path('MarkRecordBag.MarkRecord[-1].BasicRecord.BasicRecordKind', trademark) == 'Non Renewal':
41
+ et_path('MarkRepresentation.MarkReproduction.MarkImageBag.MarkImage.ImageFileName', trademark)
42
+ print("expired for %s" % trademark.ApplicationNumber.ApplicationNumberText)
43
43
  status = 'Expired'
44
44
  return trademark, status
45
45
  if data.TradeMarkApplication:
@@ -51,10 +51,10 @@ def get_termination(value, gbd_status):
51
51
  return value
52
52
  return None
53
53
 
54
- def translate_feature(feature):
55
- if not feature: return 'Undefined'
56
-
57
- if feature == '3-D': return 'Three dimensional'
54
+ def translate_feature(trademark):
55
+ feature = get_path('MarkRepresentation.MarkFeatureCategory',
56
+ trademark)
57
+ if feature == 'Three dimensional': return 'Three dimensional'
58
58
  if feature == 'Hologram': return 'Hologram'
59
59
  if feature == 'Colour': return 'Colour'
60
60
  if feature == 'Sound': return 'Sound'
@@ -64,11 +64,14 @@ def translate_feature(feature):
64
64
  # the office wild card. bof
65
65
  if feature == 'Other': return 'Other'
66
66
 
67
- # has_word = get_path('WordMarkSpecification.MarkSignificantVerbalElement', trademark)
68
- # has_figure = get_path('MarkImageDetails.MarkImage.MarkImageFilename', trademark)
69
-
70
- # if has_word and has_figure: return 'Combined'
71
- # elif has_word: return 'Word'
72
- # elif has_figure: return 'Figurative'
67
+ has_word = get_path('MarkRepresentation.MarkReproduction.WordMarkSpecification.MarkSignificantVerbalElementText',
68
+ trademark)
69
+ has_figure = get_path('MarkRepresentation.MarkReproduction.MarkImageBag.MarkImage.ImageFileName', trademark)
70
+ if has_word and has_figure:
71
+ return 'Combined'
72
+ elif has_word:
73
+ return 'Word'
74
+ elif has_figure:
75
+ return 'Figurative'
73
76
 
74
77
  raise Exception('Feature "%s" unmapped' % feature)
@@ -1,39 +1,41 @@
1
1
  {% from 'navigation.tmpl' import match %}
2
- {% set TradeMark, status = Transaction.TradeMarkTransactionBody.TransactionContentDetails.TransactionData | get_trademark %}
2
+ {% set TradeMark, status = TrademarkTransaction.TrademarkTransactionBody.TransactionContentBag.TransactionData | get_trademark %}
3
3
 
4
4
  type: TRADEMARK
5
- kind: {{ TradeMark.KindMark | translate_kind }}
6
- st13: {{ TradeMark.ApplicationNumber | st13('RU', appdate=TradeMark.ApplicationDate) }}
5
+ kind: {{ TradeMark.MarkCategory | translate_kind }}
6
+ st13: {{ TradeMark.ApplicationNumber.ApplicationNumberText | st13('RU', appdate=TradeMark.ApplicationDate) }}
7
7
  gbdStatus: {{ status }}
8
8
  officeStatus: {{ status }}
9
- markFeature: {{ TradeMark.MarkFeature | translate_feature }}
9
+ markFeature: {{ TradeMark | translate_feature }}
10
10
  registrationOfficeCode: {{ TradeMark.RegistrationOfficeCode }}
11
11
  designatedCountries:
12
12
  - {{ TradeMark.RegistrationOfficeCode }}
13
13
  applicationLanguageCode: 'ru'
14
- applicationNumber: {{ TradeMark.ApplicationNumber }}
14
+ applicationNumber: {{ TradeMark.ApplicationNumber.ApplicationNumberText }}
15
15
  applicationDate: {{ TradeMark.ApplicationDate | convertdate('%Y-%m-%d') }}
16
16
  registrationNumber: {{ TradeMark.RegistrationNumber }}
17
17
  registrationDate: {{ TradeMark.RegistrationDate }}
18
+ expiryDate: {{ TradeMark.ExpiryDate | convertdate('%Y-%m-%d') }}
19
+
18
20
  markDisclaimerDetails:
19
- {% call(desc) match('MarkDisclaimerDetails.MarkDisclaimer', TradeMark) %}
21
+ {% call(desc) match('MarkDisclaimerBag.MarkDisclaimerText', TradeMark) %}
20
22
  - text: {{ desc }}
21
23
  languageCode: {{ desc | guess_language(TradeMark.ApplicationLanguageCode, 'ru') }}
22
24
  {% endcall %}
23
25
  markDescriptionDetails:
24
- {% call(desc) match('MarkDescriptionDetails.MarkDescription', TradeMark) %}
26
+ {% call(desc) match('MarkDescriptionBag.MarkDescriptionText', TradeMark) %}
25
27
  - text: {{ desc }}
26
28
  languageCode: {{ desc | guess_language(TradeMark.ApplicationLanguageCode, 'ru') }}
27
29
  {% endcall %}
28
30
  wordMarkSpecification:
29
31
  markVerbalElement:
30
- {% call(desc) match('WordMarkSpecification.MarkSignificantVerbalElement', TradeMark) %}
32
+ {% call(desc) match('MarkRepresentation.MarkReproduction.WordMarkSpecification.MarkSignificantVerbalElementText', TradeMark) %}
31
33
  - text: {{ desc }}
32
- languageCode: {{ desc | guess_language('ru') }}
34
+ languageCode: {{ desc | guess_language(TradeMark.ApplicationLanguageCode, 'ru') }}
33
35
  {% endcall %}
34
36
  markImageDetails:
35
- {% call(img) match('MarkImageDetails.MarkImage', TradeMark) %}
36
- - name: {{ img.MarkImageFilename }}
37
+ {% call(img) match('MarkRepresentation.MarkReproduction.MarkImageBag.MarkImage', TradeMark) %}
38
+ - name: {{ img.ImageFileName }}
37
39
  colourIndicator: {{ img.MarkImageColourClaimedText | get_true_or_false }}
38
40
  colourClaimed:
39
41
  {% call(desc) match('MarkImageColourClaimedText', img) %}
@@ -42,16 +44,15 @@ markImageDetails:
42
44
  {% endcall %}
43
45
  {% endcall %}
44
46
 
45
- {% call(nc_gs) match('GoodsServicesDetails.GoodsServices', TradeMark) %}
47
+ {% call(nc_gs) match('GoodsServicesBag.GoodsServices.ClassDescriptionBag', TradeMark) %}
46
48
  goodsServicesClassification:
47
49
  kind: Nice
48
- version: {{ ASK_THE_OFFICE }}
49
50
  class:
50
- {% call(nice) match('ClassDescriptionDetails.ClassDescription', nc_gs) %}
51
+ {% call(nice) match('ClassDescription', nc_gs) %}
51
52
  - code: {{ nice.ClassNumber | int }}
52
53
  terms:
53
- {% if nice.GoodsServicesDescription | has_value %}
54
- {% call(desc) match('GoodsServicesDescription', nice) %}
54
+ {% if nice.GoodsServicesDescriptionText | has_value %}
55
+ {% call(desc) match('GoodsServicesDescriptionText', nice) %}
55
56
  ru:
56
57
  {% for gsline in desc | remove_trailing('.') | split_terms %}
57
58
  - {{ gsline | lower }}
@@ -61,39 +62,43 @@ goodsServicesClassification:
61
62
  {% endcall %}
62
63
  {% endcall %}
63
64
 
64
- {% call(unclassified) match('GoodsServicesDetails.GoodsServices.Comment', TradeMark) %}
65
- goodsServicesUnclassified:
66
- ru:
67
- - {{ unclassified }} #TODO sanitize
68
- {% endcall %}
69
-
70
65
  priorities:
71
- {% call(priority) match('PriorityDetails.Priority', TradeMark) %}
66
+ {% call(priority) match('PriorityBag.Priority', TradeMark) %}
72
67
  - countryCode: {{ priority.PriorityCountryCode }}
73
- number: {{ priority.PriorityNumber }}
74
- date: {{ priority.PriorityDate }}
68
+ number: {{ priority.ApplicationNumberText }}
69
+ date: {{ priority.PriorityRegistrationDate }}
75
70
  {% endcall %}
71
+
76
72
  publications:
77
- {% call(publication) match('PublicationDetails.Publication', TradeMark) %}
73
+ {% call(publication) match('RecordPublicationBag.RecordPublication', TradeMark) %}
78
74
  - identifier: {{ publication.PublicationIdentifier }}
79
75
  date: {{ publication.PublicationDate }}
80
- section: {{ publication.PublicationSection }}
81
76
  {% endcall %}
82
77
 
83
78
  applicants:
84
- {% call(Applicant) match('ApplicantDetails.Applicant', TradeMark) %}
85
- - identifier: {{ Applicant.ApplicationNumber }}
79
+ {% call(Applicant) match('ApplicantBag.Applicant', TradeMark) %}
80
+ - identifier: {{ Applicant.AssignmentIdentifier }}
81
+ fullName:
82
+ - text: {{ Applicant.LegalEntityName }}
83
+ languageCode: {{ Applicant.LegalEntityName | guess_language('ru') }}
86
84
  fullAddress:
87
- {% call(adrline) match('FreeFormatAddressDetails.FreeFormatNameAddressLine', Applicant.ApplicantAddressBook) %}
88
- - text: {{ adrline}}
85
+ {% call(adrline) match('Contact.PostalAddressBag.PostalAddress.PostalAddressText', Applicant) %}
86
+ - text: {{ adrline }}
89
87
  languageCode: {{ adrline | guess_language('ru') }}
88
+ countryCode: {{ Applicant.NationalityCode }}
89
+
90
90
  {% endcall %}
91
91
  {% endcall %}
92
92
 
93
93
  correspondence:
94
- {% call(corespondance) match('CorrespondenceAddress.CorrespondenceAddressBook', TradeMark) %}
94
+ {% call(corespondance) match('CorrespondenceAddress.Contact', TradeMark) %}
95
+ fullName:
96
+ {% call(adrline) match('Name.EntityName', corespondance) %}
97
+ - text: {{ adrline }}
98
+ languageCode: {{ adrline | guess_language('ru') }}
99
+ {% endcall %}
95
100
  fullAddress:
96
- {% call(adrline) match('FreeFormatAddressDetails.FreeFormatNameAddressLine', corespondance) %}
101
+ {% call(adrline) match('PostalAddressBag.PostalAddress.PostalAddressText', corespondance) %}
97
102
  - text: {{ adrline}}
98
103
  languageCode: {{ adrline | guess_language('ru') }}
99
104
  {% endcall %}
@@ -51,7 +51,7 @@ def translate_status(status, prev_status=''):
51
51
  if status == 'Expunged': return 'Expired'
52
52
  if status == 'Removed': return 'Expired'
53
53
  if status == 'Removed (Restoration Possible)': return 'Expired'
54
-
54
+ if status == 'Expired (Renewal Possible)': return 'Expired'
55
55
  raise Exception('status/prev_status "%s/%s" is not mapped.' % (status, prev_status))
56
56
 
57
57
  def translate_feature(trademark):
@@ -0,0 +1,16 @@
1
+ render = 'JSON'
2
+ source = 'national'
3
+
4
+ # TN/M/100/901864 # madrid
5
+ # TN/E/2002/001864 # etrangere
6
+ # TN/T/2019/001877 # local
7
+ # TN/S/2005/001886
8
+ appnum_mask = [ 'TN/(T|E|S|M)/\\d{4}/(\\d*)',
9
+ 'TN/(M)/100/(\\d*)',
10
+ '([A-D])/(M)/100/(\\d*)' ]
11
+
12
+ # 100/901864
13
+ # 2009/002484
14
+ # 001818
15
+ regnum_mask = [ '\\d*/(\\d*)',
16
+ '(\\d*)' ]
@@ -0,0 +1,70 @@
1
+ import gbdtransformation.brands.ipas.filters as ipas
2
+ import gbdtransformation.common.filters as commons
3
+
4
+ ignore_namespace = [
5
+ 'http://www.wipo.int/standards/XMLSchema/trademarks',
6
+ 'http://www.wipo.int/standards/XMLSchema/wo-trademarks']
7
+
8
+ def get_appdate(appdate, appnum):
9
+ return appnum.split('/')[-2].zfill(4)
10
+
11
+
12
+ def translate_type(header):
13
+ code = header.TransactionCode
14
+
15
+ if code == 'Madrid Trademark': return 'TRADEMARK'
16
+
17
+ raise Exception('Type "%s" is not mapped.' % code)
18
+
19
+ def translate_kind(trademark, header):
20
+ subcode = header.TransactionSubCode
21
+ if subcode == 'Madrid Protocol': return ['Individual']
22
+
23
+ raise Exception('Kind "%s" not mapped.' % subcode)
24
+
25
+ def translate_status(trademark):
26
+ status = trademark.MarkCurrentStatusCode
27
+
28
+ return ipas.translate_status(status)
29
+
30
+ def translate_feature(trademark):
31
+ feature = trademark.MarkFeature
32
+
33
+ return ipas.translate_feature(feature)
34
+
35
+ def translate_event(event):
36
+ return ipas.translate_event(event)
37
+
38
+ # ---------------------------------------
39
+ def verbal_lang_map(markVerbalElements, applang=None):
40
+ # print( ipas.verbal_lang_map(markVerbalElements, applang=applang))
41
+ return ipas.verbal_lang_map(markVerbalElements, applang=applang)
42
+
43
+ def get_registration_nb(trademark, tmstatus):
44
+ if trademark.RegistrationNumber:
45
+ return trademark.RegistrationNumber
46
+
47
+ if not tmstatus in ['Expired', 'Registered']:
48
+ return None
49
+
50
+ # a way to deduce the registration number
51
+ appnum_parts = trademark.ApplicationNumber.split('/')
52
+ regnum = '%s/%s' % (appnum_parts[-2], appnum_parts[-1])
53
+ return regnum
54
+
55
+ def get_expiry_date(trademark, tmstatus):
56
+ return ipas.get_expiry_date(trademark, tmstatus)
57
+
58
+ def get_registration_date(trademark, tmstatus):
59
+ return ipas.get_registration_date(trademark, tmstatus)
60
+
61
+ def is_international(header):
62
+ code = header.TransactionCode
63
+ return code == 'Marque Madrid'
64
+
65
+ # TN/M/100/673426
66
+ def get_ir_refnum(appnum):
67
+ return appnum.split('/')[-1]
68
+
69
+ def get_goods_services(goods_services):
70
+ return ipas.get_goods_services(goods_services)
@@ -0,0 +1,83 @@
1
+ /Transaction
2
+ __/TradeMarkTransactionBody
3
+ ____/TransactionContentDetails
4
+ ______/TransactionCode
5
+ ______/TransactionData
6
+ ________/TradeMarkApplication
7
+ __________/TradeMarkDetails
8
+ ____________/TradeMark
9
+ ______________/ApplicantDetails
10
+ ________________/Applicant
11
+ __________________/ApplicantAddressBook
12
+ ____________________/FormattedNameAddress
13
+ ______________________/Address
14
+ ________________________/AddressCountryCode
15
+ ________________________/FreeFormatAddress
16
+ __________________________/FreeFormatAddressLine
17
+ ______________________/Name
18
+ ________________________/FreeFormatName
19
+ __________________________/FreeFormatNameDetails
20
+ ____________________________/FreeFormatNameLine
21
+ ____________________________/FreeFormatNameLine[@languageCode=en]
22
+ ______________/ApplicationDate
23
+ ______________/ApplicationLanguageCode
24
+ ______________/ApplicationNumber
25
+ ______________/ExpiryDate
26
+ ______________/GoodsServicesDetails
27
+ ________________/GoodsServices
28
+ __________________/ClassDescriptionDetails
29
+ ____________________/ClassDescription
30
+ ______________________/ClassNumber
31
+ ______________________/GoodsServicesDescription
32
+ ______________________/GoodsServicesDescription[@languageCode=en]
33
+ ______________/MarkCurrentStatusCode
34
+ ______________/MarkCurrentStatusDate
35
+ ______________/MarkEventDetails
36
+ ________________/MarkEvent
37
+ __________________/MarkEventCode
38
+ __________________/MarkEventDate
39
+ __________________/OfficeSpecificMarkEventCode
40
+ __________________/OfficeSpecificMarkEventDescription
41
+ __________________/OfficeSpecificMarkEventDescription[@languageCode=en]
42
+ __________________/OfficeSpecificMarkEventName
43
+ ______________/MarkFeature
44
+ ______________/MarkImageDetails
45
+ ________________/MarkImage
46
+ __________________/MarkImageCategory
47
+ ____________________/CategoryCodeDetails
48
+ ______________________/CategoryCode
49
+ ____________________/CategoryKind
50
+ ____________________/CategoryVersion
51
+ __________________/MarkImageFileFormat
52
+ __________________/MarkImageFilename
53
+ ______________/PriorityDetails
54
+ ________________/Priority
55
+ __________________/PriorityCountryCode
56
+ __________________/PriorityDate
57
+ __________________/PriorityNumber
58
+ ______________/PublicationDetails
59
+ ________________/Publication
60
+ __________________/PublicationDate
61
+ __________________/PublicationIdentifier
62
+ ______________/RegistrationDate
63
+ ______________/RegistrationNumber
64
+ ______________/RegistrationOfficeCode
65
+ ______________/RepresentativeDetails
66
+ ________________/Representative
67
+ __________________/RepresentativeAddressBook
68
+ ____________________/FormattedNameAddress
69
+ ______________________/Address
70
+ ________________________/AddressCountryCode
71
+ ________________________/FreeFormatAddress
72
+ __________________________/FreeFormatAddressLine
73
+ ______________________/Name
74
+ ________________________/FreeFormatName
75
+ __________________________/FreeFormatNameDetails
76
+ ____________________________/FreeFormatNameLine
77
+ ____________________________/FreeFormatNameLine[@languageCode=en]
78
+ ______________/WordMarkSpecification
79
+ ________________/MarkVerbalElementText
80
+ ________________/MarkVerbalElementText[@languageCode=en]
81
+ ______/TransactionIdentifier
82
+ ______/TransactionSubCode
83
+
@@ -0,0 +1 @@
1
+ {% include "ipas/template.yml" %}
File without changes
@@ -147,7 +147,6 @@ def get_applicants(owners, status):
147
147
 
148
148
  if not isinstance(owners, list):
149
149
  owners = [owners]
150
-
151
150
  # look for owners
152
151
  if status in ['Registered', 'Expired']:
153
152
  cdl = 20 # code low
@@ -160,8 +159,7 @@ def get_applicants(owners, status):
160
159
  applicants = []
161
160
  for owner in owners:
162
161
  code = owner.partyType
163
-
164
- if cdl < int(code) <= cdh:
162
+ if cdl <= int(code) <= cdh:
165
163
  # get the address
166
164
  adrlines = []
167
165
  for i in range(1, 10):
@@ -1,5 +1,6 @@
1
1
  render = 'JSON'
2
2
  source = 'national'
3
3
 
4
+ default_lang = 'vi'
4
5
  # 4201911818
5
- appnum_mask = '4\\d{4}(\\d*)'
6
+ appnum_mask = '4-\\d{4}-(\\d*)'
@@ -5,7 +5,7 @@ ignore_namespace = [
5
5
  'http://www.wipo.int/standards/XMLSchema/wo-trademarks']
6
6
 
7
7
  def get_appdate(appdate, appnum):
8
- return appnum[1:5]
8
+ return appnum[2:6]
9
9
 
10
10
  def translate_type(header):
11
11
  code = header.TransactionCode
@@ -20,13 +20,20 @@ def translate_type(header):
20
20
 
21
21
  def translate_kind(trademark, header):
22
22
  kind = trademark.KindMark
23
-
23
+ if not kind:
24
+ return 'Individual'
24
25
  return ipas.translate_kind(kind)
25
26
 
26
27
  def translate_status(trademark):
27
- status = trademark.MarkCurrentStatusCode
28
+ value = trademark.MarkCurrentStatusCode
29
+ if value in ['Cấp bằng','Đang giải quyết', 'Từ chối']:
30
+ return ipas.translate_status('Pending')
31
+ elif value in ['Công bố']:
32
+ return ipas.translate_status('Active')
33
+ elif value in ['Hết hạn', 'Rút đơn']:
34
+ return ipas.translate_status("Expired")
28
35
 
29
- return ipas.translate_status(status)
36
+ raise Exception('Status "%s" is not mapped.' % value)
30
37
 
31
38
  def translate_feature(trademark):
32
39
  feature = trademark.MarkFeature
@@ -35,14 +42,15 @@ def translate_feature(trademark):
35
42
 
36
43
  def translate_event(event):
37
44
  if event == 'Notificationd': return 'Notification'
38
-
45
+ if not event:
46
+ return None
39
47
  return ipas.translate_event(event)
40
48
 
41
49
  # ---------------------------------------
42
50
 
43
51
  # TODO: all set to vi but some are english really
44
52
  # TODO: {'vi': ['NITRASA, hình']} (remove the hih)
45
- def verbal_lang_map(markVerbalElements, applang=None):
53
+ def verbal_lang_map(markVerbalElements, applang='vi'):
46
54
  # print( ipas.verbal_lang_map(markVerbalElements, applang=applang))
47
55
  return ipas.verbal_lang_map(markVerbalElements, applang=applang)
48
56
 
@@ -0,0 +1,2 @@
1
+ # instruction to render the output to JSON format
2
+ render = 'JSON'