START n = node(0)
RETURN collect(n./*name*/)
or so?
Cheers,
/peter neubauer
Google:neubauer.peter
Skype:peter.neubauer
Phone: +46 704 106975
LinkedIn http://www.linkedin.com/in/neubauer
Twitter @peterneubauer
brew install neo4j && neo4j start
heroku addons:add neo4j
Wow,
I don't think you can do that right now. However, that sounds
interesting! Maybe something like the collect function could be used
for that?
START n = node(0)
RETURN collect(n./*name*/)
On Wed, Dec 28, 2011 at 5:45 PM, Andres Taylor <and...@neotechnology.com> wrote:
> Rickard - what does the JDBC driver think about this?
>
> Andrés
Yeah, I was reading the question and having the same thought. From a
JDBC point of view you really really do want to have schemas, even
though it is merely prototypical or prescriptive rather than absolute,
as in SQL.
I was gonna bring this up later anyway, so here is my take on it,
probably slightly longish (sorry).
What are schemas? On the most fundamental level schemas are languages.
We use languages to express things so that we can communicate. You can
understand what I write now because we use a shared language.
Languages are good. If we don't have languages, azhed faut ikl
sheeada. I.e. you have no frickin' idea what I'm saying.
In the relational world, every row must belong to a table, and every
table has a description of its columns, and every row has a value for
each column (including null, which is also a value, as it is not "I
don't know"). Everything is in one little box or another little box.
Comparatively, in the XML world, each document starts off as simply
existing, and then we can add languages to it by means of XML
namespaces, to mix and match things within the document container.
Similarly, in the real world we can mix languages, like swenglish,
manglish, or 1337 talk. RDF has similar characteristics, where a
URL/URI can have tuples about it from many ontologies, but it is
different from XML in the sense that there is more explicit support
for saying that a URI "is a type of" something.
Right now Neo4j has no schema support, i.e. it has no support for
languages. In other words, allura zhifo weart floo. It is easy to make
things not make any sense, and it is impossible to talk about things
in terms of patterns and concepts, as any language is inexpressible
and implicit.
Coming back to the initial question, for the purpose of JDBC, where
you can do a whole lot of work just talking about language, i.e.
schema, i.e. "what types are there and what do they look like", Neo4j
right now doesn't really help. It shows also in the sense that doing
things like * queries have no meaning. If a tool does "select * from
X" the JDBC driver currently has to first make a call to the server to
find my type node X, list the properties back as a result, and then
make another call where the properties are explicitly listed. If types
was something that was explicitly supported, then it would be much
much easier to talk about things on the metalevel. Because basically
using * is that: "I know that what I look for has type X, so gimme
everything related to type X".
Talking about being schema-less as being good I think is something
that is not the right thing to do. Languages are very useful. It's
just that languages/schemas in the relational sense, where you only
get to pick one at a time, is really not helpful. I like swenglish,
and manglish when appropriate. Considering the power of Neo4j to
construct arbitrary graphs, much like what you can do with XML and
RDF, I would suggest that that approach, whereby you do have languages
but they can be combined and used whenever appropriate, is the right
way to go. And it will help Cypher, and it will definitely help the
JDBC driver, as then you can talk about things without mentioning
explicit instances of things.
And taking a hint from RDF and XML, languages should of course be
expressed using graphs, in two levels: users can create languages
using the language language, and the language language (i.e. something
like XMLSchema) is then defined recursively, within Neo4j itself. So
at the root, you should be able to ask "gimme a list of all languages
in the database", and then continue from there.
Something like that.
/Rickard
Oh, to add one more thing, it would also be great to be able to get all relationships or just any methods in the Node class here ... http://components.neo4j.org/neo4j/1.6.M02/apidocs/org/neo4j/graphdb/Node.html
For some reason that code is throwing an error "Can only iterate over an array or an instance of java.lang.Iterable"
Are you sure ExecutionResult implements Iterable?
Von meinem iPhone gesendet
Query query = parser.parse("start n = node(*) match n-[r:**name}->m
where r.**prop = \"XYZ\" return m");
ExecutionResult result = engine.execute(query);
Cheers,
/peter neubauer
Google: neubauer.peter
Skype: peter.neubauer
Phone: +46 704 106975
LinkedIn: http://www.linkedin.com/in/neubauer
Twitter: @peterneubauer
Tungle: tungle.me/peterneubauer
brew install neo4j && neo4j start
heroku addons:add neo4j
Or at least the nodes for m and m with their properties and relationships (and the existing "r" - relationship(s)).
Michael