-
Notifications
You must be signed in to change notification settings - Fork 18
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
Not able to generate code for GoogleDigitalBuildings RDF file and latest OLGA SDK #28
Comments
@radissoa can you please take a look? Please take a look until it is fixed. |
Thanks @charbull |
I can take a look at it, I'll come back to you soon. |
So i had a look at it, it is hard to reproduce the exact error @navneet79 mentioned because there are so many others. <owl:Class rdf:about="http://www.google.com/digitalbuildings/0.0.1/hvac#Ahu_bspc_chwsc_econ_efss4x_efvsc4x_fdpm_hwsc_sfss2x_sfvsc2x_sspc">
<rdfs:subClassOf rdf:resource="http://www.google.com/digitalbuildings/0.0.1/hvac#Ahu"/>
<rdfs:label>Ahu_bspc_chwsc_econ_efss4x_efvsc4x_fdpm_hwsc_sfss2x_sfvsc2x_sspc</rdfs:label>
<rdfs:subClassOf rdf:resource="http://www.google.com/digitalbuildings/0.0.1/hvac#Sfvsc2x"/>
<rdfs:subClassOf rdf:resource="http://www.google.com/digitalbuildings/0.0.1/hvac#Hwsc"/>
<rdfs:subClassOf rdf:resource="http://www.google.com/digitalbuildings/0.0.1/hvac#Chwsc"/>
<rdfs:subClassOf rdf:resource="http://www.google.com/digitalbuildings/0.0.1/hvac#Efvsc4x"/>
<rdfs:comment>Multi-zone AHU.</rdfs:comment>
<rdfs:subClassOf rdf:resource="http://www.google.com/digitalbuildings/0.0.1/hvac#Sspc"/>
<rdfs:subClassOf rdf:resource="http://www.google.com/digitalbuildings/0.0.1/hvac#Bspc"/>
<rdfs:subClassOf rdf:resource="http://www.google.com/digitalbuildings/0.0.1/hvac#Efss4x"/>
<rdfs:subClassOf rdf:resource="http://www.google.com/digitalbuildings/0.0.1/hvac#Econ"/>
<rdfs:subClassOf rdf:resource="http://www.google.com/digitalbuildings/0.0.1/hvac#Sfss2x"/>
<rdfs:subClassOf rdf:resource="http://www.google.com/digitalbuildings/0.0.1/hvac#Fdpm"/>
</owl:Class> This puts us in a tricky spot because in the generated code, we use both class and interface hierarchy and a class can only extend one class but an interface can extend multiple interfaces. Hence, there is a disparity between the two hierarchies and some methods are not implemented by certain classes, there is also the case that a method with the same name is declared in two interfaces, generating a conflict, because the same property applies to two of superclasses in the ontology. Looking briefly at the code, it seems that OLGA was planned for simpler class hierarchies, and we need to review the design to accept more complex ones. What is your opinion @charbull ? |
@radissoa thank you for taking a look, OLGA/OLGA/OLGA-Core/src/main/resources/templates/java/rdf4j/template_java_rdf4j_interfaces.ftl Line 12 in 81aaf0a
and here: Line 101 in 81aaf0a
Where we pick the best one to extend maybe the bug is here? we do support multi-inheritance already, probably the code has a bug there? What do you think? |
You are right we do support multi inheritance, and yes the bug might there. I will have to start the debugger to get a clearer idea. |
Compilation fails for Java code generated using the OLGA SDK
Steps to reproduce the behavior:
Download the digital_buildings rdf file from the digital buildings repo.
ZIP the OLGA Repo Master branch.
install the CORE and CLI packages,
java -jar OLGA-Cli/target/OLGA-Cli-0.0.6-with-dependencies.jar --code java --library rdf4j --name DigitalBuildings --path digital_buildings.rdf
I get the following error
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.8.0:compile (default-compile) on project digitalbuildings-RDF4J: Compilation failure: Compilation failure:
[ERROR] /E:/OLGA-master/OLGA-master/OLGA/OLGA/generated/digitalbuildings-RDF4J-java/src/main/java/digitalbuildings/rdf/model/Ahu_bspc_dx4sc_econm_efss_efvsc_oafmc_sfss_sfvsc_sspc.java:[64,17] method addUsesOptionalsEconomizer_mode(digitalbuildings.rdf.model.IEconomizer_mode) is already defined in class digitalbuildings.rdf.model.Ahu_bspc_dx4sc_econm_efss_efvsc_oafmc_sfss_sfvsc_sspc
This comes for a lot of classes
Please Help
The text was updated successfully, but these errors were encountered: