wipo-gbd-transformation 1.1.52__py3-none-any.whl → 1.1.54__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.
- gbdtransformation/brands/catm/filters.py +2 -1
- gbdtransformation/brands/catm/template.yml +9 -5
- gbdtransformation/brands/istm/filters.py +1 -2
- gbdtransformation/brands/vctm/__init__.py +5 -0
- gbdtransformation/brands/vctm/filters.py +75 -0
- gbdtransformation/brands/vctm/schema +87 -0
- gbdtransformation/brands/vctm/template.yml +1 -0
- gbdtransformation/brands/vctm/tests/__init__.py +0 -0
- gbdtransformation/brands/vntm/filters.py +1 -3
- gbdtransformation/designs/alid/filters.py +13 -1
- gbdtransformation/designs/bgid/__init__.py +5 -0
- gbdtransformation/designs/bgid/filters.py +91 -0
- gbdtransformation/designs/bgid/schema +106 -0
- gbdtransformation/designs/bgid/template.yml +169 -0
- gbdtransformation/designs/bnid/filters.py +13 -1
- gbdtransformation/designs/bwid/filters.py +13 -1
- gbdtransformation/designs/crid/filters.py +14 -1
- gbdtransformation/designs/cuid/filters.py +14 -1
- gbdtransformation/designs/egid/filters.py +14 -1
- gbdtransformation/designs/filters.py +10 -3
- gbdtransformation/designs/idid/filters.py +14 -1
- gbdtransformation/designs/ipas/filters.py +83 -0
- gbdtransformation/designs/ipas/template.yml +15 -15
- gbdtransformation/designs/joid/filters.py +14 -1
- gbdtransformation/designs/keid/filters.py +14 -1
- gbdtransformation/designs/khid/filters.py +14 -1
- gbdtransformation/designs/laid/filters.py +13 -1
- gbdtransformation/designs/mnid/filters.py +14 -1
- gbdtransformation/designs/myid/filters.py +13 -1
- gbdtransformation/designs/phid/filters.py +13 -1
- gbdtransformation/designs/sgid/filters.py +14 -1
- gbdtransformation/designs/thid/filters.py +13 -1
- gbdtransformation/designs/tnid/filters.py +13 -1
- gbdtransformation/designs/vnid/filters.py +13 -1
- gbdtransformation/designs/woid/filters.py +37 -16
- gbdtransformation/designs/woid/template.yml +177 -3
- gbdtransformation/designs/xxid/template.yml +128 -6
- gbdtransformation/execs.py +3 -2
- {wipo_gbd_transformation-1.1.52.dist-info → wipo_gbd_transformation-1.1.54.dist-info}/METADATA +3 -3
- {wipo_gbd_transformation-1.1.52.dist-info → wipo_gbd_transformation-1.1.54.dist-info}/RECORD +45 -35
- wipo_gbd_transformation-1.1.54.dist-info/SOURCES_Stefans-Mac-Studio.local_Sep-18-063455-2024_Conflict.txt +690 -0
- {wipo_gbd_transformation-1.1.52.dist-info → wipo_gbd_transformation-1.1.54.dist-info}/WHEEL +1 -1
- {wipo_gbd_transformation-1.1.52.dist-info → wipo_gbd_transformation-1.1.54.dist-info}/LICENSE.md +0 -0
- {wipo_gbd_transformation-1.1.52.dist-info → wipo_gbd_transformation-1.1.54.dist-info}/entry_points.txt +0 -0
- {wipo_gbd_transformation-1.1.52.dist-info → wipo_gbd_transformation-1.1.54.dist-info}/top_level.txt +0 -0
|
@@ -44,4 +44,17 @@ def is_international(header):
|
|
|
44
44
|
return False
|
|
45
45
|
|
|
46
46
|
def get_ir_refnum(appnum):
|
|
47
|
-
return appnum
|
|
47
|
+
return appnum
|
|
48
|
+
|
|
49
|
+
def select_earliest_date(publications):
|
|
50
|
+
return ipas.select_earliest_date(publications)
|
|
51
|
+
|
|
52
|
+
def deduplicate_publication_dates(publications):
|
|
53
|
+
return ipas.deduplicate_publication_dates(publications)
|
|
54
|
+
|
|
55
|
+
def deduplicate_classes(classes):
|
|
56
|
+
return ipas.deduplicate_classes(classes)
|
|
57
|
+
|
|
58
|
+
def deduplicate_publications(publications):
|
|
59
|
+
return ipas.deduplicate_publications(publications)
|
|
60
|
+
|
|
@@ -46,4 +46,17 @@ def is_international(header):
|
|
|
46
46
|
return False
|
|
47
47
|
|
|
48
48
|
def get_ir_refnum(appnum):
|
|
49
|
-
return appnum
|
|
49
|
+
return appnum
|
|
50
|
+
|
|
51
|
+
def select_earliest_date(publications):
|
|
52
|
+
return ipas.select_earliest_date(publications)
|
|
53
|
+
|
|
54
|
+
def deduplicate_publication_dates(publications):
|
|
55
|
+
return ipas.deduplicate_publication_dates(publications)
|
|
56
|
+
|
|
57
|
+
def deduplicate_classes(classes):
|
|
58
|
+
return ipas.deduplicate_classes(classes)
|
|
59
|
+
|
|
60
|
+
def deduplicate_publications(publications):
|
|
61
|
+
return ipas.deduplicate_publications(publications)
|
|
62
|
+
|
|
@@ -18,9 +18,16 @@ def should_display_language(lang, payload):
|
|
|
18
18
|
return lang
|
|
19
19
|
return None
|
|
20
20
|
|
|
21
|
-
def st13(appnum, office, pos, type='Design', appdate=None, roffice=None, sanitize=True):
|
|
21
|
+
def st13(appnum, registration_number, office, pos, type='Design', appdate=None, roffice=None, sanitize=True):
|
|
22
22
|
if not appnum:
|
|
23
|
-
|
|
23
|
+
# fallback to registration number (required for example by Hague pre-1999 records, which have no application number)
|
|
24
|
+
if registration_number:
|
|
25
|
+
# remove non digit prefix (we want to keep non digit char at the end of the registration number, to distinguish
|
|
26
|
+
# non unitary registration numbers from the same application, e.g. D054966 and D054966A)
|
|
27
|
+
registration_number = re.sub(r"^[^0-9]+", '', registration_number)
|
|
28
|
+
appnum = 'R' + registration_number
|
|
29
|
+
else:
|
|
30
|
+
return None
|
|
24
31
|
# collections are usually office code followed with tm: xxtm
|
|
25
32
|
collection = '%sid' % office.lower()
|
|
26
33
|
|
|
@@ -63,4 +70,4 @@ def st13(appnum, office, pos, type='Design', appdate=None, roffice=None, sanitiz
|
|
|
63
70
|
st13 = '%s%s' % (st13, appdate[:4])
|
|
64
71
|
|
|
65
72
|
# add application number and zfill till 17
|
|
66
|
-
return '%s%s
|
|
73
|
+
return '%s%s' % (st13, appnum.zfill(17 - len(st13)))
|
|
@@ -51,4 +51,17 @@ def is_international(header):
|
|
|
51
51
|
return False
|
|
52
52
|
|
|
53
53
|
def get_ir_refnum(appnum):
|
|
54
|
-
return appnum
|
|
54
|
+
return appnum
|
|
55
|
+
|
|
56
|
+
def select_earliest_date(publications):
|
|
57
|
+
return ipas.select_earliest_date(publications)
|
|
58
|
+
|
|
59
|
+
def deduplicate_publication_dates(publications):
|
|
60
|
+
return ipas.deduplicate_publication_dates(publications)
|
|
61
|
+
|
|
62
|
+
def deduplicate_classes(classes):
|
|
63
|
+
return ipas.deduplicate_classes(classes)
|
|
64
|
+
|
|
65
|
+
def deduplicate_publications(publications):
|
|
66
|
+
return ipas.deduplicate_publications(publications)
|
|
67
|
+
|
|
@@ -64,6 +64,89 @@ def get_registration_date(trademark, tmstatus):
|
|
|
64
64
|
if event.MarkEventCode == 'Published':
|
|
65
65
|
return event.MarkEventDate
|
|
66
66
|
|
|
67
|
+
# given a list of dates as strings, e.g. publication dates, deduplicate
|
|
68
|
+
def deduplicate_dates(dates):
|
|
69
|
+
return list(set(dates))
|
|
70
|
+
|
|
71
|
+
# given a list of publications, deduplicate
|
|
72
|
+
def deduplicate_publication_dates(design):
|
|
73
|
+
if design == None:
|
|
74
|
+
return None
|
|
75
|
+
dates = []
|
|
76
|
+
if "PublicationDetails" in design:
|
|
77
|
+
publicationDetails = design["PublicationDetails"]
|
|
78
|
+
publications = publicationDetails.get('Publication', [])
|
|
79
|
+
if not isinstance(publications, list):
|
|
80
|
+
publications = [publications]
|
|
81
|
+
for publication in publications:
|
|
82
|
+
if "PublicationDate" in publication:
|
|
83
|
+
dates.append(publication["PublicationDate"])
|
|
84
|
+
return deduplicate_dates(dates)
|
|
85
|
+
|
|
86
|
+
# given a list of classes, deduplicate
|
|
87
|
+
def deduplicate_classes(classes):
|
|
88
|
+
deduplicate_classes = []
|
|
89
|
+
if not isinstance(classes, list):
|
|
90
|
+
classes = [classes]
|
|
91
|
+
for the_class in classes:
|
|
92
|
+
if the_class["ClassNumber"] not in deduplicate_classes:
|
|
93
|
+
deduplicate_classes.append(the_class["ClassNumber"])
|
|
94
|
+
result = []
|
|
95
|
+
for deduplicate_class in deduplicate_classes:
|
|
96
|
+
result.append({ "code": deduplicate_class} )
|
|
97
|
+
return result
|
|
98
|
+
|
|
99
|
+
# given a list of publications, deduplicate
|
|
100
|
+
def deduplicate_publications(publications):
|
|
101
|
+
deduplicate_publications = []
|
|
102
|
+
pub_keys = []
|
|
103
|
+
if not isinstance(publications, list):
|
|
104
|
+
publications = [publications]
|
|
105
|
+
for publication in publications:
|
|
106
|
+
publication_date = publication.get("PublicationDate")
|
|
107
|
+
publication_identifier = publication.get("PublicationIdentifier")
|
|
108
|
+
pub_key = ""
|
|
109
|
+
if publication_identifier:
|
|
110
|
+
pub_key += publication_identifier
|
|
111
|
+
if publication_date:
|
|
112
|
+
pub_key += publication_date
|
|
113
|
+
if pub_key not in pub_keys:
|
|
114
|
+
deduplicate_publications.append(publication)
|
|
115
|
+
pub_keys.append(pub_key)
|
|
116
|
+
result = []
|
|
117
|
+
for publication in deduplicate_publications:
|
|
118
|
+
res = {}
|
|
119
|
+
if "PublicationIdentifier" in publication:
|
|
120
|
+
res["identifier"] = publication["PublicationIdentifier"]
|
|
121
|
+
if "PublicationDate" in publication:
|
|
122
|
+
res["date"] = publication["PublicationDate"]
|
|
123
|
+
result.append(res)
|
|
124
|
+
return result
|
|
125
|
+
|
|
126
|
+
# given a list of publications with dates as strings, select the earliest date publication
|
|
127
|
+
def select_earliest_date(design):
|
|
128
|
+
if design == None:
|
|
129
|
+
return None
|
|
130
|
+
|
|
131
|
+
if "PublicationDetails" in design:
|
|
132
|
+
publicationDetails = design["PublicationDetails"]
|
|
133
|
+
publications = publicationDetails.get('Publication', [])
|
|
134
|
+
if not isinstance(publications, list):
|
|
135
|
+
publications = [publications]
|
|
136
|
+
if len(publications) == 0:
|
|
137
|
+
return None
|
|
138
|
+
elif len(publications) == 1:
|
|
139
|
+
return publications[0]["PublicationDate"]
|
|
140
|
+
else:
|
|
141
|
+
earliest_date = None
|
|
142
|
+
n = -1
|
|
143
|
+
for count, publication in enumerate(publications):
|
|
144
|
+
if earliest_date == None or publication["PublicationDate"] < earliest_date:
|
|
145
|
+
earliest_date = publication["PublicationDate"]
|
|
146
|
+
return earliest_date
|
|
147
|
+
else:
|
|
148
|
+
return None
|
|
149
|
+
|
|
67
150
|
def translate_status(status):
|
|
68
151
|
status = status.lower()
|
|
69
152
|
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
{% call(header) match('DesignTransactionBody.TransactionContentDetails', Transaction) %}
|
|
4
4
|
|
|
5
|
-
{%
|
|
5
|
+
{% set design = Transaction.DesignTransactionBody.TransactionContentDetails.TransactionData.DesignApplicationDetails.DesignApplication %}
|
|
6
6
|
{% set design_count = design | get_designs_count(header) %}
|
|
7
7
|
{% set design_pos = design | get_designs_pos(header) %}
|
|
8
8
|
{% set kind = design | translate_kind(header) %}
|
|
@@ -35,13 +35,16 @@ reference:
|
|
|
35
35
|
{% set idstatus = design.DesignDetails.Design | translate_status %}
|
|
36
36
|
{% set appdate = design.DesignApplicationDate | get_appdate(design.DesignApplicationNumber) %}
|
|
37
37
|
|
|
38
|
-
st13: {{ design.DesignApplicationNumber | st13(design.RegistrationOfficeCode, design_pos, appdate=appdate, roffice=design.ReceivingOfficeCode) }}
|
|
38
|
+
st13: {{ design.DesignApplicationNumber | st13(None, design.RegistrationOfficeCode, design_pos, appdate=appdate, roffice=design.ReceivingOfficeCode) }}
|
|
39
39
|
|
|
40
40
|
applicationNumber: {{ design.DesignApplicationNumber }}
|
|
41
41
|
applicationDate: {{ design.DesignApplicationDate }}
|
|
42
42
|
registrationNumber: {{ design.DesignDetails.Design | get_registration_nb(idstatus) | remove_trailing('-') }}
|
|
43
43
|
registrationDate: {{ design.DesignDetails.Design | get_registration_date(idstatus) }}
|
|
44
|
-
|
|
44
|
+
|
|
45
|
+
publicationDates: {{ design.DesignDetails.Design | deduplicate_publication_dates }}
|
|
46
|
+
earliestPublicationDate: {{ design.DesignDetails.Design | select_earliest_date }}
|
|
47
|
+
|
|
45
48
|
expiryDate: {{ design.DesignDetails.Design | get_expiry_date(idstatus) }}
|
|
46
49
|
|
|
47
50
|
applicationLanguageCode: {{ design.DesignApplicationLanguageCode }}
|
|
@@ -143,13 +146,9 @@ designs:
|
|
|
143
146
|
- kind: {{ indicationProducts.ClassificationKindCode | lower }}
|
|
144
147
|
version: {{ indicationProducts.ClassificationVersion}}
|
|
145
148
|
classes:
|
|
146
|
-
|
|
147
|
-
- code: {{ code.ClassNumber }}
|
|
148
|
-
description: {{ code.ProductDescription}}
|
|
149
|
-
{% endcall %}
|
|
149
|
+
- {{ indicationProducts.ClassDescriptionDetails.ClassDescription | deduplicate_classes }}
|
|
150
150
|
{% endcall %}
|
|
151
151
|
|
|
152
|
-
|
|
153
152
|
priorities:
|
|
154
153
|
{% call(priority) match('PriorityDetails.Priority', design.DesignDetails.Design) %}
|
|
155
154
|
- countryCode: {{ priority.PriorityCountryCode }}
|
|
@@ -161,14 +160,15 @@ designs:
|
|
|
161
160
|
{% call(indic) match('NoveltyStatement', design.DesignDetails.Design) %}
|
|
162
161
|
- languageCode: {{ indic | remove_trailing('-', '.') | guess_language(indic._languageCode, design.DesignApplicationLanguageCode) }}
|
|
163
162
|
text: {{ indic | remove_trailing('-', '.') }}
|
|
164
|
-
|
|
163
|
+
{% endcall %}
|
|
164
|
+
|
|
165
|
+
{% set earliestDesignPub = design.DesignDetails.Design.PublicationDetails.Publication | select_earliest_date %}
|
|
166
|
+
earliestPublications:
|
|
167
|
+
identifier: {{ earliestDesignPub.PublicationIdentifier}}
|
|
168
|
+
date: {{ earliestDesignPub.PublicationDate}}
|
|
169
|
+
section:
|
|
165
170
|
|
|
166
171
|
publications:
|
|
167
|
-
{
|
|
168
|
-
- identifier: {{ pub.PublicationIdentifier}}
|
|
169
|
-
date: {{ pub.PublicationDate}}
|
|
170
|
-
section:
|
|
171
|
-
{% endcall %}
|
|
172
|
+
- {{ design.DesignDetails.Design.PublicationDetails.Publication | deduplicate_publications }}
|
|
172
173
|
|
|
173
174
|
{% endcall %}
|
|
174
|
-
{% endcall %}
|
|
@@ -46,4 +46,17 @@ def is_international(header):
|
|
|
46
46
|
return False
|
|
47
47
|
|
|
48
48
|
def get_ir_refnum(appnum):
|
|
49
|
-
return appnum
|
|
49
|
+
return appnum
|
|
50
|
+
|
|
51
|
+
def select_earliest_date(publications):
|
|
52
|
+
return ipas.select_earliest_date(publications)
|
|
53
|
+
|
|
54
|
+
def deduplicate_publication_dates(publications):
|
|
55
|
+
return ipas.deduplicate_publication_dates(publications)
|
|
56
|
+
|
|
57
|
+
def deduplicate_classes(classes):
|
|
58
|
+
return ipas.deduplicate_classes(classes)
|
|
59
|
+
|
|
60
|
+
def deduplicate_publications(publications):
|
|
61
|
+
return ipas.deduplicate_publications(publications)
|
|
62
|
+
|
|
@@ -46,4 +46,17 @@ def is_international(header):
|
|
|
46
46
|
return False
|
|
47
47
|
|
|
48
48
|
def get_ir_refnum(appnum):
|
|
49
|
-
return appnum
|
|
49
|
+
return appnum
|
|
50
|
+
|
|
51
|
+
def select_earliest_date(publications):
|
|
52
|
+
return ipas.select_earliest_date(publications)
|
|
53
|
+
|
|
54
|
+
def deduplicate_publication_dates(publications):
|
|
55
|
+
return ipas.deduplicate_publication_dates(publications)
|
|
56
|
+
|
|
57
|
+
def deduplicate_classes(classes):
|
|
58
|
+
return ipas.deduplicate_classes(classes)
|
|
59
|
+
|
|
60
|
+
def deduplicate_publications(publications):
|
|
61
|
+
return ipas.deduplicate_publications(publications)
|
|
62
|
+
|
|
@@ -47,4 +47,17 @@ def is_international(header):
|
|
|
47
47
|
return False
|
|
48
48
|
|
|
49
49
|
def get_ir_refnum(appnum):
|
|
50
|
-
return appnum
|
|
50
|
+
return appnum
|
|
51
|
+
|
|
52
|
+
def select_earliest_date(publications):
|
|
53
|
+
return ipas.select_earliest_date(publications)
|
|
54
|
+
|
|
55
|
+
def deduplicate_publication_dates(publications):
|
|
56
|
+
return ipas.deduplicate_publication_dates(publications)
|
|
57
|
+
|
|
58
|
+
def deduplicate_classes(classes):
|
|
59
|
+
return ipas.deduplicate_classes(classes)
|
|
60
|
+
|
|
61
|
+
def deduplicate_publications(publications):
|
|
62
|
+
return ipas.deduplicate_publications(publications)
|
|
63
|
+
|
|
@@ -46,4 +46,16 @@ def is_international(header):
|
|
|
46
46
|
return False
|
|
47
47
|
|
|
48
48
|
def get_ir_refnum(appnum):
|
|
49
|
-
return appnum
|
|
49
|
+
return appnum
|
|
50
|
+
|
|
51
|
+
def select_earliest_date(publications):
|
|
52
|
+
return ipas.select_earliest_date(publications)
|
|
53
|
+
|
|
54
|
+
def deduplicate_publication_dates(publications):
|
|
55
|
+
return ipas.deduplicate_publication_dates(publications)
|
|
56
|
+
|
|
57
|
+
def deduplicate_classes(classes):
|
|
58
|
+
return ipas.deduplicate_classes(classes)
|
|
59
|
+
|
|
60
|
+
def deduplicate_publications(publications):
|
|
61
|
+
return ipas.deduplicate_publications(publications)
|
|
@@ -46,4 +46,17 @@ def is_international(header):
|
|
|
46
46
|
return False
|
|
47
47
|
|
|
48
48
|
def get_ir_refnum(appnum):
|
|
49
|
-
return appnum
|
|
49
|
+
return appnum
|
|
50
|
+
|
|
51
|
+
def select_earliest_date(publications):
|
|
52
|
+
return ipas.select_earliest_date(publications)
|
|
53
|
+
|
|
54
|
+
def deduplicate_publication_dates(publications):
|
|
55
|
+
return ipas.deduplicate_publication_dates(publications)
|
|
56
|
+
|
|
57
|
+
def deduplicate_classes(classes):
|
|
58
|
+
return ipas.deduplicate_classes(classes)
|
|
59
|
+
|
|
60
|
+
def deduplicate_publications(publications):
|
|
61
|
+
return ipas.deduplicate_publications(publications)
|
|
62
|
+
|
|
@@ -45,4 +45,16 @@ def is_international(header):
|
|
|
45
45
|
return False
|
|
46
46
|
|
|
47
47
|
def get_ir_refnum(appnum):
|
|
48
|
-
return appnum
|
|
48
|
+
return appnum
|
|
49
|
+
|
|
50
|
+
def select_earliest_date(publications):
|
|
51
|
+
return ipas.select_earliest_date(publications)
|
|
52
|
+
|
|
53
|
+
def deduplicate_publication_dates(publications):
|
|
54
|
+
return ipas.deduplicate_publication_dates(publications)
|
|
55
|
+
|
|
56
|
+
def deduplicate_classes(classes):
|
|
57
|
+
return ipas.deduplicate_classes(classes)
|
|
58
|
+
|
|
59
|
+
def deduplicate_publications(publications):
|
|
60
|
+
return ipas.deduplicate_publications(publications)
|
|
@@ -55,4 +55,16 @@ def is_international(header):
|
|
|
55
55
|
return False
|
|
56
56
|
|
|
57
57
|
def get_ir_refnum(appnum):
|
|
58
|
-
return appnum
|
|
58
|
+
return appnum
|
|
59
|
+
|
|
60
|
+
def select_earliest_date(publications):
|
|
61
|
+
return ipas.select_earliest_date(publications)
|
|
62
|
+
|
|
63
|
+
def deduplicate_publication_dates(publications):
|
|
64
|
+
return ipas.deduplicate_publication_dates(publications)
|
|
65
|
+
|
|
66
|
+
def deduplicate_classes(classes):
|
|
67
|
+
return ipas.deduplicate_classes(classes)
|
|
68
|
+
|
|
69
|
+
def deduplicate_publications(publications):
|
|
70
|
+
return ipas.deduplicate_publications(publications)
|
|
@@ -50,4 +50,17 @@ def is_international(header):
|
|
|
50
50
|
return False
|
|
51
51
|
|
|
52
52
|
def get_ir_refnum(appnum):
|
|
53
|
-
return appnum
|
|
53
|
+
return appnum
|
|
54
|
+
|
|
55
|
+
def select_earliest_date(publications):
|
|
56
|
+
return ipas.select_earliest_date(publications)
|
|
57
|
+
|
|
58
|
+
def deduplicate_publication_dates(publications):
|
|
59
|
+
return ipas.deduplicate_publication_dates(publications)
|
|
60
|
+
|
|
61
|
+
def deduplicate_classes(classes):
|
|
62
|
+
return ipas.deduplicate_classes(classes)
|
|
63
|
+
|
|
64
|
+
def deduplicate_publications(publications):
|
|
65
|
+
return ipas.deduplicate_publications(publications)
|
|
66
|
+
|
|
@@ -49,4 +49,16 @@ def is_international(header):
|
|
|
49
49
|
return False
|
|
50
50
|
|
|
51
51
|
def get_ir_refnum(appnum):
|
|
52
|
-
return appnum
|
|
52
|
+
return appnum
|
|
53
|
+
|
|
54
|
+
def select_earliest_date(publications):
|
|
55
|
+
return ipas.select_earliest_date(publications)
|
|
56
|
+
|
|
57
|
+
def deduplicate_publication_dates(publications):
|
|
58
|
+
return ipas.deduplicate_publication_dates(publications)
|
|
59
|
+
|
|
60
|
+
def deduplicate_classes(classes):
|
|
61
|
+
return ipas.deduplicate_classes(classes)
|
|
62
|
+
|
|
63
|
+
def deduplicate_publications(publications):
|
|
64
|
+
return ipas.deduplicate_publications(publications)
|
|
@@ -51,4 +51,16 @@ def is_international(header):
|
|
|
51
51
|
return True
|
|
52
52
|
|
|
53
53
|
def get_ir_refnum(appnum):
|
|
54
|
-
return appnum
|
|
54
|
+
return appnum
|
|
55
|
+
|
|
56
|
+
def select_earliest_date(publications):
|
|
57
|
+
return ipas.select_earliest_date(publications)
|
|
58
|
+
|
|
59
|
+
def deduplicate_publication_dates(publications):
|
|
60
|
+
return ipas.deduplicate_publication_dates(publications)
|
|
61
|
+
|
|
62
|
+
def deduplicate_classes(classes):
|
|
63
|
+
return ipas.deduplicate_classes(classes)
|
|
64
|
+
|
|
65
|
+
def deduplicate_publications(publications):
|
|
66
|
+
return ipas.deduplicate_publications(publications)
|
|
@@ -47,4 +47,16 @@ def is_international(header):
|
|
|
47
47
|
return False
|
|
48
48
|
|
|
49
49
|
def get_ir_refnum(appnum):
|
|
50
|
-
return appnum
|
|
50
|
+
return appnum
|
|
51
|
+
|
|
52
|
+
def select_earliest_date(publications):
|
|
53
|
+
return ipas.select_earliest_date(publications)
|
|
54
|
+
|
|
55
|
+
def deduplicate_publication_dates(publications):
|
|
56
|
+
return ipas.deduplicate_publication_dates(publications)
|
|
57
|
+
|
|
58
|
+
def deduplicate_classes(classes):
|
|
59
|
+
return ipas.deduplicate_classes(classes)
|
|
60
|
+
|
|
61
|
+
def deduplicate_publications(publications):
|
|
62
|
+
return ipas.deduplicate_publications(publications)
|
|
@@ -3,6 +3,7 @@ from gbdtransformation.designs import kinds as std_kinds
|
|
|
3
3
|
from gbdtransformation.designs import status as std_status
|
|
4
4
|
from gbdtransformation.designs.filters import st13
|
|
5
5
|
from datetime import datetime, date
|
|
6
|
+
import json
|
|
6
7
|
|
|
7
8
|
# namespaces defined in XML and to be ignored in procecssing
|
|
8
9
|
ignore_namespace = [ "http://www.wipo.int/standards/XMLSchema/ST96/Design",
|
|
@@ -87,14 +88,15 @@ def getRefusalDate(histories, designIdentifier=None, countryCode=None):
|
|
|
87
88
|
'''
|
|
88
89
|
# check refusal
|
|
89
90
|
refusalDate = None
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
if
|
|
93
|
-
if
|
|
94
|
-
if
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
91
|
+
if histories != None:
|
|
92
|
+
for history in histories:
|
|
93
|
+
if "HagueRefusal" in history:
|
|
94
|
+
if designIdentifier == None or isAffectedDesignIdentifier(designIdentifier, history.HagueRefusal.AffectedDesign):
|
|
95
|
+
if countryCode == None or isApplicableToCountry(countryCode, history.HagueRefusal):
|
|
96
|
+
if "DecisionEffectiveDate" in history.HagueRefusal:
|
|
97
|
+
refusalDate = history.HagueRefusal.DecisionEffectiveDate
|
|
98
|
+
elif "DecisionDate" in history.HagueRefusal:
|
|
99
|
+
refusalDate = history.HagueRefusal.DecisionDate
|
|
98
100
|
return refusalDate
|
|
99
101
|
|
|
100
102
|
def build_person_name(name_struct):
|
|
@@ -169,7 +171,7 @@ def format_complete_address(PostalStructuredAddress):
|
|
|
169
171
|
def getOfficeStatusDate(registrationDate, expiryDate, histories, designIdentifier, countryCode=None):
|
|
170
172
|
expiryDate = getExpiryDate(expiryDate, histories, designIdentifier)
|
|
171
173
|
grantedDate = None
|
|
172
|
-
if countryCode != None:
|
|
174
|
+
if countryCode != None and histories != None:
|
|
173
175
|
# check possible renunciation including the particular country if specified
|
|
174
176
|
for history in histories:
|
|
175
177
|
if "HagueRenunciation" in history:
|
|
@@ -236,7 +238,7 @@ def getGbdStatus(registrationDate, expiryDate, histories, designIdentifier, coun
|
|
|
236
238
|
# if we have specified a country, check if the country is not part of a renunciation,
|
|
237
239
|
# then the status would be Ended for all design following Hague XML schema explanations
|
|
238
240
|
grantedDate = None
|
|
239
|
-
if countryCode != None:
|
|
241
|
+
if countryCode != None and histories != None:
|
|
240
242
|
for history in histories:
|
|
241
243
|
if "HagueRenunciation" in history:
|
|
242
244
|
# is the design identifier in the list of affected designs?
|
|
@@ -326,17 +328,36 @@ def isApplicableToCountry(countryCode, hagueHistoryEvent):
|
|
|
326
328
|
'''
|
|
327
329
|
Return True if the history event is applicable to the provided country
|
|
328
330
|
'''
|
|
331
|
+
if hagueHistoryEvent is None:
|
|
332
|
+
return False
|
|
333
|
+
|
|
329
334
|
if "RecordNotifyingOfficeCode" in hagueHistoryEvent:
|
|
330
335
|
if hagueHistoryEvent.RecordNotifyingOfficeCode == countryCode:
|
|
331
336
|
return True
|
|
332
337
|
elif "DesignatedCountryBag" in hagueHistoryEvent:
|
|
333
|
-
if
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
if
|
|
338
|
+
if hagueHistoryEvent.DesignatedCountryBag is not None:
|
|
339
|
+
if "DesignatedCountry" in hagueHistoryEvent.DesignatedCountryBag:
|
|
340
|
+
for designatedCountry in hagueHistoryEvent.DesignatedCountryBag.DesignatedCountry:
|
|
341
|
+
if isinstance(designatedCountry, str):
|
|
342
|
+
if hagueHistoryEvent.DesignatedCountryBag.DesignatedCountry.DesignatedCountryCode == countryCode:
|
|
343
|
+
return True
|
|
344
|
+
elif designatedCountry.DesignatedCountryCode == countryCode:
|
|
337
345
|
return True
|
|
338
|
-
elif designatedCountry.DesignatedCountryCode == countryCode:
|
|
339
|
-
return True
|
|
340
346
|
return False
|
|
341
347
|
|
|
348
|
+
"""
|
|
349
|
+
Functions dedicated to Hague transaction history
|
|
350
|
+
"""
|
|
351
|
+
|
|
352
|
+
transaction_header_elements = [ "HagueBulletinNumber", "PublicationDate" ]
|
|
353
|
+
|
|
354
|
+
def get_event_type(history):
|
|
355
|
+
for child in history:
|
|
356
|
+
if child.startswith("_"):
|
|
357
|
+
continue
|
|
358
|
+
if child not in transaction_header_elements:
|
|
359
|
+
return child
|
|
360
|
+
return None
|
|
342
361
|
|
|
362
|
+
def serialize(history):
|
|
363
|
+
return json.loads(history.toJSON())
|