Skip to content

Commit

Permalink
[master] Change sameas predicate
Browse files Browse the repository at this point in the history
  • Loading branch information
wojciechteclaw committed Jan 30, 2024
1 parent e6e59ac commit bbddf0c
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 9 deletions.
2 changes: 1 addition & 1 deletion src/enums/connection.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
enum Connection {
SAME_AS,
GEOMETRICALLY_EQUIVALENT,
CONNECTED_PORT,
HAS_FLUID_SUPPLIED_BY,
CONNECTED_WITH,
Expand Down
8 changes: 4 additions & 4 deletions src/helpers/semantic_operations.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,12 @@ class SemanticOperations {
): void {
let connectionSpecificTriples: oxigraph.Quad[] = [];
switch (connection.relation) {
case Connection.SAME_AS:
case Connection.GEOMETRICALLY_EQUIVALENT:
connectionSpecificTriples = this.generateTriplesForSameAsConnection(connection);
break;
case Connection.CONNECTED_PORT:
connectionSpecificTriples = this.generateTriplesForMepElements(connection);
console.log(connectionSpecificTriples)
console.log(connectionSpecificTriples);
break;
default:
break;
Expand Down Expand Up @@ -101,8 +101,8 @@ class SemanticOperations {

private static getPredicateFromConnection(connection: Connection): oxigraph.NamedNode {
switch (connection) {
case Connection.SAME_AS:
return oxigraph.namedNode("http://www.w3.org/2002/07/owl#sameAs");
case Connection.GEOMETRICALLY_EQUIVALENT:
return oxigraph.namedNode("https://example.com/ex#geometricallyEquivalent");
case Connection.CONNECTED_PORT:
return oxigraph.namedNode("https://w3id.org/fso#connectedPort");
case Connection.CONNECTED_WITH:
Expand Down
1 change: 1 addition & 0 deletions src/services/connectors_manager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ class ConnectorsManager {
await Promise.all(promises).then((elements) => {
this.connectors.push(...elements);
});
console.log(this.connectors);
}

public getAllUnconnectedElements(): IfcElement[] {
Expand Down
2 changes: 2 additions & 0 deletions src/services/files_service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@ class FilesService {
}

private async discoverModelsConnections(): Promise<void> {
console.time("Model federation took:");
const modelIDs = Array.from(this.models.keys());
const modelIDpairs = FilesService.getModelIdForComparison(modelIDs);
const connectedElements: ConnectedElements[] = [];
Expand All @@ -110,6 +111,7 @@ class FilesService {
let connectionTriples = [];
SemanticOperations.getTriplesFromConnectedElements(connectedElements, connectionTriples);
await dbDataController.addQuadsToStore(connectionTriples);
console.timeEnd("Model federation took:");
}

private static getModelIdForComparison(modelIDs: number[]): Array<Array<number>> {
Expand Down
7 changes: 3 additions & 4 deletions src/services/ifc_controller_service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ import { ConnectorsManager } from "@services/connectors_manager";
import { ElementPlacementService } from "@services/element-placement.service";

class IfcControllerService {

private ifcAPI: IfcAPI = new IfcAPI();
constructor() {
this.ifcAPI.SetWasmPath("./assets/");
Expand All @@ -29,7 +28,7 @@ class IfcControllerService {
const connectorManager = new ConnectorsManager(this.ifcAPI);
await connectorManager.addUnconnectedConnectors(modelID);
const elementPlacementService = new ElementPlacementService(this.ifcAPI);
await elementPlacementService.getElementsCoordinates(modelID)
await elementPlacementService.getElementsCoordinates(modelID);
return connectorManager.getAllUnconnectedElements();
}

Expand Down Expand Up @@ -83,15 +82,15 @@ class IfcControllerService {
connections,
Representation.LEVEL,
ElementsComparison.compareStringRepresentations,
Connection.SAME_AS
Connection.GEOMETRICALLY_EQUIVALENT
),
ElementsComparison.compareElements(
model1Elements,
model2Elements,
connections,
Representation.SPACE,
ElementsComparison.compareGeometryRepresentations,
Connection.SAME_AS
Connection.GEOMETRICALLY_EQUIVALENT
),
ElementsComparison.compareConnectors(model1Elements, model2Elements, connections, Representation.CONNECTOR),
]);
Expand Down

0 comments on commit bbddf0c

Please sign in to comment.