Neo4j sparql plugin data loading - neo4j

I want to insert RDF data of file containing 10M triple (berlin sparql benchmark) and I want to use neo4j sparql plugin for this. I have following questions regarding this,
sort of similar question was probably asked at Turn Neo4j into a triplestore but I couldn't find answer to my following questions.
Is there any other way to to load data than using http://localhost:7474/db/data/ext/SPARQLPlugin/graphdb/insert_quad ? so I can query it using http://localhost:7474/db/data/ext/SPARQLPlugin/graphdb/execute_sparql. If there is, then how do I do it? and how do I query it after that?
How can I load data which is in ttl form? Do I have to have my data in quad form?
Thanks In Advance!

What do you want to achieve in the first place? Using Neo4j as a plain RDF store won't make you happy.
Try to look at your use-cases, create a sensible property-graph-model for those and import into it.
You can certainly read your ttl file with some tools or libraries available and then drive the Neo4j import from that.

Related

How to import .rdf file in Neo4j database?

I have a .rdf file which I was used for Dgraph in order to import the data and the subsequently queries in order to get the relations in the Dgraph Ratel UI.
Now I need to include in my web application for which Dgraph doesn't have support (link). Hence I started looking for Neo4j.
Can anyone please help out how to import .rdf file in Neo4j if not what's the workaround.
Thanks.
Labeled property graph (LPG) and RDF graph are different graph data models, see:
RDF Triple Stores vs. Labeled Property Graphs: What's the Difference? by Jesus Barrasa
Reification is red herring by Bob DuCharme
Neo4j supports LPG data model only. However, there is the neosemantics Neo4j plugin.
After installation, say:
CALL semantics.importRDF(<RDF_file_path>, <RDF_serialization_format>)
The mapping from RDF to LPG is described here.
I'd suggest you to use a proper triplestore for RDF data.

Importing SNOMED CT into Neo4J

I need to import SNOMED CT ontology into a graph database, in this case Neo4J but it could be another choice eventually.
However, I could not find a clear depiction of SNOMED CT underlying relational data model, in order to achieve this. Or at least, simplified SQL views that expose entity relantionship in a way that can be mapped to a graph database.
I would greatly appreciate any guidance or previous experiencies with this matter.
Directly trying to serialise the relational data model is probably going to be quite difficult and will take you further away from your goal.
It is worth noting that SNOMED data is actually available in RDF format already. So you get a graph structure for "free".
For example this project provides the data in a RDF format and putting RDF data into a graph is quite simple regardless of your choice of Titan or Neo4j.
Side Note:
A colleague of mine has actually worked on importing SNOMED data into a Grakn Graph, a semantic graph system we both work on. If you interested you can check out his work here. Grakn is a semantic graph solution which runs on top of Titan.
If you are looking for a sample on how to model the Concepts, Descriptions and Relationships into a Graph database. I have a sample project in Github that can upload the Snomed data into a Neo4j database.
https://github.com/pradeepvemulakonda/Snomed
Before you go into the implementation detail, I would suggest trying out the following Snomed data browser at
http://ontoserver.csiro.au/shrimp/
Once you get a feel of the concepts and relationships you can go through the implementation. You can use the following gist to understand how you can query the uploaded concepts and relationships in Neo4j.
https://neo4j.com/graphgist/95f4f165-0172-4b3d-981b-edcbab2e0a4b#listing_category=health-care-and-science
SNOMED can be loaded into MySQL using the UMLS (unified medical language system) released by NIH. Once loaded the table MRREL contains all the relations between SNOMED nodes. If you want load it right away in Neo4j you can totally skip the MySQL step and work directly with the UMLS RRF files. The RRF documentation format is not great but the files are easy to parse tabular text.
There are in fact three tables, Concepts, Descriptions and Relationships
You'll find them described here:
https://confluence.ihtsdotools.org/display/DOCTIG/3.1.+Components
Most important are the relations between Relationships and Concepts and Descriptions and Concepts.

How to visualise Neo4j graph database created from an embedded Neo4j java application

I created an application which embedded Neo4j. In that application I created and stored some nodes with some relationships. My application has saved this database to a file. I would like to visualise that data. I know I can see graphs if I fire up the Neo4j server but I do not know how to import my neo4j.db file into the Neo4j server so that I can visualise it. Any suggestions would be greatly appreciated.
Depending on your use case you might have different solutions:
Use a web-based visualization
Use a desktop application to visualize your data
Use web-based visualization
In this case you have to take care of the web-app to visualize the data.
You have basically two solutions out there: Javascript or Java applets.
For the Javascript side you have many choices: D3js, VivaGraph, SigmaJS, KeyLines.
The first three are open source and free while the last one has a commercial licence and non-free.
There're already a million questions about these libraries on SO, so I'll link you to some of those to understand the various differences.
Desktop Application
The main solutions in this case I would recommend you, depending on the kind of data are: either Gephi or Cytoscape.
In both cases I believe you have to write your own adapter to communicate with your application.
Architecture Reference
The architecture in both cases will be the following:
The controller renders a webpage with the JS visualisation framework you want to use
The controller offers a couple of JSON endpoints the client can use to query the data from the Neo4J embedded
Each query fetch the data, put in a model and render the JSON to send to the client
If you're NOT using neo4j 2.0+ then really good way to visualize your graph is by using neoclipse. https://github.com/neo4j-contrib/neoclipse/downloads
it's really handy and it has cypher support too.
Or
another quick hack is to copy your db folder (which you created by using embedded database) into $NEO4j_HOME/data/
and
change $NEO4j_HOME/conf/neo4j-server-properties file to point to
and
start your server (bin/.neo4j start). You'll be able to visualize your database at localhost:7474
I hope it helps!

How can I import .OWL file into Neo4J?

I have been playing with Neo4J to get a feel on how easy it is to work with related data. so far I have work with the Neo4J community browser to create nodes and build relationship between them.
I have developed an ontology using protege a link!. Now, that I have a huge ontology file(.owl file). I would like to upload it to Neo4J to perform queries and find potential relationships between nodes.
I would be glad if I get any help on this.
Thanks.
Have you seen the blog post by Stefanie Wiegand?
http://blog.neo4j.org/2013/08/and-now-for-something-completely.html
There are also some other users on the Neo4j Google Group who work in ontologies / OWL, perhaps good to cross post there?
There are some more approaches:
http://michaelbloggs.blogspot.de/2013/05/importing-ttl-turtle-ontologies-in-neo4j.html
http://sujitpal.blogspot.de/2009/05/using-neo4j-to-load-and-query-owl.html

Neo4jClient Data Import

I use Neo4jClient (.NET). I have to import master data like countries.
I've seen that Neo4j has a Java API for that (the batch insertion API). Is it possible to import data via the web interface or another tool?
If not, do I have to import the data via Neo4JClient wrapper with the Create() function?!
Thanks.
It will be much faster if you grit your teeth and do this using the batch insertion API- either by writing an import script in Java or another JVM language or by using Michael Hunger's batch inserter, which inserts data from CSV. Check out Max de Marzi's post on the topic for a good approach.
Even though REST bindings are trying to offer decent performance, they'll never be as fast as native database access- and even if they were, the batch insertion API strips down some of the database features (multi-thread access, etc) to great improve initial import time.
Also,
could you try using Cypher CREATE since that is not as fast as Batch, but faster than REST, and should let you create stuff fast.
http://docs.neo4j.org/chunked/snapshot/cypher-cookbook-pretty-graphs.html gives some good hints ...
Check out the Cypher neo4j import csv option. Maybe that helps. Otherwise just use a big Cypher query
http://neo4j.com/docs/milestone/query-load-csv.html

Resources