def get_triplets(
        self,
        entity_names: Optional[List[str]] = None,
        relation_names: Optional[List[str]] = None,
        properties: Optional[dict] = None,
        ids: Optional[List[str]] = None,
    ) -> List[Triplet]:
        """
        Get the triplets of the entities in the graph.

        Args:
            entity_names (Optional[List[str]], optional): The entity names to find. Defaults to None.
            relation_names (Optional[List[str]], optional): The relation names to follow. Defaults to None.
            properties (Optional[dict], optional): The properties to return. Defaults to None.
            ids (Optional[List[str]], optional): The ids to search on. Defaults to None.

        Returns:
            List[Triplet]: A list of triples

        """
        cypher_statement = f"MATCH (e:`{BASE_ENTITY_LABEL}`) "

        params = {}
        if entity_names or properties or ids:
            cypher_statement += "WHERE "

        if entity_names:
            cypher_statement += "e.name in $entity_names "
            params["entity_names"] = entity_names

        if ids:
            cypher_statement += "e.id in $ids "
            params["ids"] = ids

        if properties:
            prop_list = []
            for i, prop in enumerate(properties):
                prop_list.append(f"e.`{prop}` = $property_{i}")
                params[f"property_{i}"] = properties[prop]
            cypher_statement += " AND ".join(prop_list)

        return_statement = f"""
            WITH e
            MATCH (e)-[r{":`" + "`|`".join(relation_names) + "`" if relation_names else ""}]->(t:{BASE_ENTITY_LABEL})
            RETURN e.name AS source_id, [l in labels(e) WHERE l <> '{BASE_ENTITY_LABEL}' | l][0] AS source_type,
                   e{{.* , embedding: Null, name: Null}} AS source_properties,
                   type(r) AS type,
                   r{{.*}} AS rel_properties,
                   t.name AS target_id, [l in labels(t) WHERE l <> '{BASE_ENTITY_LABEL}' | l][0] AS target_type,
                   t{{.* , embedding: Null, name: Null}} AS target_properties"""
        cypher_statement += return_statement

        data = self.structured_query(cypher_statement, param_map=params)
        data = data if data else []

        triples = []
        for record in data:
            source = EntityNode(
                name=record["source_id"],
                label=record["source_type"],
                properties=remove_empty_values(record["source_properties"]),
            )
            target = EntityNode(
                name=record["target_id"],
                label=record["target_type"],
                properties=remove_empty_values(record["target_properties"]),
            )
            rel = Relation(
                source_id=record["source_id"],
                target_id=record["target_id"],
                label=record["type"],
                properties=remove_empty_values(record["rel_properties"]),
            )
            triples.append([source, rel, target])
        return triples

        Get the triplets of the entities in the graph.

        Args:
            entity_names (Optional[List[str]], optional): The entity names to find. Defaults to None.
            relation_names (Optional[List[str]], optional): The relation names to follow. Defaults to None.
            properties (Optional[dict], optional): The properties to return. Defaults to None.
            ids (Optional[List[str]], optional): The ids to search on. Defaults to None.

        Returns:
            List[Triplet]: A list of triples

        
llama-index-integrations/graph_stores/llama-index-graph-stores-neptune/llama_index/graph_stores/neptune/base_property_graph.py