From 892363030418dee32a7cbfff06cf04e50b685e27 Mon Sep 17 00:00:00 2001 From: Jyrki Oraskari <31693668+jyrkioraskari@users.noreply.github.com> Date: Wed, 3 Jan 2024 17:23:41 +0100 Subject: [PATCH] Update --- IFCProps2ExcelOnline/.classpath | 8 ++- IFCProps2ExcelOnline/.project | 3 +- .../.settings/org.eclipse.jdt.core.prefs | 6 +-- IFCProps2ExcelOnline/pom.xml | 8 +-- .../excelreport/IFCPropsTOExcelOnlineUI.java | 18 ++++--- IFCtoLBD/.classpath | 3 +- IFCtoLBD/.project | 1 - IFCtoLBD/.settings/org.eclipse.jdt.core.prefs | 6 +-- IFCtoLBD/pom.xml | 48 ++++++++++-------- .../ifc2lbd/IFCtoLBDConverter.java | 10 +--- .../ifc2lbd/IFCtoLBDConverter_CLI.java | 6 +-- .../ifc2lbd/core/IFCtoLBDConverterCore.java | 4 +- .../ifc2lbd/core/IFCtoRDF.java | 6 --- .../ifc2lbd/core/TestUTF8.java | 2 +- .../ifc2lbd/core/utils/IfcOWLUtils.java | 17 +++---- .../ifc2lbd/core/utils/RDFUtils.java | 50 ++++++++----------- .../ifc2lbd/core/valuesets/AttributeSet.java | 3 +- .../ifc2lbd/core/valuesets/PropertySet.java | 3 +- .../ifc2lbd/ConverterUnitTests.java | 2 - IFCtoLBD_Desktop/pom.xml | 4 +- IFCtoLBD_Desktop_2023/pom.xml | 4 +- .../src/license/THIRD-PARTY.properties | 2 +- .../ifc2lbd/desktop/ConversionThread.java | 16 +++--- .../ifc2lbd/desktop/ReadinInThread.java | 8 +-- IFCtoLBD_Geometry/.classpath | 3 +- IFCtoLBD_Geometry/.project | 1 - .../.settings/org.eclipse.jdt.core.prefs | 6 +-- IFCtoLBD_Geometry/pom.xml | 6 +-- .../de/rwth_aachen/dc/lbd/IFCGeometry.java | 13 +++-- .../de/rwth_aachen/dc/lbd/obj/IFCtoObj.java | 15 +++--- .../org/ifcopenshell/IfcGeomServerClient.java | 3 -- .../org/ifcopenshell/IfcOpenShellEngine.java | 1 - IFCtoLBD_OpenAPI/.classpath | 1 - IFCtoLBD_OpenAPI/.project | 1 - IFCtoLBD_OpenAPI/pom.xml | 4 +- .../dc/ifc2lbd/rest/IFCtoLBD_OpenAPI.java | 2 +- IFCtoRDF/pom.xml | 23 +++++---- .../src/main/java/be/ugent/IfcSpfParser.java | 10 ++-- .../src/main/java/be/ugent/IfcSpfReader.java | 27 ++++------ .../main/java/be/ugent/PerformanceTest.java | 9 ++-- .../tech/ifcowl/ExpressReader.java | 8 ++- README.md | 16 ++++-- 42 files changed, 184 insertions(+), 203 deletions(-) diff --git a/IFCProps2ExcelOnline/.classpath b/IFCProps2ExcelOnline/.classpath index 1e8b7fef..7d1e654a 100644 --- a/IFCProps2ExcelOnline/.classpath +++ b/IFCProps2ExcelOnline/.classpath @@ -18,7 +18,7 @@ - + @@ -26,7 +26,11 @@ - + + + + + diff --git a/IFCProps2ExcelOnline/.project b/IFCProps2ExcelOnline/.project index f16867a8..4e7f7691 100644 --- a/IFCProps2ExcelOnline/.project +++ b/IFCProps2ExcelOnline/.project @@ -26,8 +26,7 @@ - - org.eclipse.jem.workbench.JavaEMFNature + org.eclipse.wst.common.modulecore.ModuleCoreNature org.eclipse.jdt.core.javanature org.eclipse.m2e.core.maven2Nature diff --git a/IFCProps2ExcelOnline/.settings/org.eclipse.jdt.core.prefs b/IFCProps2ExcelOnline/.settings/org.eclipse.jdt.core.prefs index cac0df4d..b67837d0 100644 --- a/IFCProps2ExcelOnline/.settings/org.eclipse.jdt.core.prefs +++ b/IFCProps2ExcelOnline/.settings/org.eclipse.jdt.core.prefs @@ -1,11 +1,11 @@ eclipse.preferences.version=1 org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled -org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8 -org.eclipse.jdt.core.compiler.compliance=1.8 +org.eclipse.jdt.core.compiler.codegen.targetPlatform=17 +org.eclipse.jdt.core.compiler.compliance=17 org.eclipse.jdt.core.compiler.problem.assertIdentifier=error org.eclipse.jdt.core.compiler.problem.enablePreviewFeatures=disabled org.eclipse.jdt.core.compiler.problem.enumIdentifier=error org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=ignore org.eclipse.jdt.core.compiler.release=disabled -org.eclipse.jdt.core.compiler.source=1.8 +org.eclipse.jdt.core.compiler.source=17 diff --git a/IFCProps2ExcelOnline/pom.xml b/IFCProps2ExcelOnline/pom.xml index 0ed5a0d1..dd5108e5 100644 --- a/IFCProps2ExcelOnline/pom.xml +++ b/IFCProps2ExcelOnline/pom.xml @@ -5,7 +5,7 @@ de.rwth-aachen.dc.lbd IFCProps2ExcelOnline war - 2.40.1 + 2.43.4 IFC Properties to Excel User Interface @@ -13,8 +13,8 @@ 8.14.0 9.3.9.v20160517 UTF-8 - 1.8 - 1.8 + 17 + 17 local @@ -85,7 +85,7 @@ io.github.jyrkioraskari ifc-to-lbd - 2.43.3 + 2.43.4 org.apache.poi diff --git a/IFCProps2ExcelOnline/src/main/java/de/rwth_aachen/dc/excelreport/IFCPropsTOExcelOnlineUI.java b/IFCProps2ExcelOnline/src/main/java/de/rwth_aachen/dc/excelreport/IFCPropsTOExcelOnlineUI.java index 55ae08bb..6b3efc15 100644 --- a/IFCProps2ExcelOnline/src/main/java/de/rwth_aachen/dc/excelreport/IFCPropsTOExcelOnlineUI.java +++ b/IFCProps2ExcelOnline/src/main/java/de/rwth_aachen/dc/excelreport/IFCPropsTOExcelOnlineUI.java @@ -37,7 +37,6 @@ import com.vaadin.annotations.VaadinServletConfiguration; import com.vaadin.server.FileDownloader; import com.vaadin.server.FileResource; -import com.vaadin.server.Page; import com.vaadin.server.Resource; import com.vaadin.server.ThemeResource; import com.vaadin.server.VaadinRequest; @@ -72,16 +71,16 @@ public class IFCPropsTOExcelOnlineUI extends UI { Image image; - private UI ui_interface; - private String vaadin_session; - private Page vaadin_page; + //private UI ui_interface; + //private String vaadin_session; + //private Page vaadin_page; @Override protected void init(VaadinRequest vaadinRequest) { final VerticalLayout layout = new VerticalLayout(); - this.ui_interface = this.getUI(); - this.vaadin_session = VaadinSession.getCurrent().getSession().getId(); - this.vaadin_page = Page.getCurrent(); + //this.ui_interface = this.getUI(); + //this.vaadin_session = VaadinSession.getCurrent().getSession().getId(); + //this.vaadin_page = Page.getCurrent(); Resource res = new ThemeResource("rwth_caad_en_schwarz_grau_rgb.svg"); this.image = new Image("", res); @@ -284,6 +283,11 @@ private void extractIFCtoLBD(File ifcFile, RDFFormat rdfformat) { @WebServlet(urlPatterns = "/*", name = "mvdXMLOnlineCheckerUIServlet", asyncSupported = true) @VaadinServletConfiguration(ui = IFCPropsTOExcelOnlineUI.class, productionMode = false) public static class mvdXMLOnlineCheckerUIServlet extends VaadinServlet { + + /** + * + */ + private static final long serialVersionUID = 1L; } public static void main(String[] args) { diff --git a/IFCtoLBD/.classpath b/IFCtoLBD/.classpath index d8e0c6a8..a235a0cc 100644 --- a/IFCtoLBD/.classpath +++ b/IFCtoLBD/.classpath @@ -24,7 +24,7 @@ - + @@ -32,7 +32,6 @@ - diff --git a/IFCtoLBD/.project b/IFCtoLBD/.project index 109a4348..91503a43 100644 --- a/IFCtoLBD/.project +++ b/IFCtoLBD/.project @@ -27,7 +27,6 @@ - org.eclipse.jem.workbench.JavaEMFNature org.eclipse.wst.common.modulecore.ModuleCoreNature org.eclipse.jdt.core.javanature org.eclipse.m2e.core.maven2Nature diff --git a/IFCtoLBD/.settings/org.eclipse.jdt.core.prefs b/IFCtoLBD/.settings/org.eclipse.jdt.core.prefs index 3b784bcd..af7ce860 100644 --- a/IFCtoLBD/.settings/org.eclipse.jdt.core.prefs +++ b/IFCtoLBD/.settings/org.eclipse.jdt.core.prefs @@ -1,9 +1,9 @@ eclipse.preferences.version=1 org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled org.eclipse.jdt.core.compiler.codegen.methodParameters=do not generate -org.eclipse.jdt.core.compiler.codegen.targetPlatform=15 +org.eclipse.jdt.core.compiler.codegen.targetPlatform=17 org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve -org.eclipse.jdt.core.compiler.compliance=15 +org.eclipse.jdt.core.compiler.compliance=17 org.eclipse.jdt.core.compiler.debug.lineNumber=generate org.eclipse.jdt.core.compiler.debug.localVariable=generate org.eclipse.jdt.core.compiler.debug.sourceFile=generate @@ -13,4 +13,4 @@ org.eclipse.jdt.core.compiler.problem.enumIdentifier=error org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=warning org.eclipse.jdt.core.compiler.release=disabled -org.eclipse.jdt.core.compiler.source=15 +org.eclipse.jdt.core.compiler.source=17 diff --git a/IFCtoLBD/pom.xml b/IFCtoLBD/pom.xml index 4bbb97e3..e39aacce 100644 --- a/IFCtoLBD/pom.xml +++ b/IFCtoLBD/pom.xml @@ -2,7 +2,7 @@ 4.0.0 io.github.jyrkioraskari ifc-to-lbd - 2.43.3 + 2.43.4 IFC to LBD Converter @@ -40,8 +40,8 @@ - 15 - 15 + 17 + 17 3.8.0 3.1.0 @@ -68,25 +68,24 @@ de.rwth-aachen.lbd idc_to_lbd_geometry - 2.43.0 - - - org.slf4j - slf4j-log4j12 - - + 2.43.4 + + + org.slf4j + slf4j-log4j12 + + org.apache.commons commons-lang3 - 3.12.0 + 3.14.0 - commons-codec commons-codec - 1.15 + 1.16.0 @@ -109,19 +108,19 @@ org.junit.platform junit-platform-launcher - 1.9.2 + 1.10.1 test org.junit.jupiter junit-jupiter-engine - 5.9.2 + 5.10.1 test io.github.jyrkioraskari ifc2rdf - 1.3.1 + 1.3.2 com.github.davidmoten @@ -131,8 +130,19 @@ info.picocli picocli - 4.7.1 + 4.7.5 + + + org.apache.commons + commons-text + 1.11.0 + + org.apache.jena + jena-shaded-guava + 4.8.0 + + scm:git:github.com/jyrkioraskari/IFCtoLBD.git @@ -140,7 +150,6 @@ https://https://github.com/jyrkioraskari/IFCtoLBD HEAD - release @@ -335,11 +344,10 @@ - + - github diff --git a/IFCtoLBD/src/main/java/org/linkedbuildingdata/ifc2lbd/IFCtoLBDConverter.java b/IFCtoLBD/src/main/java/org/linkedbuildingdata/ifc2lbd/IFCtoLBDConverter.java index 571623b8..ff124220 100644 --- a/IFCtoLBD/src/main/java/org/linkedbuildingdata/ifc2lbd/IFCtoLBDConverter.java +++ b/IFCtoLBD/src/main/java/org/linkedbuildingdata/ifc2lbd/IFCtoLBDConverter.java @@ -6,29 +6,23 @@ import java.io.FileNotFoundException; import java.io.FileOutputStream; import java.io.IOException; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Optional; -import java.util.Set; import java.util.Timer; import java.util.TimerTask; import java.util.concurrent.CompletableFuture; import java.util.concurrent.ExecutionException; import java.util.concurrent.Executors; -import java.util.concurrent.Future; import java.util.zip.ZipEntry; import java.util.zip.ZipInputStream; import org.apache.jena.rdf.model.Model; -import org.apache.jena.rdf.model.Resource; import org.apache.jena.sys.JenaSystem; import org.linkedbuildingdata.ifc2lbd.application_messaging.events.IFCtoLBD_SystemErrorEvent; import org.linkedbuildingdata.ifc2lbd.application_messaging.events.IFCtoLBD_SystemStatusEvent; import org.linkedbuildingdata.ifc2lbd.core.IFCtoLBDConverterCore; import org.linkedbuildingdata.ifc2lbd.core.utils.FileUtils; import org.linkedbuildingdata.ifc2lbd.core.utils.IfcOWLUtils; -import org.linkedbuildingdata.ifc2lbd.core.valuesets.PropertySet; import org.linkedbuildingdata.ifc2lbd.namespace.IfcOWL; import de.rwth_aachen.dc.lbd.IFCGeometry; @@ -259,7 +253,7 @@ private String unzip(String ifcZipFile) { ZipEntry zipEntry = zis.getNextEntry(); while (zipEntry != null) { System.out.println("entry: " + zipEntry); - String name = zipEntry.getName().split("\\.")[0]; + //String name = zipEntry.getName().split("\\.")[0]; File newFile = File.createTempFile("ifc", ".ifc"); // write file content @@ -435,7 +429,7 @@ public boolean convert_read_in_phase(String ifc_filename, String target_file, bo readInOntologies(ifc_filename); createIfcLBDProductMapping(); - eventBus.post(new IFCtoLBD_SystemStatusEvent("Model ready in the memory.")); + eventBus.post(new IFCtoLBD_SystemStatusEvent("Model ready in the memory. Select \"Convert out to RDF\" to continue.")); return true; } diff --git a/IFCtoLBD/src/main/java/org/linkedbuildingdata/ifc2lbd/IFCtoLBDConverter_CLI.java b/IFCtoLBD/src/main/java/org/linkedbuildingdata/ifc2lbd/IFCtoLBDConverter_CLI.java index 5b220eb6..86eb0fe0 100644 --- a/IFCtoLBD/src/main/java/org/linkedbuildingdata/ifc2lbd/IFCtoLBDConverter_CLI.java +++ b/IFCtoLBD/src/main/java/org/linkedbuildingdata/ifc2lbd/IFCtoLBDConverter_CLI.java @@ -143,9 +143,9 @@ public Integer call() throws Exception { if (this.exportIfcOWL.isPresent()) exportIfcOWL = this.exportIfcOWL.get(); - boolean namedGraphs = false; - if (this.namedGraphs.isPresent()) - namedGraphs = this.namedGraphs.get(); + //boolean namedGraphs = false; + //if (this.namedGraphs.isPresent()) + // namedGraphs = this.namedGraphs.get(); boolean hasUnits = false; if (this.hasUnits.isPresent()) diff --git a/IFCtoLBD/src/main/java/org/linkedbuildingdata/ifc2lbd/core/IFCtoLBDConverterCore.java b/IFCtoLBD/src/main/java/org/linkedbuildingdata/ifc2lbd/core/IFCtoLBDConverterCore.java index ba63cbb6..9771aacd 100644 --- a/IFCtoLBD/src/main/java/org/linkedbuildingdata/ifc2lbd/core/IFCtoLBDConverterCore.java +++ b/IFCtoLBD/src/main/java/org/linkedbuildingdata/ifc2lbd/core/IFCtoLBDConverterCore.java @@ -241,7 +241,7 @@ private void handle_building(Resource ifcowl_building) { } private void handle_building(Resource lbd_site, Resource building) { - String building_url_name = IfcOWLUtils.getURLEncodedName(building, this.ifcOWL); + //String building_url_name = IfcOWLUtils.getURLEncodedName(building, this.ifcOWL); if (!RDFUtils.getType(building.asResource()).get().getURI().endsWith("#IfcBuilding")) { System.err.println("Not an #IfcBuilding"); @@ -1188,7 +1188,7 @@ public Set getElementTypes() { if (st.getPredicate().getLocalName().toString().toLowerCase().contains("globalid_ifcroot")) { Resource ifcOWL_element = st.getSubject(); if (isIfcElement(ifcOWL_element)) { - Optional predefined_type = IfcOWLUtils.getPredefinedData(ifcOWL_element); + //Optional predefined_type = IfcOWLUtils.getPredefinedData(ifcOWL_element); Optional ifcowl_type = RDFUtils.getType(ifcOWL_element); Optional bot_type = Optional.empty(); if (ifcowl_type.isPresent()) { diff --git a/IFCtoLBD/src/main/java/org/linkedbuildingdata/ifc2lbd/core/IFCtoRDF.java b/IFCtoLBD/src/main/java/org/linkedbuildingdata/ifc2lbd/core/IFCtoRDF.java index 46f60f88..1a4dbc15 100644 --- a/IFCtoLBD/src/main/java/org/linkedbuildingdata/ifc2lbd/core/IFCtoRDF.java +++ b/IFCtoLBD/src/main/java/org/linkedbuildingdata/ifc2lbd/core/IFCtoRDF.java @@ -1,16 +1,10 @@ package org.linkedbuildingdata.ifc2lbd.core; -import java.io.File; -import java.io.FileInputStream; -import java.io.FileNotFoundException; -import java.io.FileOutputStream; import java.io.IOException; import java.io.PrintStream; import java.util.Optional; import java.util.Timer; import java.util.TimerTask; -import java.util.zip.ZipEntry; -import java.util.zip.ZipInputStream; import org.linkedbuildingdata.ifc2lbd.application_messaging.IFC2LBD_ApplicationEventBusService; import org.linkedbuildingdata.ifc2lbd.application_messaging.events.IFCtoLBD_SystemStatusEvent; diff --git a/IFCtoLBD/src/main/java/org/linkedbuildingdata/ifc2lbd/core/TestUTF8.java b/IFCtoLBD/src/main/java/org/linkedbuildingdata/ifc2lbd/core/TestUTF8.java index 939f2d44..8d93a5ec 100644 --- a/IFCtoLBD/src/main/java/org/linkedbuildingdata/ifc2lbd/core/TestUTF8.java +++ b/IFCtoLBD/src/main/java/org/linkedbuildingdata/ifc2lbd/core/TestUTF8.java @@ -1,6 +1,6 @@ package org.linkedbuildingdata.ifc2lbd.core; -import org.apache.commons.lang3.StringEscapeUtils; +import org.apache.commons.text.StringEscapeUtils; public class TestUTF8 { diff --git a/IFCtoLBD/src/main/java/org/linkedbuildingdata/ifc2lbd/core/utils/IfcOWLUtils.java b/IFCtoLBD/src/main/java/org/linkedbuildingdata/ifc2lbd/core/utils/IfcOWLUtils.java index ff543ec5..830c4e01 100644 --- a/IFCtoLBD/src/main/java/org/linkedbuildingdata/ifc2lbd/core/utils/IfcOWLUtils.java +++ b/IFCtoLBD/src/main/java/org/linkedbuildingdata/ifc2lbd/core/utils/IfcOWLUtils.java @@ -15,8 +15,7 @@ import java.util.ArrayList; import java.util.List; import java.util.Optional; - -import org.apache.commons.lang3.StringEscapeUtils; +import org.apache.commons.text.StringEscapeUtils; import org.apache.jena.rdf.model.Model; import org.apache.jena.rdf.model.RDFNode; import org.apache.jena.rdf.model.Resource; @@ -386,12 +385,12 @@ public static String readIfcOWLOntology(String ifc_file, Model model) { in = ClassLoader.getSystemResources("ifcOWL/"+exp + ".ttl").nextElement().openStream(); // the module (Java 9 ) version if(in==null) { - return null; + return null; } model.read(in, null, "TTL"); } catch (IOException e) { e.printStackTrace(); - } finally { + } finally { // https://openjdk.org/jeps/421 try { in.close(); } catch (Exception e1) { @@ -414,9 +413,9 @@ public static String readIfcOWLOntology(String ifc_file, Model model) { */ public static String getExpressSchema(String ifcFile) { try (FileInputStream fstream = new FileInputStream(ifcFile)) { - DataInputStream in = new DataInputStream(fstream); - BufferedReader br = new BufferedReader(new InputStreamReader(in)); - try { + // Fix by JO 2024: finally is deprecated + try (DataInputStream in = new DataInputStream(fstream); + BufferedReader br = new BufferedReader(new InputStreamReader(in));){ String strLine; while ((strLine = br.readLine()) != null) { if (strLine.length() > 0) { @@ -446,9 +445,7 @@ public static String getExpressSchema(String ifcFile) { } } } - } finally { - br.close(); - } + } } catch (IOException e) { e.printStackTrace(); } diff --git a/IFCtoLBD/src/main/java/org/linkedbuildingdata/ifc2lbd/core/utils/RDFUtils.java b/IFCtoLBD/src/main/java/org/linkedbuildingdata/ifc2lbd/core/utils/RDFUtils.java index 8674fd69..f35ec302 100644 --- a/IFCtoLBD/src/main/java/org/linkedbuildingdata/ifc2lbd/core/utils/RDFUtils.java +++ b/IFCtoLBD/src/main/java/org/linkedbuildingdata/ifc2lbd/core/utils/RDFUtils.java @@ -66,54 +66,44 @@ public abstract class RDFUtils { * */ public static void writeModel(Model m, String target_file, EventBus eventBus) { - OutputStreamWriter fo = null; - try { - fo = new OutputStreamWriter(new FileOutputStream(new File(target_file)), Charset.forName("UTF-8").newEncoder()); + // Fix by JO 2024: finally is deprecated (https://openjdk.org/jeps/421) + try (OutputStreamWriter fo = new OutputStreamWriter(new FileOutputStream(new File(target_file)), Charset.forName("UTF-8").newEncoder()); ){ + m.write(fo, "TTL"); } catch (FileNotFoundException e) { e.printStackTrace(); eventBus.post(new IFCtoLBD_SystemStatusEvent("Error : " + e.getMessage())); - } finally { - if (fo != null) - try { - fo.close(); - } catch (IOException e) { - } - } + } catch (IOException e1) { + e1.printStackTrace(); + eventBus.post(new IFCtoLBD_SystemStatusEvent("Error : " + e1.getMessage())); + } } public static void writeModelRDFStream(Model m, String target_file, EventBus eventBus) { - FileOutputStream fo = null; - try { - fo =new FileOutputStream(new File(target_file)); + + try (FileOutputStream fo = new FileOutputStream(new File(target_file));){ + StreamRDFWriter.write(fo, m.getGraph(), RDFFormat.TURTLE_BLOCKS) ; } catch (FileNotFoundException e) { e.printStackTrace(); eventBus.post(new IFCtoLBD_SystemStatusEvent("Error : " + e.getMessage())); - } finally { - if (fo != null) - try { - fo.close(); - } catch (IOException e) { - } - } + } catch (IOException e1) { + e1.printStackTrace(); + eventBus.post(new IFCtoLBD_SystemStatusEvent("Error : " + e1.getMessage())); + } } public static void writeDataset(Dataset ds, String target_file, EventBus eventBus) { - FileOutputStream fo = null; // Outputstream for RDFDataMgr.write is deprecated - try { - fo = new FileOutputStream(new File(target_file)); + // Fix by JO 2024: finally is deprecated + try (FileOutputStream fo = new FileOutputStream(new File(target_file));){ RDFDataMgr.write(fo, ds, RDFFormat.TRIG_PRETTY); } catch (FileNotFoundException e) { e.printStackTrace(); eventBus.post(new IFCtoLBD_SystemStatusEvent("Error : " + e.getMessage())); - } finally { - if (fo != null) - try { - fo.close(); - } catch (IOException e) { - } - } + } catch (IOException e1) { + e1.printStackTrace(); + eventBus.post(new IFCtoLBD_SystemStatusEvent("Error : " + e1.getMessage())); + } } /** * diff --git a/IFCtoLBD/src/main/java/org/linkedbuildingdata/ifc2lbd/core/valuesets/AttributeSet.java b/IFCtoLBD/src/main/java/org/linkedbuildingdata/ifc2lbd/core/valuesets/AttributeSet.java index d55d300f..50258f74 100644 --- a/IFCtoLBD/src/main/java/org/linkedbuildingdata/ifc2lbd/core/valuesets/AttributeSet.java +++ b/IFCtoLBD/src/main/java/org/linkedbuildingdata/ifc2lbd/core/valuesets/AttributeSet.java @@ -9,7 +9,6 @@ import java.util.Map; import java.util.Optional; import java.util.Set; -import java.util.Map.Entry; import org.apache.jena.rdf.model.Model; import org.apache.jena.rdf.model.Property; @@ -209,7 +208,7 @@ private void addUnit(Resource lbd_resource, String pname) { } - private Set getPropertynames() { + public Set getPropertynames() { return mapPnameType.keySet(); } diff --git a/IFCtoLBD/src/main/java/org/linkedbuildingdata/ifc2lbd/core/valuesets/PropertySet.java b/IFCtoLBD/src/main/java/org/linkedbuildingdata/ifc2lbd/core/valuesets/PropertySet.java index 75214a1c..fd7f5e6e 100644 --- a/IFCtoLBD/src/main/java/org/linkedbuildingdata/ifc2lbd/core/valuesets/PropertySet.java +++ b/IFCtoLBD/src/main/java/org/linkedbuildingdata/ifc2lbd/core/valuesets/PropertySet.java @@ -7,7 +7,6 @@ import java.util.HashSet; import java.util.List; import java.util.Map; -import java.util.Map.Entry; import java.util.Optional; import java.util.Set; @@ -298,7 +297,7 @@ public Optional isExternal() { } - private Set getPropertynames() { + public Set getPropertynames() { return mapPnameType.keySet(); } diff --git a/IFCtoLBD/src/test/java/org/linkedbuildingdata/ifc2lbd/ConverterUnitTests.java b/IFCtoLBD/src/test/java/org/linkedbuildingdata/ifc2lbd/ConverterUnitTests.java index 49922292..469d8474 100644 --- a/IFCtoLBD/src/test/java/org/linkedbuildingdata/ifc2lbd/ConverterUnitTests.java +++ b/IFCtoLBD/src/test/java/org/linkedbuildingdata/ifc2lbd/ConverterUnitTests.java @@ -11,8 +11,6 @@ import org.apache.jena.rdf.model.ModelFactory; import org.apache.jena.rdf.model.Resource; import org.apache.jena.rdf.model.ResourceFactory; -import org.apache.jena.rdf.model.Statement; -import org.apache.jena.rdf.model.StmtIterator; import org.apache.jena.riot.Lang; import org.apache.jena.riot.RDFDataMgr; import org.apache.jena.shacl.ShaclValidator; diff --git a/IFCtoLBD_Desktop/pom.xml b/IFCtoLBD_Desktop/pom.xml index e2507aad..e408b77d 100644 --- a/IFCtoLBD_Desktop/pom.xml +++ b/IFCtoLBD_Desktop/pom.xml @@ -10,7 +10,7 @@ 4.0.0 io.github.jyrkioraskari IFCtoLBD_Desktop - 2.43.0 + 2.43.4 IFCtoLBD Desktop Java 17 and newer The IFC to BOT converter user interface for a desktop computer @@ -67,7 +67,7 @@ io.github.jyrkioraskari ifc-to-lbd - 2.43.3 + 2.43.4 diff --git a/IFCtoLBD_Desktop_2023/pom.xml b/IFCtoLBD_Desktop_2023/pom.xml index e4422d2e..6ba179cc 100644 --- a/IFCtoLBD_Desktop_2023/pom.xml +++ b/IFCtoLBD_Desktop_2023/pom.xml @@ -10,7 +10,7 @@ 4.0.0 io.github.jyrkioraskari IFCtoLBD_Desktop_2023 - 2.43.0 + 2.43.4 IFCtoLBD Desktop 2023 Java 19 and newer The IFC to BOT converter user interface for a desktop computer @@ -67,7 +67,7 @@ io.github.jyrkioraskari ifc-to-lbd - 2.43.3 + 2.43.4 diff --git a/IFCtoLBD_Desktop_2023/src/license/THIRD-PARTY.properties b/IFCtoLBD_Desktop_2023/src/license/THIRD-PARTY.properties index 1b975e2d..98caf614 100644 --- a/IFCtoLBD_Desktop_2023/src/license/THIRD-PARTY.properties +++ b/IFCtoLBD_Desktop_2023/src/license/THIRD-PARTY.properties @@ -53,5 +53,5 @@ # Please fill the missing licenses for dependencies : # # -#Fri Jul 21 14:34:52 CEST 2023 +#Wed Jan 03 15:11:02 CET 2024 gnu.getopt--java-getopt--1.0.13= diff --git a/IFCtoLBD_Desktop_2023/src/main/java/org/linkedbuildingdata/ifc2lbd/desktop/ConversionThread.java b/IFCtoLBD_Desktop_2023/src/main/java/org/linkedbuildingdata/ifc2lbd/desktop/ConversionThread.java index 0d96ee95..685e387e 100644 --- a/IFCtoLBD_Desktop_2023/src/main/java/org/linkedbuildingdata/ifc2lbd/desktop/ConversionThread.java +++ b/IFCtoLBD_Desktop_2023/src/main/java/org/linkedbuildingdata/ifc2lbd/desktop/ConversionThread.java @@ -40,10 +40,10 @@ public class ConversionThread implements Callable { final private IFCtoLBDConverter converter; final private Set selected_types; - final private String ifc_filename; - final private String uriBase; - final private String target_file; - final private int props_level; + //final private String ifc_filename; + //final private String uriBase; + //final private String target_file; + //final private int props_level; final private boolean hasBuildingElements; final private boolean hasBuildingProperties; @@ -65,10 +65,10 @@ public ConversionThread(IFCtoLBDConverter converter,Set selected_types,S super(); this.converter=converter; this.selected_types=selected_types; - this.ifc_filename = ifc_filename; - this.uriBase = uriBase; - this.target_file = target_file; - this.props_level=props_level; + //this.ifc_filename = ifc_filename; + //this.uriBase = uriBase; + //this.target_file = target_file; + //this.props_level=props_level; this.hasBuildingElements=hasBuildingElements; this.hasBuildingProperties=hasBuildingProperties; diff --git a/IFCtoLBD_Desktop_2023/src/main/java/org/linkedbuildingdata/ifc2lbd/desktop/ReadinInThread.java b/IFCtoLBD_Desktop_2023/src/main/java/org/linkedbuildingdata/ifc2lbd/desktop/ReadinInThread.java index 345b164e..a5d142e8 100644 --- a/IFCtoLBD_Desktop_2023/src/main/java/org/linkedbuildingdata/ifc2lbd/desktop/ReadinInThread.java +++ b/IFCtoLBD_Desktop_2023/src/main/java/org/linkedbuildingdata/ifc2lbd/desktop/ReadinInThread.java @@ -40,8 +40,8 @@ public class ReadinInThread implements Callable { final private String uriBase; final private String target_file; final private int props_level; - final private boolean hasBuildingElements; - final private boolean hasBuildingProperties; + //final private boolean hasBuildingElements; + //final private boolean hasBuildingProperties; final boolean hasSeparateBuildingElementsModel; final boolean hasPropertiesBlankNodes; @@ -62,8 +62,8 @@ public ReadinInThread(String ifc_filename, String uriBase, String target_file,in this.uriBase = uriBase; this.target_file = target_file; this.props_level=props_level; - this.hasBuildingElements=hasBuildingElements; - this.hasBuildingProperties=hasBuildingProperties; + //this.hasBuildingElements=hasBuildingElements; + //this.hasBuildingProperties=hasBuildingProperties; this.hasSeparateBuildingElementsModel=hasSeparateBuildingElementsModel; this.hasSeparatePropertiesModel=hasSeparatePropertiesModel; diff --git a/IFCtoLBD_Geometry/.classpath b/IFCtoLBD_Geometry/.classpath index bc4d4668..4d6a7c42 100644 --- a/IFCtoLBD_Geometry/.classpath +++ b/IFCtoLBD_Geometry/.classpath @@ -15,10 +15,9 @@ - - + diff --git a/IFCtoLBD_Geometry/.project b/IFCtoLBD_Geometry/.project index 2fe8134a..30f833af 100644 --- a/IFCtoLBD_Geometry/.project +++ b/IFCtoLBD_Geometry/.project @@ -27,7 +27,6 @@ - org.eclipse.jem.workbench.JavaEMFNature org.eclipse.wst.common.modulecore.ModuleCoreNature org.eclipse.jdt.core.javanature org.eclipse.m2e.core.maven2Nature diff --git a/IFCtoLBD_Geometry/.settings/org.eclipse.jdt.core.prefs b/IFCtoLBD_Geometry/.settings/org.eclipse.jdt.core.prefs index 03fe1153..cb8ed12a 100644 --- a/IFCtoLBD_Geometry/.settings/org.eclipse.jdt.core.prefs +++ b/IFCtoLBD_Geometry/.settings/org.eclipse.jdt.core.prefs @@ -1,11 +1,11 @@ eclipse.preferences.version=1 org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled -org.eclipse.jdt.core.compiler.codegen.targetPlatform=15 -org.eclipse.jdt.core.compiler.compliance=15 +org.eclipse.jdt.core.compiler.codegen.targetPlatform=17 +org.eclipse.jdt.core.compiler.compliance=17 org.eclipse.jdt.core.compiler.problem.assertIdentifier=error org.eclipse.jdt.core.compiler.problem.enablePreviewFeatures=disabled org.eclipse.jdt.core.compiler.problem.enumIdentifier=error org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=warning org.eclipse.jdt.core.compiler.release=disabled -org.eclipse.jdt.core.compiler.source=15 +org.eclipse.jdt.core.compiler.source=17 diff --git a/IFCtoLBD_Geometry/pom.xml b/IFCtoLBD_Geometry/pom.xml index a6e70004..69888c84 100644 --- a/IFCtoLBD_Geometry/pom.xml +++ b/IFCtoLBD_Geometry/pom.xml @@ -17,8 +17,8 @@ - 15 - 15 + 17 + 17 @@ -75,7 +75,7 @@ - 2.43.0 + 2.43.4 github diff --git a/IFCtoLBD_Geometry/src/main/java/de/rwth_aachen/dc/lbd/IFCGeometry.java b/IFCtoLBD_Geometry/src/main/java/de/rwth_aachen/dc/lbd/IFCGeometry.java index f863439a..4ad5dced 100644 --- a/IFCtoLBD_Geometry/src/main/java/de/rwth_aachen/dc/lbd/IFCGeometry.java +++ b/IFCtoLBD_Geometry/src/main/java/de/rwth_aachen/dc/lbd/IFCGeometry.java @@ -22,7 +22,6 @@ import org.bimserver.plugins.deserializers.DeserializeException; import org.bimserver.plugins.renderengine.RenderEngineException; import org.bimserver.plugins.renderengine.RenderEngineGeometry; -import org.ifcopenshell.IfcGeomServerClientEntity; import org.ifcopenshell.IfcOpenShellEngine; import org.ifcopenshell.IfcOpenShellEntityInstance; import org.ifcopenshell.IfcOpenShellModel; @@ -191,17 +190,23 @@ private ImmutableTriple processSurface(ByteBuffer byt } + public static IfcOpenShellEngine ifcOpenShellEngine_singlethon=null; + private IfcOpenShellModel getRenderEngineModel(File ifcFile) { try { String ifcGeomServerLocation = OperatingSystemCopyOf_IfcGeomServer.getIfcGeomServer(); System.out.println("ifcGeomServerLocation: " + ifcGeomServerLocation); Path ifcGeomServerLocationPath = Paths.get(ifcGeomServerLocation); - IfcOpenShellEngine ifcOpenShellEngine = new IfcOpenShellEngine(ifcGeomServerLocationPath, false, true); - ifcOpenShellEngine.init(); + + if(IFCGeometry.ifcOpenShellEngine_singlethon==null) + { + IFCGeometry.ifcOpenShellEngine_singlethon = new IfcOpenShellEngine(ifcGeomServerLocationPath, false, true); + IFCGeometry.ifcOpenShellEngine_singlethon.init(); + } FileInputStream ifcFileInputStream = new FileInputStream(ifcFile); System.out.println("ifcFile: " + ifcFile); - IfcOpenShellModel model = ifcOpenShellEngine.openModel(ifcFileInputStream); + IfcOpenShellModel model = IFCGeometry.ifcOpenShellEngine_singlethon.openModel(ifcFileInputStream); System.out.println("IfcOpenShell opens ifc: " + ifcFile.getAbsolutePath()); model.generateGeneralGeometry(); diff --git a/IFCtoLBD_Geometry/src/main/java/de/rwth_aachen/dc/lbd/obj/IFCtoObj.java b/IFCtoLBD_Geometry/src/main/java/de/rwth_aachen/dc/lbd/obj/IFCtoObj.java index 3aeee51b..557ac30c 100644 --- a/IFCtoLBD_Geometry/src/main/java/de/rwth_aachen/dc/lbd/obj/IFCtoObj.java +++ b/IFCtoLBD_Geometry/src/main/java/de/rwth_aachen/dc/lbd/obj/IFCtoObj.java @@ -22,13 +22,12 @@ import org.bimserver.plugins.deserializers.DeserializeException; import org.bimserver.plugins.renderengine.RenderEngineException; import org.bimserver.plugins.renderengine.RenderEngineGeometry; -import org.bimserver.plugins.renderengine.RenderEngineModel; -import org.ifcopenshell.IfcGeomServerClientEntity; import org.ifcopenshell.IfcOpenShellEngine; import org.ifcopenshell.IfcOpenShellEntityInstance; import org.ifcopenshell.IfcOpenShellModel; import de.rwth_aachen.dc.OperatingSystemCopyOf_IfcGeomServer; +import de.rwth_aachen.dc.lbd.IFCGeometry; import de.rwth_aachen.dc.lbd.ObjDescription; public class IFCtoObj { @@ -134,18 +133,20 @@ private ImmutableTriple processSurface(ByteBuffer byt } - + private IfcOpenShellModel getRenderEngineModel(File ifcFile) { try { String ifcGeomServerLocation = OperatingSystemCopyOf_IfcGeomServer.getIfcGeomServer(); System.out.println("ifcGeomServerLocation: " + ifcGeomServerLocation); Path ifcGeomServerLocationPath = Paths.get(ifcGeomServerLocation); - IfcOpenShellEngine ifcOpenShellEngine = new IfcOpenShellEngine(ifcGeomServerLocationPath, false, false); - ifcOpenShellEngine.init(); - FileInputStream ifcFileInputStream = new FileInputStream(ifcFile); + if(IFCGeometry.ifcOpenShellEngine_singlethon==null) + { + IFCGeometry.ifcOpenShellEngine_singlethon = new IfcOpenShellEngine(ifcGeomServerLocationPath, false, true); + IFCGeometry.ifcOpenShellEngine_singlethon.init(); + } FileInputStream ifcFileInputStream = new FileInputStream(ifcFile); System.out.println("ifcFile: " + ifcFile); - IfcOpenShellModel model = ifcOpenShellEngine.openModel(ifcFileInputStream); + IfcOpenShellModel model = IFCGeometry.ifcOpenShellEngine_singlethon.openModel(ifcFileInputStream); System.out.println("IfcOpenShell opens ifc: " + ifcFile.getAbsolutePath()); model.generateGeneralGeometry(); diff --git a/IFCtoLBD_Geometry/src/main/java/org/ifcopenshell/IfcGeomServerClient.java b/IFCtoLBD_Geometry/src/main/java/org/ifcopenshell/IfcGeomServerClient.java index 8022aecc..2b736ba1 100644 --- a/IFCtoLBD_Geometry/src/main/java/org/ifcopenshell/IfcGeomServerClient.java +++ b/IFCtoLBD_Geometry/src/main/java/org/ifcopenshell/IfcGeomServerClient.java @@ -1,8 +1,5 @@ package org.ifcopenshell; -import java.io.BufferedInputStream; -import java.io.BufferedOutputStream; - /****************************************************************************** * Copyright (C) 2009-2019 BIMserver.org * diff --git a/IFCtoLBD_Geometry/src/main/java/org/ifcopenshell/IfcOpenShellEngine.java b/IFCtoLBD_Geometry/src/main/java/org/ifcopenshell/IfcOpenShellEngine.java index 840bd4e4..f39e7b62 100644 --- a/IFCtoLBD_Geometry/src/main/java/org/ifcopenshell/IfcOpenShellEngine.java +++ b/IFCtoLBD_Geometry/src/main/java/org/ifcopenshell/IfcOpenShellEngine.java @@ -50,7 +50,6 @@ import org.bimserver.plugins.renderengine.Metrics; import org.bimserver.plugins.renderengine.RenderEngine; import org.bimserver.plugins.renderengine.RenderEngineException; -import org.bimserver.plugins.renderengine.RenderEngineModel; import org.slf4j.Logger; import org.slf4j.LoggerFactory; diff --git a/IFCtoLBD_OpenAPI/.classpath b/IFCtoLBD_OpenAPI/.classpath index ab260793..e3b29410 100644 --- a/IFCtoLBD_OpenAPI/.classpath +++ b/IFCtoLBD_OpenAPI/.classpath @@ -8,7 +8,6 @@ - diff --git a/IFCtoLBD_OpenAPI/.project b/IFCtoLBD_OpenAPI/.project index 9b654ca4..d1078c9f 100644 --- a/IFCtoLBD_OpenAPI/.project +++ b/IFCtoLBD_OpenAPI/.project @@ -28,7 +28,6 @@ org.eclipse.m2e.core.maven2Nature - org.eclipse.jem.workbench.JavaEMFNature org.eclipse.wst.common.modulecore.ModuleCoreNature org.eclipse.wst.common.project.facet.core.nature org.eclipse.jdt.core.javanature diff --git a/IFCtoLBD_OpenAPI/pom.xml b/IFCtoLBD_OpenAPI/pom.xml index 4e48faf4..a4294370 100644 --- a/IFCtoLBD_OpenAPI/pom.xml +++ b/IFCtoLBD_OpenAPI/pom.xml @@ -3,7 +3,7 @@ 4.0.0 de.rwth-aachen.dc.ifctolbd IFCtoLBD_OpenAPI - 2.43.0 + 2.43.4 war IFCtoLBD OpenAPI Interface @@ -120,7 +120,7 @@ io.github.jyrkioraskari ifc-to-lbd - 2.43.3 + 2.43.4 diff --git a/IFCtoLBD_OpenAPI/src/main/java/de/rwth_aachen/dc/ifc2lbd/rest/IFCtoLBD_OpenAPI.java b/IFCtoLBD_OpenAPI/src/main/java/de/rwth_aachen/dc/ifc2lbd/rest/IFCtoLBD_OpenAPI.java index dc22bec4..6ce8bbf8 100644 --- a/IFCtoLBD_OpenAPI/src/main/java/de/rwth_aachen/dc/ifc2lbd/rest/IFCtoLBD_OpenAPI.java +++ b/IFCtoLBD_OpenAPI/src/main/java/de/rwth_aachen/dc/ifc2lbd/rest/IFCtoLBD_OpenAPI.java @@ -57,7 +57,7 @@ public Response convertIFCtoLBD(@HeaderParam(HttpHeaders.ACCEPT) String accept_t ifcFile.close(); if (accept_type.equals("application/ld+json")) { StringBuilder result_string = new StringBuilder(); - extractIFCtoLBD(tempIfcFile, result_string, RDFFormat.JSONLD_COMPACT_PRETTY); + extractIFCtoLBD(tempIfcFile, result_string, RDFFormat.JSONLD10_COMPACT_PRETTY); return Response.ok(result_string.toString(), "application/ld+json").build(); } else if (accept_type.equals("application/rdf+xml")) { StringBuilder result_string = new StringBuilder(); diff --git a/IFCtoRDF/pom.xml b/IFCtoRDF/pom.xml index 38d1b35e..e416f97c 100644 --- a/IFCtoRDF/pom.xml +++ b/IFCtoRDF/pom.xml @@ -14,7 +14,7 @@ ifc2rdf IFC 2 RDF jar - 1.3.1 + 1.3.2 Apache License, Version 2.0 @@ -305,7 +305,7 @@ Based on: https://github.com/pipauwel/IFCtoRDF 2.4 4.13.2 - 4.8.0 + 4.10.0 3.10.1 3.1.0 @@ -321,9 +321,10 @@ Based on: https://github.com/pipauwel/IFCtoRDF 1.4 ${scmBranch}@r${buildNumber} - 15 - 15 - 15 + 17 + 17 + 17 + UTF-8 yyyy-MM-dd HH:mm:ssZ true ${project.build.finalName} @@ -352,12 +353,12 @@ Based on: https://github.com/pipauwel/IFCtoRDF - - org.slf4j - slf4j-api - - 2.0.4 - + + + + + + junit diff --git a/IFCtoRDF/src/main/java/be/ugent/IfcSpfParser.java b/IFCtoRDF/src/main/java/be/ugent/IfcSpfParser.java index 1d7b12bf..1b249a3a 100644 --- a/IFCtoRDF/src/main/java/be/ugent/IfcSpfParser.java +++ b/IFCtoRDF/src/main/java/be/ugent/IfcSpfParser.java @@ -32,9 +32,9 @@ public IfcSpfParser(InputStream inputStream) { public void readModel() { try { - DataInputStream in = new DataInputStream(inputStream); - BufferedReader br = new BufferedReader(new InputStreamReader(in)); - try { + // Fix by JO 2024: finally is deprecated + try (DataInputStream in = new DataInputStream(inputStream); + BufferedReader br = new BufferedReader(new InputStreamReader(in));){ String strLine; while ((strLine = br.readLine()) != null) { if (strLine.length() > 0) { @@ -55,9 +55,7 @@ public void readModel() { } } } - } finally { - br.close(); - } + } } catch (IOException e) { e.printStackTrace(); } diff --git a/IFCtoRDF/src/main/java/be/ugent/IfcSpfReader.java b/IFCtoRDF/src/main/java/be/ugent/IfcSpfReader.java index 9d5bf63a..351b1772 100644 --- a/IFCtoRDF/src/main/java/be/ugent/IfcSpfReader.java +++ b/IFCtoRDF/src/main/java/be/ugent/IfcSpfReader.java @@ -174,9 +174,9 @@ else if (listOfFiles[i].isDirectory()) private static String getExpressSchema(String ifcFile) { try (FileInputStream fstream = new FileInputStream(ifcFile)) { - DataInputStream in = new DataInputStream(fstream); - BufferedReader br = new BufferedReader(new InputStreamReader(in)); - try { + // Fix by JO 2024: finally is deprecated (https://openjdk.org/jeps/421) + try ( DataInputStream in = new DataInputStream(fstream); + BufferedReader br = new BufferedReader(new InputStreamReader(in));){ String strLine; while ((strLine = br.readLine()) != null) { if (strLine.length() > 0) { @@ -206,8 +206,6 @@ private static String getExpressSchema(String ifcFile) { } } } - } finally { - br.close(); } } catch (IOException e) { e.printStackTrace(); @@ -247,29 +245,25 @@ public void setup(String ifcFileIn) throws IOException { if (fis == null) fis = IfcSpfReader.class.getResourceAsStream("/ent" + exp + ".ser"); - ObjectInputStream ois = new ObjectInputStream(fis); - - try { + + // Fix by JO 2024: finally is deprecated + try (ObjectInputStream ois = new ObjectInputStream(fis);){ ent = (Map) ois.readObject(); } catch (ClassNotFoundException e) { e.printStackTrace(); - } finally { - ois.close(); - } + } //JO -->>> fis = IfcSpfReader.class.getResourceAsStream("/resources/typ" + exp + ".ser"); if (fis == null) fis = IfcSpfReader.class.getResourceAsStream("/typ" + exp + ".ser"); - ois = new ObjectInputStream(fis); - try { + // Fix by JO 2024: finally is deprecated + try (ObjectInputStream ois = new ObjectInputStream(fis);){ typ = (Map) ois.readObject(); } catch (ClassNotFoundException e) { e.printStackTrace(); - } finally { - ois.close(); - } + } String inAlt = exp; @@ -342,6 +336,7 @@ public void convert(String ifcFile, String outputFile, String baseURI,boolean ha } catch (FileNotFoundException e1) { e1.printStackTrace(); } finally { + //TODO JO 2024: finally is deprecated try { in.close(); } catch (Exception e1) { diff --git a/IFCtoRDF/src/main/java/be/ugent/PerformanceTest.java b/IFCtoRDF/src/main/java/be/ugent/PerformanceTest.java index 97ade27a..bd13c397 100644 --- a/IFCtoRDF/src/main/java/be/ugent/PerformanceTest.java +++ b/IFCtoRDF/src/main/java/be/ugent/PerformanceTest.java @@ -1,17 +1,16 @@ package be.ugent; import java.io.IOException; -import java.io.PrintStream; import java.util.Optional; public class PerformanceTest extends IfcSpfReader { - private int i = 0; + //private int i = 0; public Optional convert_into_rdf(String ifcFile, String outputFile, String baseURI,boolean hasPerformanceBoost) throws IOException { - i = 0; - PrintStream orgSystemOut = System.out; - PrintStream orgSystemError = System.err; + //i = 0; + //PrintStream orgSystemOut = System.out; + //PrintStream orgSystemError = System.err; System.out.println("ifcfile is: "+ifcFile); diff --git a/IFCtoRDF/src/main/java/com/buildingsmart/tech/ifcowl/ExpressReader.java b/IFCtoRDF/src/main/java/com/buildingsmart/tech/ifcowl/ExpressReader.java index c7b73ccf..d6041a27 100644 --- a/IFCtoRDF/src/main/java/com/buildingsmart/tech/ifcowl/ExpressReader.java +++ b/IFCtoRDF/src/main/java/com/buildingsmart/tech/ifcowl/ExpressReader.java @@ -411,17 +411,15 @@ private void interpretSelects() { // CONVERTING private void readSpec() { try { - BufferedReader br = new BufferedReader(new InputStreamReader(schemaInputStream)); - try { + + try (BufferedReader br = new BufferedReader(new InputStreamReader(schemaInputStream));){ String strLine; while ((strLine = br.readLine()) != null) { if (strLine.length() > 0) { parse_level(strLine); } } - } finally { - br.close(); - } + } } catch (FileNotFoundException fe) { System.err.println("The IFC Express file is missing."); System.exit(1); diff --git a/README.md b/README.md index 5b57bb9d..5bb9eb1a 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,5 @@ # IFCtoLBD -Version 2.43.3 +Version 2.43.4 Contributors: Jyrki Oraskari, Mathias Bonduel, Kris McGlinn, Anna Wagner, Pieter Pauwels, Ville Kukkonen, Simon Steyskaland, Joel Lehtonen, Maxime Lefrançois, and Lewis John McGibbney. @@ -12,7 +12,7 @@ Resource Description Framework (RDF) triples that follow the small ontologies de Proceedings of the 6th Linked Data in Architecture and Construction Workshop: [The IFC to Linked Building Data Converter - Current Status](http://ceur-ws.org/Vol-2159/04paper.pdf). -It is recommended to use OpenJava 19. OpenJava can be downloaded from (https://docs.microsoft.com/en-us/java/openjdk/download). +It is recommended to use OpenJDK 21 (it is the modt current Long-Term Support version). Java 17 is supported. OpenJava can be downloaded from (https://docs.microsoft.com/en-us/java/openjdk/download). On a Windows system, download the MSI file that matches your processor type (usually x64 aka Intell), and run it to install Java. ## Precompiled binaries @@ -21,7 +21,7 @@ Precompiled applications are available in the published release. https://github.com/jyrkioraskari/IFCtoLBD/releases * Desktop application: IFCtoLBD-Desktop -Use Java 19 for compiling the converter and the desktop app. For the OpenAPI interface, it is recommended to use Java 15 (The Enunciate library does not support a newer yet, but it seems to be possible to compile it with JDK 19 using the MAVEN_OPTS environment variable shown below. ). +Use Java 21 for compiling the converter and the desktop app. For the OpenAPI interface, it is recommended to use Java 21. These are runnable JAR files. If the Java installation is fine, the file can be run by clicking it. When converting large files, `run.bat` can be used. It is also faster since it allows the program to use more memory for the calculation. @@ -275,6 +275,9 @@ java -jar IFCtoLBD_CLI.jar Duplex_A_20110907.ifc --level 1 --target_file output ``` ## Blog +### January 02, 2024 +The recommendations was changed to encourage to use one of the last two performant Long-Term Support version of Java (17 or 21). + ### November 13, 2023 The new user Java 17 (and above) compatible OpenAPI is now in the source code. Earlier Java versions are not supported as the current Enuciate package has that limitation. @@ -292,7 +295,6 @@ The geometry tests are finished. The converter now exports OBJ formatted geometr ### June 07, 2022 Support for xsd:decimal. - ### May 16, 2022 Support for multi-character Unicode sequences. @@ -367,6 +369,12 @@ Testing the correctness of the created bounding boxes. where *your java installation directory* is the base directory where your Java runtime is installed. +6. How to disable the missing project natures in Eclipse prompt + - open Eclipse. + - go to Window > Preferences. + - navigate to General > Project Natures. + There, you can disable the option for discovering missing project natures and marketplace entries. + ## Acknowledgements The research was funded by the EU through the H2020 project BIM4REN.