Skip to content

Commit

Permalink
Merge pull request #49 from jyrkioraskari/development
Browse files Browse the repository at this point in the history
Performance: Added concurrency
  • Loading branch information
jyrkioraskari authored Mar 3, 2023
2 parents 382c14a + 67b642e commit 5789765
Show file tree
Hide file tree
Showing 11 changed files with 465 additions and 359 deletions.
1 change: 1 addition & 0 deletions IFCtoLBD/.classpath
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
<classpathentry kind="con" path="org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER">
<attributes>
<attribute name="maven.pomderived" value="true"/>
<attribute name="org.eclipse.jst.component.nondependency" value=""/>
</attributes>
</classpathentry>
<classpathentry kind="con" path="org.eclipse.jdt.junit.JUNIT_CONTAINER/5">
Expand Down
3 changes: 1 addition & 2 deletions IFCtoLBD/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
<developer>
<id>jyrkio</id>
<name>Jyrki Oraskari</name>
<email>jyrki [dot] oraskari [at] aalto [dot] fi</email>
<email>jyrki [dot] oraskari [at] rwth-aachen [dot] de</email>
</developer>
<developer>
<id>mathib</id>
Expand Down Expand Up @@ -143,7 +143,6 @@
<distributionManagement>
<snapshotRepository>
<id>ossrh</id>
<url>https://oss.sonatype.org/content/repositories/snapshots</url>
</snapshotRepository>
<repository>
<id>ossrh</id>
Expand Down
3 changes: 2 additions & 1 deletion IFCtoLBD/src/license/THIRD-PARTY.properties
Original file line number Diff line number Diff line change
Expand Up @@ -49,5 +49,6 @@
# Please fill the missing licenses for dependencies :
#
#
#Wed Mar 01 16:53:43 CET 2023

#Thu Mar 02 17:35:08 CET 2023
gnu.getopt--java-getopt--1.0.13=

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@
import org.apache.jena.rdf.model.Statement;
import org.apache.jena.rdf.model.StmtIterator;
import org.apache.jena.riot.RDFDataMgr;
import org.apache.jena.sys.JenaSystem;
import org.apache.jena.vocabulary.OWL;
import org.apache.jena.vocabulary.RDF;
import org.apache.jena.vocabulary.RDFS;
Expand Down Expand Up @@ -351,7 +350,6 @@ private boolean isIfcElement(Resource s) {
Property fogasObj = null;

private void addGeometry(Resource lbd_resource, String guid) {

if (this.ifc_geometry == null)
return;
try {
Expand Down Expand Up @@ -1026,10 +1024,10 @@ protected Model readAndConvertIFC2ifcOWL(String ifc_file, String uriBase, boolea
Model m = ModelFactory.createDefaultModel();
eventBus.post(new IFCtoLBD_SystemStatusEvent("IFCtoRDF conversion"));
this.ontURI = rj.convert_into_rdf(ifc_file, outputFile.getAbsolutePath(), uriBase, hasPerformanceBoost);
File t2 = IfcOWLUtils.filterContent(outputFile);
if (t2 != null) {
RDFDataMgr.read(m, t2.getAbsolutePath());
} else
//File t2 = IfcOWLUtils.filterContent(outputFile); // Performance!!
//if (t2 != null) {
// RDFDataMgr.read(m, t2.getAbsolutePath());
//} else
RDFDataMgr.read(m, outputFile.getAbsolutePath());
return m;
} catch (IOException e) {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
package org.linkedbuildingdata.ifc2lbd.tests;

public class ProfilingTests {

public static void main(String[] args) {


}

}
2 changes: 1 addition & 1 deletion IFCtoLBD_Desktop/src/license/THIRD-PARTY.properties
Original file line number Diff line number Diff line change
Expand Up @@ -53,5 +53,5 @@
# Please fill the missing licenses for dependencies :
#
#
#Wed Mar 01 16:55:10 CET 2023
#Fri Mar 03 17:42:55 CET 2023
gnu.getopt--java-getopt--1.0.13=
1 change: 1 addition & 0 deletions IFCtoLBD_Geometry/.classpath
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
<classpathentry kind="con" path="org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER">
<attributes>
<attribute name="maven.pomderived" value="true"/>
<attribute name="org.eclipse.jst.component.nondependency" value=""/>
</attributes>
</classpathentry>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-11">
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
package de.rwth_aachen.dc.lbd;

import java.io.File;
import java.io.IOException;

import org.bimserver.plugins.deserializers.DeserializeException;
import org.bimserver.plugins.renderengine.RenderEngineException;

public class PerformanceTest {

public static void main(String[] args) {
try {
new IFCGeometry(new File("c:\\jo\\Duplex_A_20110907.ifc"));
} catch (RenderEngineException | DeserializeException | IOException e) {
e.printStackTrace();
}
System.out.println("done");
}

}
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
package org.ifcopenshell;

import java.io.BufferedInputStream;
import java.io.BufferedOutputStream;

/******************************************************************************
* Copyright (C) 2009-2019 BIMserver.org
*
Expand Down Expand Up @@ -748,7 +751,7 @@ private void terminate() throws RenderEngineException {

private void askForMore() throws IOException {
hasMore = false;
if (dis.readInt() != MORE) {
if (dis.readInt() != MORE) { // Takes most of the time
LOGGER.error("Invalid command sequence encountered");
throw new IOException();
}
Expand Down
44 changes: 44 additions & 0 deletions IFCtoRDF/src/main/java/be/ugent/PerformanceTest.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
package be.ugent;

import java.io.IOException;
import java.io.PrintStream;
import java.util.Optional;

public class PerformanceTest extends IfcSpfReader {

private int i = 0;

public Optional<String> convert_into_rdf(String ifcFile, String outputFile, String baseURI,boolean hasPerformanceBoost) throws IOException {
i = 0;
PrintStream orgSystemOut = System.out;
PrintStream orgSystemError = System.err;


System.out.println("ifcfile is: "+ifcFile);

setup(ifcFile);
convert(ifcFile, outputFile, baseURI,hasPerformanceBoost);
return Optional.of(this.ontURI);
}

public Optional<String> getOntologyURI(String ifcFile) {
try {
setup(ifcFile);
} catch (IOException e) {
e.printStackTrace();
}
return Optional.of(this.ontURI);
}


public static void main(String[] args) {
PerformanceTest pt=new PerformanceTest();
try {
pt.convert_into_rdf("c:\\jo\\Duplex_A_20110907.ifc", "c:\\jo\\out.ttl", "https://ba.se/",true);
} catch (IOException e) {
e.printStackTrace();
}

System.out.println("done");
}
}

0 comments on commit 5789765

Please sign in to comment.