[Neo4j] neo4j REST GraphAlgo
Mattias Persson
mattias at neotechnology.com
Thu Aug 19 23:26:18 CEST 2010
That's nice, I'll definately try it out when I getthe time for it!
2010/8/19 Todd Chaffee <todd at mikamai.com>
> I've just checked-in a draft implementation of the REST API for
> GraphAlgoFactory into the laboratory. It currently supports the following:
>
> - algorithms shortestPath, allSimplePaths, and allPaths
> - relationship expanders
> - max depth (shortestPath seems to ignore this - there may be a bug
> in org.neo4j.graphalgo.impl.path.ShortestPath)
>
Could you supply some test case which can trigger it? That ShortestPath algo
has been tested and even deployed in production environments with correct
behaviour.
- return a single path or all paths.
>
> Before moving forward I wonder if someone could take a quick look at it to
> see if it fits well with the existing REST API and if the java code looks
> acceptable. Here are some examples you could use to test.
>
Again, I'd be happy to whenever I get the time :)
>
> Simple case - show all shortestPaths from Node 1 to Node 3:
>
> curl -H Accept:application/json -H Content-Type:application/json -d
> '{ "to": "http://localhost:9999/node/3" }'
-X POST http://localhost:9999/node/1/pathfinder
>
So shortest path is the default algo if none specified?
>
> Specify the algorithm, max depth, and return only one path:
>
> curl -H Accept:application/json -H Content-Type:application/json -d
> '{ "to": "http://localhost:9999/node/3",
> "algorithm": "allSimplePaths",
> "max depth": 3,
> "single path": "true" }'
> -X POST http://localhost:9999/node/1/pathfinder
>
> Restrict relationships:
>
> curl -H Accept:application/json -H Content-Type:application/json -d
> '{ "to": "http://localhost:9999/node/3",
> "relationships": [
> { "type": "KNOWS", "direction": "out" },
> {"type": "LOVES" } ] }'
> -X POST http://localhost:9999/node/1/pathfinder
>
My initial thought was to have a
.../node/1/shortestpaths
.../node/1/allpaths
a.s.o.
Or even (may be my favourite)
.../node/1/paths/shortest
.../node/1/paths/simple
for multiple paths and
.../node/1/path/shortest
.../node/1/path/simple.
for single paths, but it's a matter of taste here I'd guess. Your solution
is also quite nice.
Best,
Mattias
>
> Thanks,
> Todd
> _______________________________________________
> Neo4j mailing list
> User at lists.neo4j.org
> https://lists.neo4j.org/mailman/listinfo/user
>
--
Mattias Persson, [mattias at neotechnology.com]
Hacker, Neo Technology
www.neotechnology.com
More information about the User
mailing list