1
0
Fork 0

fixed merge conflict

This commit is contained in:
scottashton 2014-06-20 09:59:00 +02:00
commit 678277981c
15 changed files with 854 additions and 3344 deletions

View File

@ -20,11 +20,11 @@ The edge definitions for a graph is an Array containing arbitrary many directed
!SUBSUBSECTION Undirected Relation
@startDocuBlock JSF_general_graph_undirectedRelationDefinition@startDocuBlock
@startDocuBlock JSF_general_graph_undirectedRelation
!SUBSUBSECTION Directed Relation
@startDocuBlock JSF_general_graph_directedRelationDefinition
@startDocuBlock JSF_general_graph_directedRelation
!SUBSECTION Orphan Collections
@ -58,8 +58,8 @@ Example Call:
```js
> var graph = require("org/arangodb/graph");
> var edgeDefinitions = graph._edgeDefinitions();
> graph._extendEdgeDefinitions(edgeDefinitions, graph._undirectedRelationDefinition("friend_of", ["Customer"]));
> graph._extendEdgeDefinitions(edgeDefinitions, graph._directedRelationDefinition("has_bought", ["Customer", "Company"], ["Groceries", "Electronics"]));
> graph._extendEdgeDefinitions(edgeDefinitions, graph._undirectedRelation("friend_of", ["Customer"]));
> graph._extendEdgeDefinitions(edgeDefinitions, graph._directedRelation("has_bought", ["Customer", "Company"], ["Groceries", "Electronics"]));
> graph._create("myStore", edgeDefinitions);
{
_id: "_graphs/123",
@ -72,7 +72,7 @@ alternative call:
```js
> var graph = require("org/arangodb/graph");
> var edgeDefinitions = graph._edgeDefinitions(graph._undirectedRelationDefinition("friend_of", ["Customer"]), graph._directedRelationDefinition("has_bought", ["Customer", "Company"], ["Groceries", "Electronics"]));
> var edgeDefinitions = graph._edgeDefinitions(graph._undirectedRelation("friend_of", ["Customer"]), graph._directedRelation("has_bought", ["Customer", "Company"], ["Groceries", "Electronics"]));
> graph._create("myStore", edgeDefinitions);
{
_id: "_graphs/123",

View File

@ -20,11 +20,11 @@ The edge definitions for a graph is an Array containing arbitrary many directed
!SUBSUBSECTION Undirected Relation
<!-- @startDocuBlock JSF_general_graph_undirectedRelationDefinition -->
<!-- @startDocuBlock JSF_general_graph_undirectedRelation -->
!SUBSUBSECTION Directed Relation
<!-- @startDocuBlock JSF_general_graph_directedRelationDefinition -->
<!-- @startDocuBlock JSF_general_graph_directedRelation -->
!SUBSECTION Orphan Collections
@ -58,8 +58,8 @@ Example Call:
```js
> var graph = require("org/arangodb/graph");
> var edgeDefinitions = graph._edgeDefinitions();
> graph._extendEdgeDefinitions(edgeDefinitions, graph._undirectedRelationDefinition("friend_of", ["Customer"]));
> graph._extendEdgeDefinitions(edgeDefinitions, graph._directedRelationDefinition("has_bought", ["Customer", "Company"], ["Groceries", "Electronics"]));
> graph._extendEdgeDefinitions(edgeDefinitions, graph._undirectedRelation("friend_of", ["Customer"]));
> graph._extendEdgeDefinitions(edgeDefinitions, graph._directedRelation("has_bought", ["Customer", "Company"], ["Groceries", "Electronics"]));
> graph._create("myStore", edgeDefinitions);
{
_id: "_graphs/123",
@ -72,7 +72,7 @@ alternative call:
```js
> var graph = require("org/arangodb/graph");
> var edgeDefinitions = graph._edgeDefinitions(graph._undirectedRelationDefinition("friend_of", ["Customer"]), graph._directedRelationDefinition("has_bought", ["Customer", "Company"], ["Groceries", "Electronics"]));
> var edgeDefinitions = graph._edgeDefinitions(graph._undirectedRelation("friend_of", ["Customer"]), graph._directedRelation("has_bought", ["Customer", "Company"], ["Groceries", "Electronics"]));
> graph._create("myStore", edgeDefinitions);
{
_id: "_graphs/123",

View File

@ -1,6 +1,6 @@
!CHAPTER General Graphs
!CHAPTER Graphs
This chapter describes the multi-collection graph module.
This chapter describes the general-graph module.
It allows you to define a graph that is spread across several edge and document collections.
This allows you to structure your models in line with your domain and group them logically in collections and giving you the power to query them in the same graph queries.
There is no need to include the referenced collections within the query, this module will handle it for you.
@ -8,7 +8,6 @@ There is no need to include the referenced collections within the query, this mo
!SECTION First Steps with Graphs
A Graph consists of *vertices* and *edges*. Edges are stored as documents in *edge
collections*. A vertex can be a document of a *document collection* or of an edge
collection (so edges can be used as vertices). Which collections are used within
collections*. In general a vertex is stored in a document collection. Which collections are used within
a graph is defined via *edge definitions*. A graph can have an arbitrary number of edge
definitions.

File diff suppressed because it is too large Load Diff

View File

@ -67,10 +67,10 @@ To add further edge definitions to the array one must call:
#### Undirected Relation
@copydetails JSF_general_graph_undirectedRelationDefinition
@copydetails JSF_general_graph_undirectedRelation
```js
graph._undirectedRelationDefinition(relationName, vertexCollections);
graph._undirectedRelation(relationName, vertexCollections);
```
Define an undirected relation.
@ -80,7 +80,7 @@ Relations are allowed in both directions among all collections in *vertexCollect
Example Call:
```js
> graph._undirectedRelationDefinition("eats", ["Human", "Animal"]);
> graph._undirectedRelation("eats", ["Human", "Animal"]);
{
collection: "eats",
from: ["Human", "Animal"],
@ -91,7 +91,7 @@ Example Call:
#### Directed Relation
```js
graph._directedRelationDefinition(relationName, fromVertexCollections, toVertexCollections);
graph._directedRelation(relationName, fromVertexCollections, toVertexCollections);
```
Define a directed relation.
@ -102,7 +102,7 @@ Relations are only allowed in the direction from any collection in *fromVertexCo
Example Call:
```js
> graph._directedRelationDefinition("has_bought", ["Customer", "Company"], ["Groceries", "Electronics"]);
> graph._directedRelation("has_bought", ["Customer", "Company"], ["Groceries", "Electronics"]);
{
collection: "has_bought",
from: ["Customer", "Company"],
@ -118,8 +118,8 @@ Example Call:
```js
> var graph = require("org/arangodb/graph");
> var edgeDefinitions = graph._edgeDefinitions();
> graph._extendEdgeDefinitions(edgeDefinitions, graph._undirectedRelationDefinition("friend_of", ["Customer"]));
> graph._extendEdgeDefinitions(edgeDefinitions, graph._directedRelationDefinition("has_bought", ["Customer", "Company"], ["Groceries", "Electronics"]));
> graph._extendEdgeDefinitions(edgeDefinitions, graph._undirectedRelation("friend_of", ["Customer"]));
> graph._extendEdgeDefinitions(edgeDefinitions, graph._directedRelation("has_bought", ["Customer", "Company"], ["Groceries", "Electronics"]));
> graph._create("myStore", edgeDefinitions);
{
_id: "_graphs/123",
@ -132,7 +132,7 @@ alternative call:
```js
> var graph = require("org/arangodb/graph");
> var edgeDefinitions = graph._edgeDefinitions(graph._undirectedRelationDefinition("friend_of", ["Customer"]), graph._directedRelationDefinition("has_bought", ["Customer", "Company"], ["Groceries", "Electronics"]));
> var edgeDefinitions = graph._edgeDefinitions(graph._undirectedRelation("friend_of", ["Customer"]), graph._directedRelation("has_bought", ["Customer", "Company"], ["Groceries", "Electronics"]));
> graph._create("myStore", edgeDefinitions);
{
_id: "_graphs/123",

View File

@ -23,7 +23,7 @@ make -j2 || exit 1
echo
echo "$0: testing ArangoDB"
make unittests-shell-server unittests-shell-server-ahuacatl unittests-http-server SKIP_RANGES=1 || exit 1
make jslint unittests-shell-server unittests-shell-server-ahuacatl unittests-http-server SKIP_RANGES=1 || exit 1
echo
echo "$0: done"

View File

@ -68,6 +68,7 @@ function notFound (req, res, code, message) {
////////////////////////////////////////////////////////////////////////////////
/// @brief execute a server-side traversal
/// @startDocuBlock JSF_HTTP_API_TRAVERSAL
///
/// @RESTHEADER{POST /_api/traversal,executes a traversal}
///
@ -78,48 +79,48 @@ function notFound (req, res, code, message) {
/// edges contained in a given edgeCollection. The request must
/// contain the following attributes.
///
/// - `startVertex`: id of the startVertex, e.g. `"users/foo"`.
/// - *startVertex*: id of the startVertex, e.g. *"users/foo"*.
///
/// - `edgeCollection`: **Deprecated** name of the collection that contains the edges.
/// - *edgeCollection*: **Deprecated** name of the collection that contains the edges.
///
/// - `graphName`: name of the graph that contains the edges.
/// - *graphName*: name of the graph that contains the edges.
///
/// - `filter` (optional, default is to include all nodes):
/// - *filter* (optional, default is to include all nodes):
/// body (JavaScript code) of custom filter function
/// function signature: (config, vertex, path) -> mixed
/// can return four different string values:
/// - `"exclude"` -> this vertex will not be visited.
/// - `"prune"` -> the edges of this vertex will not be followed.
/// - `""` or `undefined` -> visit the vertex and follow it's edges.
/// - `Array` -> containing any combination of the above.
/// If there is at least one `"exclude"` or `"prune"` respectivly
/// - *"exclude"* -> this vertex will not be visited.
/// - *"prune"* -> the edges of this vertex will not be followed.
/// - *""* or *undefined* -> visit the vertex and follow it's edges.
/// - *Array* -> containing any combination of the above.
/// If there is at least one *"exclude"* or *"prune"* respectivly
/// is contained, it's effect will occur.
///
/// - `minDepth` (optional, ANDed with any existing filters):
/// - *minDepth* (optional, ANDed with any existing filters):
/// visits only nodes in at least the given depth
///
/// - `maxDepth` (optional, ANDed with any existing filters):
/// - *maxDepth* (optional, ANDed with any existing filters):
/// visits only nodes in at most the given depth
///
/// - `visitor` (optional): body (JavaScript) code of custom visitor function
/// - *visitor* (optional): body (JavaScript) code of custom visitor function
/// function signature: (config, result, vertex, path) -> void
/// visitor function can do anything, but its return value is ignored. To
/// populate a result, use the `result` variable by reference
/// populate a result, use the *result* variable by reference
///
/// - `direction` (optional): direction for traversal
/// - *if set*, must be either `"outbound"`, `"inbound"`, or `"any"`
/// - *if not set*, the `expander` attribute must be specified
/// - *direction* (optional): direction for traversal
/// - *if set*, must be either *"outbound"*, *"inbound"*, or *"any"*
/// - *if not set*, the *expander* attribute must be specified
///
/// - `init` (optional): body (JavaScript) code of custom result initialisation function
/// - *init* (optional): body (JavaScript) code of custom result initialisation function
/// function signature: (config, result) -> void
/// initialise any values in result with what is required
///
/// - `expander` (optional): body (JavaScript) code of custom expander function
/// *must* be set if `direction` attribute is *not* set
/// - *expander* (optional): body (JavaScript) code of custom expander function
/// *must* be set if *direction* attribute is **not** set
/// function signature: (config, vertex, path) -> array
/// expander must return an array of the connections for `vertex`
/// each connection is an object with the attributes `edge` and `vertex`
/// - `sort` (optional): body (JavaScript) code of a custom comparison function
/// expander must return an array of the connections for *vertex*
/// each connection is an object with the attributes *edge* and *vertex*
/// - *sort* (optional): body (JavaScript) code of a custom comparison function
/// for the edges. The signature of this function is
/// (l, r) -> integer (where l and r are edges) and must
/// return -1 if l is smaller than, +1 if l is greater than,
@ -136,80 +137,80 @@ function notFound (req, res, code, message) {
/// expanders. If you use your custom expander you have to
/// do the sorting yourself within the expander code.
///
/// - `strategy` (optional): traversal strategy
/// can be `"depthfirst"` or `"breadthfirst"`
/// - *strategy* (optional): traversal strategy
/// can be *"depthfirst"* or *"breadthfirst"*
///
/// - `order` (optional): traversal order
/// can be `"preorder"` or `"postorder"`
/// - *order* (optional): traversal order
/// can be *"preorder"* or *"postorder"*
///
/// - `itemOrder` (optional): item iteration order
/// can be `"forward"` or `"backward"`
/// - *itemOrder* (optional): item iteration order
/// can be *"forward"* or *"backward"*
///
/// - `uniqueness` (optional): specifies uniqueness for vertices and edges visited
/// - *uniqueness* (optional): specifies uniqueness for vertices and edges visited
/// if set, must be an object like this:
/// `"uniqueness": {"vertices": "none"|"global"|path", "edges": "none"|"global"|"path"}`
/// *"uniqueness": {"vertices": "none"|"global"|path", "edges": "none"|"global"|"path"}*
///
/// - `maxIterations` (optional): Maximum number of iterations in each traversal. This number can be
/// - *maxIterations* (optional): Maximum number of iterations in each traversal. This number can be
/// set to prevent endless loops in traversal of cyclic graphs. When a traversal performs
/// as many iterations as the `maxIterations` value, the traversal will abort with an
/// error. If `maxIterations` is not set, a server-defined value may be used.
/// as many iterations as the *maxIterations* value, the traversal will abort with an
/// error. If *maxIterations* is not set, a server-defined value may be used.
///
///
/// If the Traversal is successfully executed `HTTP 200` will be returned.
/// Additionally the `result` object will be returned by the traversal.
/// If the Traversal is successfully executed *HTTP 200* will be returned.
/// Additionally the *result* object will be returned by the traversal.
///
/// For successful traversals, the returned JSON object has the
/// following properties:
///
/// - `error`: boolean flag to indicate if an error occurred (`false`
/// - *error*: boolean flag to indicate if an error occurred (*false*
/// in this case)
///
/// - `code`: the HTTP status code
/// - *code*: the HTTP status code
///
/// - `result`: the return value of the traversal
/// - *result*: the return value of the traversal
///
/// If the traversal specification is either missing or malformed, the server
/// will respond with `HTTP 400`.
/// will respond with *HTTP 400*.
///
/// The body of the response will then contain a JSON object with additional error
/// details. The object has the following attributes:
///
/// - `error`: boolean flag to indicate that an error occurred (`true` in this case)
/// - *error*: boolean flag to indicate that an error occurred (*true* in this case)
///
/// - `code`: the HTTP status code
/// - *code*: the HTTP status code
///
/// - `errorNum`: the server error number
/// - *errorNum*: the server error number
///
/// - `errorMessage`: a descriptive error message
/// - *errorMessage*: a descriptive error message
///
/// @RESTRETURNCODES
///
/// @RESTRETURNCODE{200}
/// If the traversal is fully executed
/// `HTTP 200` will be returned.
/// *HTTP 200* will be returned.
///
/// @RESTRETURNCODE{400}
/// If the traversal specification is either missing or malformed, the server
/// will respond with `HTTP 400`.
/// will respond with *HTTP 400*.
///
/// @RESTRETURNCODE{404}
/// The server will responded with `HTTP 404` if the specified edge collection
/// The server will responded with *HTTP 404* if the specified edge collection
/// does not exist, or the specified start vertex cannot be found.
///
/// @RESTRETURNCODE{500}
/// The server will responded with `HTTP 500` when an error occurs inside the
/// traversal or if a traversal performs more than `maxIterations` iterations.
/// The server will responded with *HTTP 500* when an error occurs inside the
/// traversal or if a traversal performs more than *maxIterations* iterations.
///
/// *Examples*
///
/// In the following examples the underlying graph will contain five persons
/// `Alice`, `Bob`, `Charlie`, `Dave` and `Eve`.
/// *Alice*, *Bob*, *Charlie*, *Dave* and *Eve*.
/// We will have the following directed relations:
/// - `Alice` knows `Bob`
/// - `Bob` knows `Charlie`
/// - `Bob` knows `Dave`
/// - `Eve` knows `Alice`
/// - `Eve` knows `Bob`
/// - *Alice* knows *Bob*
/// - *Bob* knows *Charlie*
/// - *Bob* knows *Dave*
/// - *Eve* knows *Alice*
/// - *Eve* knows *Bob*
///
/// The starting vertex will always be Alice.
///
@ -273,7 +274,7 @@ function notFound (req, res, code, message) {
/// examples.dropGraph("knows_graph");
/// @END_EXAMPLE_ARANGOSH_RUN
///
/// Excluding `Charlie` and `Bob`:
/// Excluding *Charlie* and *Bob*:
///
/// @EXAMPLE_ARANGOSH_RUN{RestTraversalFilterExclude}
/// var examples = require("org/arangodb/graph-examples/example-graph.js");
@ -296,7 +297,7 @@ function notFound (req, res, code, message) {
/// examples.dropGraph("knows_graph");
/// @END_EXAMPLE_ARANGOSH_RUN
///
/// Do not follow edges from `Bob`:
/// Do not follow edges from *Bob*:
///
/// @EXAMPLE_ARANGOSH_RUN{RestTraversalFilterPrune}
/// var examples = require("org/arangodb/graph-examples/example-graph.js");
@ -376,7 +377,7 @@ function notFound (req, res, code, message) {
/// examples.dropGraph("knows_graph");
/// @END_EXAMPLE_ARANGOSH_RUN
///
/// Expand only inbound edges of `Alice` and outbound edges of `Eve`:
/// Expand only inbound edges of *Alice* and outbound edges of *Eve*:
///
/// @EXAMPLE_ARANGOSH_RUN{RestTraversalVisitorExpander}
/// var examples = require("org/arangodb/graph-examples/example-graph.js");
@ -413,7 +414,7 @@ function notFound (req, res, code, message) {
/// examples.dropGraph("knows_graph");
/// @END_EXAMPLE_ARANGOSH_RUN
///
/// Follow the `depthfirst` strategy:
/// Follow the *depthfirst* strategy:
///
/// @EXAMPLE_ARANGOSH_RUN{RestTraversalDepthFirst}
/// var examples = require("org/arangodb/graph-examples/example-graph.js");
@ -434,7 +435,7 @@ function notFound (req, res, code, message) {
/// examples.dropGraph("knows_graph");
/// @END_EXAMPLE_ARANGOSH_RUN
///
/// Using `postorder` ordering:
/// Using *postorder* ordering:
///
/// @EXAMPLE_ARANGOSH_RUN{RestTraversalPostorder}
/// var examples = require("org/arangodb/graph-examples/example-graph.js");
@ -455,7 +456,7 @@ function notFound (req, res, code, message) {
/// examples.dropGraph("knows_graph");
/// @END_EXAMPLE_ARANGOSH_RUN
///
/// Using `backward` item-ordering:
/// Using *backward* item-ordering:
///
/// @EXAMPLE_ARANGOSH_RUN{RestTraversalBackwardItemOrder}
/// var examples = require("org/arangodb/graph-examples/example-graph.js");
@ -501,12 +502,12 @@ function notFound (req, res, code, message) {
/// examples.dropGraph("knows_graph");
/// @END_EXAMPLE_ARANGOSH_RUN
///
/// If the underlying graph is cyclic, `maxIterations` should be set:
/// If the underlying graph is cyclic, *maxIterations* should be set:
///
/// The underlying graph has two vertices `Alice` and `Bob`.
/// The underlying graph has two vertices *Alice* and *Bob*.
/// With the directed edges:
/// - `Alice` knows `Bob`
/// _ `Bob` knows `Alice`
/// - *Alice* knows *Bob*
/// _ *Bob* knows *Alice*
///
///
/// @EXAMPLE_ARANGOSH_RUN{RestTraversalMaxIterations}
@ -535,6 +536,8 @@ function notFound (req, res, code, message) {
/// logJsonResponse(response);
/// examples.dropGraph("knows_graph");
/// @END_EXAMPLE_ARANGOSH_RUN
///
/// @endDocuBlock
////////////////////////////////////////////////////////////////////////////////
function post_api_traversal(req, res) {

View File

@ -26,6 +26,7 @@ module.define("org/arangodb/graph/traversal", function(exports, module) {
/// Copyright holder is triAGENS GmbH, Cologne, Germany
///
/// @author Jan Steemann
/// @author Michael Hackstein
/// @author Copyright 2011-2013, triAGENS GmbH, Cologne, Germany
////////////////////////////////////////////////////////////////////////////////
@ -48,7 +49,7 @@ var ArangoTraverser;
////////////////////////////////////////////////////////////////////////////////
function clone (obj) {
if (obj === null || typeof(obj) !== "object") {
if (obj === null || typeof obj !== "object") {
return obj;
}

View File

@ -1312,9 +1312,9 @@ AQLGenerator.prototype.next = function() {
// -----------------------------------------------------------------------------
////////////////////////////////////////////////////////////////////////////////
/// @startDocuBlock JSF_general_graph_undirectedRelationDefinition
/// @startDocuBlock JSF_general_graph_undirectedRelation
///
/// `general-graph._undirectedRelationDefinition(relationName, vertexCollections)`
/// `general-graph._undirectedRelation(relationName, vertexCollections)`
/// *Define an undirected relation.*
///
/// Defines an undirected relation with the name *relationName* using the
@ -1328,24 +1328,24 @@ AQLGenerator.prototype.next = function() {
///
/// @EXAMPLE_ARANGOSH_OUTPUT{generalGraphUndirectedRelationDefinition1}
/// var graph = require("org/arangodb/general-graph");
/// graph._undirectedRelationDefinition("friend", "user");
/// graph._undirectedRelation("friend", "user");
/// @END_EXAMPLE_ARANGOSH_OUTPUT
///
/// To define a relation between several vertex collections:
///
/// @EXAMPLE_ARANGOSH_OUTPUT{generalGraphUndirectedRelationDefinition2}
/// var graph = require("org/arangodb/general-graph");
/// graph._undirectedRelationDefinition("marriage", ["female", "male"]);
/// graph._undirectedRelation("marriage", ["female", "male"]);
/// @END_EXAMPLE_ARANGOSH_OUTPUT
/// @endDocuBlock
///
////////////////////////////////////////////////////////////////////////////////
var _undirectedRelationDefinition = function (relationName, vertexCollections) {
var _undirectedRelation = function (relationName, vertexCollections) {
if (arguments.length < 2) {
throw "method _undirectedRelationDefinition expects 2 arguments";
throw "method _undirectedRelation expects 2 arguments";
}
if (typeof relationName !== "string" || relationName === "") {
@ -1368,9 +1368,9 @@ var _undirectedRelationDefinition = function (relationName, vertexCollections) {
/// Define an directed relation.
////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
/// @startDocuBlock JSF_general_graph_directedRelationDefinition
/// @startDocuBlock JSF_general_graph_directedRelation
///
/// `general-graph._directedRelationDefinition(relationName, fromVertexCollections, toVertexCollections)`
/// `general-graph._directedRelation(relationName, fromVertexCollections, toVertexCollections)`
/// *Define a directed relation.*
///
/// The *relationName* defines the name of this relation and references to the underlying edge collection.
@ -1383,18 +1383,18 @@ var _undirectedRelationDefinition = function (relationName, vertexCollections) {
///
/// @EXAMPLE_ARANGOSH_OUTPUT{generalGraphDirectedRelationDefinition}
/// var graph = require("org/arangodb/general-graph");
/// graph._directedRelationDefinition("has_bought", ["Customer", "Company"], ["Groceries", "Electronics"]);
/// graph._directedRelation("has_bought", ["Customer", "Company"], ["Groceries", "Electronics"]);
/// @END_EXAMPLE_ARANGOSH_OUTPUT
/// @endDocuBlock
///
////////////////////////////////////////////////////////////////////////////////
var _directedRelationDefinition = function (
var _directedRelation = function (
relationName, fromVertexCollections, toVertexCollections) {
if (arguments.length < 3) {
throw "method _directedRelationDefinition expects 3 arguments";
throw "method _directedRelation expects 3 arguments";
}
if (typeof relationName !== "string" || relationName === "") {
@ -1457,8 +1457,8 @@ var _list = function() {
///
/// @EXAMPLE_ARANGOSH_OUTPUT{generalGraphEdgeDefinitions}
/// var graph = require("org/arangodb/general-graph");
/// directed_relation = graph._directedRelationDefinition("lives_in", "user", "city");
/// undirected_relation = graph._directedRelationDefinition("knows", "user");
/// directed_relation = graph._directedRelation("lives_in", "user", "city");
/// undirected_relation = graph._directedRelation("knows", "user");
/// edgedefinitions = graph._edgeDefinitions(directed_relation, undirected_relation);
/// @END_EXAMPLE_ARANGOSH_OUTPUT
///
@ -1488,8 +1488,8 @@ var _edgeDefinitions = function () {
///
/// @EXAMPLE_ARANGOSH_OUTPUT{generalGraphEdgeDefinitionsExtend}
/// var graph = require("org/arangodb/general-graph");
/// directed_relation = graph._directedRelationDefinition("lives_in", "user", "city");
/// undirected_relation = graph._directedRelationDefinition("knows", "user");
/// directed_relation = graph._directedRelation("lives_in", "user", "city");
/// undirected_relation = graph._directedRelation("knows", "user");
/// edgedefinitions = graph._edgeDefinitions(directed_relation);
/// edgedefinitions = graph._extendEdgeDefinitions(undirected_relation);
/// @END_EXAMPLE_ARANGOSH_OUTPUT
@ -1546,7 +1546,7 @@ var _extendEdgeDefinitions = function (edgeDefinition) {
///
/// @EXAMPLE_ARANGOSH_OUTPUT{generalGraphCreateGraph2}
/// var graph = require("org/arangodb/general-graph");
/// g = graph._create("mygraph", [graph._undirectedRelationDefinition("relation", ["male", "female"])], ["sessions"]);
/// g = graph._create("mygraph", [graph._undirectedRelation("relation", ["male", "female"])], ["sessions"]);
/// ~ graph._drop("mygraph");
/// @END_EXAMPLE_ARANGOSH_OUTPUT
///
@ -3600,8 +3600,8 @@ Graph.prototype._diameter = function(options) {
/// @EXAMPLE_ARANGOSH_OUTPUT{general_graph__extendEdgeDefinitions}
/// var graph = require("org/arangodb/general-graph")
/// ~ if (graph._exists("myGraph")){var blub = graph._drop("myGraph", true);}
/// var ed1 = graph._directedRelationDefinition("myEC1", ["myVC1"], ["myVC2"]);
/// var ed2 = graph._directedRelationDefinition("myEC2", ["myVC1"], ["myVC3"]);
/// var ed1 = graph._directedRelation("myEC1", ["myVC1"], ["myVC2"]);
/// var ed2 = graph._directedRelation("myEC2", ["myVC1"], ["myVC3"]);
/// var g = graph._create("myGraph", [ed1]);
/// g._extendEdgeDefinitions(ed2);
/// ~ var blub = graph._drop("myGraph", true);
@ -3759,8 +3759,8 @@ var changeEdgeDefinitionsForGraph = function(graph, edgeDefinition, newCollectio
/// @EXAMPLE_ARANGOSH_OUTPUT{general_graph__editEdgeDefinition}
/// var graph = require("org/arangodb/general-graph")
/// ~ if (graph._exists("myGraph")){var blub = graph._drop("myGraph", true);}
/// var ed1 = graph._directedRelationDefinition("myEC1", ["myVC1"], ["myVC2"]);
/// var ed2 = graph._directedRelationDefinition("myEC1", ["myVC2"], ["myVC3"]);
/// var ed1 = graph._directedRelation("myEC1", ["myVC1"], ["myVC2"]);
/// var ed2 = graph._directedRelation("myEC1", ["myVC2"], ["myVC3"]);
/// var g = graph._create("myGraph", [ed1, ed2]);
/// g._editEdgeDefinition(ed2, true);
/// ~ var blub = graph._drop("myGraph", true);
@ -3831,8 +3831,8 @@ Graph.prototype._editEdgeDefinitions = function(edgeDefinition) {
/// @EXAMPLE_ARANGOSH_OUTPUT{general_graph__deleteEdgeDefinition}
/// var graph = require("org/arangodb/general-graph")
/// ~ if (graph._exists("myGraph")){var blub = graph._drop("myGraph", true);}
/// var ed1 = graph._directedRelationDefinition("myEC1", ["myVC1"], ["myVC2"]);
/// var ed2 = graph._directedRelationDefinition("myEC2", ["myVC1"], ["myVC3"]);
/// var ed1 = graph._directedRelation("myEC1", ["myVC1"], ["myVC2"]);
/// var ed2 = graph._directedRelation("myEC2", ["myVC1"], ["myVC3"]);
/// var g = graph._create("myGraph", [ed1, ed2]);
/// g._deleteEdgeDefinition("myEC1");
/// ~ var blub = graph._drop("myGraph", true);
@ -3897,7 +3897,7 @@ Graph.prototype._deleteEdgeDefinition = function(edgeCollection) {
/// @EXAMPLE_ARANGOSH_OUTPUT{general_graph__addVertexCollection}
/// var graph = require("org/arangodb/general-graph")
/// ~ if (graph._exists("myGraph")){var blub = graph._drop("myGraph", true);}
/// var ed1 = graph._directedRelationDefinition("myEC1", ["myVC1"], ["myVC2"]);
/// var ed1 = graph._directedRelation("myEC1", ["myVC1"], ["myVC2"]);
/// var g = graph._create("myGraph", [ed1]);
/// g._addVertexCollection("myVC3", true);
/// ~ var blub = graph._drop("myGraph", true);
@ -3951,7 +3951,7 @@ Graph.prototype._addVertexCollection = function(vertexCollectionName, createColl
/// @EXAMPLE_ARANGOSH_OUTPUT{general_graph__orphanCollections}
/// var graph = require("org/arangodb/general-graph")
/// ~ if (graph._exists("myGraph")){var blub = graph._drop("myGraph", true);}
/// var ed1 = graph._directedRelationDefinition("myEC1", ["myVC1"], ["myVC2"]);
/// var ed1 = graph._directedRelation("myEC1", ["myVC1"], ["myVC2"]);
/// var g = graph._create("myGraph", [ed1]);
/// g._addVertexCollection("myVC3", true);
/// g._orphanCollections();
@ -3982,7 +3982,7 @@ Graph.prototype._orphanCollections = function() {
/// @EXAMPLE_ARANGOSH_OUTPUT{general_graph__removeVertexCollections}
/// var graph = require("org/arangodb/general-graph")
/// ~ if (graph._exists("myGraph")){var blub = graph._drop("myGraph", true);}
/// var ed1 = graph._directedRelationDefinition("myEC1", ["myVC1"], ["myVC2"]);
/// var ed1 = graph._directedRelation("myEC1", ["myVC1"], ["myVC2"]);
/// var g = graph._create("myGraph", [ed1]);
/// g._addVertexCollection("myVC3", true);
/// g._addVertexCollection("myVC4", true);
@ -4045,8 +4045,8 @@ Graph.prototype._PRINT = function(context) {
// --SECTION-- MODULE EXPORTS
// -----------------------------------------------------------------------------
exports._undirectedRelationDefinition = _undirectedRelationDefinition;
exports._directedRelationDefinition = _directedRelationDefinition;
exports._undirectedRelation = _undirectedRelation;
exports._directedRelation = _directedRelation;
exports._graph = _graph;
exports._edgeDefinitions = _edgeDefinitions;
exports._extendEdgeDefinitions = _extendEdgeDefinitions;

View File

@ -33,7 +33,7 @@
var createTraversalExample = function() {
var g = Graph._create("knows_graph",
[Graph._undirectedRelationDefinition("knows", "persons")]
[Graph._undirectedRelation("knows", "persons")]
);
var a = g.persons.save({name: "Alice", _key: "alice"})._id;
var b = g.persons.save({name: "Bob", _key: "bob"})._id;
@ -50,7 +50,7 @@
var createSocialGraph = function() {
var edgeDefinition = [];
edgeDefinition.push(Graph._undirectedRelationDefinition("relation", ["female", "male"]));
edgeDefinition.push(Graph._undirectedRelation("relation", ["female", "male"]));
var g = Graph._create("social", edgeDefinition);
var a = g.female.save({name: "Alice", _key: "alice"});
var b = g.male.save({name: "Bob", _key: "bob"});

View File

@ -54,8 +54,8 @@ function GeneralGraphCreationSuite() {
var vn4 = "UnitTestVerticies4";
var gn = "UnitTestGraph";
var edgeDef = graph._edgeDefinitions(
graph._undirectedRelationDefinition(rn, vn1),
graph._directedRelationDefinition(rn1,
graph._undirectedRelation(rn, vn1),
graph._directedRelation(rn1,
[vn1, vn2], [vn3, vn4]
)
);
@ -110,8 +110,8 @@ function GeneralGraphCreationSuite() {
/// @brief test: Graph Creation
////////////////////////////////////////////////////////////////////////////////
test_undirectedRelationDefinition : function () {
var r = graph._undirectedRelationDefinition(rn, [vn1, vn2]);
test_undirectedRelation : function () {
var r = graph._undirectedRelation(rn, [vn1, vn2]);
assertEqual(r, {
collection: rn,
@ -121,8 +121,8 @@ function GeneralGraphCreationSuite() {
},
test_undirectedRelationDefinitionWithSingleCollection : function () {
var r = graph._undirectedRelationDefinition(rn, vn1);
test_undirectedRelationWithSingleCollection : function () {
var r = graph._undirectedRelation(rn, vn1);
assertEqual(r, {
collection: rn,
@ -132,9 +132,9 @@ function GeneralGraphCreationSuite() {
},
test_undirectedRelationDefinitionWithMissingName : function () {
test_undirectedRelationWithMissingName : function () {
try {
graph._undirectedRelationDefinition("", [vn1, vn2]);
graph._undirectedRelation("", [vn1, vn2]);
fail();
}
catch (err) {
@ -142,21 +142,21 @@ function GeneralGraphCreationSuite() {
}
},
test_undirectedRelationDefinitionWithTooFewArgs : function () {
test_undirectedRelationWithTooFewArgs : function () {
try {
graph._undirectedRelationDefinition([vn1, vn2]);
graph._undirectedRelation([vn1, vn2]);
fail();
}
catch (err) {
assertEqual(err, "method _undirectedRelationDefinition expects 2 arguments");
assertEqual(err, "method _undirectedRelation expects 2 arguments");
}
},
test_undirectedRelationDefinitionWithInvalidSecondArg : function () {
test_undirectedRelationWithInvalidSecondArg : function () {
try {
var param = {};
param[vn1] = vn2;
graph._undirectedRelationDefinition(rn, param);
graph._undirectedRelation(rn, param);
fail();
}
catch (err) {
@ -164,8 +164,8 @@ function GeneralGraphCreationSuite() {
}
},
test_directedRelationDefinition : function () {
var r = graph._directedRelationDefinition(rn,
test_directedRelation : function () {
var r = graph._directedRelation(rn,
[vn1, vn2], [vn3, vn4]);
assertEqual(r, {
@ -176,9 +176,9 @@ function GeneralGraphCreationSuite() {
},
test_directedRelationDefinitionWithMissingName : function () {
test_directedRelationWithMissingName : function () {
try {
graph._directedRelationDefinition("",
graph._directedRelation("",
[vn1, vn2], [vn3, vn4]);
fail();
}
@ -187,21 +187,21 @@ function GeneralGraphCreationSuite() {
}
},
test_directedRelationDefinitionWithTooFewArgs : function () {
test_directedRelationWithTooFewArgs : function () {
try {
graph._directedRelationDefinition([vn1, vn2], [vn3, vn4]);
graph._directedRelation([vn1, vn2], [vn3, vn4]);
fail();
}
catch (err) {
assertEqual(err, "method _directedRelationDefinition expects 3 arguments");
assertEqual(err, "method _directedRelation expects 3 arguments");
}
},
test_directedRelationDefinitionWithInvalidSecondArg : function () {
test_directedRelationWithInvalidSecondArg : function () {
try {
var param = {};
param[vn1] = vn2;
graph._directedRelationDefinition(rn, param, vn3);
graph._directedRelation(rn, param, vn3);
fail();
}
catch (err) {
@ -211,11 +211,11 @@ function GeneralGraphCreationSuite() {
},
test_directedRelationDefinitionWithInvalidThirdArg : function () {
test_directedRelationWithInvalidThirdArg : function () {
try {
var param = {};
param[vn1] = vn2;
graph._directedRelationDefinition(rn, vn3, param);
graph._directedRelation(rn, vn3, param);
fail();
}
catch (err) {
@ -230,8 +230,8 @@ function GeneralGraphCreationSuite() {
//with args
assertEqual(graph._edgeDefinitions(
graph._undirectedRelationDefinition(rn, vn1),
graph._directedRelationDefinition(rn1,
graph._undirectedRelation(rn, vn1),
graph._directedRelation(rn1,
[vn1, vn2], [vn3, vn4])
), [
{
@ -255,12 +255,12 @@ function GeneralGraphCreationSuite() {
//with args
var ed =graph._edgeDefinitions(
graph._undirectedRelationDefinition("relationName", "vertexC1"),
graph._directedRelationDefinition("relationName",
graph._undirectedRelation("relationName", "vertexC1"),
graph._directedRelation("relationName",
["vertexC1", "vertexC2"], ["vertexC3", "vertexC4"])
);
graph._extendEdgeDefinitions(ed,
graph._undirectedRelationDefinition("relationName", "vertexC1")
graph._undirectedRelation("relationName", "vertexC1")
);
assertEqual(ed, [
{
@ -290,8 +290,8 @@ function GeneralGraphCreationSuite() {
var a = graph._create(
gn,
graph._edgeDefinitions(
graph._undirectedRelationDefinition(rn, vn1),
graph._directedRelationDefinition(rn1, [vn1, vn2], [vn3, vn4])
graph._undirectedRelation(rn, vn1),
graph._directedRelation(rn1, [vn1, vn2], [vn3, vn4])
)
);
assertTrue(a.__vertexCollections.hasOwnProperty(vn1));
@ -343,8 +343,8 @@ function GeneralGraphCreationSuite() {
graph._create(
"",
graph._edgeDefinitions(
graph._undirectedRelationDefinition("relationName", "vertexC1"),
graph._directedRelationDefinition("relationName2",
graph._undirectedRelation("relationName", "vertexC1"),
graph._directedRelation("relationName2",
["vertexC1", "vertexC2"], ["vertexC3", "vertexC4"]
)
)
@ -420,7 +420,7 @@ function GeneralGraphCreationSuite() {
if(graph._exists(gn)) {
graph._drop(gn, true);
}
var edgeDef2 = [graph._directedRelationDefinition(rn, vn1, vn2)];
var edgeDef2 = [graph._directedRelation(rn, vn1, vn2)];
var g = graph._create(gn, edgeDef2);
var v1 = g[vn1].save({_key: "1"})._id;
var v2 = g[vn2].save({_key: "2"})._id;
@ -458,7 +458,7 @@ function GeneralGraphCreationSuite() {
test_deleteEdgeDefinitionFromExistingGraph1: function() {
var dr1 = graph._directedRelationDefinition(ec1, [vc1], [vc1, vc2]),
var dr1 = graph._directedRelation(ec1, [vc1], [vc1, vc2]),
g1 = graph._create(gN1, [dr1]);
try {
@ -474,9 +474,9 @@ function GeneralGraphCreationSuite() {
test_deleteEdgeDefinitionFromExistingGraph2: function() {
var dr1 = graph._directedRelationDefinition(ec1, [vc1], [vc1, vc2]),
dr2 = graph._directedRelationDefinition(ec2, [vc3], [vc4, vc5]),
dr3 = graph._directedRelationDefinition(ec3, [vc4], [vc5]),
var dr1 = graph._directedRelation(ec1, [vc1], [vc1, vc2]),
dr2 = graph._directedRelation(ec2, [vc3], [vc4, vc5]),
dr3 = graph._directedRelation(ec3, [vc4], [vc5]),
g1 = graph._create(gN1, [dr1, dr2, dr3]);
assertEqual([dr1, dr2, dr3], g1.__edgeDefinitions);
@ -496,8 +496,8 @@ function GeneralGraphCreationSuite() {
} catch(ignore) {
}
var dr1 = graph._directedRelationDefinition(ec1, [vc1], [vc2]),
dr2 = graph._directedRelationDefinition(ec1, [vc2], [vc3]),
var dr1 = graph._directedRelation(ec1, [vc1], [vc2]),
dr2 = graph._directedRelation(ec1, [vc2], [vc3]),
g1 = graph._create(gN1, [dr1]);
try {
@ -518,9 +518,9 @@ function GeneralGraphCreationSuite() {
test_extendEdgeDefinitionFromExistingGraph2: function() {
var dr1 = graph._directedRelationDefinition(ec1, [vc1], [vc1, vc2]),
dr2 = graph._directedRelationDefinition(ec2, [vc3], [vc4, vc5]),
dr2a = graph._directedRelationDefinition(ec2, [vc3], [vc4]),
var dr1 = graph._directedRelation(ec1, [vc1], [vc1, vc2]),
dr2 = graph._directedRelation(ec2, [vc3], [vc4, vc5]),
dr2a = graph._directedRelation(ec2, [vc3], [vc4]),
g1 = graph._create(gN1, [dr1]),
g2 = graph._create(gN2, [dr2]);
@ -554,9 +554,9 @@ function GeneralGraphCreationSuite() {
} catch(ignore) {
}
var dr1 = graph._directedRelationDefinition(ec1, [vc1], [vc1, vc2]),
dr2 = graph._directedRelationDefinition(ec2, [vc3], [vc4, vc5]),
dr3 = graph._directedRelationDefinition(ec3, [vc3], [vc4]),
var dr1 = graph._directedRelation(ec1, [vc1], [vc1, vc2]),
dr2 = graph._directedRelation(ec2, [vc3], [vc4, vc5]),
dr3 = graph._directedRelation(ec3, [vc3], [vc4]),
g1 = graph._create(gN1, [dr1]),
g2 = graph._create(gN2, [dr2]);
@ -572,8 +572,8 @@ function GeneralGraphCreationSuite() {
},
test_editEdgeDefinitionFromExistingGraph1: function() {
var dr1 = graph._directedRelationDefinition(ec1, [vc1], [vc1, vc2]),
dr2 = graph._directedRelationDefinition(ec2, [vc3], [vc4, vc5]),
var dr1 = graph._directedRelation(ec1, [vc1], [vc1, vc2]),
dr2 = graph._directedRelation(ec2, [vc3], [vc4, vc5]),
g1 = graph._create(gN1, [dr1]);
try {
@ -589,9 +589,9 @@ function GeneralGraphCreationSuite() {
test_editEdgeDefinitionFromExistingGraph2: function() {
var dr1 = graph._directedRelationDefinition(ec1, [vc1, vc2], [vc3, vc4]),
dr2 = graph._directedRelationDefinition(ec2, [vc1], [vc4]),
dr3 = graph._directedRelationDefinition(ec1, [vc5], [vc5]),
var dr1 = graph._directedRelation(ec1, [vc1, vc2], [vc3, vc4]),
dr2 = graph._directedRelation(ec2, [vc1], [vc4]),
dr3 = graph._directedRelation(ec1, [vc5], [vc5]),
g1 = graph._create(gN1, [dr1, dr2]),
g2 = graph._create(gN2, [dr1]);
@ -611,9 +611,9 @@ function GeneralGraphCreationSuite() {
test_editEdgeDefinitionFromExistingGraph3: function() {
var dr1 = graph._directedRelationDefinition(ec1, [vc1], [vc1, vc2]),
dr2 = graph._directedRelationDefinition(ec1, [vc3], [vc4, vc5]),
dr3 = graph._directedRelationDefinition(ec2, [vc2], [vc2, vc3]),
var dr1 = graph._directedRelation(ec1, [vc1], [vc1, vc2]),
dr2 = graph._directedRelation(ec1, [vc3], [vc4, vc5]),
dr3 = graph._directedRelation(ec2, [vc2], [vc2, vc3]),
g1 = graph._create(gN1, [dr1, dr3]),
g2 = graph._create(gN2, [dr1]);
@ -670,10 +670,10 @@ function GeneralGraphAQLQueriesSuite() {
var createInclExcl = function() {
dropInclExcl();
var inc = graph._directedRelationDefinition(
var inc = graph._directedRelation(
included, [v1], [v1, v2]
);
var exc = graph._directedRelationDefinition(
var exc = graph._directedRelation(
excluded, [v1], [v3]
);
var g = graph._create(graphName, [inc, exc]);
@ -949,8 +949,8 @@ function ChainedFluentAQLResultsSuite() {
var g;
var edgeDef = [];
edgeDef.push(graph._undirectedRelationDefinition(isFriend, user));
edgeDef.push(graph._directedRelationDefinition(hasBought, user, product));
edgeDef.push(graph._undirectedRelation(isFriend, user));
edgeDef.push(graph._directedRelation(hasBought, user, product));
var findBoughts = function(result, list) {
@ -1820,8 +1820,8 @@ function EdgesAndVerticesSuite() {
g = graph._create(
unitTestGraphName,
graph._edgeDefinitions(
graph._undirectedRelationDefinition(ec1, vc1),
graph._directedRelationDefinition(ec2,
graph._undirectedRelation(ec1, vc1),
graph._directedRelation(ec2,
[vc1, vc2], [vc3, vc4]
)
)
@ -1839,7 +1839,7 @@ function EdgesAndVerticesSuite() {
graph._create(
myGraphName,
graph._edgeDefinitions(
graph._undirectedRelationDefinition(myEdgeColName, myVertexColName)
graph._undirectedRelation(myEdgeColName, myVertexColName)
)
);
graph._drop(myGraphName, true);
@ -1855,7 +1855,7 @@ function EdgesAndVerticesSuite() {
graph._create(
myGraphName,
graph._edgeDefinitions(
graph._undirectedRelationDefinition(myEdgeColName, myVertexColName)
graph._undirectedRelation(myEdgeColName, myVertexColName)
)
);
graph._drop(myGraphName);
@ -1869,7 +1869,7 @@ function EdgesAndVerticesSuite() {
graph._create(
myGraphName,
graph._edgeDefinitions(
graph._undirectedRelationDefinition(ec1, vc1)
graph._undirectedRelation(ec1, vc1)
)
);
assertTrue(graph._exists(myGraphName));
@ -1885,7 +1885,7 @@ function EdgesAndVerticesSuite() {
graph._create(
myGraphName,
graph._edgeDefinitions(
graph._undirectedRelationDefinition(ec1, vc2)
graph._undirectedRelation(ec1, vc2)
)
);
} catch (e) {
@ -1910,8 +1910,8 @@ function EdgesAndVerticesSuite() {
graph._create(
myGraphName,
graph._edgeDefinitions(
graph._undirectedRelationDefinition(myED, myVD1),
graph._undirectedRelationDefinition(myED, myVD2)
graph._undirectedRelation(myED, myVD1),
graph._undirectedRelation(myED, myVD2)
)
);
} catch (e) {
@ -2083,7 +2083,7 @@ function EdgesAndVerticesSuite() {
var g2 = graph._create(
myGraphName,
graph._edgeDefinitions(
graph._directedRelationDefinition(myEC02,
graph._directedRelation(myEC02,
[ec1], [myVC01]
)
)
@ -2158,25 +2158,25 @@ function EdgesAndVerticesSuite() {
var g1 = graph._create(
gN1,
graph._edgeDefinitions(
graph._directedRelationDefinition(eC1, [eC4], [vC1])
graph._directedRelation(eC1, [eC4], [vC1])
)
);
var g2 = graph._create(
gN2,
graph._edgeDefinitions(
graph._directedRelationDefinition(eC2, [eC1], [vC2])
graph._directedRelation(eC2, [eC1], [vC2])
)
);
var g3 = graph._create(
gN3,
graph._edgeDefinitions(
graph._directedRelationDefinition(eC3, [eC2], [vC3])
graph._directedRelation(eC3, [eC2], [vC3])
)
);
var g4 = graph._create(
gN4,
graph._edgeDefinitions(
graph._directedRelationDefinition(eC4, [eC3], [vC4])
graph._directedRelation(eC4, [eC3], [vC4])
)
);
@ -2288,7 +2288,7 @@ function GeneralGraphCommonNeighborsSuite() {
testGraph = graph._create(
"bla3",
graph._edgeDefinitions(
graph._directedRelationDefinition(eColName,
graph._directedRelation(eColName,
[v1ColName, v2ColName],
[v1ColName, v2ColName]
)
@ -2506,7 +2506,7 @@ function OrphanCollectionSuite() {
g1 = graph._create(
gN1,
graph._edgeDefinitions(
graph._directedRelationDefinition(
graph._directedRelation(
eC1, [vC1], [vC1, vC2]
)
)
@ -2514,7 +2514,7 @@ function OrphanCollectionSuite() {
g2 = graph._create(
gN2,
graph._edgeDefinitions(
graph._directedRelationDefinition(
graph._directedRelation(
eC2, [vC3], [vC1]
)
)

View File

@ -1924,8 +1924,8 @@ function GeneralGraphTraversalSuite () {
cleanUp();
var edgeDef = [];
edgeDef.push(generalGraph._directedRelationDefinition(enDir, vnA, vnBDH));
edgeDef.push(generalGraph._undirectedRelationDefinition(enUndir, [vnBDH, vnCEFGI]));
edgeDef.push(generalGraph._directedRelation(enDir, vnA, vnBDH));
edgeDef.push(generalGraph._undirectedRelation(enUndir, [vnBDH, vnCEFGI]));
g = generalGraph._create(gn, edgeDef);
saveVertex(vnA, "A");

View File

@ -160,7 +160,8 @@ extend(Controller.prototype, {
'use strict';
var newRoute = internal.constructRoute(method, route, callback, this),
requestContext = new RequestContext(this.allRoutes, this.models, newRoute, this.rootElement),
summary;
summary,
undocumentedBody;
this.routingInfo.routes.push(newRoute);
@ -175,8 +176,8 @@ extend(Controller.prototype, {
this.applicationContext.clearComments();
if (method === 'post' || method === 'put' || method === 'patch') {
var UndocumentedBody = require('org/arangodb/foxx').Model.extend();
requestContext.bodyParam("undocumented body", "Undocumented body param", UndocumentedBody);
undocumentedBody = require('org/arangodb/foxx').Model.extend();
requestContext.bodyParam("undocumented body", "Undocumented body param", undocumentedBody);
}
return requestContext;

View File

@ -89,8 +89,8 @@ function ahuacatlQueryGeneralEdgesTestSuite() {
graph._create(
"bla3",
graph._edgeDefinitions(
graph._undirectedRelationDefinition("UnitTestsAhuacatlEdge1", "UnitTestsAhuacatlVertex1"),
graph._directedRelationDefinition("UnitTestsAhuacatlEdge2",
graph._undirectedRelation("UnitTestsAhuacatlEdge1", "UnitTestsAhuacatlVertex1"),
graph._directedRelation("UnitTestsAhuacatlEdge2",
["UnitTestsAhuacatlVertex1", "UnitTestsAhuacatlVertex2"],
["UnitTestsAhuacatlVertex3", "UnitTestsAhuacatlVertex4"]
)
@ -303,7 +303,7 @@ function ahuacatlQueryGeneralCommonTestSuite() {
graph._create(
"bla3",
graph._edgeDefinitions(
graph._directedRelationDefinition("UnitTestsAhuacatlEdge1",
graph._directedRelation("UnitTestsAhuacatlEdge1",
["UnitTestsAhuacatlVertex1", "UnitTestsAhuacatlVertex2"],
["UnitTestsAhuacatlVertex1", "UnitTestsAhuacatlVertex2"]
)
@ -493,8 +493,8 @@ function ahuacatlQueryGeneralPathsTestSuite() {
var g = graph._create(
"bla3",
graph._edgeDefinitions(
graph._undirectedRelationDefinition("UnitTestsAhuacatlEdge1", "UnitTestsAhuacatlVertex1"),
graph._directedRelationDefinition("UnitTestsAhuacatlEdge2",
graph._undirectedRelation("UnitTestsAhuacatlEdge1", "UnitTestsAhuacatlVertex1"),
graph._directedRelation("UnitTestsAhuacatlEdge2",
["UnitTestsAhuacatlVertex1", "UnitTestsAhuacatlVertex2"],
["UnitTestsAhuacatlVertex3", "UnitTestsAhuacatlVertex4"]
)
@ -661,8 +661,8 @@ function ahuacatlQueryGeneralTraversalTestSuite() {
var g = graph._create(
"werKenntWen",
graph._edgeDefinitions(
graph._undirectedRelationDefinition(KenntAnderenBerliner, "UnitTests_Berliner"),
graph._directedRelationDefinition(KenntAnderen,
graph._undirectedRelation(KenntAnderenBerliner, "UnitTests_Berliner"),
graph._directedRelation(KenntAnderen,
["UnitTests_Hamburger", "UnitTests_Frankfurter", "UnitTests_Berliner", "UnitTests_Leipziger"],
["UnitTests_Hamburger", "UnitTests_Frankfurter", "UnitTests_Berliner", "UnitTests_Leipziger"]
)
@ -1622,8 +1622,8 @@ function ahuacatlQueryGeneralCycleSSuite() {
var g = graph._create(
"werKenntWen",
graph._edgeDefinitions(
graph._undirectedRelationDefinition(KenntAnderenBerliner, "UnitTests_Berliner"),
graph._directedRelationDefinition(KenntAnderen,
graph._undirectedRelation(KenntAnderenBerliner, "UnitTests_Berliner"),
graph._directedRelation(KenntAnderen,
["UnitTests_Hamburger", "UnitTests_Frankfurter", "UnitTests_Berliner", "UnitTests_Leipziger"],
["UnitTests_Hamburger", "UnitTests_Frankfurter", "UnitTests_Berliner", "UnitTests_Leipziger"]
)