Sorry, the browser you are using is not currently supported. Disqus actively supports the following browsers:
This page is forcing your browser to use legacy mode, which is not compatible with Disqus. Please see our troubleshooting guide to get more information about this error.
I have one graph which is created by protege 4.3 which is an ontology creating tool. How can I take that graph as input and how can I retrieve data from that graph
I'd suggest you ask on the Neo4j mailing list or stackoverflow what others have done.
How do I negate matches? For example, I want to find all nodes that don't have relationships. Something like:
start n=node(*) match (n)-[!]-() return n;
if "!" we the opposite of "?".
One way is to do something like this:
start n=node(*)
match p = n-[r?]-()
with n,p
where p is null
return n;
I would suggest you use:
start n=node(*)
where not( n--() )
return n
The Cypher master has spoken, go with this answer!
What specific algorithm does Cypher use to perform subgraph matching? What sort of running time big-O are we talking about here?
Also, it'd be nice to have a page somewhere in documentation that lists the references to various graph theoretic approaches used by neo4j and Cypher.
I have a db with 348 nodes and 950,261 relationship between nodes, and I execute a cypher query like this:
START dep = node:airports(code = "HKG") MATCH path = dep -[policy:HAS_POLICY_TO*2]-> arr WHERE arr.code = "CAN" RETURN path
But the query can not return the result even after I wait half a hour. Can you give me some advice to optimize the query? Thanks.
It looks like you could get both start and end node(s) from the airports index, that would reduce the numbers of paths the query engine has to check.
Also,
is START dep = node:airports(code =
"HKG") MATCH path = dep -[policy:HAS_POLICY_TO*2]-> arr WHERE
arr.code = "CAN" RETURN count(path)
and
START dep = node:airports(code = "HKG") RETURN count(dep)
returning faster, and what does it give you?
Thanks for your help. But the first query of yours runs also slowly on my server, and there is only one node's "code" index is "HKG", so the second query can not give me any thing.
What about
START dep = node:airports(code = "HKG"), arr = node:airports(code="CAN") MATCH path = dep -[policy:HAS_POLICY_TO*2]-> arr RETURN count(path)
?
Thanks for your help, I have tried this query, but it's also slow. I think it because the db has a huge number of relationship, so the index of node help little. Is there some method to index on the relationship and make the query to use the relationship's index?
Then I think you might need some love from our engineers. Mind contacting sales at neotechnology.com to set up something?
It might be worth mentioning that create unique will not update any properties if that node is referenced in start.
START n=node(0) CREATE UNIQUE (n {test:'fail'})-[:new]->(m {test:'success'}) return n, m
The above will create node m, but will not set n.test to 'fail'.
Mmh, that almost looks like a bug to me. Could you please raise and issue over at GITHUB?
just did. this could really go either way as a bug or feature.
Does CREATE UNIQUE really work? I'm only getting errors (in the live query windows as well).
Remember to use the latest SNAPSHOT, this is only in the codebase since a few days back.
Just realized my mistake, I was using the latest milestone. Thanks!