Importing an .xml file into neo4j - neo4j

I am new to neo4j. Please could you help me how I can import an xml file into Neo4j.
I installed the neo4j community version and added Neosemantics plugin(.jar file) in the appropriate folder. I tried both adding the below lines to neo4j.conf file:
dbms.unmanaged_extension_classes=semantics.extension=/rdf
dbms.unmanaged_extension_classes=n10s.endpoint=/rdf
But still getting an error 'Neo.ClientError.Procedure.ProcedureNotFound' for the following commands I tried in Neo4j browser as a query:
CALL semantics.liteOntoImport('file:///C:/Users/np/neo4j-community-5.2.0/import/ABC.xml','RDF/XML')
CALL semantics.importRDF("https://ABC.xml","RDF/XML")

Related

Create graph reports "no protocol" error message

WITH "/Users/nlp/social_graph/graph-nodes.csv" as uri
LOAD CSV WITH HEADERS FROM uri as row
MERGE (:User {id: row.id})
I have a CSV file to contains some nodes, and I want to load it into neo4j through Neo4j Desktop, but got the following error message:
Invalid URL '/Users/nlp/social_graph/graph-nodes.csv': no protocol: /Users/nlp/social_graph/social-nodes.csv
What's the error? Note that before I run the command in the browser, the database is empty. How to load the database?
EDIT: Did some search and added 'file:///' to the file path, this time I got another message:
Couldn't load the external resource at: file:/Users/congminmin/Library/Application%20Support/Neo4j%20Desktop/Application/neo4jDatabases/database-fdb13bea-33f7-409b-a6bd-387a25a679e6/installation-3.5.12/import/Users/congminmin/social_graph/social-nodes.csv
The easiest would be to copy your cv file into the import directory under your neo4j installation directory. Then use file:///social-nodes.csv In your LOAD CSV command.
Find more details here: https://neo4j.com/developer/guide-import-csv/
I know it's late, but if you are using neo4j on docker, the import folder path is as follows:
/var/lib/neo4j/import
You can create a volume that bounds to the import directory. After mounting, copy your local files to your mounted directory, then use file:///file-name in your LOAD command.

Neo4j Desktop 1.1.10 how to export cypher file?

I have created a graph database within Neo4j Desktop (version 1.1.10) I wish to export that as a Cypher file.
How do I do that? I can't see any command within the app for export a Cypher file.
You can try following the documentation here: Neo4j - Export a (sub)graph to Cypher script and import it again
First, install the apoc procedure library, and add it into the plugins directory.
Second, run Neo4j as an administrator. If not, Neo4j doesn't have permission to write files.
Before starting Neo4j, edit the neo4j.conf file and add this line:
apoc.export.file.enabled=true
Then, start Neo4j, and in the Neo4j browser, execute the following command:
CALL apoc.export.cypher.all("export.cypher",{})
This will store the whole database in the file "export.cypher".

Error loading CSV file into Neo4j enterprise edition :Illegal character in opaque part

I'm trying to load a CSV file into Neo4j Enterprise edition and I think I'm considering all the rules but I don't understand what is the error related to
this is the error :
this is my csv file . I have entered my data in excel and then saved it as a CSV file :
Copy your CSV file to Neo4j Import Directory. Take a look in Neo4j file locations docs. For windows desktop installations this directory is %APPDATA%\Neo4j Community Edition\import.
Change your import path to 'file:///abc.csv'
Try again.

Issues with exporting Neo4j 3.2.2 Graph to Gephi 0.9.1

As there is no Neo4j plugin for Grephi 0.9.1 I tried to export my Neo4j graph as an .graphml file. I created an empty .graphml file in Grephi and used the procedure:
call apoc.export.graphml.all('file:C:/test.graphml',{})
However I recieve:
Failed to invoke procedure `apoc.export.graphml.all`: Caused by: java.io.FileNotFoundException: file:C:\test.graphml (Syntax of filename, directory or harddrive is wrong)
in the neo4j.conf file I added before:
apoc.export.file.enabled=true
apoc.import.file.enabled=true
Any ideas?
I found helpful information here:
http://grokbase.com/t/gg/neo4j/15397fjvyy/export-graphml
"import-graphml can read from an URL but as you can't write to an URL the export only supports normal path syntax"
so this worked for me:
call apoc.export.graphml.all('C:/test.graphml',{})

Neo4j csv cypher import

Im trying to import csv files from disk with cypher commands as shown in the tutorial, but Im getting "Couldn't load the external resourse at: externalResourceFailure.
Is there any "roadmap" for importing csv in windows from files?
Thank you in advance!
take alook at SyntaxException with Neo4j LOAD command
in the question, step 3, please check if you path to the file is correct on your operating system:
the syntax for accessing a local file on windows is simply "file:c:/nosql/test/unclaimed.csv" and not file:// as might be inferred from examples on ...
You have to put the files into the import directory in neo4j.
it will work if path like this "file:///C:/myfile.csv"
The Windows and Linux file systems require different file URI schemes for streaming over HTTP. Neo4j's LOAD CSV Cypher clause makes an HTTP web request to the URI of a file and not the file system path.
For more information on file URI schemes on Windows please take a look at: http://en.wikipedia.org/wiki/File_URI_scheme#Windows_2
You can also create a folder import into your neo4j installation folder and run a cipher like this
LOAD CSV WITH HEADERS FROM "file:///yourcsvfile.csv" AS row
On mac: create a folder inside the Neo4j directory. Neo4j will install in Documents (by default)
mkdir /Users//Documents/Neo4j/default.graphdb/import
Copy your file in this location
Use it like this
USING PERIODIC COMMIT LOAD CSV WITH HEADERS FROM "file:///user_list.csv" as row create (:Users {userId: row.USER_ID });

Resources