3

I am thinking of using a graph DB to store IFC data. Ideally, the DB should provide a way to define all the rule types defined in the IFC schema. However, I don't think there are any such databases because some of the rule types in IFC are very complex and requires querying the DB. Others are simple, like uniqueness of GUID, existence of mandatory attributes, or data validation. Neo4j seem to have a few constraint enforcing methods:

Neo4j helps enforce data integrity with the use of constraints. Constraints can be applied to either nodes or relationships. Unique node property constraints can be created, as well as node and relationship property existence constraints.

Are there other methods that can ensure compliance of entered data with a predefined schema?

Or are there other graph DBs that are more suitable for this job?

Thoran
  • 8,884
  • 7
  • 41
  • 50
  • Hi @Thoran, may I ask how did you manage to convert IFC data into neo4j? thanks! – JAD Mar 29 '18 at 09:01
  • I didn't. But someone has done it. Look for IFC QA on Github. If you can't find, come back to me and I will try to find it for you. – Thoran Mar 30 '18 at 10:48
  • Thank you for your reply, unfortunately its not available. If you've got a chance to find it would be great! thanks. – JAD Mar 31 '18 at 14:11
  • Note that I've found someone did it using Ruby script, but I want to check if the approach you have followed is different. – JAD Mar 31 '18 at 14:18
  • No problem. See if you can find help @ https://github.com/IndustryFoundationClasses/Questions/issues/12 – Thoran Apr 01 '18 at 15:02

2 Answers2

3

You can achieve pretty much everything you want by creating Transaction Event handlers.

http://neo4j.com/docs/java-reference/current/javadocs/org/neo4j/graphdb/event/TransactionEventHandler.html

You can also take a look at the GraphAware Framework and all its submodules for use-cases and also the ease of creating and deploying neo4j extensions.

Christophe Willemsen
  • 19,399
  • 2
  • 29
  • 36
  • The TransactionEventHandler link is bad. Try this instead: https://neo4j.com/docs/java-reference/current/transaction-management/#transactions-events – Clem Wang May 12 '21 at 21:20
1

Depends on whether you need the schema enforced by the database itself, or whether you're OK with that being done at the application layer.

I've just gotten Restagraph to the "working prototype" level, and my next trick is Dockerising it. It's a framework of sorts, that enables you to define a schema by creating nodes and relationships in Neo4J with specific labels, and which dynamically creates a REST API to enforce it.

It's also written in Common Lisp, so I'll understand if you wait for the Docker image :)

  • Welcome to SO James. I am all in for your project idea. I wish I could contribute to it but I have never written code in Common Lisp or anything close to it. – Thoran Jan 02 '17 at 15:35
  • Also, I like your github workflow. Documenting everything via issues. Amazing work :) – Thoran Jan 02 '17 at 15:39
  • It's the only way I can keep track of it all, but thanks! – James Fleming Jan 02 '17 at 15:57
  • 1
    As welcome as direct contributions would be, I'll be much more excited by hearing back from people actually using it. If you follow that project, you'll see when I've Dockerised it, which should be the point at which it's useful to people other than me. – James Fleming Jan 02 '17 at 16:00