示例#1
0
 def to_json(self):
     json_dict = _o({
         'position': self.position,
         'residue_from': self.residue_from,
         'residue_to': self.residue_to
     })
     return json_dict
示例#2
0
 def to_json(self):
     query_type = self.get_type()
     json_dict = _o(type=query_type)
     json_dict['condition_entity'] = self.condition_entity.to_json()
     json_dict['target_entity'] = self.target_entity.to_json()
     json_dict['direction'] = self.direction
     return json_dict
示例#3
0
 def to_json(self):
     json_dict = _o({'mod_type': self.mod_type})
     if self.residue is not None:
         json_dict['residue'] = self.residue
     if self.position is not None:
         json_dict['position'] = self.position
     json_dict['is_modified'] = self.is_modified
     return json_dict
示例#4
0
 def to_json(self):
     json_dict = _o({'mod_type': self.mod_type})
     if self.residue is not None:
         json_dict['residue'] = self.residue
     if self.position is not None:
         json_dict['position'] = self.position
     json_dict['is_modified'] = self.is_modified
     return json_dict
示例#5
0
 def to_json(self):
     query_type = self.get_type()
     json_dict = _o(type=query_type)
     json_dict['entity'] = self.entity.to_json()
     json_dict['stmt_type'] = self.stmt_type
     json_dict['entity_role'] = self.entity_role
     json_dict['terminal_ns'] = self.terminal_ns
     return json_dict
示例#6
0
 def to_json(self):
     query_type = self.get_type()
     json_dict = _o(type=query_type)
     json_dict['entity'] = self.entity.to_json()
     json_dict['pattern_type'] = self.pattern_type
     json_dict['quantity'] = {}
     json_dict['quantity']['type'] = self.quant_type
     json_dict['quantity']['value'] = self.quant_value
     return json_dict
示例#7
0
 def to_json(self):
     json_dict = _o({'name': self.name})
     if self.mods:
         json_dict['mods'] = [mc.to_json() for mc in self.mods]
     if self.mutations:
         json_dict['mutations'] = [mc.to_json() for mc in self.mutations]
     if self.bound_conditions:
         json_dict['bound_conditions'] = [bc.to_json() for bc in
                                          self.bound_conditions]
     if self.activity is not None:
         json_dict['activity'] = self.activity.to_json()
     if self.location is not None:
         json_dict['location'] = self.location
     json_dict['db_refs'] = self.db_refs
     return json_dict
示例#8
0
 def to_json(self):
     json_dict = _o({'name': self.name})
     if self.mods:
         json_dict['mods'] = [mc.to_json() for mc in self.mods]
     if self.mutations:
         json_dict['mutations'] = [mc.to_json() for mc in self.mutations]
     if self.bound_conditions:
         json_dict['bound_conditions'] = [bc.to_json() for bc in
                                          self.bound_conditions]
     if self.activity is not None:
         json_dict['activity'] = self.activity.to_json()
     if self.location is not None:
         json_dict['location'] = self.location
     json_dict['db_refs'] = self.db_refs
     return json_dict
示例#9
0
 def to_json(self):
     query_type = self.get_type()
     json_dict = _o(type=query_type)
     json_dict['path'] = self.path_stmt.to_json()
     json_dict['entity_constraints'] = {}
     if self.include_entities:
         json_dict['entity_constraints']['include'] = [
             ec.to_json() for ec in self.include_entities]
     if self.exclude_entities:
         json_dict['entity_constraints']['exclude'] = [
             ec.to_json() for ec in self.exclude_entities]
     json_dict['relationship_constraints'] = {}
     if self.include_rels:
         json_dict['relationship_constraints']['include'] = [
             {'type': rel} for rel in self.include_rels]
     if self.exclude_rels:
         json_dict['relationship_constraints']['exclude'] = [
             {'type': rel} for rel in self.exclude_rels]
     return json_dict
示例#10
0
 def to_json(self):
     """Convert the evidence object into a JSON dict."""
     json_dict = _o({})
     if self.source_api:
         json_dict['source_api'] = self.source_api
     if self.pmid:
         json_dict['pmid'] = self.pmid
     if self.source_id:
         json_dict['source_id'] = self.source_id
     if self.text:
         json_dict['text'] = self.text
     if self.annotations:
         json_dict['annotations'] = self.annotations
     if self.epistemics:
         json_dict['epistemics'] = self.epistemics
     if self.context:
         json_dict['context'] = self.context.to_json()
     if self.text_refs:
         json_dict['text_refs'] = self.text_refs
     json_dict['source_hash'] = self.get_source_hash()
     if self.stmt_tag:
         json_dict['stmt_tag'] = self.stmt_tag
     return json_dict
示例#11
0
 def to_json(self):
     json_dict = _o({'name': self.name})
     json_dict['db_refs'] = self.db_refs
     return json_dict
示例#12
0
 def to_json(self):
     json_dict = _o({'position': self.position,
                     'residue_from': self.residue_from,
                     'residue_to': self.residue_to})
     return json_dict
示例#13
0
 def to_json(self):
     json_dict = _o({'activity_type': self.activity_type,
                     'is_active': self.is_active})
     return json_dict
示例#14
0
 def to_json(self):
     json_dict = _o({'polarity': self.polarity})
     if self.adjectives:
         json_dict['adjectives'] = self.adjectives
     return json_dict
示例#15
0
 def to_json(self):
     json_dict = _o({
         'activity_type': self.activity_type,
         'is_active': self.is_active
     })
     return json_dict
示例#16
0
 def to_json(self):
     json_dict = _o({'name': self.name})
     json_dict['db_refs'] = self.db_refs
     return json_dict
示例#17
0
 def to_json(self):
     json_dict = _o({
         'agent': self.agent.to_json(),
         'is_bound': self.is_bound
     })
     return json_dict
示例#18
0
 def to_json(self):
     json_dict = _o({'polarity': self.polarity})
     if self.adjectives:
         json_dict['adjectives'] = self.adjectives
     return json_dict
示例#19
0
 def to_json(self):
     json_dict = _o({'agent': self.agent.to_json(),
                     'is_bound': self.is_bound})
     return json_dict
示例#20
0
 def to_json(self):
     json_dict = _o({'type': 'qualitative', 'polarity': self.polarity})
     if self.adjectives:
         json_dict['adjectives'] = self.adjectives
     return json_dict