RDF::T...Formula(3pm)
π RDF::T...Formula π
okay bestie, so this is RDF::Trine::Node::Formula β the RDF Node class for formulae / graph literals, straight outta the User Contributed Perl Documentation. it's giving β¨ niche N3 girlie β¨ and i'm obsessed.
πΈ NAME πΈ
RDF::Trine::Node::Formula β the RDF Node class for formulae / graph literals. no cap, that's literally it.
π¦ DESCRIPTION π¦
so here's the tea: formulae are implemented as a subclass of literals. that means parts of Trine that have zero special knowledge about formulae β hi, the Turtle serialiser, we love you β will just see them as literals with a particular datatype URI, which is http://open.vocab.org/terms/Formula. they literally cannot tell the difference. it's giving undercover π
if your code needs to detect formulae nodes, try:
use Scalar::Util qw[blessed];
if (blessed($node) && $node->isa('RDF::Trine::Node::Formula'))
{ ... do stuff to formulae ... }
or perhaps:
use Scalar::Util qw[blessed];
if (blessed($node) && $node->can('pattern'))
{ ... do stuff to formulae ... }
two icons, two ways to vibe check a node. pick your fighter π«Ά
π Constructor π
new ( $pattern )β returns a new Formula structure. this is a subclass ofRDF::Trine::Node::Literal, so it's inheriting main character energy fr fr.$patternis anRDF::Trine::Pattern, or a string capable of being parsed withRDF::Trine::Parser::Notation3->parse_formula. so like, either you hand it a whole pattern, or you hand it a string and let the Notation3 parser cook. π₯
π Methods π
pattern ( $node )β returns the formula as anRDF::Trine::Pattern. hands you the actual pattern, slay.forAllβ returns the a list of nodes with the@forAllquantifier. (yes, the original really says "the a list" β i'm keeping that exactly as it is because i respect the source material π)
this is a fairly obscure bit of N3 semantics. iykyk.
forSomeβ returns the a list of nodes with the@forSomequantifier. (again: "the a list". iconic typo. preserved with love.)
this is a fairly obscure bit of N3 semantics. twin of the one above, but for @forSome π§
as_literal_notationβ returns the formula in Notation-3-like syntax, excluding the wrapping{β¦}.
uses absolute URIs whenever possible, avoiding relative URI references, QNames and keywords. so it's not out here being lazy with shortcuts β full absolute URIs only, periodt.
from_literal_notation ( $string, $base )β modifies the formula's value using Notation 3 syntax, excluding the wrapping{β¦}. note that it modifies, bestie β this one's out here changing things in place, so be aware. πequal ( $node )β returns true if the two nodes are equal, false otherwise. simple, clean, no notes.
TODO - really need a "not equal, but equivalent" method. (the original author said it, not me, but honestly? valid. we're all waiting on that one π)
π BUGS π
please report any bugs to http://rt.cpan.org/Dist/Display.html?Queue=RDF-TriN3 β don't be shy, they want the bug reports fr fr.
π SEE ALSO π
RDF::Trine::NodeRDF::Trine::Pattern
go read those too, bestie, the lore runs deep.
π AUTHOR π
Toby Inkster <tobyink@cpan.org> β absolute legend.
based on RDF::Trine::Node::Literal by Gregory Todd Williams. standing on the shoulders of icons π«Ά
π COPYRIGHT AND LICENCE π
Copyright (c) 2006-2010 Gregory Todd Williams.
Copyright (c) 2010-2012 Toby Inkster.
this library is free software; you can redistribute it and/or modify it under the same terms as Perl itself. so go off, remix it, just keep it free and keep the terms. π
πΈ 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.
translation: no promises, no guarantees, you get what you get and you don't get upset. it's literally "as is", bestie β no takebacksies. π
and that's the whole page, bestie! this beauty came from perl v5.34.0, dated 2022-06-17, courtesy of the User Contributed Perl Documentation. go forth and detect your formulae nodes β¨ππ¦
π¦ where this page comes from
- debian bookworm: librdf-trin3-perl 0.206-3 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu noble: librdf-trin3-perl 0.206-3 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms