3333
3434/**
3535 * The ArangoDB graph class.
36- *
36+ * <p>
3737 * NOTE: USE OF THIS API REQUIRES A USER WITH <b>ADMINISTRATOR</b> ACCESS IF THE <b>DB</b> USED FOR
3838 * THE GRAPH DOES NOT EXIST. As per ArangoDB, creating DB is only allowed for the root user, hence
3939 * only the root user can be used if the DB does not exist.
5151 * An ArangoDBGraph is instantiated from an Apache Commons Configuration instance. The configuration
5252 * must provide both TinkerPop and ArangoDB configuration options. The ArangoDB options are
5353 * described in the ArangoDB Java Driver <a href="https://github.com/arangodb/arangodb-java-driver/blob/master/docs/Drivers/Java/Reference/Setup.md">documentation.</a>
54- *
54+ * <p>
5555 * For the TinkerPop part, the configuration must provide as a minimum the database name and the
5656 * graph name. If no vertex, edge and relation information is provided, the graph will be considered
5757 * schema-less.
7171 * simple graphs, only one graph.vertex and graph.edge properties need to be provided. In this case
7272 * edges are allowed to connect to any two nodes. For example:
7373 * <pre>gremlin.arangodb.conf.graph.vertex = Place
74- *gremlin.arangodb.conf.graph.edge = Transition
74+ * gremlin.arangodb.conf.graph.edge = Transition
7575 * </pre>
7676 * would allow the user to create Vertices that represent Places, and Edges that represent
7777 * Transitions. A transition can be created between any two Places. If additional vertices and edges
8282 * relations are allowed, e.g.:
8383 * <ul>
8484 * <li>One-to-one edges
85- *<pre>gremlin.arangodb.conf.graph.vertex = Place
86- *gremlin.arangodb.conf.graph.vertex = Transition
87- *gremlin.arangodb.conf.graph.edge = PTArc
88- *gremlin.arangodb.conf.graph.edge = TPArc
89- *gremlin.arangodb.conf.graph.relation = PTArc:Place->Transition
90- *gremlin.arangodb.conf.graph.relation = TPArc:Transition->Place
91- *</pre>
85+ * <pre>gremlin.arangodb.conf.graph.vertex = Place
86+ * gremlin.arangodb.conf.graph.vertex = Transition
87+ * gremlin.arangodb.conf.graph.edge = PTArc
88+ * gremlin.arangodb.conf.graph.edge = TPArc
89+ * gremlin.arangodb.conf.graph.relation = PTArc:Place->Transition
90+ * gremlin.arangodb.conf.graph.relation = TPArc:Transition->Place
91+ * </pre>
9292 * would allow the user to create nodes to represent Places and Transitions, and edges to represent
9393 * Arcs. However, in this case, we have two type of arcs: PTArc and TPArc. The relations specify
9494 * that PTArcs can only go from Place to Transitions and TPArcs can only go from Transitions to
9595 * Places. A relation can also specify multiple to/from nodes. In this case, the to/from values is a
9696 * comma separated list of names.
9797 * <li>Many-to-many edges
9898 * <pre>gremlin.arangodb.conf.graph.vertex = male
99- *gremlin.arangodb.conf.graph.vertex = female
100- *gremlin.arangodb.conf.graph.edge = relation
101- *gremlin.arangodb.conf.graph.relation = relation:male,female->male,female
99+ * gremlin.arangodb.conf.graph.vertex = female
100+ * gremlin.arangodb.conf.graph.edge = relation
101+ * gremlin.arangodb.conf.graph.relation = relation:male,female->male,female
102102 * </pre>
103103 * </ul>
104104 * <p>
131131 * @author Johannes Gocke (http://www.triagens.de)
132132 * @author Guido Schwab (http://www.triagens.de)
133133 * @author Horacio Hoyos Rodriguez (https://www.york.ac.uk)
134- *
135134 */
136135
137136@ Graph .OptIn (Graph .OptIn .SUITE_STRUCTURE_STANDARD )
183182 test = "org.apache.tinkerpop.gremlin.structure.VertexTest$AddEdgeTest" ,
184183 method = "shouldAddEdgeWithUserSuppliedStringId" ,
185184 reason = "FIXME" )
185+ @ Graph .OptOut (
186+ test = "org.apache.tinkerpop.gremlin.process.traversal.step.map.MergeEdgeTest$Traversals" ,
187+ method = "*" ,
188+ reason = "replaced by com.arangodb.tinkerpop.gremlin.custom.process.traversal.step.map.MergeEdgeTest"
189+ )
190+ @ Graph .OptOut (
191+ test = "org.apache.tinkerpop.gremlin.process.traversal.step.map.MergeVertexTest$Traversals" ,
192+ method = "g_withSideEffectXc_label_person_name_markoX_withSideEffectXm_age_19X_mergeVXselectXcXX_optionXonMatch_selectXmXX_option" ,
193+ reason = "FIXME: DE-995"
194+ )
195+ @ Graph .OptOut (
196+ test = "org.apache.tinkerpop.gremlin.process.traversal.step.map.MergeVertexTest$Traversals" ,
197+ method = "g_mergeVXlabel_person_name_markoX_optionXonMatch_age_19X_option" ,
198+ reason = "FIXME: DE-995"
199+ )
186200public class ArangoDBGraph implements Graph {
187201
188202 /**
@@ -197,14 +211,17 @@ public class ArangoDBGraphFeatures implements Features {
197211
198212 private class ArangoDBGraphGraphFeatures implements GraphFeatures {
199213
200- /** The variable features. */
214+ /**
215+ * The variable features.
216+ */
201217 private VariableFeatures variableFeatures = new ArangoDBGraphVariables .ArangoDBGraphVariableFeatures ();
202218
203219 /**
204220 * Instantiates a new ArangoDB graph graph features.
205221 */
206222
207- ArangoDBGraphGraphFeatures () { }
223+ ArangoDBGraphGraphFeatures () {
224+ }
208225
209226 @ Override
210227 public boolean supportsComputer () {
@@ -237,7 +254,8 @@ private class ArangoDBGraphElementFeatures implements ElementFeatures {
237254 * Instantiates a new ArangoDB graph element features.
238255 */
239256
240- ArangoDBGraphElementFeatures () { }
257+ ArangoDBGraphElementFeatures () {
258+ }
241259
242260 @ Override
243261 public boolean supportsAnyIds () {
@@ -257,11 +275,11 @@ public boolean supportsNumericIds() {
257275 @ Override
258276 public boolean supportsUuidIds () {
259277 /* We can not use Java Objects as keys, ergo we can not support UUID and Integer
260- * the string representation of these is fine for ArangoDB, which makes the test
261- * complain because it expects the actual class to be deserialized. We can test
262- * to see if a string is accepted for deserialization.
263- * TODO As with properties, a way to support this is to store the id value class
264- */
278+ * the string representation of these is fine for ArangoDB, which makes the test
279+ * complain because it expects the actual class to be deserialized. We can test
280+ * to see if a string is accepted for deserialization.
281+ * TODO As with properties, a way to support this is to store the id value class
282+ */
265283 return false ;
266284 }
267285 }
@@ -272,15 +290,18 @@ public boolean supportsUuidIds() {
272290
273291 private class ArangoDBGraphVertexFeatures extends ArangoDBGraphElementFeatures implements VertexFeatures {
274292
275- /** The vertex property features. */
293+ /**
294+ * The vertex property features.
295+ */
276296
277297 private final VertexPropertyFeatures vertexPropertyFeatures = new ArangoDBGraphVertexPropertyFeatures ();
278298
279299 /**
280300 * Instantiates a new ArangoDB graph vertex features.
281301 */
282302
283- ArangoDBGraphVertexFeatures () { }
303+ ArangoDBGraphVertexFeatures () {
304+ }
284305
285306
286307 @ Override
@@ -294,15 +315,18 @@ public VertexPropertyFeatures properties() {
294315 */
295316 public class ArangoDBGraphEdgeFeatures extends ArangoDBGraphElementFeatures implements EdgeFeatures {
296317
297- /** The edge property features. */
318+ /**
319+ * The edge property features.
320+ */
298321
299322 private final EdgePropertyFeatures edgePropertyFeatures = new ArangoDBGraphEdgePropertyFeatures ();
300323
301324 /**
302325 * Instantiates a new ArangoDB graph edge features.
303326 */
304327
305- ArangoDBGraphEdgeFeatures () { }
328+ ArangoDBGraphEdgeFeatures () {
329+ }
306330
307331 @ Override
308332 public EdgePropertyFeatures properties () {
@@ -320,7 +344,8 @@ private class ArangoDBGraphVertexPropertyFeatures implements VertexPropertyFeatu
320344 * Instantiates a new ArangoDB graph vertex property features.
321345 */
322346
323- ArangoDBGraphVertexPropertyFeatures () { }
347+ ArangoDBGraphVertexPropertyFeatures () {
348+ }
324349
325350 @ Override
326351 public boolean supportsAnyIds () {
@@ -340,11 +365,11 @@ public boolean supportsNumericIds() {
340365 @ Override
341366 public boolean supportsUuidIds () {
342367 /* We can not use Java Objects as keys, ergo we can not support UUID and Integer
343- * the string representation of these is fine for ArangoDB, which makes the test
344- * complain because it expects the actual class to be deserialized. We can test
345- * to see if a string is accepted for deserialization.
346- * TODO As with properties, a way to support this is to store the id value class
347- */
368+ * the string representation of these is fine for ArangoDB, which makes the test
369+ * complain because it expects the actual class to be deserialized. We can test
370+ * to see if a string is accepted for deserialization.
371+ * TODO As with properties, a way to support this is to store the id value class
372+ */
348373 return false ;
349374 }
350375 }
@@ -358,18 +383,25 @@ private class ArangoDBGraphEdgePropertyFeatures implements EdgePropertyFeatures
358383 * Instantiates a new ArangoDB graph edge property features.
359384 */
360385
361- ArangoDBGraphEdgePropertyFeatures () { }
386+ ArangoDBGraphEdgePropertyFeatures () {
387+ }
362388 }
363389
364- /** The graph features. */
390+ /**
391+ * The graph features.
392+ */
365393
366394 protected GraphFeatures graphFeatures = new ArangoDBGraphGraphFeatures ();
367395
368- /** The vertex features. */
396+ /**
397+ * The vertex features.
398+ */
369399
370400 protected VertexFeatures vertexFeatures = new ArangoDBGraphVertexFeatures ();
371401
372- /** The edge features. */
402+ /**
403+ * The edge features.
404+ */
373405
374406 protected EdgeFeatures edgeFeatures = new ArangoDBGraphEdgeFeatures ();
375407
@@ -394,90 +426,132 @@ public VertexFeatures vertex() {
394426 }
395427 }
396428
397- /** The Logger. */
429+ /**
430+ * The Logger.
431+ */
398432
399433 private static final Logger logger = LoggerFactory .getLogger (ArangoDBGraph .class );
400434
401- /** The properties name CONFIG_CONF. */
435+ /**
436+ * The properties name CONFIG_CONF.
437+ */
402438
403439 public static final String PROPERTY_KEY_PREFIX = "gremlin.arangodb.conf" ;
404440
405- /** The properties name CONFIG_DB. */
441+ /**
442+ * The properties name CONFIG_DB.
443+ */
406444
407445 public static final String PROPERTY_KEY_DB_NAME = "graph.db" ;
408446
409- /** The properties name CONFIG_NAME. */
447+ /**
448+ * The properties name CONFIG_NAME.
449+ */
410450
411451 public static final String PROPERTY_KEY_GRAPH_NAME = "graph.name" ;
412452
413- /** The properties name CONFIG_VERTICES. */
453+ /**
454+ * The properties name CONFIG_VERTICES.
455+ */
414456
415457 public static final String PROPERTY_KEY_VERTICES = "graph.vertex" ;
416458
417- /** The properties name CONFIG_EDGES. */
459+ /**
460+ * The properties name CONFIG_EDGES.
461+ */
418462
419463 public static final String PROPERTY_KEY_EDGES = "graph.edge" ;
420464
421- /** The properties name CONFIG_RELATIONS. */
465+ /**
466+ * The properties name CONFIG_RELATIONS.
467+ */
422468
423469 public static final String PROPERTY_KEY_RELATIONS = "graph.relation" ;
424470
425- /** The properties name CONFIG_SHOULD_PREFIX_COLLECTION_NAMES **/
471+ /**
472+ * The properties name CONFIG_SHOULD_PREFIX_COLLECTION_NAMES
473+ **/
426474
427475 public static final String PROPERTY_KEY_SHOULD_PREFIX_COLLECTION_NAMES = "graph.shouldPrefixCollectionNames" ;
428476
429- /** The Constant DEFAULT_VERTEX_COLLECTION. */
477+ /**
478+ * The Constant DEFAULT_VERTEX_COLLECTION.
479+ */
430480
431481 public static final String DEFAULT_VERTEX_COLLECTION = "vertex" ;
432482
433- /** The Constant DEFAULT_VERTEX_COLLECTION. */
483+ /**
484+ * The Constant DEFAULT_VERTEX_COLLECTION.
485+ */
434486
435487 public static final String DEFAULT_EDGE_COLLECTION = "edge" ;
436488
437- /** The Constant GRAPH_VARIABLES_COLLECTION. */
489+ /**
490+ * The Constant GRAPH_VARIABLES_COLLECTION.
491+ */
438492
439493 public static final String GRAPH_VARIABLES_COLLECTION = "TINKERPOP-GRAPH-VARIABLES" ;
440494
441- /** The Constant ELEMENT_PROPERTIES_COLLECTION. */
495+ /**
496+ * The Constant ELEMENT_PROPERTIES_COLLECTION.
497+ */
442498
443499 public static final String ELEMENT_PROPERTIES_COLLECTION = "ELEMENT-PROPERTIES" ;
444500
445- /** The Constant ELEMENT_PROPERTIES_EDGE_COLLECTION. */
501+ /**
502+ * The Constant ELEMENT_PROPERTIES_EDGE_COLLECTION.
503+ */
446504
447505 public static final String ELEMENT_PROPERTIES_EDGE_COLLECTION = "ELEMENT-HAS-PROPERTIES" ;
448506
449507 public static Set <String > GRAPH_COLLECTIONS = new HashSet <>(Arrays .asList (ELEMENT_PROPERTIES_EDGE_COLLECTION , ELEMENT_PROPERTIES_COLLECTION ));
450508
451- /** The features. */
509+ /**
510+ * The features.
511+ */
452512
453513 private final Features FEATURES = new ArangoDBGraphFeatures ();
454514
455- /** A ArangoDBGraphClient to handle the connection to the Database. */
515+ /**
516+ * A ArangoDBGraphClient to handle the connection to the Database.
517+ */
456518
457519 private ArangoDBGraphClient client = null ;
458520
459- /** The name. */
521+ /**
522+ * The name.
523+ */
460524
461525 private String name ;
462526
463- /** The vertex collections. */
527+ /**
528+ * The vertex collections.
529+ */
464530
465531 private final List <String > vertexCollections ;
466532
467- /** The edge collections. */
533+ /**
534+ * The edge collections.
535+ */
468536
469537 private final List <String > edgeCollections ;
470538
471- /** The relations. */
539+ /**
540+ * The relations.
541+ */
472542
473543 private final List <String > relations ;
474544
475- /** The configuration. */
545+ /**
546+ * The configuration.
547+ */
476548
477549 private Configuration configuration ;
478550
479551
480- /** If collection names should be prefixed with graph name */
552+ /**
553+ * If collection names should be prefixed with graph name
554+ */
481555 private final boolean shouldPrefixCollectionNames ;
482556
483557
@@ -729,6 +803,7 @@ public List<String> vertexCollections() {
729803
730804 /**
731805 * Return the collection name correctly prefixed according to the shouldPrefixCollectionNames flag
806+ *
732807 * @param collectionName the collection name
733808 * @return the Collection name prefixed
734809 */
0 commit comments