-
Notifications
You must be signed in to change notification settings - Fork 634
JSON Queries
The new query language is still in development, so expect this to change.
You can read the original motivations to write this language here
Some characteristics to of this language to keep in mind:
- The data model of the "queried" is the same data model as the "query results". In most cases it will be Ifc2x3tc1 or Ifc4
- The previous also explains why there are no aggregates, because there is no place to store those
- A query result is always a subset of the original model
- Query language is probably not the best term here, a "filter language" might be better
- The queries are based on objects. Geometry is not treated any other way. If you don't ask for geometry, you won't get it.
All queries must be valid JSON. This means that all keys must be quoted, all strings must be quoted. When you send your query to BIMserver via the ServiceInterface.download call via JSON, make sure to base64 encode your query.
This query will query all objects.
{
}
This query will get all IfcWall objects
{
"type": "IfcWall"
}
When your model for example only contains IfcWallStandardCase objects, this query will not return any objects, although IfcWallStandardCase is a subtype of IfcWall. To include subtypes, you have to explicitly define this:
{
"type": "IfcWall",
"includeAllSubtypes": true
}
You can also query multiple types, the next example would give you all IfcDoor and IfcWindow objects
{
"types": ["IfcDoor", "IfcWindow"]
}
# GUID query
When you already know the GUID(s) of (an) object(s), you can query those directly:
```json
{
"guids": ["GUID1", "GUID2"]
}
The same as for GUIDs, you can also query by OID (ObjectID)
{
"oids": [1523, 2130, 898]
}
In a lot of cases, the results of the query will be serialized as IFC. The previous examples would however not result in valid IFC files. For an IFC file to be valid, it not only has to solely contain objects that conform to the IFC schema, also certain references should always be included. For example every object must have an IfcOwnerHistory. Also there must always be an 1 IfcProject object.
Example of the body of an IFC file for the IfcWall query:
#1= IFCWALLSTANDARDCASE('1hmUg1hfv4UPf0UtHFe7ta',$,'SW - 009',$,$,$,$,'6BC1EA81-AE9E-4479-9A-40-7B744FA07DE4');
#2= IFCWALLSTANDARDCASE('05UYVl82vAa8mFc3FMTYL7',$,'SW - 010',$,$,$,$,'057A27EF-202E-4A90-8C-0F-9833D6762547');
#3= IFCWALLSTANDARDCASE('37ZZt1nzL2nu6PjSr0Wa2a',$,'SW - 011',$,$,$,$,'C78E3DC1-C7D5-42C7-81-99-B5CD408240A4');
#4= IFCWALLSTANDARDCASE('1EzyXtTtv7RAinwkFVr6_I',$,'SW - 012',$,$,$,$,'4EF7C877-777E-476C-AB-31-EAE3DFD46F92');
#5= IFCWALLSTANDARDCASE('08u2EMNSnBL8Izk3LNHAwK',$,'SW - 013',$,$,$,$,'08E02396-5DCC-4B54-84-BD-B8355744AE94');
Get Started
- Quick Guide
- Requirements Version 1.2
- Requirements Version 1.3
- Requirements Version 1.4
- Requirements Version 1.4 > 2015-09-12
- Requirements Version 1.5
- Download
- JAR Starter
- Setup
Deployment
- Ubuntu installation
- Windows installation
- Security
- Memory Usage
- More memory
- Performance statistics
- Large databases
Developers
- Service Interfaces
- Common functions
- Data Model
- Low Level Calls
- Endpoints
Clients
BIMServer Developers
- Plugins in 1.5
- Plugin Development
- Eclipse
- Eclipse Modeling Framework
- Embedding
- Terminology
- Database/Versioning
- IFC STEP Encoding
- Communication
- Global changes in 1.5
- Writing a service
- Services/Notifications
- BIMserver 1.5 Developers
- Extended data
- Extended data schema
- Object IDM
New developments
- New remote service interface
- Plugins new
- Deprecated
- New query language
- Visual query language
- Reorganizing BIMserver JavaScript API
General