Skip to content
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

Json Queries: Include porperty set values in response #1037

Closed
muren400 opened this issue Sep 19, 2019 · 2 comments

Comments

@muren400
Copy link

commented Sep 19, 2019

Hi,

in the examples for the JSON Queries I've seen, that it's possible, to filter the results by using their properties. Like this:

{
"version": 2,
"type": {
"name": "IfcWall",
"includeAllSubTypes": true
},
"properties": {
"Pset_WallCommon": {
"IsExternal": true
}
}
}

Is it also possible, to include a specific property and its value in the queried result?
So if I wanted to include the Property "Category" the result would look something like this?

{
"_i":1,
"_t":"IfcBuildingElementProxy",
"_s":1,
"Category": "some random value"
}

I'm building a tree view for the Models on the Server. The treenodes are supposed to be categorized by some property value, for example a property called "Category". What I'm doing right now is to load all the Properties for the objects and then iterate through all of them until I find the right one.

This procedure requires a lot of data being downloaded and processed and since its possible to filter objects by a specific property value, I thought it might be possible to include a specific property, rather than querying all of them?

@rubendel

This comment has been minimized.

Copy link
Member

commented Sep 27, 2019

The results of queries are always structured according to the IFC schema (serialized as either ifc-step or json). So what you ask is not possible (IfcBuildingElementProxy does not have a field called "Category"). Basically, the query language does not allow you to command the structure of the returned data, only the content.

It is however possible to get the properties in the result, but they will be structured as they are in the IFC file.

For example this query:

{
  "type": {
    "name": "IfcWall",
    "includeAllSubTypes": true
  },
  "include": "ifc2x3tc1-stdlib:AllProperties"
}

Will give you all the walls and all their properties.

And the next query will filter the walls on your requirement:

{
  "type": {
    "name": "IfcWall",
    "includeAllSubTypes": true
  },
  "properties": {
    "Pset_WallCommon": {
      "IsExternal": true
    }
  },
  "include": "ifc2x3tc1-stdlib:AllProperties"
}

It is up to you to get the final results out.

@muren400

This comment has been minimized.

Copy link
Author

commented Oct 18, 2019

All right. Thanks for the Answer. I kind of expected something like that, but I wanted to ask anyway. I guess I'll look a bit into the Query Engine Plugins.

Closing this issue.

@muren400 muren400 closed this Oct 18, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.