Hello guys,
So my usecase is a building model (as in construction), which has been converted into turtle triples. Thus I have windows, walls etc. represented by rdf and owl.
Now I need to find all windows contained in walls and this can be done by the following rule in Stardog:
# Rule to find windows in walls
[] a rule:SPARQLRule ;
rule:content """
IF {
?ifcrelfill a ifcowl:IfcRelFillsElement ;
ifcowl:relatingOpeningElement_IfcRelFillsElement ?openingelement ;
ifcowl:relatedBuildingElement_IfcRelFillsElement ?window .
?window a ifcowl:IfcWindow .
?voidelement a ifcowl:IfcRelVoidsElement ;
ifcowl:relatedOpeningElement_IfcRelVoidsElement ?openingelement ;
ifcowl:relatingBuildingElement_IfcRelVoidsElement ?wall .
?wall a ifcowl:IfcWallStandardCase .
}
THEN {
?window expr:hasString "window in wall"
}""".
Now that is fine and good. However I need to create a product-id for these windows and these id's are created on the basis of letters and a running number: QQA#runningnumber.
The letters are the same for all resulting instances of windows from this rule. But the runningnumber is based on the order in which the windows were placed while designing the BIM model. So my question is: Is there a way to give each instance resulting from a rule a identification number, so that it would look something like this:
inst:window_222 :id QQA1
inst:window_212 :id QQA2
inst:window_525 :id QQA3 ..