Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Specification for semantic information and CXF #155

Open
wants to merge 8 commits into
base: master
Choose a base branch
from

Conversation

anandkp92
Copy link
Member

  • updated specification for including semantic information
  • added new page for CXF specification (including classes and properties used in CXF)

@anandkp92
Copy link
Member Author

@mwetter can you take a look at the changes to CDL semantic information and the CXF specification?

Copy link
Member

@mwetter mwetter left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@anandkp92 : Please see inline comments.

specification/source/cdl.rst Outdated Show resolved Hide resolved
refers to the complete hierarchical path that specifies the instance's
location within an object structure. This qualified path shall include all
parent instances leading up to the current instance, with each level of
instantiation separated by an underscore (“_”). If an instance is nested
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How does this affect the translation from CXF to CDL, if the block is in CDL
Buildings.Controls.OBC.ASHRAE.G36.VentilationZones.ASHRAE62_1.Setpoints?
In CXF, with this convention, this becomes Buildings_Controls_OBC_ASHRAE_G36.VentilationZones_ASHRAE62_1_Setpoints but there is no package 1 and translating it to CDL would give an error and a different structure.

Copy link
Member Author

@anandkp92 anandkp92 Nov 19, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So this specification <instanceName>, does not affect CXF.
It only affects the semantic model extracted from a CDL class, and that too only the instance name. The class name, if used in the semantic model, will remain as is, but it's the name of the instance that will be appended with _.

So in your example, if the file structure is

model A
    B controller; 
    ...
end A;
model B
    Buildings.Controls.OBC.ASHRAE.G36.VentilationZones.ASHRAE62_1.Setpoints heaSet
        annotation(__cdl(semantic(metadataLanguage="Brick 1.3 text/turtle" 
                "bldg:<instanceName> a brick:Heating_Septoint .")));
end B;

The semantic model will have the following content:

bldg:controller_heaSet a brick:Heating_Setpoint .

where <instanceName> was replaced by controller_heaSet

specification/source/glossary.rst Outdated Show resolved Hide resolved
specification/source/cxf.rst Outdated Show resolved Hide resolved
specification/source/cdl.rst Outdated Show resolved Hide resolved
specification/source/cxf.rst Outdated Show resolved Hide resolved
specification/source/cxf.rst Outdated Show resolved Hide resolved
appended with the underscore (``_``) character.
For matrices (two dimensions) and arrays with more than
two dimensions, each index shall be concatenated
with the underscore character (``_``).
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You also need to add in normative text how an assignment is serialized. See https://fmi-standard.org/docs/3.0/ section 2.2.7.1 for the order used to serialize a matrix into a one-dimensional string.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm a bit unclear about this. In CDL, if someone is assigning values to individual elements of a matrix using indices, such as M[1,2] = a12, in CXF, wouldn't this become M_1_2=a12 anyway?

specification/source/cxf.rst Outdated Show resolved Hide resolved
expressions in the CDL sequence such as those
within assignment operations, conditional
assignments and arithmetic operations. By default,
the expressions shall be preseved in CXF. If the
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You write that the expressions are preserved. In other parts you also write that aa.bb is converted to aa_bb. So if the expression is preserved, it contains a reference to aa.bb but if we indeed use underscores (as separate discussion) then we have invalid references.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As mentioned earlier, the changing the name of instances only happens in the semantic model and not for CXF. The parameters will remain aa.bb and the separator will not be replaced with _.

@anandkp92
Copy link
Member Author

@mwetter I've made necessary changes and resolved most of your comments. I do have some questions for the remaining comments.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants