IndustryFoundationClasses / Questions

Have a question about IFCs? Ask here. Use Github Issues.
20 stars 4 forks source link

Storing IFC in graph databases #12

Open aahoo opened 7 years ago

aahoo commented 7 years ago

AFAIK, IFC data structure is graph/network. It seems natural to store graph data in a graph database. Some are converting IFC to RDF and utilizing semantic web technology (also graph-based) for querying IFC. I would like to avoid conversion as much as possible.

What are your thoughts about storing IFC in graph databases such as neo4j?

martin1cerny commented 7 years ago

I agree it seems to be a natural fit and maintaining bidirectional relations between all the objects in a graph might help with performance of some kinds of complicated queries. But I did not find neo4j to be the best fit for this because I didn't find a convenient way to use it for multiple models. But I didn't invest too much time in the investigation and only used it through a .NET client which makes it even worst because all the communication happens through the chatty REST API. If you have any luck with this I would very much like to hear more.

ifcwebserver commented 7 years ago

I am a research assistant in TU Dresden in Germany and the developer of IfcWebServer.org IFC data model server. Recently we did a master project about this topic exactly "Applying graph theory concepts for analyzing BIM models based on IFC standard"

I will check if can publish the thesis in public domain and share the results with you.

Basically what we did is developing a workflow to convert the IFC EXPRESS schema into a meta graph database and to convert the IFC models into an object graph database. The conversation is almost automatically through the automatic conversation of IFC EXPRESS model into Cypher commands of Neo4J and also converting the IFC data into a set of CSV files with an import commands in Cypher.

The automatic conversation was posibble through writing IFCWebServer server scripts. As Neo4J doesn't support multiple databases on the server, we solved the problem of having multi IFC models easily though adding a "Model" attribute to all Nodes in the database.

The results was very promising and there are a lot of application of this approach concerning the managing of BIM data and running simple and advanced queries, even more doing advanced analysis of the IFC model, for example to do a topology analysis to find out the emergency routes ( by analyzing the relations between spaces-doors, space boundaries, etc) and for comparing different IFC model versions and find out the changes between models with time ( new elements, deleted elements, changed element)

I am writing at moment a conference paper (IG-ICE 2017) about this topic, so later I can share it with you

If you are interested for more information you can contact me at ali.syria.germany@gmail.com

ylcnky commented 7 years ago

Hi Ali @ifcwebserver , I am a researcher in Aalto University, Finland. I am working with Neo4j for 3 years and many years in BIM development. Although there are a lot of research and development activity going on IFC2RDF, ifcOWL area, I believe Neo4j can be a good alternative to store the IFC data. RDF Stores and Neo4j, both have pros and cons. I didn't focus on development of another BIMServer or IfcWebServer. Instead, I am using the existing client libraries and APIs mostly, merging the IFC and ifcRDF data in Neo4j and develop applications on top of them. The enterprise version of Neo4j allows clusters. However, some hidden cluster can be easily created with additional properties by using them as a parameter in query. I heard about your research. We discussed with Julian Amann from Munich Technic (I assume you know each other). I would like to know more about your research and approach on the conversion. Please give a notice when you publish your research and becomes publicaly available. Regards.

ifcwebserver commented 7 years ago

Hi Mehmet @ylcnky

Here you can download a copy of the conference paper:

Application of graph databases and graph theory concepts for advanced analysing of BIM models based on IFC standard

Kind regards

ysangkok commented 7 years ago

@ifcwebserver is the implementation also available?

ifcwebserver commented 7 years ago

@ysangkok The IFC2GraphDB will be offered soon as a free service through IFCWebServer.org The users can upload IFC models and in one-click get the Cypher commands to create the Neo4J database localy on their PCs.

We still have to improve the mapping to cover all IFC relationships and enhance the performance, for big models it takes at moment a long time to create the relationships.

If you have good skills in Neo4J and IFC maybe we can work together or publish a papaer.

Ali

ysangkok commented 7 years ago

I can't publish any papers with you, and I am wary working with IFC files in web services when many of them are proprietary and massive.

But here is my script for generating Cypher queries: https://gist.github.com/ysangkok/8aa7ab1c3207536518f3c3bf5f664880

I am looking forward to seeing your code.

An example query:

MATCH a=(first:IFCFILE1 { nid: 12345})-[b*1..5]-(other { nid: 54321}) 
WHERE NOT any(x IN tail(nodes(a)) 
    WHERE toUpper(x.cls) IN [
        "IFCAPPLICATION", "IFCPERSONANDORGANIZATION", 
        "IFCWALL", "IFCGEOMETRICREPRESENTATIONSUBCONTEXT",
        "IFCPRESENTATIONLAYERASSIGNMENT", "IFCOWNERHISTORY", 
        "IFCRELCONTAINEDINSPATIALSTRUCTURE", "IFCLOCALPLACEMENT"
    ])
RETURN nodes(a);

find connection between arbitrary nodes, but not through any nodes of the given types.

ifcwebserver commented 6 years ago

Here is a link for the presentation on the EG-ICE 2017 conference:

https://www.slideshare.net/AliIsmail7/convert-bim-ifc-models-into-graph-database-neo4j-based-on-ifcwebserverorg

ibakirov commented 4 years ago

Very interested in this issue and progress of @ifcwebserver