[ { "title": "0: Introduction", "description": [ "This is a test" ], "query": "", "triples": "" }, { "title": "1.1: Wall - architect's dataset", "description": [ "The triples tab holds the architect's dataset. The query is just a `CONSTRUCT` query, which returns the full graph." ], "query": [ "PREFIX rdf: ", "PREFIX props: ", "PREFIX bsdd: ", "PREFIX ifc: \n", "CONSTRUCT", "WHERE {", "\t?subject ?predicate ?object", "}" ], "triples": [ "@prefix bot: .", "@prefix rdf: .", "@prefix prod: .", "@prefix props: .", "@prefix ifc: .", "@prefix bsdd: .\n", " a bot:Element , prod:Wall , ifc:IfcWall ;", "\tprops:area \"20.3 m2\" ;", "\tbsdd:area \"20.3 m2\" ." ] }, { "title": "1.2: Wall - querying properties", "description": [ "Doing a `SELECT` query on the dataset will return a table with the results. This example returns all the properties defined in the architect's dataset." ], "query": [ "SELECT ?property ?value", "WHERE {", "\t ?property ?value", "}" ], "triples": [ "@prefix bot: .", "@prefix rdf: .", "@prefix prod: .", "@prefix props: .", "@prefix ifc: .", "@prefix bsdd: .\n", " a bot:Element , prod:Wall , ifc:IfcWall ;", "\tprops:area \"20.3 m2\" ;", "\tbsdd:area \"20.3 m2\" ." ] }, { "title": "1.3: Wall - full dataset", "description": [ "In this example, also data from the HVAC engineer and the structural engineer is included in the dataset. Try to do the query from the previous step to get all the properties of the wall including the ones not defined by the architect." ], "query": [ "PREFIX rdf: ", "PREFIX props: ", "PREFIX bsdd: ", "PREFIX stat: ", "PREFIX ds418: ", "PREFIX ifc: \n", "CONSTRUCT", "WHERE {", "\t?subject ?predicate ?object", "}" ], "triples": [ "@prefix bot: .", "@prefix rdf: .", "@prefix prod: .", "@prefix props: .", "@prefix ifc: .", "@prefix bsdd: .", "@prefix stat: .", "@prefix ds418: .\n", "# ARCHITECT'S DATASET", " a bot:Element , prod:Wall , ifc:IfcWall ;", "\tprops:area \"20.3 m2\" ;", "\tbsdd:area \"20.3 m2\" .\n", "# HVAC ENGINEER'S DATASET", " props:uValue \"0.21 W/m2K\" .", " a bot:Interface ;", "\tbot:interfaceOf ;", "\tprops:surfaceResistance \"0.13 m2K/W\" ;", "\tprops:area \"10.5 m2\" ;", "\tds418:heatTransmissionArea \"10.5 m2\" .\n", "# STRUCTURAL ENGINEER'S DATASET", " props:concreteStrength \"20 MPa\" ;", "\tbsdd:strength \"20 MPa\" ;", "\tstat:reinforcementDefinition .", " a stat:ReinforcementDefinition ;", "\tstat:verticalBars \"5 bars/m\" ;", "\tstat:horisontalBars \"5 bars/m\" ." ] }, { "title": "1.4: Wall - interface", "description": [ "This is a query to return the DS418 heat transfer area of all interfaces of walls. In `SELECT *` the asterisk symbol specifies that all variables should be returned." ], "query": [ "PREFIX prod: ", "PREFIX bot: ", "PREFIX ds418: \n", "SELECT *", "WHERE {", "\t?wall a prod:Wall .", "\t?interface a bot:Interface ;", "\t\tbot:interfaceOf ?wall ;", "\t\tds418:heatTransmissionArea ?htArea .", "}" ], "triples": [ "@prefix bot: .", "@prefix rdf: .", "@prefix prod: .", "@prefix props: .", "@prefix ifc: .", "@prefix bsdd: .", "@prefix stat: .", "@prefix ds418: .\n", "# ARCHITECT'S DATASET", " a bot:Element , prod:Wall , ifc:IfcWall ;", "\tprops:area \"20.3 m2\" ;", "\tbsdd:area \"20.3 m2\" .\n", "# HVAC ENGINEER'S DATASET", " props:uValue \"0.21 W/m2K\" .", " a bot:Interface ;", "\tbot:interfaceOf ;", "\tprops:surfaceResistance \"0.13 m2K/W\" ;", "\tprops:area \"10.5 m2\" ;", "\tds418:heatTransmissionArea \"10.5 m2\" .\n", "# STRUCTURAL ENGINEER'S DATASET", " props:concreteStrength \"20 MPa\" ;", "\tbsdd:strength \"20 MPa\" ;", "\tstat:reinforcementDefinition .", " a stat:ReinforcementDefinition ;", "\tstat:verticalBars \"5 bars/m\" ;", "\tstat:horisontalBars \"5 bars/m\" ." ] }, { "title": "2.1: Systems - full dataset", "description": [ "This is a full overview of the dataset used for Case 2." ], "query": [ "PREFIX rdf: ", "PREFIX fso: ", "PREFIX pto: ", "PREFIX owl: ", "PREFIX bot: ", "PREFIX ice: \n", "CONSTRUCT", "WHERE {", "\t?s ?p ?o", "}" ], "triples": [ "@prefix bot: .", "@prefix rdf: .", "@prefix rdfs: .", "@prefix owl: .", "@prefix pto: .", "@prefix ice: .", "@prefix fso: .\n", "#FSO TBOX", "fso:heatedBy a owl:ObjectProperty ;", "\trdfs:range fso:Heater .\n", "# ARCHITECT'S DATASET", " a bot:Space .", " a bot:Space .\n", "# ICE ENGINEER'S DATASET", " ice:heatingDemand \"550 W\" .", " ice:heatingDemand \"500 W\" .\n", "# HVAC ENGINEER'S DATASET", " fso:heatedBy .", " fso:heatedBy , .", " a pto:Radiator ;", "\tfso:heatOutput \"200 W\" .", " a pto:Radiator ;", "\tfso:heatOutput \"200 W\" .", " a pto:Radiator ;", "\tfso:heatOutput \"600 W\" ." ] }, { "title": "2.2: Systems - heating demand vs. heat output", "description": [ "*NB! This is query only works with Stardog.*", "The query compares the heating demand of each space to the total output of the devices that heat the room. The query is constructed in the following way:\n", "First anything that is classified as a `bot:Space` is assigned variable `?space`. The space must have a heating demand assigned in order to do the check so the triple `?space ice:heatingDemand ?hd` must also return a result. The heating demand is assigned to variable `?hd`. `?hd` needs to be converted to a decimal number in order to do calculations with it, and this is accomplished using a `BIND`. The `BIND` method also checks if the string contains a space and if so, only takes what is before the space, thereby stripping the unit. The decimal number is assigned to variable `?heatingDemand`\n", "Next step is to sum the total heat output of everything that heats the space. A subquery is used for this purpose. This query checks for `fso:heatedBy` relationships from the spaces and thereby achieves all heat sources that supply heat to the space. The `fso:heatOutput` of these is found, converted to a decimal number and assigned to variable `?hoNumber`. The subquery groups the results by variable `?space` and returns the sum of `?hoNumber`.\n", "The last step is to use two `BIND` methods to calculate the over capacity and check if the heat requirement is fulfilled.\n", "The result of the query is the following:\n", "| space | heatingDemand | heatOutput | overCapacity | heatRequirementFulfilled ", "| ----------- | ------------- | ---------- | ------------ | ------------------------ ", "| inst:O21 | 500 | 400 | 0.8 | false ", "| inst:O21 | 400 | 500 | 1.25 | true " ], "query": [ "PREFIX bot: ", "PREFIX fso: ", "PREFIX ice: \n", "SELECT ?space ?heatingDemand ?heatOutput ?overCapacity ?heatRequirementFulfilled", "WHERE {", "\t?space a bot:Space ;", "\t\tice:heatingDemand ?hd .\n", "# STRIP UNIT AND CONVERT TO A DECIMAL NUMBER", "\tBIND(if(contains(str( ?hd ), \" \") , xsd:decimal(strbefore(str(?hd), \" \")), xsd:decimal(?hd)) AS ?heatingDemand)\n", "# GET THE TOTAL HEAT OUTPUT OF HEATERS IN THE SPACE", "\t{", "\t\tSELECT ?space (SUM(?hoNumber) AS ?heatOutput) WHERE {", "\t\t\t?space fso:heatedBy ?heater .", "\t\t\t?heater fso:heatOutput ?ho .\n", "\t\t\t# STRIP UNIT AND CONVERT TO A DECIMAL NUMBER", "\t\t\tBIND(if(contains(str( ?ho ), \" \") , xsd:decimal(strbefore(str(?ho), \" \")), xsd:decimal(?ho)) AS ?hoNumber)", "\t\t} GROUP BY ?space", "\t}\n", "\t# CALCULATE OVER CAPACITY", "\tBIND(?heatOutput /?heatingDemand AS ?overCapacity)\n", "\t# CHECK IF REQUIREMENT IS FULFILLED", "\tBIND(IF(?overCapacity > 1, xsd:boolean(true), xsd:boolean(false)) AS ?heatRequirementFulfilled)", "}" ], "triples": [ "@prefix bot: .", "@prefix rdf: .", "@prefix rdfs: .", "@prefix owl: .", "@prefix pto: .", "@prefix ice: .", "@prefix fso: .\n", "#FSO TBOX", "fso:heatedBy a owl:ObjectProperty ;", "\trdfs:range fso:Heater .\n", "# ARCHITECT'S DATASET", " a bot:Space .", " a bot:Space .\n", "# ICE ENGINEER'S DATASET", " ice:heatingDemand \"400 W\" .", " ice:heatingDemand \"500 W\" .\n", "# HVAC ENGINEER'S DATASET", " fso:heatedBy .", " fso:heatedBy , .", " a pto:Radiator ;", "\tfso:heatOutput \"200 W\" .", " a pto:Radiator ;", "\tfso:heatOutput \"200 W\" .", " a pto:Radiator ;", "\tfso:heatOutput \"500 W\" ." ] } ]