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

Is it possible to filter a query by PSet property value? #675

Closed
malinkody opened this Issue Jan 2, 2018 · 6 comments

Comments

Projects
None yet
2 participants
@malinkody

malinkody commented Jan 2, 2018

I have been trying to figure out if it is possible to filter a query by a specific PSet and property value. I know you can filter by name, oid and guid. Lets say I want to query all IfcBeam objects that have a PSet named "Materials" which has a property named "type" which in turn has a value of "Steel".

  • How would I go about doing this?
  • Is it possible using the current javascript client and serializer?
  • If not, can I write a Serializer that can process a filter and output the required result? I have experimented with the SerializerPlugin, but so far I don't see how I can access the query parameters during Serialization.
@rubendel

This comment has been minimized.

Show comment
Hide comment
@rubendel

rubendel Jan 5, 2018

Member

You can do this already with the embedded query/filter language:

{
  "type": {
    "name": "IfcBeam"
  },
  "properties": {
    "type": "Steel"
  }
}

The only thing this is not filtering on is the PSet name "Materials", so if there are multiple PSets with the property name "type" this will fail. For that I have created a new issue: #678

Member

rubendel commented Jan 5, 2018

You can do this already with the embedded query/filter language:

{
  "type": {
    "name": "IfcBeam"
  },
  "properties": {
    "type": "Steel"
  }
}

The only thing this is not filtering on is the PSet name "Materials", so if there are multiple PSets with the property name "type" this will fail. For that I have created a new issue: #678

@malinkody

This comment has been minimized.

Show comment
Hide comment
@malinkody

malinkody Jan 5, 2018

Thank you for the quick answer. This seems to work well. I tested several queries using the Query tab in BIMvie.ws and came upon another issue. My use case is as follows:

In our model we have objects of type IfcBuildingElementProxy. These objects inherit values and properties from IfcBuildingElementProxyType which is related to IfcBuildingElementProxy via IfcRelDefinesByType objects. Now if I were to use the following filter I will only get objects of type IfcBuildingElementProxy that have explicitly defined this property in their own PSets. But it is possible to have an IfcBuildingElementProxy with an undefined "type" where the related IfcBuildingElementProxyType object has defined the "type" property as "steel" for all its children.
Is it possible to expand the following query to include all objects of type IfcBuildingElementProxy where their relating IfcBuildingElementProxyType might have the "type" value set as "steel"?

{ "type": { "name": "IfcBuildingElementProxy" }, "properties": { "type": "Steel" } }

I also ran into the issue that you mentioned of duplicate property names. The proposed solution in issue #678 would solve this issue for us. I would love to know if there is a development timetable and if so, when this solution will be implemented.

malinkody commented Jan 5, 2018

Thank you for the quick answer. This seems to work well. I tested several queries using the Query tab in BIMvie.ws and came upon another issue. My use case is as follows:

In our model we have objects of type IfcBuildingElementProxy. These objects inherit values and properties from IfcBuildingElementProxyType which is related to IfcBuildingElementProxy via IfcRelDefinesByType objects. Now if I were to use the following filter I will only get objects of type IfcBuildingElementProxy that have explicitly defined this property in their own PSets. But it is possible to have an IfcBuildingElementProxy with an undefined "type" where the related IfcBuildingElementProxyType object has defined the "type" property as "steel" for all its children.
Is it possible to expand the following query to include all objects of type IfcBuildingElementProxy where their relating IfcBuildingElementProxyType might have the "type" value set as "steel"?

{ "type": { "name": "IfcBuildingElementProxy" }, "properties": { "type": "Steel" } }

I also ran into the issue that you mentioned of duplicate property names. The proposed solution in issue #678 would solve this issue for us. I would love to know if there is a development timetable and if so, when this solution will be implemented.

@rubendel

This comment has been minimized.

Show comment
Hide comment
@rubendel

rubendel Jan 5, 2018

Member

That makes sense, this should be implemented generically for all objects that have a "*Type" variant. I'll leave this issue open for that specific implementation.

No timetables.

Member

rubendel commented Jan 5, 2018

That makes sense, this should be implemented generically for all objects that have a "*Type" variant. I'll leave this issue open for that specific implementation.

No timetables.

@malinkody

This comment has been minimized.

Show comment
Hide comment
@malinkody

malinkody Jan 5, 2018

Thank you for the quick reply. I'm looking forward to these features.

malinkody commented Jan 5, 2018

Thank you for the quick reply. I'm looking forward to these features.

@rubendel

This comment has been minimized.

Show comment
Hide comment
@rubendel

rubendel Jan 5, 2018

Member

Depending on your situation, you might be able to recreate this feature in the mean time by doing multiple queries. For example first query the "*Type" objects having the properties and then use the relation to get the related "IfcBeam" objects in a second query.

Member

rubendel commented Jan 5, 2018

Depending on your situation, you might be able to recreate this feature in the mean time by doing multiple queries. For example first query the "*Type" objects having the properties and then use the relation to get the related "IfcBeam" objects in a second query.

rubendel added a commit that referenced this issue Feb 6, 2018

@rubendel

This comment has been minimized.

Show comment
Hide comment
@rubendel

rubendel Feb 16, 2018

Member

This has now been implemented

Member

rubendel commented Feb 16, 2018

This has now been implemented

@rubendel rubendel closed this Feb 16, 2018

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