public static Optional getPropertySearchQuery()

in data-resource-management-service/drms-graph-impl/drms-api/src/main/java/org/apache/airavata/drms/api/utils/Utils.java [61:76]


    public static Optional<String> getPropertySearchQuery(List<ResourceSearchQuery> resourceSearchQueries, String type, String storageId) {
        if (!resourceSearchQueries.isEmpty()) {
            for (ResourceSearchQuery qry : resourceSearchQueries) {
                String query = "";
                if ((type.equals("FILE") || type.equals("COLLECTION")) && !storageId.isEmpty()) {
                    query = " MATCH (s:Storage{entityId:'" + storageId + "'})<-[:CHILD_OF*]-(r:" + type +
                            ") where r." + qry.getField() + " contains  '" + qry.getValue() + "' Return r ";
                } else {
                    query = " MATCH (r:" + type +
                            ") where r." + qry.getField() + " contains  '" + qry.getValue() + "' Return r ";
                }
                return Optional.ofNullable(query);
            }
        }
        return Optional.empty();
    }