opensourceBIM / BIMserver

The open source BIMserver platform
GNU Affero General Public License v3.0
1.55k stars 608 forks source link

Query with property conditions for entities that do not have property sets assigned #1278

Open hlg opened 1 year ago

hlg commented 1 year ago

Queries with property conditions will ignore the condition for entities that do not have any property sets assigned. I don't think that is the semantics we want - not 100% sure though.

For example, the following query will include walls without property sets in the result:

{
  "type": {
    "name": "IfcWall",
    "includeAllSubTypes": true
  },
  "properties": {
    "Pset_WallCommon": {
      "IsExternal": false
    }
  }
}
hlg commented 1 month ago

In the following piece of code, lines 113 and 137-140 should go outside (before and after) the if-condition to have currentObject set to null when there are no property sets at all for the current object, but at least one property condition in the query.

https://github.com/opensourceBIM/BIMserver/blob/0ee3d93fae5c7a7470c8d1fbae7da46e9e07dd72/BimServer/src/org/bimserver/database/queries/QueryPropertiesAndTypesStackFrame.java#L107-L141