How to import .rdf file in Neo4j database? - neo4j

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.

Related

How to create a graph visualisation of a relational database in Neo4j?

I have some normalized Master Data in PostgreSQL.
I want a graph visualization layer in Neo4j without migrating any Data to Neo4j. Kind of like a view. Lazy fetching of data at runtime.
Neo4j will not commit any changes and only meant for viewing.
Can Neo4j use something like a PostgreSQL JDBC connector and provide a visualization?
Thanks.
You could with apoc.load.jdbc and virtual nodes/relationships created from the data.
But it would be a bit involved as you need to load all tables and then connect them.
With the Neo4j-ETL tool you can do a quick (few min) one-time import to visualize.
https://neo4j.com/blog/neo4j-etl-1-2-0-release-whats-new-and-demo/
Esp. if you don't just visualize but also query you need to transfer the data anyway.
You can use ETL tool, from Neo4j.
You need to ask for an activation key via email at devrel#neo4j.com

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.

Neo4j sparql plugin data loading

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.

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

Visualizing graph database

Assuming i am working with neo4j, the only way i can think of that would visualize my mock up data is to generate cypher code and paste it into neo4j's data browser
Is there another (better, simplier?) way one can use to create visualization without using cypher? Generating cypher code seems like a complex enough task by itself.
Writing tests is of course another way of making sure relationships are set up right, but as i am learning the system, i'd like to visually see things to make sure they are set up as expected.
This gist contains an example on how to use the Neo4J Graphviz component to generate output in Graphviz DOT notation, which is supported by a range of graph visualizing software. (And of course Graphviz itself)
(Link to the original blog post where I found the example: http://blog.neo4j.org/2012/05/graph-this-rendering-your-graph-with.html)
There is a new solution to explore the content of a Neo4j graph database using a web browser: http://linkurio.us/
It allows you to search nodes by properties, inspect nodes, expand neighborhood...
Disclamer: I'm co-founder of Linkurious and Gephi.
There are some options listed on http://www.neo4j.org/develop/visualize also.

Resources