tricc-oo 1.0.1__py3-none-any.whl → 1.4.15__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.
Files changed (66) hide show
  1. tests/build.py +213 -0
  2. tests/test_cql.py +197 -0
  3. tests/to_ocl.py +51 -0
  4. {tricc → tricc_oo}/__init__.py +3 -1
  5. tricc_oo/converters/codesystem_to_ocl.py +169 -0
  6. tricc_oo/converters/cql/cqlLexer.py +822 -0
  7. tricc_oo/converters/cql/cqlListener.py +1632 -0
  8. tricc_oo/converters/cql/cqlParser.py +11204 -0
  9. tricc_oo/converters/cql/cqlVisitor.py +913 -0
  10. tricc_oo/converters/cql_to_operation.py +402 -0
  11. tricc_oo/converters/datadictionnary.py +115 -0
  12. tricc_oo/converters/drawio_type_map.py +222 -0
  13. tricc_oo/converters/tricc_to_xls_form.py +61 -0
  14. tricc_oo/converters/utils.py +65 -0
  15. tricc_oo/converters/xml_to_tricc.py +1003 -0
  16. tricc_oo/models/__init__.py +4 -0
  17. tricc_oo/models/base.py +732 -0
  18. tricc_oo/models/calculate.py +216 -0
  19. tricc_oo/models/ocl.py +281 -0
  20. tricc_oo/models/ordered_set.py +125 -0
  21. tricc_oo/models/tricc.py +418 -0
  22. tricc_oo/parsers/xml.py +138 -0
  23. tricc_oo/serializers/__init__.py +0 -0
  24. tricc_oo/serializers/xls_form.py +745 -0
  25. tricc_oo/strategies/__init__.py +0 -0
  26. tricc_oo/strategies/input/__init__.py +0 -0
  27. tricc_oo/strategies/input/base_input_strategy.py +111 -0
  28. tricc_oo/strategies/input/drawio.py +317 -0
  29. tricc_oo/strategies/output/base_output_strategy.py +148 -0
  30. tricc_oo/strategies/output/spice.py +365 -0
  31. tricc_oo/strategies/output/xls_form.py +697 -0
  32. tricc_oo/strategies/output/xlsform_cdss.py +189 -0
  33. tricc_oo/strategies/output/xlsform_cht.py +200 -0
  34. tricc_oo/strategies/output/xlsform_cht_hf.py +334 -0
  35. tricc_oo/visitors/__init__.py +0 -0
  36. tricc_oo/visitors/tricc.py +2198 -0
  37. tricc_oo/visitors/utils.py +17 -0
  38. tricc_oo/visitors/xform_pd.py +264 -0
  39. tricc_oo-1.4.15.dist-info/METADATA +219 -0
  40. tricc_oo-1.4.15.dist-info/RECORD +46 -0
  41. {tricc_oo-1.0.1.dist-info → tricc_oo-1.4.15.dist-info}/WHEEL +1 -1
  42. tricc_oo-1.4.15.dist-info/top_level.txt +2 -0
  43. tricc/converters/mc_to_tricc.py +0 -542
  44. tricc/converters/tricc_to_xls_form.py +0 -553
  45. tricc/converters/utils.py +0 -44
  46. tricc/converters/xml_to_tricc.py +0 -740
  47. tricc/models/tricc.py +0 -1093
  48. tricc/parsers/xml.py +0 -81
  49. tricc/serializers/xls_form.py +0 -364
  50. tricc/strategies/input/base_input_strategy.py +0 -80
  51. tricc/strategies/input/drawio.py +0 -246
  52. tricc/strategies/input/medalcreator.py +0 -168
  53. tricc/strategies/output/base_output_strategy.py +0 -92
  54. tricc/strategies/output/xls_form.py +0 -194
  55. tricc/strategies/output/xlsform_cdss.py +0 -46
  56. tricc/strategies/output/xlsform_cht.py +0 -106
  57. tricc/visitors/tricc.py +0 -375
  58. tricc_oo-1.0.1.dist-info/LICENSE +0 -78
  59. tricc_oo-1.0.1.dist-info/METADATA +0 -229
  60. tricc_oo-1.0.1.dist-info/RECORD +0 -26
  61. tricc_oo-1.0.1.dist-info/top_level.txt +0 -2
  62. venv/bin/vba_extract.py +0 -78
  63. {tricc → tricc_oo}/converters/__init__.py +0 -0
  64. {tricc → tricc_oo}/models/lang.py +0 -0
  65. {tricc/serializers → tricc_oo/parsers}/__init__.py +0 -0
  66. {tricc → tricc_oo}/serializers/planuml.py +0 -0
tricc/visitors/tricc.py DELETED
@@ -1,375 +0,0 @@
1
- import re
2
-
3
- from tricc.converters.utils import *
4
- from tricc.models.tricc import *
5
-
6
-
7
-
8
- def merge_node(from_node,to_node):
9
- if from_node.activity != to_node.activity:
10
- logger.error("Cannot merge nodes from different activities")
11
- elif issubclass(from_node.__class__, TriccNodeCalculateBase) and issubclass(to_node.__class__, TriccNodeCalculateBase):
12
- for e in to_node.activity.edges:
13
- if e.target == from_node.id:
14
- e.target = to_node.id
15
- else:
16
- logger.error("Cannot merge not calculate nodes ")
17
-
18
-
19
- def get_max_version(dict):
20
- max_version = None
21
- for id, sim_node in dict.items():
22
- if max_version is None or max_version.version < sim_node.version :
23
- max_version = sim_node
24
- return max_version
25
-
26
- def get_last_version(dict, name):
27
- max_version = None
28
- if name in dict:
29
- for sim_node in dict[name].values():
30
- if max_version is None or max_version.path_len < sim_node.path_len :
31
- max_version = sim_node
32
- return max_version
33
-
34
-
35
-
36
-
37
- def process_calculate(node,processed_nodes, stashed_nodes, calculates, used_calculates, warn = False, **kwargs ):
38
- # used_calculates dict[name, Dict[id, node]]
39
- # processed_nodes Dict[id, node]
40
- # calculates dict[name, Dict[id, node]]
41
- if node not in processed_nodes:
42
- # generate condition
43
- if is_ready_to_process(node, processed_nodes,False) and process_reference(node, calculates,used_calculates,processed_nodes,warn = warn):
44
- if is_rhombus_ready_to_process(node,processed_nodes):
45
- generate_calculates(node,calculates, used_calculates,processed_nodes)
46
- if issubclass(node.__class__, (TriccNodeDisplayCalculateBase )) and node.name is not None:
47
- # generate the calc node version by looking in the processed calculate
48
- last_calc = get_last_version(calculates, node.name)
49
- # get max version used
50
- #last_used_version = get_max_named_version(used_calculates, node.name)
51
- last_used_calc = get_last_version(used_calculates, node.name)
52
- # add calculate is added after the version collection so it is 0 in case there is no calc found
53
- add_calculate(calculates,node)
54
- # merge is there is unused version ->
55
- # current node not yet in the list so 1 item is enough
56
- if last_calc is not None:
57
- if last_used_calc is None or last_calc.path_len > last_used_calc.path_len:
58
- node.version = last_calc.version + 1
59
- node_to_delete = merge_calculate(node, calculates[node.name],last_used_calc)
60
- if node_to_delete is not None:
61
- for d_node in node_to_delete:
62
- del calculates[d_node.name][d_node.id]
63
-
64
- if d_node.name in used_calculates:
65
- if d_node.id in used_calculates[d_node.name]:
66
- logger.error("node {} used but deleted".format(d_node.get_name()))
67
- if d_node.id in d_node.activity.nodes:
68
- # mostly for end nodes
69
- if isinstance(d_node,(TriccNodeEnd,TriccNodeActivityEnd)):
70
- del d_node.activity.nodes[d_node.id]
71
- if d_node in stashed_nodes:
72
- logger.error("node {} not porcessed but deleted".format(d_node.get_name()))
73
- # chaining the calculate, this is needed each time there is a last used version
74
- if last_used_calc is not None :
75
- logger.debug("set last to false for node {} and add its link it to next one".format(last_used_calc.get_name()))
76
- set_prev_next_node(last_used_calc,node)
77
- last_used_calc.last = False
78
- update_calc_version(calculates,node.name)
79
- #if hasattr(node, 'next_nodes'):
80
- #node.next_nodes=reorder_node_list(node.next_nodes, node.group)
81
- return True
82
- # not ready to process or already processed
83
-
84
- return False
85
-
86
- def update_calc_version(calculates,name):
87
- if name in calculates and len(calculates[name])>1:
88
- ordered_list = sorted(list(calculates[name].values()), key=lambda x:x.path_len)
89
- i = 1
90
- len_max=len(calculates[name])
91
- for elm in ordered_list:
92
- elm.version=i
93
- elm.last= (i == len_max)
94
- i+=1
95
-
96
-
97
- def get_max_named_version(calculates,name):
98
- max = 0
99
- if name in calculates:
100
- for node in calculates[name].values():
101
- if node.version > max:
102
- max = node.version
103
- return max
104
-
105
- def get_count_node(node):
106
- count_id = generate_id()
107
- count_name = "cnt_"+count_id
108
- return TriccNodeCount(
109
- id = count_id,
110
- group = node.group,
111
- activity = node.activity,
112
- label = "count: "+node.get_name(),
113
- name = count_name,
114
- path_len=node.path_len
115
- )
116
-
117
- ### Function that inject a wait after path that will wait for the nodes
118
- def get_activity_wait(prev_nodes, nodes_to_wait, next_nodes, replaced_node = None, edge_only = False, activity = None):
119
-
120
- if not isinstance(nodes_to_wait, list):
121
- nodes_to_wait = [nodes_to_wait]
122
- path = prev_nodes[0] if len(prev_nodes) == 1 else get_bridge_path(prev_nodes, activity)
123
- activity = activity or prev_nodes[0].activity
124
- calc_node = TriccNodeWait(
125
- id = "ar_"+generate_id(),
126
- reference = nodes_to_wait,
127
- activity = activity,
128
- group = activity,
129
- path = path
130
- )
131
-
132
- #start the wait and the next_nodes from the prev_nodes
133
- #add the wait as dependency of the next_nodes
134
-
135
- # add edge between rhombus and node
136
-
137
- set_prev_next_node(path,calc_node, edge_only=edge_only, activity=activity )
138
- for next_node in next_nodes:
139
- #if prev != replaced_node and next_node != replaced_node :
140
- # set_prev_next_node(prev,next_node,replaced_node)
141
- #if first:
142
- #first = False
143
- set_prev_next_node(calc_node,next_node, edge_only=edge_only,activity=activity)
144
- return calc_node
145
-
146
- def get_bridge_path(prev_nodes, node=None,edge_only=False):
147
- if node is None:
148
- node = prev_nodes[0]
149
- calc_id = generate_id()
150
- calc_name = "path_"+calc_id
151
- data = {
152
- 'id': calc_id,
153
- 'group': node.group,
154
- 'activity': node.activity,
155
- 'label': "path: " + ( node.get_name()),
156
- 'name': calc_name,
157
- 'path_len': node.path_len + 1 * (node == prev_nodes[0])
158
- }
159
-
160
- if sum([0 if issubclass(n.__class__, (TriccNodeDisplayCalculateBase, TriccNodeRhombus)) else 1 for n in prev_nodes])>0 : #and len(node.prev_nodes)>1:
161
- calc= TriccNodeDisplayBridge( **data)
162
- else:
163
- calc = TriccNodeBridge( **data)
164
- for prev in prev_nodes:
165
- set_prev_next_node(prev, calc, activity=node.activity, edge_only=edge_only )
166
-
167
- def inject_bridge_path(node, nodes):
168
-
169
- prev_nodes = [nodes[n.source] for n in list(filter(lambda x: (x.target == node.id or x.target == node) and x.source in nodes ,node.activity.edges ))]
170
- calc = get_bridge_path(prev_nodes, node,edge_only=True)
171
-
172
- for e in node.activity.edges:
173
- if e.target == node.id:
174
- e.target = calc.id
175
-
176
- # add edge between bridge and node
177
- set_prev_next_node(calc,node,edge_only=True, activity=node.activity)
178
- node.path_len += 1
179
- return calc
180
-
181
- def generate_calculates(node,calculates, used_calculates,processed_nodes):
182
- list_calc = []
183
- ## add select calcualte
184
- if issubclass(node.__class__, TriccNodeCalculateBase):
185
- if isinstance(node, TriccNodeRhombus):
186
- if node.expression_reference is None and len(node.reference)==1 and issubclass(node.reference[0].__class__, TriccNodeSelect):
187
- count_node = get_count_node(node)
188
- list_calc.append(count_node)
189
- set_prev_next_node(node.reference[0],count_node)
190
- node.path_len+=1
191
- node.reference[0] = count_node
192
- processed_nodes.append(count_node)
193
- add_calculate(calculates, count_node)
194
- add_used_calculate(node, count_node, calculates, used_calculates, processed_nodes)
195
-
196
- # if a prev node is a calculate then it must be added in used_calc
197
- for prev in node.prev_nodes:
198
- add_used_calculate(node, prev, calculates, used_calculates, processed_nodes)
199
- #if the node have a save
200
- if hasattr(node, 'save') and node.save is not None and node.save != '':
201
- # get fragments type.name.icdcode
202
- save_fragments=node.save.split('.')
203
- if len(save_fragments)>1:
204
- calculate_name = "{0}.{1}".format(save_fragments[0], save_fragments[1])
205
- else:
206
- calculate_name = "{0}.{1}".format(save_fragments[0], node.name)
207
-
208
-
209
-
210
-
211
- if not isinstance(node, TriccNodeSelectYesNo) and issubclass(node.__class__, (TriccNodeSelect)):
212
- calc_node = get_count_node(node)
213
- calc_node.path_len += 1
214
- calc_node.name=calculate_name
215
- calc_node.label = "save select: " +node.get_name()
216
- else:
217
- calc_id = generate_id()
218
- calc_node = TriccNodeCalculate(
219
- name=calculate_name,
220
- id = calc_id,
221
- group = node.group,
222
- activity = node.activity,
223
- label = "save: " +node.get_name(),
224
- path_len=node.path_len+ 1
225
- )
226
- logger.debug("generate_save_calculate:{}:{} as {}".format(calc_node.tricc_type, node.name if hasattr(node,'name') else node.id, calculate_name))
227
- if isinstance(node, TriccNodeSelectYesNo):
228
- yesNode = node.options[0]
229
- set_prev_next_node(yesNode,calc_node)
230
- else:
231
- set_prev_next_node(node,calc_node)
232
- list_calc.append(calc_node)
233
- #add_save_calculate(calc_node, calculates, used_calculates,processed_nodes)
234
- return list_calc
235
-
236
-
237
-
238
- def add_calculate(calculates, calc_node):
239
- if issubclass(calc_node.__class__, TriccNodeDisplayCalculateBase):
240
- if calc_node.name not in calculates:
241
- calculates[calc_node.name]= {}
242
- calculates[calc_node.name][calc_node.id] = calc_node
243
-
244
- def process_reference(node, calculates ,used_calculates,processed_nodes, warn = False ):
245
- #global last_unfound_ref
246
- reference = []
247
- expression_reference = None
248
- if issubclass(node.__class__, TriccRhombusMixIn):
249
- if isinstance(node.reference, str) :
250
- logger.debug("process_reference:{}: {} ".format(node.get_name(), node.reference))
251
- ref_regex=r'(\$\{[^\}]+\})'
252
- lookup = re.findall(ref_regex, node.reference)
253
- if lookup and len(lookup)>0:
254
- ref_list = [x[2:-1] for x in lookup]
255
- expression_reference = re.sub(ref_regex,r"${{{}}}", node.reference )
256
- else:
257
- ref_list= [node.reference]
258
- for ref in ref_list:
259
- ref = ref.strip()
260
- last_found = get_prev_node_by_name(processed_nodes, ref, node)
261
- # ref is still a string here
262
- if last_found is None or issubclass(last_found.__class__, TriccNodeCalculateBase):
263
- if ref in calculates and len(calculates[ref])>0 :
264
- # issue is that it can be further in another path
265
- last_found = get_last_version(calculates, ref)
266
- if last_found is None:
267
- if warn:
268
- logger.warning("reference {} not found for a calculate {}".format(ref, node.get_name()))
269
- else:
270
- logger.debug("reference {} not found for a calculate {}".format(ref, node.get_name()))
271
- #if last_unfound_ref == node:
272
- # logger.warning("reference not found for a calculate twice in a row {}".format(node.get_name()))
273
- #last_unfound_ref = node
274
- return False
275
- else:
276
- reference.append(last_found)
277
- last_found.next_nodes.append(node)
278
- node.path_len = max(node.path_len,last_found.path_len )
279
- for ref in reference:
280
- add_used_calculate(node, ref, calculates, used_calculates, processed_nodes)
281
- node.reference = reference
282
- node.expression_reference = expression_reference
283
- elif isinstance(node.reference,list):
284
- for ref in node.reference:
285
- #add_calculate(calculates,ref )
286
- add_used_calculate(ref, node,calculates, used_calculates, processed_nodes)
287
- elif node.reference is None:
288
- logger.error("process_calculate_version_requirement:reference is None for {0} ".format(node.get_name()))
289
- exit()
290
-
291
- return True
292
-
293
-
294
- #add_used_calculate(node, calc_node, calculates, used_calculates, processed_nodes)
295
-
296
- def add_used_calculate(node, prev_node, calculates, used_calculates, processed_nodes):
297
- if issubclass(prev_node.__class__, TriccNodeDisplayCalculateBase):
298
- if prev_node in processed_nodes:
299
- # if not a verison, index will equal -1
300
- if prev_node.name not in calculates :
301
- logger.debug("node {} refered before being processed".format(node.get_name()))
302
- return False
303
- max_version = prev_node#get_max_version(calculates[node_clean_name])
304
- if prev_node.name not in used_calculates:
305
- used_calculates[prev_node.name] = {}
306
- #save the max version only once
307
- if max_version.id not in used_calculates[prev_node.name]:
308
- used_calculates[prev_node.name][max_version.id] = max_version
309
- else:
310
- logger.debug("process_calculate_version_requirement: failed for {0} , prev Node {1} ".format(node.get_name(), prev_node.get_name()))
311
-
312
- def merge_calculate(node, calculates, last_used_calc):
313
- #calcualtes list[ node]
314
- node_to_delete = []
315
- for calc_node in calculates.values():
316
- # merge only if same name, version >= fromm version but < node version and we don't merge the end node from differentes instance
317
- if calc_node!=node and node.tricc_type == calc_node.tricc_type:
318
- # if there is a calculate and a count, merge on the count
319
- remaining = node
320
- to_remove = calc_node
321
- if not(isinstance(remaining,(TriccNodeActivityEnd, TriccNodeActivityStart))) or remaining.instance == to_remove.instance:
322
- if (last_used_calc is None or to_remove.path_len > last_used_calc.path_len )and to_remove.path_len<=remaining.path_len:
323
- logger.debug("merge_calculate:{} ".format(remaining.name if hasattr(remaining,'name') else remaining.id))
324
- # unlink the merged node in its next nodes
325
- # list node is used to not update to_remove.next_nodes in a loop not porcessed but deleted
326
- list_nodes = []
327
- for next_node in to_remove.next_nodes:
328
- list_nodes.append(next_node)
329
- for next_node in list_nodes:
330
- set_prev_next_node(remaining, next_node, to_remove )
331
- # unlink the merged node in its prev nodes
332
- # list node is used to not update to_remove.prev_nodes in a loop
333
- list_nodes = []
334
- for prev_node in to_remove.prev_nodes:
335
- list_nodes.append(prev_node)
336
- for prev_node in list_nodes:
337
- set_prev_next_node(prev_node, remaining, to_remove )
338
- node_to_delete.append(to_remove)
339
- else:
340
- logger.info("activity {} instance {} and {} might be merged (end node mergables)".format(remaining.activity.get_name(), remaining.activity.instance, to_remove.activity.instance))
341
- elif node.tricc_type != calc_node.tricc_type:
342
- logger.warning("two different type of calculate node share the same name {}::{}::{}".format(node.name,node.tricc_type, calc_node.tricc_type))
343
- return node_to_delete
344
-
345
-
346
-
347
-
348
- def get_select_not_available_options(node,group,label):
349
- return {0:TriccNodeSelectOption(
350
- id = generate_id(),
351
- name="1",
352
- label=label,
353
- select = node,
354
- group = group,
355
- list_name = node.list_name
356
- )}
357
-
358
- def get_select_yes_no_options(node, group):
359
- yes = TriccNodeSelectOption(
360
- id = generate_id(),
361
- name="1",
362
- label="Yes",
363
- select = node,
364
- group = group,
365
- list_name = node.list_name
366
- )
367
- no = TriccNodeSelectOption(
368
- id = generate_id(),
369
- name="-1",
370
- label="No",
371
- select = node,
372
- group = group,
373
- list_name = node.list_name
374
- )
375
- return {0:yes, 1:no }
@@ -1,78 +0,0 @@
1
- Attribution-NonCommercial 3.0 Unported
2
- CREATIVE COMMONS CORPORATION IS NOT A LAW FIRM AND DOES NOT PROVIDE LEGAL SERVICES. DISTRIBUTION OF THIS LICENSE DOES NOT CREATE AN ATTORNEY-CLIENT RELATIONSHIP. CREATIVE COMMONS PROVIDES THIS INFORMATION ON AN "AS-IS" BASIS. CREATIVE COMMONS MAKES NO WARRANTIES REGARDING THE INFORMATION PROVIDED, AND DISCLAIMS LIABILITY FOR DAMAGES RESULTING FROM ITS USE.
3
-
4
- License
5
-
6
- THE WORK (AS DEFINED BELOW) IS PROVIDED UNDER THE TERMS OF THIS CREATIVE COMMONS PUBLIC LICENSE ("CCPL" OR "LICENSE"). THE WORK IS PROTECTED BY COPYRIGHT AND/OR OTHER APPLICABLE LAW. ANY USE OF THE WORK OTHER THAN AS AUTHORIZED UNDER THIS LICENSE OR COPYRIGHT LAW IS PROHIBITED.
7
-
8
- BY EXERCISING ANY RIGHTS TO THE WORK PROVIDED HERE, YOU ACCEPT AND AGREE TO BE BOUND BY THE TERMS OF THIS LICENSE. TO THE EXTENT THIS LICENSE MAY BE CONSIDERED TO BE A CONTRACT, THE LICENSOR GRANTS YOU THE RIGHTS CONTAINED HERE IN CONSIDERATION OF YOUR ACCEPTANCE OF SUCH TERMS AND CONDITIONS.
9
-
10
- 1. Definitions
11
-
12
- Adaptation means a work based upon the Work, or upon the Work and other pre-existing works, such as a translation, adaptation, derivative work, arrangement of music or other alterations of a literary or artistic work, or phonogram or performance and includes cinematographic adaptations or any other form in which the Work may be recast, transformed, or adapted including in any form recognizably derived from the original, except that a work that constitutes a Collection will not be considered an Adaptation for the purpose of this License. For the avoidance of doubt, where the Work is a musical work, performance or phonogram, the synchronization of the Work in timed-relation with a moving image ("synching") will be considered an Adaptation for the purpose of this License.
13
- Collection means a collection of literary or artistic works, such as encyclopedias and anthologies, or performances, phonograms or broadcasts, or other works or subject matter other than works listed in Section 1(f) below, which, by reason of the selection and arrangement of their contents, constitute intellectual creations, in which the Work is included in its entirety in unmodified form along with one or more other contributions, each constituting separate and independent works in themselves, which together are assembled into a collective whole. A work that constitutes a Collection will not be considered an Adaptation (as defined above) for the purposes of this License.
14
- Distribute means to make available to the public the original and copies of the Work or Adaptation, as appropriate, through sale or other transfer of ownership.
15
- Licensor means the individual, individuals, entity or entities that offer(s) the Work under the terms of this License.
16
- Original Author means, in the case of a literary or artistic work, the individual, individuals, entity or entities who created the Work or if no individual or entity can be identified, the publisher; and in addition (i) in the case of a performance the actors, singers, musicians, dancers, and other persons who act, sing, deliver, declaim, play in, interpret or otherwise perform literary or artistic works or expressions of folklore; (ii) in the case of a phonogram the producer being the person or legal entity who first fixes the sounds of a performance or other sounds; and, (iii) in the case of broadcasts, the organization that transmits the broadcast.
17
- Work means the literary and/or artistic work offered under the terms of this License including without limitation any production in the literary, scientific and artistic domain, whatever may be the mode or form of its expression including digital form, such as a book, pamphlet and other writing; a lecture, address, sermon or other work of the same nature; a dramatic or dramatico-musical work; a choreographic work or entertainment in dumb show; a musical composition with or without words; a cinematographic work to which are assimilated works expressed by a process analogous to cinematography; a work of drawing, painting, architecture, sculpture, engraving or lithography; a photographic work to which are assimilated works expressed by a process analogous to photography; a work of applied art; an illustration, map, plan, sketch or three-dimensional work relative to geography, topography, architecture or science; a performance; a broadcast; a phonogram; a compilation of data to the extent it is protected as a copyrightable work; or a work performed by a variety or circus performer to the extent it is not otherwise considered a literary or artistic work.
18
- You means an individual or entity exercising rights under this License who has not previously violated the terms of this License with respect to the Work, or who has received express permission from the Licensor to exercise rights under this License despite a previous violation.
19
- Publicly Perform means to perform public recitations of the Work and to communicate to the public those public recitations, by any means or process, including by wire or wireless means or public digital performances; to make available to the public Works in such a way that members of the public may access these Works from a place and at a place individually chosen by them; to perform the Work to the public by any means or process and the communication to the public of the performances of the Work, including by public digital performance; to broadcast and rebroadcast the Work by any means including signs, sounds or images.
20
- Reproduce means to make copies of the Work by any means including without limitation by sound or visual recordings and the right of fixation and reproducing fixations of the Work, including storage of a protected performance or phonogram in digital form or other electronic medium.
21
- 2. Fair Dealing Rights.
22
-
23
- Nothing in this License is intended to reduce, limit, or restrict any uses free from copyright or rights arising from limitations or exceptions that are provided for in connection with the copyright protection under copyright law or other applicable laws.
24
-
25
- 3. License Grant.
26
-
27
- Subject to the terms and conditions of this License, Licensor hereby grants You a worldwide, royalty-free, non-exclusive, perpetual (for the duration of the applicable copyright) license to exercise the rights in the Work as stated below:
28
-
29
- to Reproduce the Work, to incorporate the Work into one or more Collections, and to Reproduce the Work as incorporated in the Collections;
30
-
31
- to create and Reproduce Adaptations provided that any such Adaptation, including any translation in any medium, takes reasonable steps to clearly label, demarcate or otherwise identify that changes were made to the original Work. For example, a translation could be marked "The original work was translated from English to Spanish," or a modification could indicate "The original work has been modified.";
32
-
33
- to Distribute and Publicly Perform the Work including as incorporated in Collections; and,
34
-
35
- to Distribute and Publicly Perform Adaptations.
36
-
37
- The above rights may be exercised in all media and formats whether now known or hereafter devised. The above rights include the right to make such modifications as are technically necessary to exercise the rights in other media and formats. Subject to Section 8(f) , all rights not expressly granted by Licensor are hereby reserved, including but not limited to the rights set forth in Section 4(d) .
38
-
39
- 4. Restrictions.
40
-
41
- The license granted in Section 3 above is expressly made subject to and limited by the following restrictions:
42
-
43
- You may Distribute or Publicly Perform the Work only under the terms of this License. You must include a copy of, or the Uniform Resource Identifier (URI) for, this License with every copy of the Work You Distribute or Publicly Perform. You may not offer or impose any terms on the Work that restrict the terms of this License or the ability of the recipient of the Work to exercise the rights granted to that recipient under the terms of the License. You may not sublicense the Work. You must keep intact all notices that refer to this License and to the disclaimer of warranties with every copy of the Work You Distribute or Publicly Perform. When You Distribute or Publicly Perform the Work, You may not impose any effective technological measures on the Work that restrict the ability of a recipient of the Work from You to exercise the rights granted to that recipient under the terms of the License. This Section 4(a) applies to the Work as incorporated in a Collection, but this does not require the Collection apart from the Work itself to be made subject to the terms of this License. If You create a Collection, upon notice from any Licensor You must, to the extent practicable, remove from the Collection any credit as required by Section 4(c) , as requested. If You create an Adaptation, upon notice from any Licensor You must, to the extent practicable, remove from the Adaptation any credit as required by Section 4(c) , as requested.
44
-
45
- You may not exercise any of the rights granted to You in Section 3 above in any manner that is primarily intended for or directed toward commercial advantage or private monetary compensation. The exchange of the Work for other copyrighted works by means of digital file-sharing or otherwise shall not be considered to be intended for or directed toward commercial advantage or private monetary compensation, provided there is no payment of any monetary compensation in con-nection with the exchange of copyrighted works.
46
-
47
- If You Distribute, or Publicly Perform the Work or any Adaptations or Collections, You must, unless a request has been made pursuant to Section 4(a) , keep intact all copyright notices for the Work and provide, reasonable to the medium or means You are utilizing: (i) the name of the Original Author (or pseudonym, if applicable) if supplied, and/or if the Original Author and/or Licensor designate another party or parties (e.g., a sponsor institute, publishing entity, journal) for attribution ("Attribution Parties") in Licensor's copyright notice, terms of service or by other reasonable means, the name of such party or parties; (ii) the title of the Work if supplied; (iii) to the extent reasonably practicable, the URI, if any, that Licensor specifies to be associated with the Work, unless such URI does not refer to the copyright notice or licensing information for the Work; and, (iv) consistent with Section 3(b) , in the case of an Adaptation, a credit identifying the use of the Work in the Adaptation (e.g., "French translation of the Work by Original Author," or "Screenplay based on original Work by Original Author"). The credit required by this Section 4(c) may be implemented in any reasonable manner; provided, however, that in the case of a Adaptation or Collection, at a minimum such credit will appear, if a credit for all contributing authors of the Adaptation or Collection appears, then as part of these credits and in a manner at least as prominent as the credits for the other contributing authors. For the avoidance of doubt, You may only use the credit required by this Section for the purpose of attribution in the manner set out above and, by exercising Your rights under this License, You may not implicitly or explicitly assert or imply any connection with, sponsorship or endorsement by the Original Author, Licensor and/or Attribution Parties, as appropriate, of You or Your use of the Work, without the separate, express prior written permission of the Original Author, Licensor and/or Attribution Parties.
48
-
49
- For the avoidance of doubt:
50
-
51
- Non-waivable Compulsory License Schemes . In those jurisdictions in which the right to collect royalties through any statutory or compulsory licensing scheme cannot be waived, the Licensor reserves the exclusive right to collect such royalties for any exercise by You of the rights granted under this License;
52
-
53
- Waivable Compulsory License Schemes . In those jurisdictions in which the right to collect royalties through any statutory or compulsory licensing scheme can be waived, the Licensor reserves the exclusive right to collect such royalties for any exercise by You of the rights granted under this License if Your exercise of such rights is for a purpose or use which is otherwise than noncommercial as permitted under Section 4(c) , and otherwise waives the right to collect royalties through any statutory or compulsory licensing scheme; and,
54
-
55
- Voluntary License Schemes . The Licensor reserves the right to collect royalties, whether individually or, in the event that the Licensor is a member of a collecting society that administers voluntary licensing schemes, via that society, from any exercise by You of the rights granted under this License that is for a purpose or use which is otherwise than noncommercial as permitted under Section 4(c) , .
56
-
57
- Except as otherwise agreed in writing by the Licensor or as may be otherwise permitted by applicable law, if You Reproduce, Distribute or Publicly Perform the Work either by itself or as part of any Adaptations or Collections, You must not distort, mutilate, modify or take other derogatory action in relation to the Work which would be prejudicial to the Original Author's honor or reputation. Licensor agrees that in those jurisdictions (e.g. Japan), in which any exercise of the right granted in Section 3(b) of this License (the right to make Adaptations) would be deemed to be a distortion, mutilation, modification or other derogatory action prejudicial to the Original Author's honor and reputation, the Licensor will waive or not assert, as appropriate, this Section, to the fullest extent permitted by the applicable national law, to enable You to reasonably exercise Your right under Section 3(b) of this License (right to make Adaptations) but not otherwise.
58
-
59
- 5. Representations, Warranties and Disclaimer
60
-
61
- UNLESS OTHERWISE MUTUALLY AGREED TO BY THE PARTIES IN WRITING AND TO THE FULLEST EXTENT PERMITTED BY APPLICABLE LAW, LICENSOR OFFERS THE WORK AS-IS AND MAKES NO REPRESENTATIONS OR WARRANTIES OF ANY KIND CONCERNING THE WORK, EXPRESS, IMPLIED, STATUTORY OR OTHERWISE, INCLUDING, WITHOUT LIMITATION, WARRANTIES OF TITLE, MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, NONINFRINGEMENT, OR THE ABSENCE OF LATENT OR OTHER DEFECTS, ACCURACY, OR THE PRESENCE OF ABSENCE OF ERRORS, WHETHER OR NOT DISCOVERABLE. SOME JURISDICTIONS DO NOT ALLOW THE EXCLUSION OF IMPLIED WARRANTIES, SO THIS EXCLUSION MAY NOT APPLY TO YOU.
62
-
63
- 6. Limitation on Liability.
64
-
65
- EXCEPT TO THE EXTENT REQUIRED BY APPLICABLE LAW, IN NO EVENT WILL LICENSOR BE LIABLE TO YOU ON ANY LEGAL THEORY FOR ANY SPECIAL, INCIDENTAL, CONSEQUENTIAL, PUNITIVE OR EXEMPLARY DAMAGES ARISING OUT OF THIS LICENSE OR THE USE OF THE WORK, EVEN IF LICENSOR HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
66
-
67
- 7. Termination
68
-
69
- This License and the rights granted hereunder will terminate automatically upon any breach by You of the terms of this License. Individuals or entities who have received Adaptations or Collections from You under this License, however, will not have their licenses terminated provided such individuals or entities remain in full compliance with those licenses. Sections 1, 2, 5, 6, 7, and 8 will survive any termination of this License.
70
- Subject to the above terms and conditions, the license granted here is perpetual (for the duration of the applicable copyright in the Work). Notwithstanding the above, Licensor reserves the right to release the Work under different license terms or to stop distributing the Work at any time; provided, however that any such election will not serve to withdraw this License (or any other license that has been, or is required to be, granted under the terms of this License), and this License will continue in full force and effect unless terminated as stated above.
71
- 8. Miscellaneous
72
-
73
- Each time You Distribute or Publicly Perform the Work or a Collection, the Licensor offers to the recipient a license to the Work on the same terms and conditions as the license granted to You under this License.
74
- Each time You Distribute or Publicly Perform an Adaptation, Licensor offers to the recipient a license to the original Work on the same terms and conditions as the license granted to You under this License.
75
- If any provision of this License is invalid or unenforceable under applicable law, it shall not affect the validity or enforceability of the remainder of the terms of this License, and without further action by the parties to this agreement, such provision shall be reformed to the minimum extent necessary to make such provision valid and enforceable.
76
- No term or provision of this License shall be deemed waived and no breach consented to unless such waiver or consent shall be in writing and signed by the party to be charged with such waiver or consent.
77
- This License constitutes the entire agreement between the parties with respect to the Work licensed here. There are no understandings, agreements or representations with respect to the Work not specified here. Licensor shall not be bound by any additional provisions that may appear in any communication from You. This License may not be modified without the mutual written agreement of the Licensor and You.
78
- The rights granted under, and the subject matter referenced, in this License were drafted utilizing the terminology of the Berne Convention for the Protection of Literary and Artistic Works (as amended on September 28, 1979), the Rome Convention of 1961, the WIPO Copyright Treaty of 1996, the WIPO Performances and Phonograms Treaty of 1996 and the Universal Copyright Convention (as revised on July 24, 1971). These rights and subject matter take effect in the relevant jurisdiction in which the License terms are sought to be enforced according to the corresponding provisions of the implementation of those treaty provisions in the applicable national law. If the standard suite of rights granted under applicable copyright law includes additional rights not granted under this License, such additional rights are deemed to be included in the License; this License is not intended to restrict the license of any rights under applicable law.