This is the third installment of the "3 Ways to Serialize and Write a Sub-Graph to Client Side" series. The first installmentshowed an approach which serializes a sub graph on the server side and copies the graph data files to the client side. The second installment, on the other hand, showed a more direct way that first reads a sub graph to the client side and then uses utility methods in OraclePropertyGraphUtilsBase Java class to serialize the graph data.
I saved the easiest for the last :)
Approach #3 Use Grep or AWK or Whatever Your Favorite Text Processing Tool to Apply Filtering Directly on the Flat Files
The flat file format used by Oracle Big Data Spatial and Graph (BDSG) is in fact quite text processing friendly. Assume you have a large graph stored in flat files (.opv, .ope) and you want to create a sub graph on the client side. Chances are you can use grep or egrep or gawk or whatever your favorite text processing tool to apply filtering directly on the fat files, as long as the filtering condition is at per record level.
For example, the following egrep will keep only edges with label "collaborates".