Пример #1
0
 def _convert_kg1_node_to_swagger_node(
         self, neo4j_node: Dict[str, any]) -> Tuple[str, Node]:
     swagger_node = Node()
     swagger_node_key = neo4j_node.get('id')
     swagger_node.name = neo4j_node.get('name')
     node_category = neo4j_node.get('category')
     swagger_node.category = eu.convert_to_list(node_category)
     other_properties = ["symbol", "description", "uri"]
     swagger_node.attributes = self._create_swagger_attributes(
         other_properties, neo4j_node)
     return swagger_node_key, swagger_node
Пример #2
0
 def _create_ngd_node(kg2_node_key: str,
                      kg2_node: Node) -> Tuple[str, Node]:
     ngd_node = Node()
     ngd_node_key = kg2_node_key
     ngd_node.name = kg2_node.name
     ngd_node.category = kg2_node.category
     ngd_node.attributes = [
         attribute for attribute in kg2_node.attributes
         if attribute.name in {"iri", "description"}
     ]
     return ngd_node_key, ngd_node
Пример #3
0
 def _convert_kg2c_node_to_swagger_node(
         self, neo4j_node: Dict[str, any]) -> Tuple[str, Node]:
     swagger_node = Node()
     swagger_node_key = neo4j_node.get('id')
     swagger_node.name = neo4j_node.get('name')
     swagger_node.category = neo4j_node.get('types')
     # Add all additional properties on KG2c nodes as swagger Attribute objects
     other_properties = [
         "description", "iri", "equivalent_curies", "publications",
         "all_names"
     ]
     swagger_node.attributes = self._create_swagger_attributes(
         other_properties, neo4j_node)
     return swagger_node_key, swagger_node
Пример #4
0
 def _convert_kg2c_node_to_trapi_node(
         self, neo4j_node: Dict[str, any]) -> Tuple[str, Node]:
     node = Node()
     node_key = neo4j_node.get('id')
     node.name = neo4j_node.get('name')
     node.category = eu.convert_to_list(neo4j_node.get('category'))
     # Add all additional properties on KG2c nodes as TRAPI Attribute objects
     other_properties = [
         "iri", "description", "all_names", "all_categories",
         "expanded_categories", "equivalent_curies", "publications"
     ]
     node.attributes = self._create_trapi_attributes(
         other_properties, neo4j_node)
     return node_key, node
Пример #5
0
 def _convert_kg2_node_to_trapi_node(
         self, neo4j_node: Dict[str, any]) -> Tuple[str, Node]:
     node = Node()
     node_key = neo4j_node.get('id')
     node.name = neo4j_node.get('name')
     node.category = eu.convert_to_list(neo4j_node.get('category'))
     # Add all additional properties on KG2 nodes as TRAPI Attribute objects
     other_properties = [
         "iri", "full_name", "description", "publications", "synonym",
         "provided_by", "deprecated", "update_date"
     ]
     node.attributes = self._create_trapi_attributes(
         other_properties, neo4j_node)
     return node_key, node
Пример #6
0
 def _convert_kg2_node_to_swagger_node(
         self, neo4j_node: Dict[str, any]) -> Tuple[str, Node]:
     swagger_node = Node()
     swagger_node_key = neo4j_node.get('id')
     swagger_node.name = neo4j_node.get('name')
     node_category = neo4j_node.get('category_label')
     swagger_node.category = eu.convert_to_list(node_category)
     # Add all additional properties on KG2 nodes as swagger Attribute objects
     other_properties = [
         "full_name", "description", "iri", "publications", "synonym",
         "category", "provided_by", "deprecated", "update_date"
     ]
     swagger_node.attributes = self._create_swagger_attributes(
         other_properties, neo4j_node)
     return swagger_node_key, swagger_node