mirror of https://gitee.com/bigwinds/arangodb
Merge remote-tracking branch 'origin/1.4' into devel
Conflicts: CHANGELOG VERSION arangod/Ahuacatl/ahuacatl-access-optimiser.c arangod/Ahuacatl/ahuacatl-codegen.c build.h configure configure.ac js/apps/system/aardvark/api-docs.json js/apps/system/aardvark/api-docs/batch.json js/apps/system/aardvark/api-docs/database.json js/apps/system/aardvark/api-docs/endpoint.json js/apps/system/aardvark/api-docs/job.json js/apps/system/aardvark/api-docs/replication.json js/apps/system/aardvark/api-docs/system.json js/apps/system/aardvark/frontend/js/modules/org/arangodb/graph/traversal.js js/common/modules/org/arangodb/graph/traversal.js js/server/modules/org/arangodb/ahuacatl.js lib/HttpServer/HttpCommTask.h
This commit is contained in:
commit
8406f51435
|
@ -1918,9 +1918,9 @@ def RunSystemTests(flavor):
|
|||
arflags_target = 'crs'
|
||||
# ar -T enables thin archives on Linux. OS X's ar supports a -T flag, but it
|
||||
# does something useless (it limits filenames in the archive to 15 chars).
|
||||
if flavor != 'mac' and gyp.system_test.TestArSupportsT(ar_command=ar_target,
|
||||
cc_command=cc_target):
|
||||
arflags_target = 'crsT'
|
||||
#if flavor != 'mac' and gyp.system_test.TestArSupportsT(ar_command=ar_target,
|
||||
# cc_command=cc_target):
|
||||
# arflags_target = 'crsT'
|
||||
|
||||
ar_host = os.environ.get('AR_host', 'ar')
|
||||
cc_host = os.environ.get('CC_host', 'gcc')
|
||||
|
@ -1929,9 +1929,9 @@ def RunSystemTests(flavor):
|
|||
# cross-compiles, but due to quirks of history CC_host defaults to 'gcc'
|
||||
# while CC_target defaults to 'cc', so the commands really are different
|
||||
# even though they're nearly guaranteed to run the same code underneath.
|
||||
if flavor != 'mac' and gyp.system_test.TestArSupportsT(ar_command=ar_host,
|
||||
cc_command=cc_host):
|
||||
arflags_host = 'crsT'
|
||||
#if flavor != 'mac' and gyp.system_test.TestArSupportsT(ar_command=ar_host,
|
||||
# cc_command=cc_host):
|
||||
# arflags_host = 'crsT'
|
||||
|
||||
return { 'ARFLAGS.target': arflags_target,
|
||||
'ARFLAGS.host': arflags_host }
|
||||
|
|
|
@ -190,9 +190,11 @@ v1.4.11 (XXXX-XX-XX)
|
|||
* fixed access to potentially uninitialised variable when collection had a cap constraint
|
||||
|
||||
|
||||
v1.4.10 (XXXX-XX-XX)
|
||||
v1.4.10 (2014-02-21)
|
||||
--------------------
|
||||
|
||||
* fixed graph constructor to allow graph with some parameter to be used
|
||||
|
||||
* added node.js "events" and "stream"
|
||||
|
||||
* updated npm packages
|
||||
|
|
|
@ -93,7 +93,7 @@ See @ref RestDocument for details.
|
|||
See @ref RestDocument for details.
|
||||
|
||||
@anchor RestEdgeHead
|
||||
@RESTHEADER{GET /_api/edge,reads an edge header}
|
||||
@RESTHEADER{HEAD /_api/edge,reads an edge header}
|
||||
|
||||
@REST{HEAD /_api/edge/@FA{document-handle}}
|
||||
|
||||
|
|
|
@ -147,7 +147,7 @@ describe ArangoDB do
|
|||
doc1.code.should eq(201)
|
||||
|
||||
doc2 = create_graph( prefix, "recreate", vertex_collection, edge_collection )
|
||||
doc2.code.should eq(400)
|
||||
doc2.code.should eq(201)
|
||||
end
|
||||
|
||||
it "checks (re)create graph different name" do
|
||||
|
|
|
@ -1529,7 +1529,7 @@ static void GenerateBitarrayAccess (TRI_aql_codegen_js_t* const generator,
|
|||
ScopeOutput(generator, ")");
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
if (fieldAccess->_type == TRI_AQL_ACCESS_REFERENCE &&
|
||||
fieldAccess->_value._reference._operator == TRI_AQL_NODE_OPERATOR_BINARY_IN) {
|
||||
ScopeOutput(generator, "aql.GET_DOCUMENTS_BITARRAY_LIST('");
|
||||
|
|
|
@ -213,6 +213,13 @@
|
|||
"name": "graph-name",
|
||||
"description": "The name of the graph "
|
||||
},
|
||||
{
|
||||
"dataType": "String",
|
||||
"paramType": "path",
|
||||
"required": "true",
|
||||
"name": "vertex-name",
|
||||
"description": "The name of the vertex "
|
||||
},
|
||||
{
|
||||
"dataType": "String",
|
||||
"paramType": "query",
|
||||
|
@ -535,7 +542,7 @@
|
|||
"description": "The call expects a JSON hash array as body with the edge properties: "
|
||||
}
|
||||
],
|
||||
"notes": "Creates an edge in a graph. <br><br>The call expects a JSON hash array as body with the edge properties: <br><br>- <em>_key</em>: The name of the edge.- <em>_from</em>: The name of the from vertex.- <em>_to</em>: The name of the to vertex.- <em>$label</em>: A label for the edge (optional).- further optional attributes.<br><br>Returns an object with an attribute <em>edge</em> containing the list of all edge properties. <br><br>",
|
||||
"notes": "Creates an edge in a graph. <br><br>The call expects a JSON hash array as body with the edge properties: <br><br>- <em>_key</em>: The name of the edge (optional, if edge collection allows user defined keys).- <em>_from</em>: The name of the from vertex.- <em>_to</em>: The name of the to vertex.- <em>$label</em>: A label for the edge (optional).- further optional attributes.<br><br>Returns an object with an attribute <em>edge</em> containing the list of all edge properties. <br><br>",
|
||||
"summary": "create edge",
|
||||
"httpMethod": "POST",
|
||||
"examples": "<br><br><pre><code class=\"json\" >unix> curl -X POST --data @- --dump - http://localhost:8529/_api/graph/graph/edge\n{\"_key\":\"edge1\",\"_from\":\"vert2\",\"_to\":\"vert1\",\"optional1\":\"val1\"}\n\nHTTP/1.1 202 Accepted\ncontent-type: application/json; charset=utf-8\netag: 162021799\n\n{ \n \"edge\" : { \n \"_id\" : \"edges/edge1\", \n \"_rev\" : \"162021799\", \n \"_key\" : \"edge1\", \n \"_from\" : \"vertices/vert2\", \n \"_to\" : \"vertices/vert1\", \n \"$label\" : null, \n \"optional1\" : \"val1\" \n }, \n \"error\" : false, \n \"code\" : 202 \n}\n\n</code></pre><br>",
|
||||
|
@ -573,6 +580,13 @@
|
|||
"name": "graph-name",
|
||||
"description": "The name of the graph "
|
||||
},
|
||||
{
|
||||
"dataType": "String",
|
||||
"paramType": "path",
|
||||
"required": "true",
|
||||
"name": "edge-name",
|
||||
"description": "The name of the edge "
|
||||
},
|
||||
{
|
||||
"dataType": "String",
|
||||
"paramType": "query",
|
||||
|
|
|
@ -47,7 +47,7 @@
|
|||
"description": "The index-handle. "
|
||||
}
|
||||
],
|
||||
"notes": "<br><br>The result is an objects describing the index. It has at least the following attributes: <br><br>- <em>id</em>: The identifier of the index.<br><br>- <em>type</em>: The type of the collection.<br><br>All other attributes are type-dependent. <br><br>",
|
||||
"notes": "<br><br>The result is an objects describing the index. It has at least the following attributes: <br><br>- <em>id</em>: The identifier of the index.<br><br>All other attributes are type-dependent. <br><br>",
|
||||
"summary": "reads an index",
|
||||
"httpMethod": "GET",
|
||||
"examples": "<br><br><pre><code class=\"json\" >unix> curl --dump - http://localhost:8529/_api/index/products/0\n\nHTTP/1.1 200 OK\ncontent-type: application/json; charset=utf-8\n\n{ \n \"id\" : \"products/0\", \n \"type\" : \"primary\", \n \"unique\" : true, \n \"fields\" : [ \n \"_id\" \n ], \n \"error\" : false, \n \"code\" : 200 \n}\n\n</code></pre><br>",
|
||||
|
|
|
@ -169,7 +169,7 @@
|
|||
"description": "Contains the query. "
|
||||
}
|
||||
],
|
||||
"notes": "<br><br>This will find all documents from the collection that match the fulltext query specified in <em>query</em>. <br><br>In order to use the <em>fulltext</em> operator, a fulltext index must be defined for the collection and the specified attribute. <br><br>The call expects a JSON object as body with the following attributes: <br><br>- <em>collection</em>: The name of the collection to query.<br><br>- <em>attribute</em>: The attribute that contains the texts.<br><br>- <em>query</em>: The fulltext query.<br><br>- <em>skip</em>: The documents to skip in the query. (optional)<br><br>- <em>limit</em>: The maximal amount of documents to return. (optional)<br><br>- <em>index</em>: If given, the identifier of the fulltext-index to use. (optional)<br><br>Returns a cursor containing the result, see the manual for details. <br><br>",
|
||||
"notes": "<br><br>This will find all documents from the collection that match the fulltext query specified in <em>query</em>. <br><br>In order to use the <em>fulltext</em> operator, a fulltext index must be defined for the collection and the specified attribute. <br><br>The call expects a JSON object as body with the following attributes: <br><br>- <em>collection</em>: The name of the collection to query.<br><br>- <em>attribute</em>: The attribute that contains the texts.<br><br>- <em>query</em>: The fulltext query.<br><br>- <em>skip</em>: The documents to skip in the query. (optional)<br><br>- <em>limit</em>: The maximal amount of documents to return. (optional)<br><br>- <em>index</em>: The identifier of the fulltext-index to use.<br><br>Returns a cursor containing the result, see the manual for details. <br><br>",
|
||||
"summary": "executes simple query FULLTEXT",
|
||||
"httpMethod": "PUT",
|
||||
"examples": "<br><br><pre><code class=\"json\" >unix> curl -X PUT --data @- --dump - http://localhost:8529/_api/simple/fulltext\n{ \"collection\": \"products\", \"attribute\" : \"text\", \"query\" : \"word\" }\n\nHTTP/1.1 201 Created\ncontent-type: application/json; charset=utf-8\n\n{ \n \"result\" : [ \n { \n \"_id\" : \"products/224805287\", \n \"_rev\" : \"224805287\", \n \"_key\" : \"224805287\", \n \"text\" : \"this text contains word\" \n }, \n { \n \"_id\" : \"products/225067431\", \n \"_rev\" : \"225067431\", \n \"_key\" : \"225067431\", \n \"text\" : \"this text also has a word\" \n } \n ], \n \"hasMore\" : false, \n \"count\" : 2, \n \"error\" : false, \n \"code\" : 201 \n}\n\n</code></pre><br>",
|
||||
|
|
|
@ -3969,7 +3969,7 @@ function TRAVERSAL_FUNC (func,
|
|||
}
|
||||
catch (err1) {
|
||||
}
|
||||
|
||||
|
||||
// end vertex
|
||||
var e;
|
||||
if (endVertex !== undefined) {
|
||||
|
|
|
@ -47,11 +47,6 @@ var arangodb = require("org/arangodb"),
|
|||
// --SECTION-- private functions
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// @addtogroup ArangoGraph
|
||||
/// @{
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// @brief find or create a collection by name
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
@ -92,19 +87,14 @@ var findOrCreateEdgeCollectionByName = function (name) {
|
|||
return col;
|
||||
};
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// @}
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
// -----------------------------------------------------------------------------
|
||||
// --SECTION-- Edge
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
// --SECTION-- public methods
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// @addtogroup ArangoGraph
|
||||
/// @{
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// @brief changes a property of an edge
|
||||
///
|
||||
|
@ -134,40 +124,14 @@ Edge.prototype.setProperty = function (name, value) {
|
|||
return value;
|
||||
};
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// @}
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
// --SECTION-- Vertex
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
// --SECTION-- constructors and destructors
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// @addtogroup ArangoGraph
|
||||
/// @{
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// @brief constructs a new vertex object
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// @}
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
// --SECTION-- public methods
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// @addtogroup ArangoGraph
|
||||
/// @{
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// @brief inbound and outbound edges
|
||||
///
|
||||
|
@ -325,19 +289,14 @@ Vertex.prototype.setProperty = function (name, value) {
|
|||
return value;
|
||||
};
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// @}
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
// -----------------------------------------------------------------------------
|
||||
// --SECTION-- Graph
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
// --SECTION-- constructors and destructors
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// @addtogroup ArangoGraph
|
||||
/// @{
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// @brief constructs a new graph object
|
||||
///
|
||||
|
@ -374,13 +333,13 @@ Graph.prototype.initialize = function (name, vertices, edges, waitForSync) {
|
|||
if (typeof vertices === 'object' && typeof vertices.name === 'function') {
|
||||
vertices = vertices.name();
|
||||
}
|
||||
|
||||
if (typeof edges === 'object' && typeof edges.name === 'function') {
|
||||
edges = edges.name();
|
||||
}
|
||||
|
||||
// find an existing graph by name
|
||||
if (vertices === undefined && edges === undefined) {
|
||||
|
||||
// Find an existing graph
|
||||
try {
|
||||
graphProperties = gdb.document(name);
|
||||
}
|
||||
|
@ -404,17 +363,19 @@ Graph.prototype.initialize = function (name, vertices, edges, waitForSync) {
|
|||
throw "edge collection '" + graphProperties.edges + "' has vanished";
|
||||
}
|
||||
}
|
||||
|
||||
// sanity check for vertices
|
||||
else if (typeof vertices !== "string" || vertices === "") {
|
||||
throw "<vertices> must be a string or null";
|
||||
}
|
||||
|
||||
// sanity check for edges
|
||||
else if (typeof edges !== "string" || edges === "") {
|
||||
throw "<edges> must be a string or null";
|
||||
}
|
||||
|
||||
// create a new graph or get an existing graph
|
||||
else {
|
||||
// Create a new graph or get an existing graph
|
||||
vertices = findOrCreateCollectionByName(vertices);
|
||||
edges = findOrCreateEdgeCollectionByName(edges);
|
||||
|
||||
try {
|
||||
graphProperties = gdb.document(name);
|
||||
}
|
||||
|
@ -422,24 +383,27 @@ Graph.prototype.initialize = function (name, vertices, edges, waitForSync) {
|
|||
graphProperties = null;
|
||||
}
|
||||
|
||||
// Graph doesn't exist yet
|
||||
// graph doesn't exist yet, create it
|
||||
if (graphProperties === null) {
|
||||
|
||||
// check if know that graph
|
||||
graphProperties = gdb.firstExample(
|
||||
'vertices', vertices.name(),
|
||||
'edges', edges.name()
|
||||
'vertices', vertices,
|
||||
'edges', edges
|
||||
);
|
||||
|
||||
if (graphProperties === null) {
|
||||
|
||||
// check if edge is used in a graph
|
||||
graphProperties = gdb.firstExample('edges', edges.name());
|
||||
graphProperties = gdb.firstExample('edges', edges);
|
||||
|
||||
if (graphProperties === null) {
|
||||
findOrCreateCollectionByName(vertices);
|
||||
findOrCreateEdgeCollectionByName(edges);
|
||||
|
||||
graphPropertiesId = gdb.save({
|
||||
'vertices' : vertices.name(),
|
||||
'edges' : edges.name(),
|
||||
'vertices' : vertices,
|
||||
'edges' : edges,
|
||||
'_key' : name
|
||||
}, waitForSync);
|
||||
|
||||
|
@ -454,15 +418,13 @@ Graph.prototype.initialize = function (name, vertices, edges, waitForSync) {
|
|||
}
|
||||
}
|
||||
else {
|
||||
throw "graph with that name already exists";
|
||||
//if (graphProperties.vertices !== vertices.name()) {
|
||||
// throw "found graph but has different <vertices>";
|
||||
//}
|
||||
|
||||
//if (graphProperties.edges !== edges.name()) {
|
||||
// throw "found graph but has different <edges>";
|
||||
//}
|
||||
if (graphProperties.vertices !== vertices || graphProperties.edges !== edges) {
|
||||
throw "graph with that name already exists";
|
||||
}
|
||||
}
|
||||
|
||||
vertices = db._collection(graphProperties.vertices);
|
||||
edges = db._collection(graphProperties.edges);
|
||||
}
|
||||
|
||||
this._properties = graphProperties;
|
||||
|
@ -481,19 +443,10 @@ Graph.prototype.initialize = function (name, vertices, edges, waitForSync) {
|
|||
this.distances = {};
|
||||
};
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// @}
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
// --SECTION-- public methods
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// @addtogroup ArangoGraph
|
||||
/// @{
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// @fn JSF_graph_getAll
|
||||
/// @brief returns all available graphs
|
||||
|
@ -776,19 +729,10 @@ Graph.prototype.removeEdge = function (edge, waitForSync) {
|
|||
}
|
||||
};
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// @}
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
// --SECTION-- MODULE EXPORTS
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// @addtogroup ArangoGraph
|
||||
/// @{
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
exports.Edge = Edge;
|
||||
exports.Graph = Graph;
|
||||
exports.Vertex = Vertex;
|
||||
|
@ -796,10 +740,6 @@ exports.GraphArray = GraphArray;
|
|||
|
||||
require("org/arangodb/graph/algorithms-common");
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// @}
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
// --SECTION-- END-OF-FILE
|
||||
// -----------------------------------------------------------------------------
|
||||
|
|
Loading…
Reference in New Issue