Class GraphMLWriter.Builder
- java.lang.Object
-
- org.apache.tinkerpop.gremlin.structure.io.graphml.GraphMLWriter.Builder
-
- All Implemented Interfaces:
GraphWriter.WriterBuilder<GraphMLWriter>
- Enclosing class:
- GraphMLWriter
public static final class GraphMLWriter.Builder extends Object implements GraphWriter.WriterBuilder<GraphMLWriter>
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description GraphMLWritercreate()Creates theGraphWriterimplementation given options provided to theGraphWriter.WriterBuilderimplementation.GraphMLWriter.BuilderedgeKeyTypes(Map<String,String> edgeKeyTypes)Map of the data types of the edge keys.GraphMLWriter.BuilderedgeLabelKey(String edgeLabelKey)Set the name of the edge label in the GraphML.GraphMLWriter.Buildernormalize(boolean normalize)Normalized output is deterministic with respect to the order of elements and properties in the resulting XML document, and is compatible with line diff-based tools such as Git.GraphMLWriter.BuildervertexKeyTypes(Map<String,String> vertexKeyTypes)Map of the data types of the vertex keys.GraphMLWriter.BuildervertexLabelKey(String vertexLabelKey)Set the name of the vertex label in the GraphML.GraphMLWriter.BuilderxmlSchemaLocation(String xmlSchemaLocation)Location of the GraphML schema which is defaulted toGraphMLTokens.DEFAULT_GRAPHML_SCHEMA_LOCATION.
-
-
-
Method Detail
-
normalize
public GraphMLWriter.Builder normalize(boolean normalize)
Normalized output is deterministic with respect to the order of elements and properties in the resulting XML document, and is compatible with line diff-based tools such as Git. Note: normalized output is sideEffects-intensive and is not appropriate for very large graphs.- Parameters:
normalize- whether to normalize the output.
-
vertexKeyTypes
public GraphMLWriter.Builder vertexKeyTypes(Map<String,String> vertexKeyTypes)
Map of the data types of the vertex keys. It is best to specify this Map if possible as the only other way to attain it is to iterate all vertices to find all the property keys.
-
edgeKeyTypes
public GraphMLWriter.Builder edgeKeyTypes(Map<String,String> edgeKeyTypes)
Map of the data types of the edge keys. It is best to specify this Map if possible as the only other way to attain it is to iterate all vertices to find all the property keys.
-
xmlSchemaLocation
public GraphMLWriter.Builder xmlSchemaLocation(String xmlSchemaLocation)
Location of the GraphML schema which is defaulted toGraphMLTokens.DEFAULT_GRAPHML_SCHEMA_LOCATION.
-
edgeLabelKey
public GraphMLWriter.Builder edgeLabelKey(String edgeLabelKey)
Set the name of the edge label in the GraphML. This value is defaulted toGraphMLTokens.LABEL_E. The value ofElement.label()is written as a data element on the edge and the appropriate key element is added to define it in the GraphML. It is important that when reading this GraphML back in with the reader that this label key is set appropriately to properly read the edge labels.- Parameters:
edgeLabelKey- if the label of an edge will be handled by the data property.
-
vertexLabelKey
public GraphMLWriter.Builder vertexLabelKey(String vertexLabelKey)
Set the name of the vertex label in the GraphML. This value is defaulted toGraphMLTokens.LABEL_V. The value ofElement.label()is written as a data element on the vertex and the appropriate key element is added to define it in the GraphML. It is important that when reading this GraphML back in with the reader that this label key is set appropriately to properly read the vertex labels.- Parameters:
vertexLabelKey- if the label of an vertex will be handled by the data property.
-
create
public GraphMLWriter create()
Description copied from interface:GraphWriter.WriterBuilderCreates theGraphWriterimplementation given options provided to theGraphWriter.WriterBuilderimplementation.- Specified by:
createin interfaceGraphWriter.WriterBuilder<GraphMLWriter>
-
-