How to query ifc files? - ifc

I'm working on a project with BIM for my education and I want to extract data from ifc files.
The idea is to find information like finding floors with a specific height, shape and structure, then I would like to run pathfinding algorithms.
I can't find any document describing and comparing all possibilities...
I found some ways to query but most of them seems abandoned and others have drawbacks, here is what I have:
BIMQL : no activity since 2017
QL4BIM : no activity
SPARQL : no comparison operators
BIMServer query language : requires to run a server
IFC++ : lack of documentation
I don't mind if the query language structure ( even if json would be awesome ).

Don't know about pathfinding, but did you look at xBIM?
It has documentation, examples and a viewer, so you can explore objects/hierarchy.

Refer to the above BIM_POC , this should help you.

IF you have some programming knowledge/experience, I suggest IfcOpenShell for all sorts of query and data extraction from ifc file.

Related

How to convert IFC file to OBJ File...?

I am trying to convert IFC file to OBJ and Reverse OBJ to IFC using C# .Net.
If any body has any idea. Help me to achieve this functionality.
For Ifc-to-Obj, you should take a look at the Xbim framework (xbimteam on github) as you will be able to generate triangulated polyhedron and then turn it into OBJ data.
In all cases, without a framework for parsing your Ifc file, you won't be able to go anywhere ...
It is going to be hard in opposite Obj-to-Ifc direction, as OBJ format does not contains building element informations you'll need to create an Ifc.
Might come a bit late, and I know that it doesn't directly answer the question regarding the programming language, but if you have the possibility to use JavaScript/NodeJS, you could use the ifc-convert package based also on IfcOpenShell. It worked fine for me. Hope it helps.

Convert database data into graph with tinkerpop tools

I am looking to find graph software that will create a graph from a database automatically. Upon exploration of the tinkerpop documentation, the provided tutorials discuss querying ready-made graphs but there is not much about creating graphs from a database. Is it possible to use any of the tools in the tinkerpop suite to automatically convert data from a database into a graph ready for querying?
Let's say we have an event stream like this:
event_type=create_file name="filename.txt" handle=1
event_type=read handle=1 data="file content"
event_type=write handle=1 data="new file content"
event_type=close handle=1
Is there a way to convert the event stream into a graph automatically by specifying which properties to follow for creating edges? For example, by selecting the "handle" property I should get:
create_file-->read-->write-->close
All the examples I could find teach me how to do some activity like
add_node create_file
add_node read
add_node write
add_node close
followed by adding all desired edges manually.
Thank you for your help.
I just came across http://neo4j-contrib.github.io/neo4j-etl-components/ which is a very interesting tool. It takes an RDBMS schema and generates a graph representation, turning foreign keys and join tables into relationships, and (other) tables into nodes in the graph. And then it generates CSV files to load into a graph database, either for wholesale or incremental updates.
I don't know if there's an equivalent tool for Tinkerpop. But I'd hope that since much of the work is done (reading the SQL schema, mapping tables with foreign keys into vertices and edges) in this open source project, perhaps it'd be a good starting point?
The output of the tool looks like it depends on having a clean source data model, and may be naive. It looks like it's configurable so when it guesses wrongly about which tables are vertices and which are edges you can override it I think.
What you are suggesting is simply not possible. A graph database is very different from a traditional relational database. The biggest difference being that graphs are naturally unstructured which allow for more flexibility and manipulation. On the other hand, traditional relational or tabular databases are more rigidly structured which provide less flexibility but easier control and querying.
As stated by the answer provided here you also show not be using your original database as a frame of reference. You should instead be thinking about how to manipulate your data into a graph so as to take advantage of graphs.
For example, a traversal in a graph as opposed to a query in a tabular DB is a lot more flexible (and arguably powerful) but harder to construct and formalise.
There is a lot of good material providing guidelines for how to approach this problem [1] [2] [3] [4]. Unfortunately though there is no good automated migration at the moment.

MapBox sqlite layer from OSM

New to MapBox.
I have read the tuto on how to create a layer from OSM which relies on a PostGIS connection. Tried it. So far, so good.
Nonetheless, given the very limited magnitude of the project i'm working on (single user...), i'd really rather avoid having to have a pgsql instance running just for that. sqlite comes across as an option of course!
Can someone help with the following questions:
Any reason why sqlite would not do the job ? The data set i'm pulling from OSM is about 30MB
Any recommandable and tried script to convert OSM .xml or .pbf to .sqlite ? There is a bunch of osm2sqlite out there on github and where-else, but can't see any reference to them that let me think they will still be maintained in a foreseeable future...
How straightforward will it be to link such sqlite output to a tile mill layer ? Clearly, I have no idea on the underlying data model and subsequent sql statement to bring it across...
Many thanks
Laurent
Use mbtiles (this is basically sqlite if you didn't know).
Mbtiles will work perfectly for you. In fact Mapbox uses it for their maps
As you've seen from that link, tilemill can export your project to mbtiles . Personally I would import to postgres using imposm3, it's fairly fast and doesn't use up ask your memory. After importing I'd style the map with tilemill then use it to generate mbtiles.
Seems like you're already comfortable with the first 2 steps of this. The docs cover the exporting step
Never used mbtiles but I can't see why you would have difficulty with them.
Nb In the future you'll be better off asking questions these at gis.stackexchange.com/

Database structure of a triple store?

I want to use RDF / triples in my Symfony2 project in order to organize things (in my case it is Tags).
I would see something like this :
ENTITY TAG <-------------- TAG_TAG --------------> ASSOCIATION_TYPE
^ |
|---------------------/
Fields :
TAG
ID
Tag (text)
Description (text/html)
TAG_TAG
ID
*TAG1
*TAG2
*ASSOCIATION_TYPE
ASSOCIATION_PARAM
Like this, I would be able :
To store triple associations
To set different association types. For example, PHP is a Programming_language ; stackoverflow.com is a website ; but the Earth turns around the Sun.
To set parameters (which permits to give more information inside associations)
We could consider setting a many-to-many relation between TAG_TAG and ASSOCIATION_TYPE. By doing this we could set several parameters.
So I have several questions :
Do you think it's a good way to store triples efficiently ?
Is there any RDF layer to extract existing RDF/triples databases and populate my own ?
Should I consider using some kind of tripleStore like Sesame and use it with Symfony ?
To answer your questions:
1) I'm not entirely sure what you're asking. If you're asking if that's a reasonable way to model your data, it's probably ok. But your diagram is not clear and you're a bit light on details. Best thing to do is just do something that works to start with. You can improve the modeling later without much of a hassle.
If you're asking about storage of triples, don't. See my response to #3.
2) There are many RDF libraries available, you have Jena & Sesame in Java, dotNetRdf for the .Net world, RDFLib in python, redland for C, etc.
3) Yes. Don't attempt to re-invent the wheel and build your own triple store. It's not an easy project and you won't do better than even the worst existing triple store on any reasonable time scale.
As Michael said - please don't build your own triple store! There are several solutions available in PHP:
ARC2 provides a triple store based on MySQL
The librdf extension provides a PHP wrapper for the standrad RDF C library
The Erfurt Library is an abstraction library for connecting with the open source Virtuoso Server triple store, but also has its own triple store based on Zend DB taht can be used with MySQL.

Where can I obtain dictionary files for use in checking spelling?

I thought this was asked before, but 15 minutes of searching on Google and the site search didn't turn anything up...so:
Where can I obtain free (as in beer and/or as in speech) dictionary files? I'm mainly interested in English, but if you know of any dictionary files, please point them out.
Note: This question doesn't have a right/wrong answer, so I made it community-wiki. However, I feel that it might be valuable to not only myself, but anyone who wishes to implement or use a spell checker with various dictionary files.
I have found a SourceForge project called Word List, which appears to have a number of dictionaries. I have downloaded a couple and am currently checking them out.
On Linux you can look in places like /usr/share/dict/words
I would presume that OpenOffice contains dictionaries for several languages.
I don't know what your target platform is but here is a solution that is for VB.NET. It uses the Office libraries which Office in itself isn't free but if your users are all internal and have Office then you could leverage these libs. There is a zip file with the example source code you can download as well.
Check spelling and grammar
There is what appears to be a half-decent dictionary available for free here on CodeProject.com (registration required unfortunately).

Resources