Skip to content

FragmentsModel#getAttributeTypes() and getRelationNames() always return empty arraysΒ #219

@MarcinKoziuk

Description

@MarcinKoziuk

Describe the bug πŸ“

Hi! Been working on an IFC to Linked Data export using this library, great stuff!

I was trying to use FragmentsModel#getAttributeTypes() and getRelationNames() to enumerate available attributes and relations, so that we can make a more informed configuration for invoking getItemsData(). It seems both methods consistently return [] though, regardless of what's in the model.

The IFC files I'm working with definitely have attributes and relations. I can't share them (client data), but I have a reproduction repo with a public IFC that triggers the same thing.

This happens with the latest version of the libraries (@thatopen/fragments 3.4.5 and web-ifc 0.0.77)

const categories = await model.getCategories()
const relationNames = await model.getRelationNames()
const attributeTypes = await model.getAttributeTypes()
console.log("model categories, relationNames, attributeTypes", {
  model,
  categories,
  relationNames,
  attributeTypes,
})
Image

Reproduction ▢️

https://github.com/MarcinKoziuk/ThatOpen-relationNames-attributeTypes-reproduction

Steps to reproduce πŸ”’

Run the app e.g. yarn install and yarn dev
Open an IFC or Fragment file in the app
Open developer console
Notice the relationNames and attributeTypes are empty

System Info πŸ’»

System:
    OS: macOS 26.4.1
    CPU: (16) arm64 Apple M3 Max
    Memory: 1.56 GB / 64.00 GB
    Shell: 4.4.0 - /opt/homebrew/bin/fish
  Binaries:
    Node: 20.20.0 - /usr/local/bin/node
    Yarn: 1.22.22 - /opt/homebrew/bin/yarn
    npm: 10.8.2 - /usr/local/bin/npm
  Browsers:
    Chrome: 148.0.7778.168
    Safari: 26.4

Used Package Manager πŸ“¦

yarn

Error Trace/Logs πŸ“ƒ

Validations βœ…

  • Read the docs.
  • Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
  • Make sure this is a repository issue and not a framework-specific issue. For example, if it's a THREE.js related bug, it should likely be reported to mrdoob/threejs instead.
  • Check that this is a concrete bug. For Q&A join our Community.
  • The provided reproduction is a minimal reproducible example of the bug.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions