Infohub JS API
Loading...
Searching...
No Matches
PropertyServices Class Reference

Description

Properties on infohub.

Public Member Functions

 constructor (ctx)
async getPropertyFromNode (node_shortid, propertykey)
 getPropertyListFromTypeIds (typeids)
async readPropertyList (query)
async readPropertyListByQueryId (queryid)
async readPropertyValuesFromNode (node_shortid)
async writePropertyList (proplist)
async writePropertyValues (proplist)
async writePropertyValuesToNode (node_sid, proplist)

Function Documentation

◆ constructor()

constructor ( ctx)
Since
1.0, 11.2025, ar
Parameters
{Context}ctx - Context instance

◆ getPropertyFromNode()

async getPropertyFromNode ( node_shortid,
propertykey )

Reads a single property from a node in the current scope.

Sends GET /{scope}/nodes/{nodeShortId}/properties/{propertyKey}. The scope is taken from the current Context. The node short ID and property key are URL-encoded before they are added to the request path.

Parameters
{string}node_shortid - Short ID of the node whose property is read.
{string}propertykey - Full property key, including its value type when applicable, for example ifcType##xs:string.
Returns
{Promise<ApiResponse>} The API response containing the requested property data, or an error status and message if the request fails.

Example:

const response = await propertyServices.getPropertyFromNode(
'node-shortid',
'ifcType##xs:string'
);
if (response.status < 300) {
console.log(response.data);
// Example response.data:
// {
// project_shortid: 'project-shortid',
// container_shortid: 'container-shortid',
// object_id: 'wall-001',
// object_name: 'Exterior wall',
// node_shortid: 'node-shortid',
// type: 'xs:string',
// value: 'ifcWall',
// comment: 'IFC entity type',
// createdby: 'user@example.com',
// created: '2026-07-12T10:00:00Z',
// updated: '2026-07-12T11:30:00Z',
// updatedby: 'user@example.com'
// }
}

◆ getPropertyListFromTypeIds()

getPropertyListFromTypeIds ( typeids)

Helper function.

Get list of property types in a format that can be used in 'readPropertyList

Parameters
{Array<string>}typeids
Returns
{Array<any>}

◆ readPropertyList()

async readPropertyList ( query)

Get property list from infohub.

Use query to specify which objects and properties should be taken into account. For convenience, you can get the member ‘properties’ in the correct format from a list of properties by using the method getPropertyListFromTypeIds( typeids ).

Parameters
{*}query = { "project_ids" : [ '... project shortid... ' , ' ... ' ], "object_ids" : [ '... object id ' , ' ... ' ], "properties" : [ { } ] }
Returns
{Promise<ApiResponse>}

◆ readPropertyListByQueryId()

async readPropertyListByQueryId ( queryid)
Parameters
{*}queryid
Returns
{Promise<ApiResponse>}

◆ readPropertyValuesFromNode()

async readPropertyValuesFromNode ( node_shortid)

Reads all property values from a node in the current scope.

Sends GET /{scope}/nodes/{nodeShortId}/properties/values. The scope is taken from the current Context.

Parameters
{string}node_shortid - Short ID of the node whose properties are read.
Returns
{Promise<ApiResponse>} The API response. On success, data contains a map of property names to their values; on failure, the response contains the error status and message.

Example:

const response = await propertyServices.readPropertyValuesFromNode('node-shortid');
if (response.status < 300) {
console.log(response.data);
// Example response.data:
// {
// 'ifcType##xs:string': 'ifcWall',
// 'height##xs:double': 2.75,
// 'loadBearing##xs:boolean': true
// }
}

◆ writePropertyList()

async writePropertyList ( proplist)

Writes object properties to objects given by object ID the current project.

Sends the supplied objects to POST /{scope}/projects/{projectShortId}/properties. The scope and project short ID are taken from the current Context. Property comments can be supplied using the same property names as in properties.

Parameters
{Array<{parent_id: string, object_id: string, object_name: string, object_type: string, properties: Object<string, *>, properties_comments: (Object<string, string>|undefined) }>} proplist - Objects and their property data to write.
Returns
{Promise<ApiResponse>} The API response, including its HTTP status and the response data or error message.

Example:

const response = await propertyServices.writePropertyList([
{
parent_id: 'parent-object-id',
object_id: 'wall-001',
object_name: 'Exterior wall',
object_type: 'ifcWall',
properties: {
'height##xs:double': 2.75,
'loadBearing##xs:boolean': true
},
properties_comments: {
'height##xs:double': 'Height in metres'
}
}
]);
if (response.status < 300) {
console.log(response.data);
}
Since
27.11.2025, ar

◆ writePropertyValues()

async writePropertyValues ( proplist)

Writes property values and comments for one or more objects given by ShortIDs in the current scope.

Sends the supplied list to POST /{scope}/properties. Each entry identifies an object by its short ID and contains property names mapped to their values. Property comments can be supplied using the same property names.

Parameters
{Array<{shortid: string, properties: Object<string, *>, properties_comments: (Object<string, string>|undefined) }>} proplist - Property updates. properties_comments is optional.
Returns
{Promise<ApiResponse>} The API response, including its HTTP status and the response data or error message.

Example:

Infohub.PropertyServices = new PropertyServices( Infohub.Context )
const response = await Infohub.PropertyServices.writePropertyValues([
{
shortid: 'object-shortid',
properties: {
'height##xs:double': 2.75,
'label##xs:string': 'Exterior wall'
},
properties_comments: {
'height##xs:double': 'Height in metres'
}
}
]);
if (response.status < 300) {
console.log(response.data);
}
Properties on infohub.
Definition Properties.js:19
async writePropertyValues(proplist)
Writes property values and comments for one or more objects given by ShortIDs in the current scope.
Definition Properties.js:122

◆ writePropertyValuesToNode()

async writePropertyValuesToNode ( node_sid,
proplist )

Writes property values directly to a node in the current scope.

Sends the property map to POST /{scope}/nodes/{nodeShortId}/properties/values. The scope is taken from the current Context. Property keys may include their value type, for example ifcType##xs:string.

Parameters
{string}node_sid - Short ID of the node whose properties are updated.
{Object<string,*>}proplist - Property names mapped to the values to store on the node. Values may be strings, numbers, booleans, or other JSON-compatible values supported by the property type.
Returns
{Promise<ApiResponse>} The API response, including its HTTP status and the response data or error message.

Example:

const response = await propertyServices.writePropertyValuesToNode(
'node-shortid',
{
'ifcType##xs:string': 'ifcWall',
'height##xs:double': 2.75,
'loadBearing##xs:boolean': true
}
);
if (response.status < 300) {
console.log(response.data);
}