public class OraclePropertyGraphUtils extends Object
Constructor and Description |
---|
OraclePropertyGraphUtils() |
Modifier and Type | Method and Description |
---|---|
static boolean |
compareFiles(String szSrcFile, String szDstFile)
Compare the two given files to see if they are same
|
static void |
dropPropertyGraph(oracle.kv.KVStoreConfig kvStoreConfig, String szGraphName)
This method drops an instance of OraclePropertyGraph.
|
static void |
dropPropertyGraph(oracle.kv.KVStoreConfig kvStoreConfig, String szGraphName, String username, String password)
This method drops an instance of OraclePropertyGraph.
|
static void |
dropPropertyGraph(OraclePropertyGraph opg)
This method drops an instance of OraclePropertyGraph.
|
static byte[] |
escape(String s)
This method escapes a string in the following manner: In one scan from left to right, a % is replaced with %25, a tab \t is replaced with %09, a newline \n is replaced with %0A, and a comma is replaced with %2c.
|
static void |
exportFlatFiles(OraclePropertyGraph pg, OutputStream osVertex, OutputStream osEdge, int dop, boolean append)
This function exports a given property graph into two flat files: one for vertices and the other for edges.
|
static void |
exportFlatFiles(OraclePropertyGraph pg, String vertexFileName, String edgeFileName, boolean append)
This function exports a given property graph into two flat files: one for vertices and the other for edges.
|
static void |
exportFlatFiles(OraclePropertyGraph pg, String vertexFileName, String edgeFileName, int dop, boolean append)
This function exports a given property graph into two flat files: one for vertices and the other for edges.
|
static void |
exportGML(OraclePropertyGraph opg, OutputStream os, PrintStream psOut)
Export the given OraclePropertyGraph instance to be GML format.
|
static void |
exportGML(OraclePropertyGraph opg, String gmlFileName, PrintStream psOut)
Export the given OraclePropertyGraph instance to be GML format.
|
static void |
exportGraphML(OraclePropertyGraph opg, OutputStream os, PrintStream psOut)
Export the given OraclePropertyGraph instance to be GraphML format.
|
static void |
exportGraphML(OraclePropertyGraph opg, String graphMLFileName, PrintStream psOut)
Export the given OraclePropertyGraph instance to be GraphML format.
|
static void |
exportGraphSON(OraclePropertyGraph opg, OutputStream os, PrintStream psOut)
Export the given OraclePropertyGraph instance to be GraphSON format.
|
static void |
exportGraphSON(OraclePropertyGraph opg, String graphSonFileName, PrintStream psOut)
Export the given OraclePropertyGraph instance to be GraphSON format.
|
static List<String> |
getGraphNames(oracle.kv.KVStoreConfig kvsc)
This method gets names of all graphs in database
|
static void |
importGML(OraclePropertyGraph opg, InputStream is, PrintStream psOut)
Import given graph in GML format to be an OraclePropertyGraph.
|
static void |
importGML(OraclePropertyGraph opg, String gmlFileName, PrintStream psOut)
Import given graph in GML format to be an OraclePropertyGraph.
|
static void |
importGraphML(OraclePropertyGraph opg, InputStream is, PrintStream psOut)
Import given graph in GraphML format to be an OraclePropertyGraph.
|
static void |
importGraphML(OraclePropertyGraph opg, String graphMLFileName, PrintStream psOut)
Import given graph in GraphML format to be an OraclePropertyGraph.
|
static void |
importGraphSON(OraclePropertyGraph opg, InputStream is, PrintStream psOut)
Import given graph in GraphSON format to be an OraclePropertyGraph.
|
static void |
importGraphSON(OraclePropertyGraph opg, String graphSonFileName, PrintStream psOut)
Import given graph in GraphSON format to be an OraclePropertyGraph.
|
static <E> List<E> |
listify(Iterable<E> it)
This method converts a given Iterable instance to a List object.
|
static void |
quietlyClose(InputStream is) |
static void |
quietlyClose(OutputStream os) |
static void |
quietlyCloseConnections(oracle.kv.KVStoreConfig[] connections) |
static void |
quietlyCloseKVStore(OraclePropertyGraph opg) |
static void |
quietlyShutdown(OraclePropertyGraph opg) |
static String[] |
readFileIntoArray(String filename) |
static long |
size(Iterable it)
This method returns the number of elements in the given Iterable object.
|
static String |
unescape(String s)
This method escapes a string in the following manner: %2C => ',' %0A => chr(10) %20 => ' ' %09 => chr(9) %25 => '%'
|
static void |
writeValue(OutputStream os, Object value, byte[] baFieldDelimiter, SimpleDateFormat sdf)
This helper function serializes an object into the given output stream.
|
public static boolean compareFiles(String szSrcFile, String szDstFile) throws IOException
IOException
public static void dropPropertyGraph(oracle.kv.KVStoreConfig kvStoreConfig, String szGraphName) throws IOException, Exception
kvStoreConfig
- configuration for Oracle NoSQL DatabaseszGraphName
- name of the property graph.IOException
Exception
public static void dropPropertyGraph(oracle.kv.KVStoreConfig kvStoreConfig, String szGraphName, String username, String password) throws IOException, Exception
kvStoreConfig
- configuration for Oracle NoSQL DatabaseszGraphName
- name of the property graph.username
- name of the userpassword
- password of the userIOException
Exception
public static void dropPropertyGraph(OraclePropertyGraph opg) throws IOException, Exception
opg
- an instance of OraclePropertyGraphIOException
Exception
public static byte[] escape(String s)
public static void exportFlatFiles(OraclePropertyGraph pg, OutputStream osVertex, OutputStream osEdge, int dop, boolean append) throws IOException, FileNotFoundException, InterruptedException
osVertex
- output stream to store the serialized verticesosEdge
- output stream to store the serialized edgesIOException
FileNotFoundException
InterruptedException
public static void exportFlatFiles(OraclePropertyGraph pg, String vertexFileName, String edgeFileName, boolean append) throws IOException, FileNotFoundException, InterruptedException
public static void exportFlatFiles(OraclePropertyGraph pg, String vertexFileName, String edgeFileName, int dop, boolean append) throws IOException, FileNotFoundException, InterruptedException
public static void exportGML(OraclePropertyGraph opg, OutputStream os, PrintStream psOut) throws IOException
IOException
public static void exportGML(OraclePropertyGraph opg, String gmlFileName, PrintStream psOut) throws IOException
IOException
public static void exportGraphML(OraclePropertyGraph opg, OutputStream os, PrintStream psOut) throws IOException
IOException
public static void exportGraphML(OraclePropertyGraph opg, String graphMLFileName, PrintStream psOut) throws IOException
IOException
public static void exportGraphSON(OraclePropertyGraph opg, OutputStream os, PrintStream psOut) throws IOException
IOException
public static void exportGraphSON(OraclePropertyGraph opg, String graphSonFileName, PrintStream psOut) throws IOException
IOException
public static List<String> getGraphNames(oracle.kv.KVStoreConfig kvsc) throws OraclePropertyGraphException
kvsc
- a KVStoreConfig
objectOraclePropertyGraphException
public static void importGML(OraclePropertyGraph opg, InputStream is, PrintStream psOut) throws IOException
IOException
public static void importGML(OraclePropertyGraph opg, String gmlFileName, PrintStream psOut) throws IOException
IOException
public static void importGraphML(OraclePropertyGraph opg, InputStream is, PrintStream psOut) throws IOException
IOException
public static void importGraphML(OraclePropertyGraph opg, String graphMLFileName, PrintStream psOut) throws IOException
IOException
public static void importGraphSON(OraclePropertyGraph opg, InputStream is, PrintStream psOut) throws IOException
IOException
public static void importGraphSON(OraclePropertyGraph opg, String graphSonFileName, PrintStream psOut) throws IOException
IOException
public static <E> List<E> listify(Iterable<E> it)
it
- an Iterable instance. It can be NULL.public static void quietlyClose(InputStream is)
public static void quietlyClose(OutputStream os)
public static void quietlyCloseConnections(oracle.kv.KVStoreConfig[] connections)
public static void quietlyCloseKVStore(OraclePropertyGraph opg)
public static void quietlyShutdown(OraclePropertyGraph opg)
public static String[] readFileIntoArray(String filename) throws IOException, FileNotFoundException
IOException
FileNotFoundException
public static long size(Iterable it)
public static String unescape(String s)
public static void writeValue(OutputStream os, Object value, byte[] baFieldDelimiter, SimpleDateFormat sdf) throws IOException
IOException
Copyright © 2015 Oracle and/or its afflilates. All Rights Reserved.