Comments (13)
I'll have to investigate the fromJSON()
options. This looks related, so I'll wait for someone to answer: http://r.789695.n4.nabble.com/prblem-when-using-fromJSON-td4669306.html
In the meantime, you might have better results using the following if you're only interested in the tweet text:
tweets = cypher(graph, "MATCH (t:Tweet) WHERE HAS(t.text) RETURN t.text")
This will return a data.frame tweets
where the text is in the column t.text
.
from rneo4j.
That returns the same error - so I assume some nasty characters in the text in one of the tweets.
Would be good to have a fix, but not desperately urgent.
I will try to narrow this down to the offending tweet.
from rneo4j.
Unicode nastiness is also a possibility.
http://stackoverflow.com/questions/15768116/how-to-replace-unexpected-escaped-character-in-r
from rneo4j.
backslash! I removed '' from 51 tweets and no problem with the remaining 25k.
from rneo4j.
Glad you figured it out.
from rneo4j.
Nicole,
I still think there is a bug that needs fixing. For the time being I can remove backslashes from tweets, but it would be useful to fix the underlying problem with the json corruption.
Let me know if you can fix this.
thanks,
js
from rneo4j.
here is a bit more information. It was getting late last night so sorry if I was a bit misleading. The fix I have got is a workaround to avoid this bug. I think that the text in the nodes I am retrieving from Neo4j are perfectly valid and should be returned without the json error.
The code I am using is adapted from your tutorial code https://github.com/nicolewhite/graphs_r_cool
Here is the line:
## Word cloud.
tweets = getNodes(Graph, "MATCH (t:Tweet) WHERE HAS(t.text) RETURN t ")
here is an example of the text in the node that causes the problems:
"@xtabel_25: Nigerian Union of Teachers said teachers should not resume till ebola is taking care of. :-\"forget that, saturday is still on
here is what it looks like in Neo4j browser -
please ping me if you need any further information.
from rneo4j.
According to your code block, getNodes()
works fine but the problems are in subsequent functions for cleaning up the text for the word cloud? Let me know if I am understanding this correctly.
from rneo4j.
No, the line:
tweets = getNodes(Graph, "MATCH (t:Tweet) WHERE HAS(t.text) RETURN t")
gives error
Error in fromJSON(content, handler, default.size, depth, allowComments, :
invalid JSON input
I have updated the comment above to remove the comment about ASCII conversion - that is a separate (but maybe related) issue. Sorry for the confusion.
from rneo4j.
I'm going to look into switching to rjson from RJSONIO. rjson's fromJSON()
has an option for handling unexpected escape characters and also doesn't round numbers unexpectedly like RJSONIO does. I'll let you know when I've tested this with the tweet text you supplied. Thanks for letting me know.
from rneo4j.
Nicole, any update on this issue? I would like to start doing some text analysis on tweets. It would be useful to know if I need to start work on a workaround.
thanks,
js
from rneo4j.
I haven't been able to reproduce your problem. When I use RJSONIO's fromJSON()
on the string you provided, I get no errors. This is sitting on my back burner right now, as I still want to switch from RJSONIO to rjson. I think you'll have to continue cleaning up unwanted escape characters from your strings. I will comment here again when I get around to switching everything over to rjson.
from rneo4j.
I have a workaround - I just create a clean property on the node with all non alphanumerics stripped out. I can access the nodes ok from Python which I use for running processes, so no worries for time being.
from rneo4j.
Related Issues (20)
- Error in cypher(graph, query) - "You must query for tabular results when using this function." HOT 3
- Long sessions start to decrease in performance
- cannot connect -- curl cannot resolve host name
- How do you disconnect from the server?
- Cannot delete graph HOT 1
- Queries for the sample files are still in the old format
- Rneo4j can be used to connect using https connection HOT 1
- Import a full cypher file HOT 2
- Docker support HOT 1
- importSample example fails HOT 2
- RNeo4j pulled out of CRAN? HOT 3
- /lib64/libc.so.6: version `GLIBC_2.18' not found HOT 1
- getOrCreate / getUniqueNode multiple labels
- Feature request: getOrCreateNode flag
- Feature request: createRel, add Duplicates parameter HOT 1
- Featrure request: startGraph - user password encoding
- Feature Request: getLabeledNodes to accept "starts with", "ends with", "contains"
- Dependency missing HOT 1
- Graph Connection Error via HTTPS Self Signed Certificates
- Error: Could not find tools necessary to compile a package
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from rneo4j.