Search Mailing List Archives


Limit search to: Subject & Body Subject Author
Sort by: Reverse Sort
Limit to: All This Week Last Week This Month Last Month
Select Date Range     through    

[protege-discussion] Add instances to multislot

Samson Tu swt at stanford.edu
Mon Mar 26 09:32:09 PDT 2007


Hi,

You can link instances from multiple hierarchies using Jess. It would 
help if you tell use exactly what your classes and slots are.

In your Jess example, ?f, ?u, and ?s are being bound to Jess facts, not 
object instances. To bind the variable ?u to the object corresponding to 
the fact

(object (Object_Id ?m))

instead of ?u <- (object (Object_Id ?m)), you need

(object (Object_Id ?m)(OBJECT ?u))

Similarly for ?s (object (ID ?n)(OBJECT ?s))

Then on the RHS, you can have

(slot-insert$ ?u linksToS ?s)


Thane Hall wrote:
> I am new to Jess and JessTab in Protege but having worked this 
> (relatively simple?) problem now for 12 hours and having read everything 
> I can possible find on the internet I am now issuing a cry for help!
> 
>  
> 
> I am trying to link two sets of instances (contained in separate class 
> hierarchies) together with the contents of an imported table 
> (Link_Table). I have a multislot (type instance) "linksToS" in all of 
> the instance ?u objects which I want to contain references to the 
> relevant instance ?s objects. The LHS identifies the correct instances 
> that need to be linked (U_Trial identifies the right ?u object by 
> searching on Object_Id and S_Trial identifies the right ?s object by 
> searching on ID ) but I can't get the multislot to populate. I have 
> tried more or less everything and the only partial success I had was 
> using 'slot-set' but that clearly isn’t going to populate a multi-slot 
> with multiple instance references. I think I should be using either 
> create$ and/or modify and/or slot-insert$ but I can't get any of these 
> to work.
> 
>  
> 
> It must be possible to do this in Jess. Any help would be greatly 
> appreciated!
> 
>  
> 
> My current best Jess guess is:
> 
>  
> 
> (defrule MAIN::link_matching_instances
> 
>    ?f <- (object (is-a Link_Table) (U_Trial ?m) (S_Trial ?n))
> 
>    ?u <- (object (Object_Id ?m))
> 
>    ?s <- (object (ID ?n))
> 
>    =>
> 
>    (printout t "Matching entries: " ?u ?s crlf)
> 
>    (modify ?u (linksToS ?s)))
> 
>  
> 
> Thanks in advance.
> 
>  
> 
> Thane
> 
>  
> 
> 
> ------------------------------------------------------------------------
> 
> _______________________________________________
> protege-discussion mailing list
> protege-discussion at lists.stanford.edu
> https://mailman.stanford.edu/mailman/listinfo/protege-discussion
> 
> Instructions for unsubscribing: http://protege.stanford.edu/doc/faq.html#01a.03 


-- 
Samson Tu                    email: swt at stanford.edu
Senior Research Scientist    web: www.stanford.edu/~swt/
Stanford Medical Informatics phone: 1-650-725-3391
Stanford University          fax: 1-650-725-7944




More information about the protege-discussion mailing list