-
Notifications
You must be signed in to change notification settings - Fork 14
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
base: master
Are you sure you want to change the base?
Conversation
anandkp92
commented
Nov 4, 2024
- updated specification for including semantic information
- added new page for CXF specification (including classes and properties used in CXF)
@mwetter can you take a look at the changes to CDL semantic information and the CXF specification? |
There was a problem hiding this 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.
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 |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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/cxf.rst
Outdated
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 (``_``). |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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?
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 |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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 _
.
@mwetter I've made necessary changes and resolved most of your comments. I do have some questions for the remaining comments. |