New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Generating a table that lists all IFC Entities and their properties #607

Closed
malinkody opened this Issue Sep 7, 2017 · 3 comments

Comments

Projects
None yet
3 participants
@malinkody

malinkody commented Sep 7, 2017

Hi,
I'm new to BIM and tried to use the javascript client API to generate a HTML table that lists all IFC Entities and their properties as well as the properties of their types. Each row was supposed to be a single entity like an IfcBuildingElementProxy or IfcBuilding.

I achieved this by retrieving all projects and their latest revisions and then requesting thier entities and the relevant property sets. This worked fine in my test case where I only had 2 Entities related to several property sets which in turn had some properties.

Problem/Issue : The problem occured when I tried to use the script I had written on an actual model. Within seconds the client browser was making more than 10000 ajax requests to the BIM Server. This ofcourse crashed both my browser and the test server I was using. It seems that for every entity the client api needs to make multiple requests to resolve all the properties and their values. With more than 500 entities and each entity having about 40 Properties the number of requests became too large for the browser or the server to handle.

Is there a better way to go about doing this? I'm currently looking into plugin integration to better query model data. I also briefly looked up the documentation on the different ways to query the BIM Server. What would be the recommended way to retrieving all this information to a single page?

@epeter-

This comment has been minimized.

Show comment
Hide comment
@epeter-

epeter- Sep 22, 2017

not a reply but a similar question:
i achieved to extract "data objects" from the bimserver - in my tests i went with the console first.
from the bimserver i received nested json strings. from where i had to construct the properties for every element analysing the json result.
my question now is, is there an api support for getting all properties for an data object?
something like: get_all_properties for oid?

epeter- commented Sep 22, 2017

not a reply but a similar question:
i achieved to extract "data objects" from the bimserver - in my tests i went with the console first.
from the bimserver i received nested json strings. from where i had to construct the properties for every element analysing the json result.
my question now is, is there an api support for getting all properties for an data object?
something like: get_all_properties for oid?

@malinkody

This comment has been minimized.

Show comment
Hide comment
@malinkody

malinkody Oct 23, 2017

I managed to implement this by extending the JSONStreamingSerializer to mirror my required data. Everything is working fine. I came upon a new issue while implementing this. Is it possible to filter a query result by index? Like pagination? Because currently the download function returns all objects in the query. I would like to use some form of pagination in order to minimize load time and JSON file size.

malinkody commented Oct 23, 2017

I managed to implement this by extending the JSONStreamingSerializer to mirror my required data. Everything is working fine. I came upon a new issue while implementing this. Is it possible to filter a query result by index? Like pagination? Because currently the download function returns all objects in the query. I would like to use some form of pagination in order to minimize load time and JSON file size.

@rubendel

This comment has been minimized.

Show comment
Hide comment
@rubendel

rubendel Oct 24, 2017

Member

There is no pagination supported, that would be hard to implement on a graph query language, not even sure how that would work.

Regarding the JavaScript API, the way we solved this issue in BIMvie.ws is by using the preload functionality of the JavaScript API. You basically prepare a BIMserver Query that will contain all the data you are going to need (but not more) and pre-cache the client with that data. After that, the specific calls to the JavaScript api won't need to fetch the data for every call.

Of course there are a lot of ways to implement some sort of pagination by calling a few (not > 100) queries after each other.

Member

rubendel commented Oct 24, 2017

There is no pagination supported, that would be hard to implement on a graph query language, not even sure how that would work.

Regarding the JavaScript API, the way we solved this issue in BIMvie.ws is by using the preload functionality of the JavaScript API. You basically prepare a BIMserver Query that will contain all the data you are going to need (but not more) and pre-cache the client with that data. After that, the specific calls to the JavaScript api won't need to fetch the data for every call.

Of course there are a lot of ways to implement some sort of pagination by calling a few (not > 100) queries after each other.

@rubendel rubendel closed this Oct 10, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment