logo
Free, unlimited AI code reviews that run on commit
git-lrc git-lrc GitHub Install Now We'd appreciate a star git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt

Biblio::Thesaurus::ModRewrite - a module to manipulate ontologies

Author

       Nuno Carvalho, "<smash@cpan.org>"

       J.Joao Almeida, "<jj@di.uminho.pt>"

       Alberto Simoes, "<albie@alfarrabio.di.uminho.pt>"

Description

       This module implements a compiler to run programs written in a domain specific language that can be used
       to manipulate information in ontologies. This domain specific language is called OML and is described in
       the next section.

Examples

       Look in the examples and bin directory for sample programs.

Functions

new
       This function creates a new object and stores the source file for the thesaurus given as argument.

   process
       This function processes source code written in OML. This and "new" should be the only functions you need
       to call to use this module.

   parseFile
       This function parses the source code and builds a parsing tree. The parser is defined in the
       Biblio::Thesaurus::ModRewrite::Parser module.

   buildSemanticTree
       This function calculates the solution node for every pattern in the parsing tree.

   calc_set
       This function calculates the solution for a given pattern.

   _intersect
       This function is used by "calc_set" and should not be called on it's own.

   _comum
       This function is used by "calc_set" and should not be called on it's own.

   _union
       This function is used by "calc_set" and should not be called on it's own.

   run_program
       This function executes every action for each rule in an OML program.

   execute
       This function is used to execute an action.

Name

       Biblio::Thesaurus::ModRewrite - a module to manipulate ontologies

Oml

       OML is a domain specific language that can be used to describe operations that manipulate information in
       a ontology. Programs written in OML are a set of rules that are executed in order, each rule looks
       something like:

         pattern => action .

       Which means that when the "pattern" is found the given "action" block is executed.

   Patterns
       Patterns describe information in the ontology. A pattern can be used to represent terms, relations,
       relations between terms, or any combination of any of these.

   Actions
       The action block is used to describe the operations that are going to be executed if a given pattern is
       found.

Synopsis

         use Biblio::Thesaurus;
         use Biblio::Thesaurus::ModRewrite;

         my $code = "Lisbon 'city-of' Portugal => add (Lisbon 'city-of' Europe).";

         $thesaurus = thesaurusLoad($file);
         $obj = Biblio::Thesaurus::ModRewrite->new($thesaurus);

         $obj->process($code);

Version

       Version 0.02

See Also