Hello Scott,
I'll have a look.
 
partial choices: in attached ontology when I wanted to add existing individuals 
of WallSegment as parts for my Wall individuals.
 
if you want to reproduce:
1. go to Wall1 of Class Wall
2. at hasPart_directly widget do "add existing"' (there are already 2 
individuals there)
3. the list on the right has no scroll bar only after you select again the 
already selected owl:Thing
(I added some dummy individuals to make the problem apperent otherwise the list 
was too short...)
 
ps
this is the same ontology of the inference problem....you get the error when 
you run Inferences and then try to look at Wall1 again...(anyway I study your 
examples too)
 
 
 

   TNO.NL

 

Michel Böhms

Consultant Building Innovation
 

TNO Built Environment and Geosciences

Van Mourik Broekmanweg 6 | PO Box 49 | 2600 AA Delft | The Netherlands

 

 

T +31 15 2763107

M +31 6 30381220
E  michel.bo...@tno.nl <blocked::blocked::blocked::mailto:michel.bo...@tno.nl>  

 

 

Disclaimer 
<blocked::http://www.tno.nl/content.cfm?&context=overtno&content=overtnosub&laag1=282&item_id=72&Taal=2>
  

 

 
 
 
 
 
 
 

________________________________

From: topbraid-composer-users@googlegroups.com 
[mailto:topbraid-composer-us...@googlegroups.com] On Behalf Of Scott Henninger
Sent: 17 March 2009 15:44
To: topbraid-composer-users@googlegroups.com
Subject: [tbc-users] Re: own functions in spin:rules


It seems that somewhere the function is not getting defined in the right 
places.  Attached is a minimal file that calls the function in a spin:rule.

<...when you 'add existing' (and owl:Thing is higlighted) ther is only a 
partial set of choices...>

Where exactly is this happening?
-- Scott

Bohms, H.M. (Michel) wrote: 

         
        Dear Scot,
        
        All red boxes resolved.
        
        But when executing: no error, but when I try to look at an individual 
for its derived value (totalCost of say House1):
        Operation Failed, Reason: Could not execute query; attempt to get a 
CONSTRUCT model from a slect query.
        
        
        
        Ps
        Small other issue: when you 'add existing' (and owl:Thing is 
higlighted) ther is only a partial set of choices on the right side; only after 
you select manually owl:Thing you can scroll (ie initially the scroll bar is 
missing..).
         
         
         
         
         
        
        -----Original Message-----
        From: topbraid-composer-users@googlegroups.com 
[mailto:topbraid-composer-us...@googlegroups.com] On Behalf Of Scott Henninger
        Sent: 17 March 2009 14:48
        To: TopBraid Composer Users
        Subject: [tbc-users] Re: own functions in spin:rules
        
        
        Michel;  The red box indicates syntax errors, which are shown in the 
status bar at the bottom of Composer.  The first syntax error is to encapsulate 
the AS statement with parentheses:
           SELECT (SUM(?cost) AS ?totalCost)
        
        The second is to use the variable name ?arg1 - i.e. the "?" is missing.
        
        When a function is created, it exists in your ontology as a URI.
        Therefore you need to use a qname or full URI to name the function,
        i.e.:
          :sumFunction() or <http://myStuff.org/funct#sumFunction> 
<http://myStuff.org/funct#sumFunction> ()
        
        Give that a try.
        -- Scott
        
        On Mar 17, 8:11 am, Michel Bohms <michel.bo...@gmail.com> 
<mailto:michel.bo...@gmail.com>  wrote:
          

                 Replying myself after reading the manual :)
                
                I now first defined a subclass of sp:Functions called 
sumFunction.
                Then I defined a spin:constraint for it: Argument sp:arg1 : 
House
                
                Finally I defined a body for it (delete at House...):
                
                SELECT SUM(?cost) AS ?totalCost
                WHERE {
                    arg1 :hasPart_transitive ?Part .
                    ?Part :cost ?cost .
                    OPTIONAL {
                        ?Part :hasPart_directly ?anotherPart .
                    } .
                    FILTER (!bound(?anotherPart)) .
                
                }
                
                still 2 problems:
                
                1. the box for the body stays red
                2. at House: the box for the spin:rule:
                
                CONSTRUCT {?this :totalCost ?totalCost } WHERE { LET 
(?totalCost := 
                sumFunction (?this)).}
                
                is still red (despite the function is now known...).
                
                Feel I am getting closer....thx for getting it to work!
                
                Michel
                
                On 17 mrt, 13:28, Michel Bohms <michel.bo...@gmail.com> 
<mailto:michel.bo...@gmail.com>  wrote:
                
                    

                        Hi Holger,
                              

                        In earlier mails we discussed the determination of 
totalCost (of 
                        some
                        'whole') via a helper function.
                              

                        When I do as spin:rule:
                              

                        CONSTRUCT {?this :totalCost ?totalCost } WHERE { LET 
(?totalCost := 
                        sumFunction (?this)).
                              

                        }
                              

                        it seems the box stays red although I defined:
                              

                        a spin:body
                              

                        SELECT SUM(?cost) AS ?totalCost
                        WHERE {
                            ?this :hasPart_transitive ?Part .
                            ?Part :cost ?cost .
                            OPTIONAL {
                                ?part :hasPart_directly ?anotherPart .
                            } .
                            FILTER (!bound(?anotherPart)) .
                              

                        }
                              

                        clearly I am missing the "sumFuction" definition itself 
but how do I 
                        do that ? (assuming SUM is now implemented in the 
latest beta).
                              

                        (to refresh your memory: the idea was to calculate the 
cost of the 
                        whole by counting all the leaf part's cost via querying 
over the all 
                        transitive parts and then filter out the atomic leafs)
                              

                        thx a lot, Michel
                              

        
        This e-mail and its contents are subject to the DISCLAIMER at 
http://www.tno.nl/disclaimer/email.html
        
        
        
        
          




This e-mail and its contents are subject to the DISCLAIMER at 
http://www.tno.nl/disclaimer/email.html

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"TopBraid Composer Users" group.
To post to this group, send email to topbraid-composer-users@googlegroups.com
To unsubscribe from this group, send email to 
topbraid-composer-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/topbraid-composer-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Attachment: test3.owl
Description: test3.owl

Reply via email to