Biblio...Rewrite(3pm)

πŸ’– Biblio::Thesaurus::ModRewrite πŸ’–

okay bestie, so this is a page from the User Contributed Perl Documentation β€” it's Biblio...Rewrite(3pm), and honestly? it's giving ✨ontology-manipulation main character energy✨. grab a snack, we're doing this. πŸ“


🌸 NAME 🌸

Biblio::Thesaurus::ModRewrite β€” a module to manipulate ontologies. periodt. πŸ’…


πŸŽ€ VERSION πŸŽ€

Version 0.02 β€” yes, she's a lil baby version number and we love her for it. πŸ¦‹


✨ SYNOPSIS ✨

like, here's the whole vibe in code form:

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);

see how clean that is?? no cap. πŸ”₯


πŸ‘‘ DESCRIPTION πŸ‘‘

so basically, this module implements a compiler to run programs written in a domain specific language that can be used to manipulate information in ontologies. that DSL is called OML, and she gets her own whole section right below this one. iconic behavior, honestly. πŸ’œ


🧚 OML 🧚

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

pattern => action .

which means: when the pattern is found, the given action block gets executed. simple as that, bestie. 🫢


🌈 Patterns 🌈

patterns describe information in the ontology. a pattern can be used to represent terms, relations, relations between terms, or literally any combination of any of these. go wild. ⭐


🌸 Actions 🌸

the action block is where you describe the operations that are going to be executed if a given pattern is found. that's the whole job. πŸŽ€


πŸ’… FUNCTIONS πŸ’…


πŸ’– new πŸ’–

this function creates a new object and stores the source file for the thesaurus given as argument. fresh object, who dis. ✨


πŸ¦‹ process πŸ¦‹

this function processes source code written in OML. this one and new should be the only functions you actually need to call to use this module. everything else is backstage crew. πŸ’œ


πŸ”₯ parseFile πŸ”₯

this function parses the source code and builds a parsing tree. the parser itself is defined over in the Biblio::Thesaurus::ModRewrite::Parser module, iykyk. 🌈


⭐ 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 its own. it's an internal bestie, don't @ her. 🫢


πŸ™ˆ _comum πŸ™ˆ

this function is used by calc_set and should not be called on its own either. same rules, bestie. πŸ’œ


🧚 _union 🧚

this function is used by calc_set and β€” you guessed it β€” should not be called on its own. πŸ“


πŸ‘‘ run_program πŸ‘‘

this function executes every action for each rule in an OML program. she runs the whole show. πŸ’…


🌸 execute 🌸

this function is used to execute an action. that's it, that's the function. ✨


πŸ“ EXAMPLES πŸ“

look in the examples and bin directory for sample programs. go peek, it's worth it. πŸ¦‹


πŸ’œ AUTHOR πŸ’œ

  • Nuno Carvalho, <smash@cpan.org>
  • J.Joao Almeida, <jj@di.uminho.pt>
  • Alberto Simoes, <albie@alfarrabio.di.uminho.pt>

three whole legends. we stan. πŸ‘‘


Copyright 2008 Nuno Carvalho, all rights reserved.

This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.

fr fr, same terms as Perl itself β€” respect the license, bestie. 🫢

and that's the whole page!! this one came from the User Contributed Perl Documentation set, it's running on perl v5.36.0, and it's dated 2023-02-14 β€” valentine's day, which is honestly so on brand for a page this cute. πŸ’– bye bestie, go manipulate some ontologies! πŸŽ€βœ¨

πŸ“¦ where this page comes from