dap4/d4core/src/main/java/dap4/core/dmr/DapNode.java
public DapNode getContainer()
    {
        DapNode parent = this.parent;
        switch (getSort()) {
        default:
            break;
        case ENUMCONST:
            parent = ((DapEnumConst) this).getParent().getContainer();
            break;
        case ATTRIBUTE:
        case ATTRIBUTESET:
        case OTHERXML:
            parent = ((DapAttribute) this).getParent();
            if(parent instanceof DapVariable)
                parent = parent.getContainer();
            break;
        case MAP:
            parent = ((DapMap) this).getVariable().getContainer();
            break;
        }
        return parent;
    }
public DapNode getContainer()
    {
        DapNode parent = this.parent;
        switch (getSort()) {
        default:
            break;
        case ENUMCONST:
            parent = ((DapEnumConst) this).getParent().getContainer();
            break;
        case ATTRIBUTE:
        case ATTRIBUTESET:
        case OTHERXML:
            parent = ((DapAttribute) this).getParent();
            if(parent instanceof DapVariable)
                parent = parent.getContainer();
            break;
        case MAP:
            parent = ((DapMap) this).getVariable().getContainer();
            break;
        }
        return parent;
    }
Closest containing group, structure, sequence

@returns closest container