@Test public void doNotTruncateVirusName() { assertThat(NodeUtil.truncateTaxonName("whatever something virus"), is("whatever something virus")); }
public static String truncateTaxonName(String taxonName) { String truncatedName = taxonName; if (!StringUtils.containsIgnoreCase(taxonName, "virus") && StringUtils.isNotBlank(taxonName)) { String[] nameParts = StringUtils.split(taxonName); if (nameParts.length > 2) { truncatedName = nameParts[0].trim() + " " + nameParts[1].trim(); } } return truncatedName; }
NodeUtil { public static String truncateTaxonName(String taxonName) { String truncatedName = taxonName; if (!StringUtils.containsIgnoreCase(taxonName, "virus") && StringUtils.isNotBlank(taxonName)) { String[] nameParts = StringUtils.split(taxonName); if (nameParts.length > 2) { truncatedName = nameParts[0].trim() + " " + nameParts[1].trim(); } } return truncatedName; } }
NodeUtil { public static String truncateTaxonName(String taxonName) { String truncatedName = taxonName; if (!StringUtils.containsIgnoreCase(taxonName, "virus") && StringUtils.isNotBlank(taxonName)) { String[] nameParts = StringUtils.split(taxonName); if (nameParts.length > 2) { truncatedName = nameParts[0].trim() + " " + nameParts[1].trim(); } } return truncatedName; }  }
NodeUtil { public static String truncateTaxonName(String taxonName) { String truncatedName = taxonName; if (!StringUtils.containsIgnoreCase(taxonName, "virus") && StringUtils.isNotBlank(taxonName)) { String[] nameParts = StringUtils.split(taxonName); if (nameParts.length > 2) { truncatedName = nameParts[0].trim() + " " + nameParts[1].trim(); } } return truncatedName; }  static String getPropertyStringValueOrDefault(Node node, String propertyName, String defaultValue); static String truncateTaxonName(String taxonName); static void connectTaxa(Taxon taxon, TaxonNode taxonNode, GraphDatabaseService graphDb, RelTypes relType); static List<StudyNode> findAllStudies(GraphDatabaseService graphService); static void findStudies(GraphDatabaseService graphService, StudyNodeListener listener); static void findStudiesByQuery(GraphDatabaseService graphService, StudyNodeListener listener, String queryKey, String queryValue); static void findDatasetsByQuery(GraphDatabaseService graphService, DatasetNodeListener listener, String queryKey, String queryValue); static RelationshipType asNeo4j(RelType type); static RelationshipType[] asNeo4j(); static RelationshipType[] asNeo4j(RelType[] values); static Iterable<Relationship> getSpecimens(StudyNode study); static Iterable<Relationship> getSpecimensSupportedAndRefutedBy(Study study); static Iterable<Relationship> getSpecimens(StudyNode study, RelTypes relType); static Iterable<Relationship> getSpecimens(Node studyNode); static Iterable<Relationship> getOutgoingNodeRelationships(Node node, RelType relType); static Iterable<Relationship> getOutgoingNodeRelationships(Node node, RelType relType, Direction dir); static Iterable<Relationship> getClassifications(Specimen specimen); static Iterable<Relationship> getStomachContents(Specimen specimen); static Iterable<Relationship> getSpecimenCaughtHere(Location location); static Node getDataSetForStudy(StudyNode study); static Index<Node> forNodes(GraphDatabaseService graphDb, String indexName); static Index<Node> forNodes(GraphDatabaseService graphDb, String indexName, Map properties); static void handleCollectedRelationships(NodeTypeDirection ntd, final RelationshipListener listener); static void handleCollectedRelationships(NodeTypeDirection ntd, final RelationshipListener listener, int batchSize); }
NodeUtil { public static String truncateTaxonName(String taxonName) { String truncatedName = taxonName; if (!StringUtils.containsIgnoreCase(taxonName, "virus") && StringUtils.isNotBlank(taxonName)) { String[] nameParts = StringUtils.split(taxonName); if (nameParts.length > 2) { truncatedName = nameParts[0].trim() + " " + nameParts[1].trim(); } } return truncatedName; }  static String getPropertyStringValueOrDefault(Node node, String propertyName, String defaultValue); static String truncateTaxonName(String taxonName); static void connectTaxa(Taxon taxon, TaxonNode taxonNode, GraphDatabaseService graphDb, RelTypes relType); static List<StudyNode> findAllStudies(GraphDatabaseService graphService); static void findStudies(GraphDatabaseService graphService, StudyNodeListener listener); static void findStudiesByQuery(GraphDatabaseService graphService, StudyNodeListener listener, String queryKey, String queryValue); static void findDatasetsByQuery(GraphDatabaseService graphService, DatasetNodeListener listener, String queryKey, String queryValue); static RelationshipType asNeo4j(RelType type); static RelationshipType[] asNeo4j(); static RelationshipType[] asNeo4j(RelType[] values); static Iterable<Relationship> getSpecimens(StudyNode study); static Iterable<Relationship> getSpecimensSupportedAndRefutedBy(Study study); static Iterable<Relationship> getSpecimens(StudyNode study, RelTypes relType); static Iterable<Relationship> getSpecimens(Node studyNode); static Iterable<Relationship> getOutgoingNodeRelationships(Node node, RelType relType); static Iterable<Relationship> getOutgoingNodeRelationships(Node node, RelType relType, Direction dir); static Iterable<Relationship> getClassifications(Specimen specimen); static Iterable<Relationship> getStomachContents(Specimen specimen); static Iterable<Relationship> getSpecimenCaughtHere(Location location); static Node getDataSetForStudy(StudyNode study); static Index<Node> forNodes(GraphDatabaseService graphDb, String indexName); static Index<Node> forNodes(GraphDatabaseService graphDb, String indexName, Map properties); static void handleCollectedRelationships(NodeTypeDirection ntd, final RelationshipListener listener); static void handleCollectedRelationships(NodeTypeDirection ntd, final RelationshipListener listener, int batchSize); static final int TRANSACTION_BATCH_SIZE_DEFAULT; }