Translator for loading SUMO into PowerLoom

Cameron Ross <[email protected]> Tue, 12 Dec 2006 12:16:52 -0500
Newsgroups gmane.comp.ai.powerloom
Message-ID <[email protected]>
Hans/Adam,

My implementation of a translator that will load SUMO into PowerLoom is 
progressing 
(http://pando.svn.sourceforge.net/viewvc/pando/code/java/tools/src/net/sf/pando/tools/suokif).  
I've implemented and tested an ANTLR-based SUO-KIF parser that generates 
an initial Abstract Syntax Tree (AST) for an arbitrary collection of 
SUO-KIF statements.
I currently have tree walkers that transform this initial AST by 
expanding SUO-KIF sequence variables and by adding a dummy relation 
called "holds" to eliminate variables in the predicate position.  I 
believe this functionality is generally useful for loading SUO-KIF 
ontologies into various automated reasoners and have therefore included 
it as part of the main SUO-KIF parser.

I will now implement what I think are the PowerLoom specific 
transformations.  One obvious transformation is to convert SUO-KIF 
language symbols to those defined for PowerLoom (e.g. 'equals' to '=').  
I will obtain these mappings from the PowerLoom grammar documentation. 

Are there any other transforms that must be considered?  For example, 
should I quote all embedded second-order formulas for PowerLoom as Adam 
has done for the Vampire reasoner?  Any recommendations are greatly 
appreciated.

Thanks much,
Cameron.


Adam Pease wrote:
> Hi Cameron,
>   Creating a separate parser and translator would be one way to do it, 
> but it might be faster (and certainly would result in a more tightly 
> integrated system) to make use of the parsing and pre-processing code 
> already available in Sigma (it's open source, by the way).
>   If you look in Sigma's Formula.preProcess() method 
> <http://sigmakee.cvs.sourceforge.net/sigmakee/sigma/src/java/com/articulate/sigma/Formula.java?revision=1.16&view=markup> 
> you'll see a number of things that have to be done in order for 
> Vampire to handle SUO-KIF.  Maybe Hans can address whether these are 
> needed for PowerLoom
>
> - prepend every clause with a dummy relation called "holds", in order 
> to eliminate variables in the predicate position
>
> - translate mathematical operators to symbols handled in Vampire's 
> native implementation of basic arithmetic
>
> - quote all embedded second-order formulas.  While this eliminates the 
> actual semantics of the symbols in the embedded formulas, it at least 
> allows for unification of variables in formulas that would otherwise 
> be rejected by a first-order theorem prover
>
> You could create a new class, cloned from Sigma's Vampire.java that 
> would send commands to PowerLoom.  You'd have to add another 
> pre-processing step appropriate for PowerLoom, and some code to handle 
> the XML-based communication format.  But, you'd gain the whole 
> environment of Sigma, and save time in not having to create your own 
> SUO-KIF parser.
>
> Adam
>
> Cameron Ross wrote:
>> Hi,
>>
>> I'm willing and able to commit some time to this.  I don't have 
>> detailed understanding of PowerLoom or SUMO, but it looks like there 
>> will be enough support to get something accomplished.  I already have 
>> an ANTLR grammar developed for SUO-KIF and can render most of the 
>> Sigma ontologies into their respective Abstract Syntax Trees (ASTs).  
>> It should be a fairly straight forward task to convert a SUO-KIF AST 
>> into a PowerLoom knowledge-base, but there may be some rough spots 
>> where I'll require some feedback.  I'll can cross-post my progress to 
>> both the PowerLoom and Sigma mail lists.
>>
>> Cheers,
>> Cameron.
>>
>> Adam Pease wrote:
>>> Hans,
>>>   Many thanks.  Hopefully, this is what Cameron was looking to do.
>>>
>>> Adam
>>>
>>> Hans Chalupsky wrote:
>>>> Adam,
>>>>
>>>> thanks for the update on SUMO.  I don't have any cycles to integrate
>>>> PowerLoom with Sigma, but I can answer questions in case you find
>>>> somebody to work on that.
>>>>
>>>> Hans
>>>>
>>>>>>>>> Adam Pease <[email protected]> writes:
>>>>
>>>>> Folks,
>>>>>    A colleague was kind enough to forward a copy of your recent 
>>>>> exchange on the powerloom list.  The SUMOtoLOOM work is available 
>>>>> from <http://www.mel.nist.gov/msid/sumo2loom.html>.  Please note 
>>>>> that the main site for SUMO is <http://www.ontologyportal.org>.  I 
>>>>> and the rest of the SUMO team left Teknowledge between 2003 and 
>>>>> 2004, and the IEEE group that was working on SUMO is also inactive.
>>>>>    It would be very exciting to have the Sigma system 
>>>>> <http://sigmakee.sourceforge.net/> be able to call PowerLoom, as 
>>>>> well as the Vampire prover, which is the only prover it currently 
>>>>> supports.
>>>>>    I'd be glad to answer any questions you might have.
>>>>
>>>>> Adam
>>>>
>>>>>> -------- Original Message --------
>>>>>> Subject: [PowerLoom Forum]  PowerLoom and SUMO
>>>>>> Date: Mon, 20 Nov 2006 11:09:08 -0800
>>>>>> From: Hans Chalupsky <[email protected]>
>>>>>> To: Cameron Ross <[email protected]>
>>>>>> CC: [email protected]
>>>>>> References: <[email protected]>
>>>>>>
>>>>>> Cameron,
>>>>>>
>>>>>> it shouldn't be too hard to create a translator from SUO-KIF to
>>>>>> PowerLoom.  There are a few things you need to do:
>>>>>>
>>>>>> (1) You need to create concept and relation definitions for each
>>>>>> concept and relation used in the ontologies before they can be 
>>>>>> used in
>>>>>> assertions.  These definitions can't (yet) be made via assertions 
>>>>>> but
>>>>>> need to be done via `defconcept' and `defrelation' (or 
>>>>>> `deffunction');
>>>>>> however, the definitions can be minimal and simply introduce the 
>>>>>> term
>>>>>> (and arity in the case of relations).  All other information such as
>>>>>> sub/superconcepts/relations, argument domains, rules, etc. can be
>>>>>> generated via standard assertions.  For example:
>>>>>>
>>>>>> (defconcept Person)
>>>>>> (defconcept Animal)
>>>>>> (assert (subset-of Person Animal))
>>>>>> (assert (documentation Person "The class of human beings"))
>>>>>> (defrelation brother (?x ?y))
>>>>>> (assert (nth-domain brother 0 Person))
>>>>>> (assert (nth-domain brother 1 Person))
>>>>>> ....
>>>>>>
>>>>>> That is, all the keywords used in PowerLoom definitions are really
>>>>>> just syntactic sugar and can be handled via standard assertions.
>>>>>>
>>>>>> (2) You need to watch out for subtle differences.  For example, the
>>>>>> SUO-KIF version of `nth-domain' is 1-based while PowerLoom's version
>>>>>> is 0-based (I remember that from some quick attempt of translating
>>>>>> SUMO into PowerLoom some years ago - never finished that).
>>>>>> There might be others.
>>>>>>
>>>>>> I remember some people from NIST translated SUMO into Loom, so it
>>>>>> should certainly be possible to translate it into PowerLoom.
>>>>>>
>>>>>> If you succeed and it is feasible for you to do so, it would be 
>>>>>> great
>>>>>> if you could make (some of) the translations available to the 
>>>>>> community.
>>>>>>
>>>>>> Hans
>>>>>>
>>>>>> -------------------------------------------------------------------------- 
>>>>>>
>>>>>> Hans Chalupsky, PhD                     USC Information Sciences 
>>>>>> Institute
>>>>>> Project Leader, Loom KR&R Group         4676 Admiralty Way
>>>>>> <[email protected]>                          Marina del Rey, CA 90292
>>>>>> (310) 448-8745
>>>>>> -------------------------------------------------------------------------- 
>>>>>>
>>>>>>
>>>>>>>>>>> Cameron Ross <[email protected]> writes:
>>>>>>> I would like to construct a PowerLoom knowledge-base using 
>>>>>>> ontologies constructed with SUO-KIF 
>>>>>>> (http://suo.ieee.org/SUO/KIF/index.html).  My current plan is to 
>>>>>>> create a tool that translates from SUO-KIF to PowerLoom KIF.  
>>>>>>> Note that SUO-KIF is a minimalistic implementation of KIF 
>>>>>>> whereby many traditional KIF features have been moved out of the 
>>>>>>> language with the intention of having them defined using 
>>>>>>> ontologies (e.g.  defconcept, defrelation etc. don't exist in 
>>>>>>> the language).  I could implement the translator such that it 
>>>>>>> maps these concepts, or I can just account for keyword 
>>>>>>> differences and load in the SUMO ontology with the requisite 
>>>>>>> abstractions.  I'd prefer to do the later as it would be very 
>>>>>>> simple to implement, but I'm concerned that I'll be missing out 
>>>>>>> on some key PowerLoom features.  Are there any recommendations 
>>>>>>> as to how I should proceed?
>>>>>>> Cheers,
>>>>>>> Cameron.
>>>>>>> _______________________________________________
>>>>>>> powerloom-forum mailing list
>>>>>>> [email protected]
>>>>>>> http://mailman.isi.edu/mailman/listinfo/powerloom-forum
>>>>>> _______________________________________________
>>>>>> powerloom-forum mailing list
>>>>>> [email protected]
>>>>>> http://mailman.isi.edu/mailman/listinfo/powerloom-forum
>>>>>>
>>>>>>
>>>>
>>>
>>
>>
>