diff --git a/IFCtoLBDGeometry/src/main/java/de/rwth_aachen/dc/lbd/IFCBoundingBoxes.java b/IFCtoLBDGeometry/src/main/java/de/rwth_aachen/dc/lbd/IFCBoundingBoxes.java
index 4b82d7a1..e0478ae3 100644
--- a/IFCtoLBDGeometry/src/main/java/de/rwth_aachen/dc/lbd/IFCBoundingBoxes.java
+++ b/IFCtoLBDGeometry/src/main/java/de/rwth_aachen/dc/lbd/IFCBoundingBoxes.java
@@ -37,22 +37,21 @@ public BoundingBox getBoundingBox(String guid) {
if (renderEngineInstance == null) {
return null;
}
+
IfcGeomServerClientEntity geometry = renderEngineInstance.generateGeometry();
- if (geometry != null && geometry.getIndices().length > 0) {
- boundingBox = new BoundingBox();
- double[] tranformationMatrix = new double[16];
- if (renderEngineInstance.getTransformationMatrix() != null) {
- tranformationMatrix = renderEngineInstance.getTransformationMatrix();
- tranformationMatrix = Matrix.changeOrientation(tranformationMatrix);
- } else {
- Matrix.setIdentityM(tranformationMatrix, 0);
- }
-
- float[] vertices = geometry.getPositions();
- for (int i = 0; i < geometry.getPositions().length; i += 3) {
- processExtends(boundingBox, tranformationMatrix, vertices[i], vertices[i + 1], vertices[i + 2]);
- }
- }
+ if (geometry != null && geometry.getIndices().length > 0) {
+ boundingBox = new BoundingBox();
+ double[] tranformationMatrix = new double[16];
+ Matrix.setIdentityM(tranformationMatrix, 0);
+ if (renderEngineInstance.getTransformationMatrix() != null) {
+ tranformationMatrix = renderEngineInstance.getTransformationMatrix();
+ }
+ for (int i = 0; i < geometry.getIndices().length; i++) {
+ Point3d p=processExtends(tranformationMatrix, geometry.getPositions(), geometry.getIndices()[i] * 3);
+ boundingBox.add(p);
+ }
+ }
+
return boundingBox;
}
@@ -74,14 +73,18 @@ private IfcOpenShellModel getRenderEngineModel(File ifcFile) throws RenderEngine
return model;
}
- private void processExtends(BoundingBox boundingBox, double[] transformationMatrix, double x, double y, double z) {
- double[] result = new double[4];
- Matrix.multiplyMV(result, 0, transformationMatrix, 0, new double[] { x, y, z, 1 }, 0);
- x = result[0];
- y = result[1];
- z = result[2];
- Point3d point = new Point3d(x / 1000, y / 1000, z / 1000);
- boundingBox.add(point);
- }
+ private Point3d processExtends(double[] transformationMatrix, float[] ds, int index) {
+ double x = ds[index];
+ double y = ds[index + 1];
+ double z = ds[index + 2];
+
+ double[] result = new double[4];
+ Matrix.multiplyMV(result, 0, transformationMatrix, 0, new double[] { x, y, z, 1 }, 0);
+
+ Point3d point = new Point3d(result[0], result[2], result[2]);
+ return point;
+
+ }
+
}
\ No newline at end of file
diff --git a/converter/pom.xml b/converter/pom.xml
index 306c274a..ec70616d 100644
--- a/converter/pom.xml
+++ b/converter/pom.xml
@@ -67,7 +67,7 @@
${project.build.finalName}
-
+
de.rwth-aachen.dc.lbd
IFCtoLBDGeometry
2.8
@@ -113,25 +113,31 @@
IFCtoRDF
0.5J-SNAPSHOT
-
-
- org.apache.jena
- jena-core
- 3.16.0
-
-
- org.apache.jena
- jena-arq
- 3.16.0
-
+
+
+ org.apache.jena
+ jena-core
+ 3.16.0
+
+
+ org.apache.jena
+ jena-arq
+ 3.16.0
+
org.apache.jena
apache-jena-libs
3.16.0
- pom
+ pom
-
+
+
+ com.github.davidmoten
+ rtree-multi
+ 0.1-RC1
+
+
scm:git:github.com/jyrkioraskari/IFCtoLBD.git
diff --git a/converter/src/license/THIRD-PARTY.properties b/converter/src/license/THIRD-PARTY.properties
index a5dc665c..1b91914f 100644
--- a/converter/src/license/THIRD-PARTY.properties
+++ b/converter/src/license/THIRD-PARTY.properties
@@ -48,5 +48,5 @@
# Please fill the missing licenses for dependencies :
#
#
-#Thu Oct 01 15:24:55 CEST 2020
+#Fri Oct 02 20:10:27 CEST 2020
gnu.getopt--java-getopt--1.0.13=
diff --git a/converter/src/main/java/org/linkedbuildingdata/ifc2lbd/IFCtoLBDConverter.java b/converter/src/main/java/org/linkedbuildingdata/ifc2lbd/IFCtoLBDConverter.java
index ff054268..2820c96d 100644
--- a/converter/src/main/java/org/linkedbuildingdata/ifc2lbd/IFCtoLBDConverter.java
+++ b/converter/src/main/java/org/linkedbuildingdata/ifc2lbd/IFCtoLBDConverter.java
@@ -92,7 +92,8 @@ public IFCtoLBDConverter(String ifc_filename, String uriBase, String target_file
eventBus.post(new IFCtoLBD_SystemStatusEvent("Not a valid IFC version."));
return;
}
-
+ System.out.println("#2");
+
try {
System.out.println("Set the bounding box generator");
this.bounding_boxes = new IFCBoundingBoxes(new File(ifc_filename));
@@ -149,6 +150,8 @@ public IFCtoLBDConverter(String ifc_filename, String uriBase, String target_file
eventBus.post(new IFCtoLBD_SystemStatusEvent("Not a valid IFC version."));
return;
}
+ System.out.println("#2");
+
if(hasGeometry)
try {
@@ -310,7 +313,7 @@ public Model convert(String ifc_filename, String target_file, boolean hasBuildin
boolean hasSeparateBuildingElementsModel, boolean hasBuildingProperties, boolean hasSeparatePropertiesModel,
boolean hasGeolocation, boolean hasGeometry) {
-
+ System.out.println("#1");
if(IfcOWLUtils.getExpressSchema(ifc_filename)==null) //TODO this result could be saved
{
eventBus.post(new IFCtoLBD_SystemStatusEvent("Not a valid IFC version."));
@@ -329,6 +332,7 @@ public Model convert(String ifc_filename, String target_file, boolean hasBuildin
ifcowl_model = readAndConvertIFC(ifc_filename, uriBase); // Before: readInOntologies(ifc_filename);
+ System.out.println("converted RDF");
eventBus.post(new IFCtoLBD_SystemStatusEvent("Reading in ontologies"));
readInOntologies(ifc_filename);
createIfcLBDProductMapping();
diff --git a/converter/src/main/java/org/linkedbuildingdata/ifc2lbd/core/IFCtoLBDConverterCore.java b/converter/src/main/java/org/linkedbuildingdata/ifc2lbd/core/IFCtoLBDConverterCore.java
index d0da4a46..20d5b4b8 100644
--- a/converter/src/main/java/org/linkedbuildingdata/ifc2lbd/core/IFCtoLBDConverterCore.java
+++ b/converter/src/main/java/org/linkedbuildingdata/ifc2lbd/core/IFCtoLBDConverterCore.java
@@ -35,6 +35,7 @@
import org.apache.jena.vocabulary.RDFS;
import org.linkedbuildingdata.ifc2lbd.application_messaging.IFC2LBD_ApplicationEventBusService;
import org.linkedbuildingdata.ifc2lbd.application_messaging.events.IFCtoLBD_SystemStatusEvent;
+import org.linkedbuildingdata.ifc2lbd.core.utils.ChangeableOptonal;
import org.linkedbuildingdata.ifc2lbd.core.utils.FileUtils;
import org.linkedbuildingdata.ifc2lbd.core.utils.IfcOWLUtils;
import org.linkedbuildingdata.ifc2lbd.core.utils.RDFUtils;
@@ -47,6 +48,10 @@
import org.linkedbuildingdata.ifc2lbd.namespace.LBD_NS;
import org.linkedbuildingdata.ifc2lbd.namespace.OPM;
+import com.github.davidmoten.rtreemulti.Entry;
+import com.github.davidmoten.rtreemulti.RTree;
+import com.github.davidmoten.rtreemulti.geometry.Geometry;
+import com.github.davidmoten.rtreemulti.geometry.Rectangle;
import com.google.common.eventbus.EventBus;
import com.openifctools.guidcompressor.GuidCompressor;
@@ -90,12 +95,19 @@ public abstract class IFCtoLBDConverterCore {
protected IFCBoundingBoxes bounding_boxes = null;
- Set has_geometry = new HashSet<>();
+ private Set has_geometry = new HashSet<>();
+
+ private RTree rtree;
+ private Map rtree_map = new HashMap<>();
+
protected void conversion(String target_file, boolean hasBuildingElements, boolean hasSeparateBuildingElementsModel, boolean hasBuildingProperties, boolean hasSeparatePropertiesModel,
boolean hasGeolocation,boolean hasGeometry) {
+ System.out.println("Conversion starts");
+
+ rtree= RTree.dimensions(3).create();
IfcOWLUtils.listSites(ifcOWL, ifcowl_model).stream().map(rn -> rn.asResource()).forEach(site -> {
- Resource sio = createformattedURI(site, lbd_general_output_model, "Site");
+ Resource sio = createformattedURIRecource(site, lbd_general_output_model, "Site");
String guid_site = IfcOWLUtils.getGUID(site, this.ifcOWL);
String uncompressed_guid_site = GuidCompressor.uncompressGuidString(guid_site);
addAttrributes(lbd_property_output_model, site.asResource(), sio);
@@ -115,7 +127,7 @@ protected void conversion(String target_file, boolean hasBuildingElements, boole
System.err.println("Not an #IfcBuilding");
return;
}
- Resource bo = createformattedURI(building, lbd_general_output_model, "Building");
+ Resource bo = createformattedURIRecource(building, lbd_general_output_model, "Building");
String guid_building = IfcOWLUtils.getGUID(building, this.ifcOWL);
String uncompressed_guid_building = GuidCompressor.uncompressGuidString(guid_building);
addAttrributes(lbd_property_output_model, building, bo);
@@ -139,7 +151,7 @@ protected void conversion(String target_file, boolean hasBuildingElements, boole
return;
}
- Resource so = createformattedURI(storey, lbd_general_output_model, "Storey");
+ Resource so = createformattedURIRecource(storey, lbd_general_output_model, "Storey");
String guid_storey = IfcOWLUtils.getGUID(storey, this.ifcOWL);
String uncompressed_guid_storey = GuidCompressor.uncompressGuidString(guid_storey);
addAttrributes(lbd_property_output_model, storey, so);
@@ -157,13 +169,13 @@ protected void conversion(String target_file, boolean hasBuildingElements, boole
IfcOWLUtils.listContained_StoreyElements(storey, ifcOWL).stream().map(rn -> rn.asResource()).forEach(element -> {
if (RDFUtils.getType(element.asResource()).get().getURI().endsWith("#IfcSpace"))
return;
- connectElement(so, element);
+ connectIfcContaidedElement(so, element);
});
IfcOWLUtils.listStoreySpaces(storey.asResource(), ifcOWL).stream().forEach(space -> {
if (!RDFUtils.getType(space.asResource()).get().getURI().endsWith("#IfcSpace"))
return;
- Resource spo = createformattedURI(space.asResource(), lbd_general_output_model, "Space");
+ Resource spo = createformattedURIRecource(space.asResource(), lbd_general_output_model, "Space");
String guid_space = IfcOWLUtils.getGUID(space.asResource(), this.ifcOWL);
String uncompressed_guid_space = GuidCompressor.uncompressGuidString(guid_space);
addAttrributes(lbd_property_output_model, space.asResource(), spo);
@@ -172,23 +184,36 @@ protected void conversion(String target_file, boolean hasBuildingElements, boole
addBoundingBox(spo, guid_space);
spo.addProperty(RDF.type, LBD_NS.BOT.space);
- Optional isExternal=Optional.empty();
+ final ChangeableOptonal isExternal=new ChangeableOptonal();
IfcOWLUtils.listPropertysets(space.asResource(), ifcOWL).stream().map(rn -> rn.asResource()).forEach(propertyset -> {
PropertySet p_set = this.propertysets.get(propertyset.getURI());
if (p_set != null) {
p_set.connect(spo, uncompressed_guid_space);
- // This knows if the element has an isExtrenal -property and the value
+ if(!isExternal.isPresent())
+ isExternal.overwriteIfPresent(p_set.isExternal());
}
});
- //TODO bot:containsElement between storey and element is incorrectly converted from IFC #1
IfcOWLUtils.listContained_SpaceElements(space.asResource(), ifcOWL).stream().map(rn -> rn.asResource()).forEach(element -> {
- connectElement(spo, element);
+ Resource lbd_element=connectIfcContaidedElement(spo, element);
+ if(lbd_element!=null)
+ storey.addProperty(LBD_NS.BOT.containsElement, lbd_element);
});
- //TODO bot:containsElement between storey and element is incorrectly converted from IFC #1
IfcOWLUtils.listAdjacent_SpaceElements(space.asResource(), ifcOWL).stream().map(rn -> rn.asResource()).forEach(element -> {
- connectElement(spo, LBD_NS.BOT.adjacentElement, element);
+ Resource lbd_element=connectElement(spo, LBD_NS.BOT.adjacentElement, element);
+ if(isExternal.isPresent()&&isExternal.get()==true)
+ {
+ if(lbd_element!=null)
+ storey.addProperty(LBD_NS.BOT.adjacentElement, lbd_element);
+
+ }
+ else
+ {
+ if(lbd_element!=null)
+ storey.addProperty(LBD_NS.BOT.containsElement, lbd_element);
+
+ }
});
@@ -228,16 +253,32 @@ protected void conversion(String target_file, boolean hasBuildingElements, boole
}
}
- private void addBoundingBox(Resource sp, String guid) {
+
+ private void addBoundingBox(Resource lbd_resource, String guid) {
if(this.bounding_boxes==null)
return;
try {
+ System.out.println("Bounding box for: "+lbd_resource);
BoundingBox bb = this.bounding_boxes.getBoundingBox(guid);
- if (bb != null && has_geometry.add(sp)) {
+ if (bb != null && has_geometry.add(lbd_resource)) {
Resource sp_blank = this.lbd_general_output_model.createResource();
- sp.addProperty(LBD_NS.GEO.hasGeometry, sp_blank);
+ lbd_resource.addProperty(LBD_NS.GEO.hasGeometry, sp_blank);
sp_blank.addLiteral(LBD_NS.GEO.asWKT, bb.toString());
+ Rectangle rectangle = Rectangle.create(bb.getMin().x, bb.getMin().y, bb.getMin().z, bb.getMax().x, bb.getMax().y, bb.getMax().z);
+ rtree=rtree.add(lbd_resource,rectangle); // rtree is immutable
+ rtree_map.put(rectangle, lbd_resource);
+
+
+ //TODO This is not mature enough
+ /*Iterable> results =
+ rtree.search(rectangle);
+ for(Entry e: results)
+ {
+ if(e.value()!=lbd_resource)
+ e.value().addProperty(LBD_NS.LBD.containsInVolume, lbd_resource);
+ }*/
+
}
} catch (Exception e) { // Just in case IFCOpenShell does not function
// under Tomcat
@@ -260,6 +301,8 @@ private void addBoundingBox(Resource sp, String guid) {
* If the nameless nodes are used.
*/
protected void handlePropertySetData(int props_level, boolean hasPropertiesBlankNodes) {
+ System.out.println("Property sets");
+ eventBus.post(new IFCtoLBD_SystemStatusEvent("Handle Property set data"));
List units = IfcOWLUtils.getProjectSIUnits(ifcOWL, ifcowl_model);
for (RDFNode ru : units) {
@@ -373,7 +416,7 @@ protected void addNamespaces(String uriBase, int props_level, boolean hasBuildin
LBD_NS.GEO.addNameSpace(lbd_general_output_model);
-
+ LBD_NS.LBD.addNameSpace(lbd_general_output_model);
LBD_NS.BOT.addNameSpace(lbd_general_output_model);
if (hasBuildingElements)
LBD_NS.Product.addNameSpace(lbd_product_output_model);
@@ -399,7 +442,8 @@ protected void addNamespaces(String uriBase, int props_level, boolean hasBuildin
}
}
- protected void connectElement(Resource bot_resource, Resource ifc_element) {
+
+ protected Resource connectIfcContaidedElement(Resource bot_resource,Resource ifc_element) {
Optional predefined_type = IfcOWLUtils.getPredefinedData(ifc_element);
Optional ifcowl_type = RDFUtils.getType(ifc_element);
Optional bot_type = Optional.empty();
@@ -408,39 +452,43 @@ protected void connectElement(Resource bot_resource, Resource ifc_element) {
}
System.out.println("Connect element: " + ifc_element);
if (bot_type.isPresent()) {
- Resource eo = createformattedURI(ifc_element, this.lbd_general_output_model, bot_type.get().getLocalName());
+ Resource lbd_element = createformattedURIRecource(ifc_element, this.lbd_general_output_model, bot_type.get().getLocalName());
String guid = IfcOWLUtils.getGUID(ifc_element, this.ifcOWL);
String uncompressed_guid = GuidCompressor.uncompressGuidString(guid);
- addBoundingBox(eo, guid);
- Resource lbd_property_object = this.lbd_product_output_model.createResource(eo.getURI());
+ addBoundingBox(lbd_element, guid);
+ Resource lbd_property_object = this.lbd_product_output_model.createResource(lbd_element.getURI());
if (predefined_type.isPresent()) {
Resource product = this.lbd_product_output_model.createResource(bot_type.get().getURI() + "-" + predefined_type.get());
lbd_property_object.addProperty(RDF.type, product);
}
lbd_property_object.addProperty(RDF.type, bot_type.get());
- eo.addProperty(RDF.type, LBD_NS.BOT.element);
- bot_resource.addProperty(LBD_NS.BOT.containsElement, eo);
-
+ lbd_element.addProperty(RDF.type, LBD_NS.BOT.element);
+
+ bot_resource.addProperty(LBD_NS.BOT.containsElement, lbd_element);
+
IfcOWLUtils.listPropertysets(ifc_element, ifcOWL).stream().map(rn -> rn.asResource()).forEach(propertyset -> {
PropertySet p_set = this.propertysets.get(propertyset.getURI());
if (p_set != null)
- p_set.connect(eo, uncompressed_guid);
+ p_set.connect(lbd_element, uncompressed_guid);
});
- addAttrributes(this.lbd_property_output_model, ifc_element, eo);
+ addAttrributes(this.lbd_property_output_model, ifc_element, lbd_element);
IfcOWLUtils.listHosted_Elements(ifc_element, ifcOWL).stream().map(rn -> rn.asResource()).forEach(ifc_element2 -> {
// if (eo.getLocalName().toLowerCase().contains("space"))
// System.out.println("hosts: " + ifc_element + "--" +
// ifc_element2 + " bot:" +
// eo);
- connectElement(eo, LBD_NS.BOT.hasSubElement, ifc_element2);
+ connectElement(lbd_element, LBD_NS.BOT.hasSubElement, ifc_element2);
});
IfcOWLUtils.listAggregated_Elements(ifc_element, ifcOWL).stream().map(rn -> rn.asResource()).forEach(ifc_element2 -> {
- connectElement(eo, LBD_NS.BOT.hasSubElement, ifc_element2);
+ connectElement(lbd_element, LBD_NS.BOT.hasSubElement, ifc_element2);
});
+ return lbd_element;
}
+ return null;
}
+
/**
* For a RDF LBD resource, creates the targetted object for the given
@@ -454,7 +502,7 @@ protected void connectElement(Resource bot_resource, Resource ifc_element) {
* @param ifcowl_element
* The corresponding ifcOWL elemeny
*/
- protected void connectElement(Resource bot_resource, Property bot_property, Resource ifcowl_element) {
+ protected Resource connectElement(Resource bot_resource, Property bot_property, Resource ifcowl_element) {
Optional predefined_type = IfcOWLUtils.getPredefinedData(ifcowl_element);
Optional ifcowl_type = RDFUtils.getType(ifcowl_element);
Optional lbd_product_type = Optional.empty();
@@ -463,8 +511,8 @@ protected void connectElement(Resource bot_resource, Property bot_property, Reso
}
if (lbd_product_type.isPresent()) {
- Resource lbd_object = createformattedURI(ifcowl_element, this.lbd_general_output_model, lbd_product_type.get().getLocalName());
- Resource lbd_property_object = this.lbd_product_output_model.createResource(lbd_object.getURI());
+ Resource lbd_element = createformattedURIRecource(ifcowl_element, this.lbd_general_output_model, lbd_product_type.get().getLocalName());
+ Resource lbd_property_object = this.lbd_product_output_model.createResource(lbd_element.getURI());
if (predefined_type.isPresent()) {
Resource product = this.lbd_product_output_model.createResource(lbd_product_type.get().getURI() + "-" + predefined_type.get());
@@ -472,10 +520,10 @@ protected void connectElement(Resource bot_resource, Property bot_property, Reso
}
lbd_property_object.addProperty(RDF.type, lbd_product_type.get());
- lbd_object.addProperty(RDF.type, LBD_NS.BOT.element);
+ lbd_element.addProperty(RDF.type, LBD_NS.BOT.element);
- addAttrributes(this.lbd_property_output_model, ifcowl_element, lbd_object);
- bot_resource.addProperty(bot_property, lbd_object);
+ addAttrributes(this.lbd_property_output_model, ifcowl_element, lbd_element);
+ bot_resource.addProperty(bot_property, lbd_element);
IfcOWLUtils.listHosted_Elements(ifcowl_element, ifcOWL).stream().map(rn -> rn.asResource()).forEach(ifc_element2 -> {
// if
// (lbd_object.getLocalName().toLowerCase().contains("space"))
@@ -483,21 +531,19 @@ protected void connectElement(Resource bot_resource, Property bot_property, Reso
// .println("hosts2: " + ifcowl_element + "-->" + ifc_element2 +
// " bot:" +
// lbd_object);
- connectElement(lbd_object, LBD_NS.BOT.hasSubElement, ifc_element2);
+ connectElement(lbd_element, LBD_NS.BOT.hasSubElement, ifc_element2);
});
IfcOWLUtils.listAggregated_Elements(ifcowl_element, ifcOWL).stream().map(rn -> rn.asResource()).forEach(ifc_element2 -> {
- connectElement(lbd_object, LBD_NS.BOT.hasSubElement, ifc_element2);
+ connectElement(lbd_element, LBD_NS.BOT.hasSubElement, ifc_element2);
});
- } else {
- //IFC Virtual Elements not found #4
- // There is no need to show that we have non-LBD types in the IFC model
- //System.err.println("No type: " + ifcowl_element);
- }
+ return lbd_element;
+ }
+ return null;
}
- protected Set handledSttributes4resource = new HashSet<>();
+ protected Set handledAttributes4resource = new HashSet<>();
/**
* Creates and adds the literal triples from the original ifcOWL resource
@@ -512,7 +558,7 @@ protected void connectElement(Resource bot_resource, Property bot_property, Reso
* resource.
*/
protected void addAttrributes(Model output_model, Resource r, Resource bot_r) {
- if (!handledSttributes4resource.add(r)) // Tests if the attributes are
+ if (!handledAttributes4resource.add(r)) // Tests if the attributes are
// added already
return;
String guid = IfcOWLUtils.getGUID(r, this.ifcOWL);
@@ -566,7 +612,7 @@ protected void addAttrributes(Model output_model, Resource r, Resource bot_r) {
* The LBD product type to be shown on the URI
* @return
*/
- protected Resource createformattedURI(Resource r, Model m, String product_type) {
+ protected Resource createformattedURIRecource(Resource r, Model m, String product_type) {
String guid = IfcOWLUtils.getGUID(r, this.ifcOWL);
if (guid == null) {
String localName = r.getLocalName();
@@ -902,7 +948,7 @@ protected void addGeolocation2BOT() {
IfcOWLUtils.listSites(ifcOWL, ifcowl_model).stream().map(rn -> rn.asResource()).forEach(site -> {
// Create a resource and add to bot model (resource, model, string)
- Resource sio = createformattedURI(site, lbd_general_output_model, "Site");
+ Resource sio = createformattedURIRecource(site, lbd_general_output_model, "Site");
// Create a resource geosparql:Feature;
Resource geof = lbd_general_output_model.createResource("http://www.opengis.net/ont/geosparql#Feature");
@@ -942,4 +988,23 @@ protected void addGeolocation2BOT() {
eventBus.post(new IFCtoLBD_SystemStatusEvent("LDB geom read"));
}
+
+ public static void main(String[] args) {
+ RTree rtree= RTree.dimensions(3).create();
+
+
+ Rectangle rectangle = Rectangle.create(-0.5, -0.5, -0.5, 0.1, 0.1, 0.1);
+ Resource r1=ResourceFactory.createResource("http://example.de/1");
+ rtree=rtree.add(r1,rectangle); // rtree is immutable
+
+
+ Rectangle rectangle2 = Rectangle.create(0.1, 0.1, 0.1, 1, 1, 1);
+
+ Iterable> results =
+ rtree.search(rectangle2);
+ for(Entry e: results)
+ {
+ System.out.println(""+e.value());
+ }
+ }
}
diff --git a/converter/src/main/java/org/linkedbuildingdata/ifc2lbd/core/utils/ChangeableOptonal.java b/converter/src/main/java/org/linkedbuildingdata/ifc2lbd/core/utils/ChangeableOptonal.java
new file mode 100644
index 00000000..7247b044
--- /dev/null
+++ b/converter/src/main/java/org/linkedbuildingdata/ifc2lbd/core/utils/ChangeableOptonal.java
@@ -0,0 +1,31 @@
+package org.linkedbuildingdata.ifc2lbd.core.utils;
+
+import java.util.Optional;
+
+public class ChangeableOptonal {
+ private Optional value = Optional.empty();
+
+ public void setValue(type value) {
+ this.value = Optional.of(value);
+ }
+
+ public type get() {
+ return value.get();
+ }
+
+
+ public Optional getValue() {
+ return value;
+ }
+
+ public void overwriteIfPresent(Optional value) {
+ if(value.isPresent())
+ this.value = value;
+ }
+
+ public boolean isPresent()
+ {
+ return value.isPresent();
+ }
+
+}
diff --git a/converter/src/main/java/org/linkedbuildingdata/ifc2lbd/core/valuesets/PropertySet.java b/converter/src/main/java/org/linkedbuildingdata/ifc2lbd/core/valuesets/PropertySet.java
index 149e002b..cf577834 100644
--- a/converter/src/main/java/org/linkedbuildingdata/ifc2lbd/core/valuesets/PropertySet.java
+++ b/converter/src/main/java/org/linkedbuildingdata/ifc2lbd/core/valuesets/PropertySet.java
@@ -225,7 +225,7 @@ public Optional isExternal()
{
if(!val.isLiteral())
return Optional.empty();
- if(val.asLiteral().getString().toLowerCase().contains("true"))
+ if(val.asLiteral().getValue().equals(true))
return Optional.of(true);
else
return Optional.of(false);
diff --git a/converter/src/main/java/org/linkedbuildingdata/ifc2lbd/namespace/LBD_NS.java b/converter/src/main/java/org/linkedbuildingdata/ifc2lbd/namespace/LBD_NS.java
index aba37e9f..c60b80f5 100644
--- a/converter/src/main/java/org/linkedbuildingdata/ifc2lbd/namespace/LBD_NS.java
+++ b/converter/src/main/java/org/linkedbuildingdata/ifc2lbd/namespace/LBD_NS.java
@@ -39,6 +39,23 @@ public static void addNameSpace(Model model)
}
}
+
+
+
+
+ public static class LBD {
+ public static final String lbd_ns = "https://linkebuildingdata.org/LBD#";
+
+
+ public static final Property containsInVolume =property(lbd_ns,"containsInVolume");
+ public static final Property isContainedIn3D =property(lbd_ns,"isContainedIn3D");
+ public static void addNameSpace(Model model)
+ {
+ model.setNsPrefix("lbd", lbd_ns);
+ }
+
+ }
+
public static class BOT {
public static final String bot_ns = "https://w3id.org/bot#";
@@ -67,8 +84,8 @@ public static void addNameSpace(Model model)
public static class Product {
public static final String beo_ns = "https://pi.pauwel.be/voc/buildingelement#";
- public static final String furnishing_ns = "https://pi.pauwel.be/voc/furniture#";
- public static final String mep_ns = "https://pi.pauwel.be/voc/distributionelement#";
+ public static final String furnishing_ns = "http://pi.pauwel.be/voc/furniture#";
+ public static final String mep_ns = "http://pi.pauwel.be/voc/distributionelement#";
public static void addNameSpace(Model model)
{
diff --git a/desktop_java11/src/license/THIRD-PARTY.properties b/desktop_java11/src/license/THIRD-PARTY.properties
index 34a69837..fe7e9515 100644
--- a/desktop_java11/src/license/THIRD-PARTY.properties
+++ b/desktop_java11/src/license/THIRD-PARTY.properties
@@ -49,5 +49,5 @@
# Please fill the missing licenses for dependencies :
#
#
-#Thu Oct 01 15:26:43 CEST 2020
+#Fri Oct 02 18:07:50 CEST 2020
gnu.getopt--java-getopt--1.0.13=
diff --git a/desktop_java8/src/license/THIRD-PARTY.properties b/desktop_java8/src/license/THIRD-PARTY.properties
index d529b89b..eb2cc2a6 100644
--- a/desktop_java8/src/license/THIRD-PARTY.properties
+++ b/desktop_java8/src/license/THIRD-PARTY.properties
@@ -49,5 +49,5 @@
# Please fill the missing licenses for dependencies :
#
#
-#Thu Oct 01 13:50:39 CEST 2020
+#Fri Oct 02 20:11:37 CEST 2020
gnu.getopt--java-getopt--1.0.13=