1RDF::Trine::Node::FormuUlsae(r3)Contributed Perl DocumenRtDaFt:i:oTnrine::Node::Formula(3)
2
3
4
6 RDF::Trine::Node::Formula - RDF Node class for formulae / graph
7 literals
8
10 Formulae are implemented as a subclass of literals. Parts of Trine that
11 have no special knowledge about formulae (e.g. the Turtle serialiser)
12 will just see them as literals with a particular datatype URI
13 (http://open.vocab.org/terms/Formula).
14
15 If your code needs to detect formulae nodes, try:
16
17 use Scalar::Util qw[blessed];
18 if (blessed($node) && $node->isa('RDF::Trine::Node::Formula'))
19 { ... do stuff to formulae ... }
20
21 or perhaps
22
23 use Scalar::Util qw[blessed];
24 if (blessed($node) && $node->can('pattern'))
25 { ... do stuff to formulae ... }
26
28 "new ( $pattern )"
29 Returns a new Formula structure. This is a subclass of
30 RDF::Trine::Node::Literal.
31
32 $pattern is an RDF::Trine::Pattern or a string capable of being
33 parsed with RDF::Trine::Parser::Notation3->parse_formula.
34
36 "pattern ( $node )"
37 Returns the formula as an RDF::Trine::Pattern.
38
39 "forAll"
40 Returns the a list of nodes with the @forAll quantifier.
41
42 This is a fairly obscure bit of N3 semantics.
43
44 "forSome"
45 Returns the a list of nodes with the @forSome quantifier.
46
47 This is a fairly obscure bit of N3 semantics.
48
49 "as_literal_notation"
50 Returns the formula in Notation-3-like syntax, excluding the
51 wrapping "{"..."}".
52
53 Uses absolute URIs whenever possible, avoiding relative URI
54 references, QNames and keywords.
55
56 "from_literal_notation ( $string, $base )"
57 Modifies the formula's value using Notation 3 syntax, excluding the
58 wrapping "{"..."}".
59
60 "equal ( $node )"
61 Returns true if the two nodes are equal, false otherwise.
62
63 TODO - really need a "not equal, but equivalent" method.
64
66 Please report any bugs to
67 <http://rt.cpan.org/Dist/Display.html?Queue=RDF-TriN3>.
68
70 RDF::Trine::Node, RDF::Trine::Pattern.
71
73 Toby Inkster "<tobyink@cpan.org>"
74
75 Based on RDF::Trine::Node::Literal by Gregory Todd Williams.
76
78 Copyright (c) 2006-2010 Gregory Todd Williams.
79
80 Copyright (c) 2010-2012 Toby Inkster.
81
82 This library is free software; you can redistribute it and/or modify it
83 under the same terms as Perl itself.
84
86 THIS PACKAGE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR IMPLIED
87 WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
88 MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
89
90
91
92perl v5.32.0 2020-07-28 RDF::Trine::Node::Formula(3)