.\" Automatically generated by Pod::Man 4.14 (Pod::Simple 3.43) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" Set up some character translations and predefined strings. \*(-- will .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left .\" double quote, and \*(R" will give a right double quote. \*(C+ will .\" give a nicer C++. Capital omega is used to do unbreakable dashes and .\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, .\" nothing in troff, for use with C<>. .tr \(*W- .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' .ie n \{\ . ds -- \(*W- . ds PI pi . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch . ds L" "" . ds R" "" . ds C` "" . ds C' "" 'br\} .el\{\ . ds -- \|\(em\| . ds PI \(*p . ds L" `` . ds R" '' . ds C` . ds C' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is >0, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .\" .\" Avoid warning from groff about undefined register 'F'. .de IX .. .nr rF 0 .if \n(.g .if rF .nr rF 1 .if (\n(rF:(\n(.g==0)) \{\ . if \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{\ . nr % 0 . nr F 2 . \} . \} .\} .rr rF .\" ======================================================================== .\" .IX Title "Biblio::Thesaurus::ModRewrite 3pm" .TH Biblio::Thesaurus::ModRewrite 3pm "2023-02-14" "perl v5.36.0" "User Contributed Perl Documentation" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH "NAME" Biblio::Thesaurus::ModRewrite \- a module to manipulate ontologies .SH "VERSION" .IX Header "VERSION" Version 0.02 .SH "SYNOPSIS" .IX Header "SYNOPSIS" .Vb 2 \& use Biblio::Thesaurus; \& use Biblio::Thesaurus::ModRewrite; \& \& my $code = "Lisbon \*(Aqcity\-of\*(Aq Portugal => add (Lisbon \*(Aqcity\-of\*(Aq Europe)."; \& \& $thesaurus = thesaurusLoad($file); \& $obj = Biblio::Thesaurus::ModRewrite\->new($thesaurus); \& \& $obj\->process($code); .Ve .SH "DESCRIPTION" .IX Header "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 \s-1OML\s0 and is described in the next section. .SH "OML" .IX Header "OML" \&\s-1OML\s0 is a domain specific language that can be used to describe operations that manipulate information in a ontology. Programs written in \s-1OML\s0 are a set of rules that are executed in order, each rule looks something like: .PP .Vb 1 \& pattern => action . .Ve .PP Which means that when the \f(CW\*(C`pattern\*(C'\fR is found the given \f(CW\*(C`action\*(C'\fR block is executed. .SS "Patterns" .IX Subsection "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. .SS "Actions" .IX Subsection "Actions" The action block is used to describe the operations that are going to be executed if a given pattern is found. .SH "FUNCTIONS" .IX Header "FUNCTIONS" .SS "new" .IX Subsection "new" This function creates a new object and stores the source file for the thesaurus given as argument. .SS "process" .IX Subsection "process" This function processes source code written in \s-1OML.\s0 This and \f(CW\*(C`new\*(C'\fR should be the only functions you need to call to use this module. .SS "parseFile" .IX Subsection "parseFile" This function parses the source code and builds a parsing tree. The parser is defined in the Biblio::Thesaurus::ModRewrite::Parser module. .SS "buildSemanticTree" .IX Subsection "buildSemanticTree" This function calculates the solution node for every pattern in the parsing tree. .SS "calc_set" .IX Subsection "calc_set" This function calculates the solution for a given pattern. .SS "_intersect" .IX Subsection "_intersect" This function is used by \f(CW\*(C`calc_set\*(C'\fR and should not be called on it's own. .SS "_comum" .IX Subsection "_comum" This function is used by \f(CW\*(C`calc_set\*(C'\fR and should not be called on it's own. .SS "_union" .IX Subsection "_union" This function is used by \f(CW\*(C`calc_set\*(C'\fR and should not be called on it's own. .SS "run_program" .IX Subsection "run_program" This function executes every action for each rule in an \s-1OML\s0 program. .SS "execute" .IX Subsection "execute" This function is used to execute an action. .SH "EXAMPLES" .IX Header "EXAMPLES" Look in the \fIexamples\fR and \fIbin\fR directory for sample programs. .SH "AUTHOR" .IX Header "AUTHOR" Nuno Carvalho, \f(CW\*(C`\*(C'\fR .PP J.Joao Almeida, \f(CW\*(C`\*(C'\fR .PP Alberto Simoes, \f(CW\*(C`\*(C'\fR .SH "COPYRIGHT & LICENSE" .IX Header "COPYRIGHT & LICENSE" Copyright 2008 Nuno Carvalho, all rights reserved. .PP This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.