Hi guys,
So I have a bunch of data, an ontology and some rulesets that combined should give me some results.
The basics of it is this:
I have some instances of rdf:type ifcowl:IfcWallStandardCase.
My ontology states that a class ccs:WallStructure owl:equivalentClass ifcowl:IfcWallStandardCase .
Then I do some computing and I get results like this for the following properties:
?wall ccs:singleLevelID “AD2”
?wall ccs:typeID “AD1” …
Another property related to this is ccs:singleLevelLocationAtID that is found from the following ruleset:
# Rule for CCSSingleLevelLocationAtID for elements inside storey->space (Lokations-ID). 
[] a rule:SPARQLRule ;
    rule:content """
            IF {
            ?relcontains a ifcowl:IfcRelContainedInSpatialStructure ;
                    ifcowl:relatedElements_IfcRelContainedInSpatialStructure ?el ;
                    ifcowl:relatingStructure_IfcRelContainedInSpatialStructure  ?space .        
            ?space a ifcowl:IfcSpace ;
                    ccs:singleLevelID ?SpaceID .         
            
            ?rel a ifcowl:IfcRelAggregates ;
                ifcowl:relatingObject_IfcRelAggregates ?storey ;
                ifcowl:relatedObjects_IfcRelAggregates ?space .
            ?storey ccs:singleLevelID ?sID .   
            ?el ccs:singleLevelID ?elID . 
            BIND(REPLACE(?SpaceID, "#", " ", "i") AS ?sID2)  
            BIND (CONCAT("++", ?sID, ".", ?sID2 , "." , ?elID) AS ?elementinspaceID)                
            }
            THEN {
            ?el ccs:singleLevelLocationAtID ?elementinspaceID .     
            }""".
This is partly based on the dataset, but also on the following rulesets:
# Rule for Storey classification and identification . 
[] a rule:SPARQLRule ;
    rule:content """
            IF {
            ?storey a ifcowl:IfcBuildingStorey ;
                ifcowl:name_IfcRoot/express:hasString ?string . 
            BIND (substr(?string, strlen(?string)) AS ?levelno) .
            ## E is the prefix for storey ## 
            
            BIND (CONCAT("E", ?levelno) AS ?storeyID)
                    
            }
            THEN {
            ?storey ccs:singleLevelID ?storeyID .
            }""".
# Rule for Space classification and identification . 
[] a rule:SPARQLRule ;
    rule:content """
            IF {
            ?space a ifcowl:IfcSpace ;
                ifcowl:name_IfcRoot/express:hasString ?roomno .
            ## R is the prefix for space ## 
            
            BIND (CONCAT("#","R", ?roomno) AS ?spaceID)
                    
            }
            THEN {
            ?space ccs:singleLevelID ?spaceID .
            }""".
So to sum it up and get the results I want i run the following query in the Stardog webdatabase:
select *
where {
  ?uri a ccs:WallStructure ; 
        ifcowl:globalId_IfcRoot/express:hasString ?guid ; 
        ccs:singleLevelID ?ID .
  OPTIONAL {?uri ifcowl:objectType_IfcObject/express:hasString ?type2 .}
  OPTIONAL {?uri ccs:typeID ?typeID .}
  OPTIONAL {?uri ccs:topNode ?topNode .}
  OPTIONAL {?uri ccs:singleLevelLocationAtID ?locationID .}
  
  }
But when I run this it just keep thinking (the blue bar to just seems to be loading) and my testcase only has 14 instances of ccs:WallStructure … So i dont know what to do about this… is the rules too much for the reasoner? Can I make the reasoner work faster? Any input would be appreciated.