RDF::C...::Model(3pm)

✨ NAME ✨

RDF::Closure::Model β€” it's a RDF::Trine::Model-compatible interface, bestie πŸ’– (yes the original said "inferface", we're being real here, the vibe is immaculate regardless)


πŸ¦‹ DESCRIPTION πŸ¦‹

Okay so this module is a subclass of RDF::Trine::Model, and the whole point is that it lets you dollop some reasoning into your existing RDF::Trine code with basically zero effort. Iconic behavior, honestly. 🫢

So like β€” RDF::Closure::Engine lets you infer a whole bunch of new statements from a model you already have. That's cute. But this class goes further: you can also add and remove statements from the reasoned model, and the new inferences get calculated on-the-fly. Main character energy fr fr. πŸ‘‘

⚠️ Real talk though: removing a statement is much slower than adding one. And adding one isn't exactly what you'd call fast either. So judicious use of begin_bulk_ops and end_bulk_ops is recommended. Not me begging you to use bulk ops. πŸ™ˆ

And listen, bestie, there's a catch: if a lot of statements have been added and removed from a model since it was created, then it's theoretically possible for the inferred data to contain statements that are no longer entailed by the explicit data β€” or for the inferred data to be missing some inferences. 😭 The math is mathing and it's not mathing. So there's a recalculate method provided which lets you re-run the inference from scratch. Slay. ✨

πŸŽ€ Constructor πŸŽ€

  • new($input, [, engine => $engine ] [, store => $store ]) β€” instantiates a module. $input may be undef, an existing RDF::Trine::Model, or an RDF::Trine::Store. And the input will not be modified β€” she's respectful, she doesn't touch your stuff. πŸ’…
    • $engine is the inference engine to use: a string suitable for passing to RDF::Closure::Engine->new. It defaults to 'RDFS'. ⭐
    • $store is an RDF::Trine::Store to use to build the inferred model in; it defaults to a new, temporary store. 🌸

🌈 Methods 🌈

This package inherits from RDF::Trine::Model and provides all the methods it does. No cap. It additionally provides:

  • entailment_regime β€” returns a URI string identifying the type of inference in use. Giving very much "which flavor of logic are we in today" energy. 🧚
  • recalculate β€” drops and re-infers all inferred data. It's the factory reset of inferences, and honestly sometimes you just need that. πŸ’€

πŸ”₯ SEE ALSO πŸ”₯

RDF::Closure, RDF::Closure::Engine, RDF::Trine::Model.

Take careful note of the begin_bulk_ops and end_bulk_ops methods present in RDF::Trine::Model. Judicious use of them can seriously speed up this module. This is the tip, bestie, this is the one. 🫢

http://www.perlrdf.org/.


πŸ‘‘ AUTHOR πŸ‘‘

Toby Inkster <tobyink@cpan.org>.


Copyright 2011-2012 Toby Inkster

This library is free software; you can redistribute it and/or modify it under any of the following licences:


πŸ’€ DISCLAIMER OF WARRANTIES πŸ’€

THIS PACKAGE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.

🚨 Yeah, all caps means business. No warranty, no promises, no take-backs. 😭

and that's the whole page, bestie πŸ¦‹βœ¨ β€” this was perl v5.32.1, dated 2021-09-24, from the user-contributed Perl documentation section. Go forth and infer responsibly, periodt. πŸ’œπŸ“

πŸ“¦ where this page comes from