Re: [Neo4j] Hyperedges in Neo4j

2011-09-01 Thread Niels Hoogeveen

Correct, turing completeness is not the lower bound for non-guaranteed 
termination.
It is however possible to have some forms of recursion without sacrificing 
guaranteed termination. Neo4j traversals, memorizing visited paths, 
relationships or nodes are an example (Note, it would be nice to have an option 
to memorize visited (Node, RelationshipType, Direction)). This limited form of 
recursion is useful as a query language. Doing so of course eliminates correct 
statements. 

When memorizing nodes, the statement john (FRIEND_OF, OUTGOING) pete 
(FRIEND_OF, OUTGOING) john can no longer be true, but we could memorize 
relationships instead of nodes. This makes the former statement possible, but 
makes it impossible to return the statement john (FRIEND_OF, OUTGOING) pete 
(FRIEND_OF, OUTGOING) john (FRIEND_OF, OUTGOING) pete, unless john has more 
than one outgoing FRIEND relationship with pete (Memorizing (Node, 
RelationshipType, Direction) would make that statement impossible even in the 
presence of more than one FRIEND relationship from john to pete). 
While repeated paths in the graph are in principle true statements of the graph 
grammar, in many practical programming tasks we are not interested in such 
statements and in fact like to see those eliminated. 
Niels

> From: okramma...@gmail.com
> Date: Thu, 1 Sep 2011 08:17:27 -0600
> To: user@lists.neo4j.org
> Subject: Re: [Neo4j] Hyperedges in Neo4j
> 
> Hey,
> 
> > I think a traversal should in principal be performed with a query language 
> > that is not turing complete so we can guarantee termination.
> 
> Turning completeness is not the lower bound for non-guaranteed termination. 
> You can't guarantee completion in a regular language when your "String" (data 
> structure) is a graph. E.g.
> 
>   a*
> 
> The only languages guaranteed to complete are Star-free languages. That is, 
> those that don't allow for recursion.
> 
> See ya,
> Marko.
> 
> http://markorodriguez.com
> ___
> Neo4j mailing list
> User@lists.neo4j.org
> https://lists.neo4j.org/mailman/listinfo/user
  
___
Neo4j mailing list
User@lists.neo4j.org
https://lists.neo4j.org/mailman/listinfo/user


Re: [Neo4j] Hyperedges in Neo4j

2011-09-01 Thread Marko Rodriguez
Hey,

> I think a traversal should in principal be performed with a query language 
> that is not turing complete so we can guarantee termination.

Turning completeness is not the lower bound for non-guaranteed termination. You 
can't guarantee completion in a regular language when your "String" (data 
structure) is a graph. E.g.

a*

The only languages guaranteed to complete are Star-free languages. That is, 
those that don't allow for recursion.

See ya,
Marko.

http://markorodriguez.com
___
Neo4j mailing list
User@lists.neo4j.org
https://lists.neo4j.org/mailman/listinfo/user


Re: [Neo4j] Hyperedges in Neo4j

2011-09-01 Thread Peter Neubauer
Yup,
+1 on that. This is just a workaround for expressing things in property
graph language. I think for proper HyperGraph support, we need to go a bit
further in the modeling and querying capabilities. Will be interesting to
see what you cook up :)

Cheers,

/peter neubauer

GTalk:  neubauer.peter
Skype   peter.neubauer
Phone   +46 704 106975
LinkedIn   http://www.linkedin.com/in/neubauer
Twitter  http://twitter.com/peterneubauer

http://www.neo4j.org   - Your high performance graph database.
http://startupbootcamp.org/- Öresund - Innovation happens HERE.
http://www.thoughtmade.com - Scandinavia's coolest Bring-a-Thing party.


On Thu, Sep 1, 2011 at 4:11 PM, Niels Hoogeveen
wrote:

>
> Hi Peter,
> Thanks for sharing this. Layout-wise, the solution you present is not
> really different from what Enhanced API does with regard to n-ary
> relationships. I would like to know if there is an elegant creation pattern
> for n-ary relationships, or do you have to rely on a manual creation of the
> proper edge-node and role-relationships?
> The query to extract information from the graph is however quite different
> from what I am aiming for.
> The back-operator is an interesting one and necessary in this situation,
> whereas I would like to do a query like that without the use of a
> back-operator. This is possible when the filter operator can take a
> traversal of itself, something of the form  filter(in("groupIn").name =
> "group2")
> I think a traversal should in principal be performed with a query language
> that is not turing complete so we can guarantee termination. This is
> especially important in a REST architecture where we can't control the type
> of queries asked.
> Niels
>
>
> > From: peter.neuba...@neotechnology.com
> > Date: Wed, 31 Aug 2011 18:19:00 +0200
> > To: user@lists.neo4j.org
> > Subject: [Neo4j] Hyperedges in Neo4j
> >
> > Hi folks,
> > I took a discussion over at Tinkerpop as the excuse to put in an example
> of
> > modeling and traversing Hyperedges in neo4j (in this case with Gremlin).
> Of
> > course this is nowhere near Nils thinking, but for simple cases this
> might
> > serve as a pattern.
> >
> >
> http://docs.neo4j.org/chunked/snapshot/gremlin-plugin.html#rest-api-hyperedges---find-user-roles-in-groups
> >
> > Let me know if you find that helpful.
> >
> > Cheers,
> >
> > /peter neubauer
> >
> > GTalk:  neubauer.peter
> > Skype   peter.neubauer
> > Phone   +46 704 106975
> > LinkedIn   http://www.linkedin.com/in/neubauer
> > Twitter  http://twitter.com/peterneubauer
> >
> > http://www.neo4j.org   - Your high performance graph
> database.
> > http://startupbootcamp.org/- Öresund - Innovation happens HERE.
> > http://www.thoughtmade.com - Scandinavia's coolest Bring-a-Thing party.
> > ___
> > Neo4j mailing list
> > User@lists.neo4j.org
> > https://lists.neo4j.org/mailman/listinfo/user
>
> ___
> Neo4j mailing list
> User@lists.neo4j.org
> https://lists.neo4j.org/mailman/listinfo/user
>
___
Neo4j mailing list
User@lists.neo4j.org
https://lists.neo4j.org/mailman/listinfo/user


Re: [Neo4j] Hyperedges in Neo4j

2011-09-01 Thread Niels Hoogeveen

Hi Peter,
Thanks for sharing this. Layout-wise, the solution you present is not really 
different from what Enhanced API does with regard to n-ary relationships. I 
would like to know if there is an elegant creation pattern for n-ary 
relationships, or do you have to rely on a manual creation of the proper 
edge-node and role-relationships?
The query to extract information from the graph is however quite different from 
what I am aiming for. 
The back-operator is an interesting one and necessary in this situation, 
whereas I would like to do a query like that without the use of a 
back-operator. This is possible when the filter operator can take a traversal 
of itself, something of the form  filter(in("groupIn").name = "group2")
I think a traversal should in principal be performed with a query language that 
is not turing complete so we can guarantee termination. This is especially 
important in a REST architecture where we can't control the type of queries 
asked. 
Niels


> From: peter.neuba...@neotechnology.com
> Date: Wed, 31 Aug 2011 18:19:00 +0200
> To: user@lists.neo4j.org
> Subject: [Neo4j] Hyperedges in Neo4j
> 
> Hi folks,
> I took a discussion over at Tinkerpop as the excuse to put in an example of
> modeling and traversing Hyperedges in neo4j (in this case with Gremlin). Of
> course this is nowhere near Nils thinking, but for simple cases this might
> serve as a pattern.
> 
> http://docs.neo4j.org/chunked/snapshot/gremlin-plugin.html#rest-api-hyperedges---find-user-roles-in-groups
> 
> Let me know if you find that helpful.
> 
> Cheers,
> 
> /peter neubauer
> 
> GTalk:  neubauer.peter
> Skype   peter.neubauer
> Phone   +46 704 106975
> LinkedIn   http://www.linkedin.com/in/neubauer
> Twitter  http://twitter.com/peterneubauer
> 
> http://www.neo4j.org   - Your high performance graph database.
> http://startupbootcamp.org/- Öresund - Innovation happens HERE.
> http://www.thoughtmade.com - Scandinavia's coolest Bring-a-Thing party.
> ___
> Neo4j mailing list
> User@lists.neo4j.org
> https://lists.neo4j.org/mailman/listinfo/user
  
___
Neo4j mailing list
User@lists.neo4j.org
https://lists.neo4j.org/mailman/listinfo/user


[Neo4j] Hyperedges in Neo4j

2011-08-31 Thread Peter Neubauer
Hi folks,
I took a discussion over at Tinkerpop as the excuse to put in an example of
modeling and traversing Hyperedges in neo4j (in this case with Gremlin). Of
course this is nowhere near Nils thinking, but for simple cases this might
serve as a pattern.

http://docs.neo4j.org/chunked/snapshot/gremlin-plugin.html#rest-api-hyperedges---find-user-roles-in-groups

Let me know if you find that helpful.

Cheers,

/peter neubauer

GTalk:  neubauer.peter
Skype   peter.neubauer
Phone   +46 704 106975
LinkedIn   http://www.linkedin.com/in/neubauer
Twitter  http://twitter.com/peterneubauer

http://www.neo4j.org   - Your high performance graph database.
http://startupbootcamp.org/- Öresund - Innovation happens HERE.
http://www.thoughtmade.com - Scandinavia's coolest Bring-a-Thing party.
___
Neo4j mailing list
User@lists.neo4j.org
https://lists.neo4j.org/mailman/listinfo/user