-
Notifications
You must be signed in to change notification settings - Fork 0
New query langage
BIMserver has had several ways of querying the stored models, but none have been very useful so far. This page will describe the requirements of a new query language that should replace all the other ways of querying data.
Requirements
- Should be easy to read/write, or easy to build higher-level languages on top of it
- Query by type (e.g. IfcDoor), with or without subtypes
- Query on exact values of fields (e.g. guid = "FHAJJAJJH", oid=20020)
- Use comparative expressions like >, <
- Use functions like substr etc...
- An efficient implementation should be possible (using indices, not loading the complete model in advance)
- Should basically be possible to create a query to get any sub-graph of any given model
- Should have the possibility to traverse a model (recursively)
- Should allow for having reusable pieces of query that are used a lot
- Should have the possibility to simplify for example the concept of Ifc properties via IfcPropertySet etc...
- http://www.jsoniq.org/
- XQuery
This is not very intuitive, but can be used to query a model quite precisely.
The "defines" section declares reusable query-parts, the "queries" section the actual queries (which are all joined as OR)
The first query get's all IfcProject objects (usually just one). For every IfcProject, 2 includes are traversed. "IsDecomposedByDefine" will follow the "IsDecomposedBy" field, for every object it will follow "RelatedObjects", it will then recursively call itself, and "ContainsElementsDefine" and "Representation". And so on... This will basically read the whole decomposes-tree, with some sidesteps.
This example script is used in BIMvie.ws to preload the minimal amount of objects needed to create the tree/types/classifications/layers tabs on the left.
var preLoadQuery = {
defines: {
Representation: {
field: "Representation"
},
ContainsElementsDefine: {
field: "ContainsElements",
include: {
field: "RelatedElements",
include: [
"IsDecomposedByDefine",
"ContainsElementsDefine",
"Representation"
]
}
},
IsDecomposedByDefine: {
field: "IsDecomposedBy",
include: {
field: "RelatedObjects",
include: [
"IsDecomposedByDefine",
"ContainsElementsDefine",
"Representation"
]
}
}
},
queries: [
{
type: "IfcProject",
include: [
"IsDecomposedByDefine",
"ContainsElementsDefine"
]
},
{
type: "IfcRepresentation",
includeAllSubtypes: true
},
{
type: "IfcProductRepresentation"
},
{
type: "IfcPresentationLayerWithStyle"
},
{
type: "IfcProduct",
includeAllSubTypes: true
},
{
type: "IfcProductDefinitionShape"
},
{
type: "IfcPresentationLayerAssignment"
},
{
type: "IfcRelAssociatesClassification",
include: [
{
field: "RelatedObjects"
},
{
field: "RelatingClassification"
}
]
},
{
type: "IfcSIUnit"
},
{
type: "IfcPresentationLayerAssignment"
}
]
};Query on type
{
type: "IfcProject"
}
Query on oid
{
oid: 12345
}
Query on oids (OR)
{
oids: [12346, 56789]
}
Query on GUID
{
guid: "EBEBEBEBE"
}
Query on GUID's (OR)
{
guids: ["EBEBEBEBEB", "CDCDCDCDCD"]
}
Using AND, OR, XOR
{
or: [{
type: "IfcWall"
}, {
type: "IfcWallStandardCase"
}]
}
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