1RDF::Redland::Model(3)User Contributed Perl DocumentationRDF::Redland::Model(3)
2
3
4

NAME

6       RDF::Redland::Model - Redland RDF Model Class
7

SYNOPSIS

9         use RDF::Redland;
10         my $storage=new RDF::Redland::Storage("hashes", "test", "new='yes',hash-type='memory'");
11         my $model=new RDF::Redland::Model($storage, "");
12         ...
13
14         my(@sources)=$model->targets($predicate_node, $object_node);
15
16         ...
17

DESCRIPTION

19       Manipulate the RDF model.
20

CONSTRUCTORS

22       new STORAGE OPTIONS_STRING
23       new_with_options STORAGE OPTIONS_HASH
24           Create a new RDF::Redland::Model object using RDF::Redland::Storage
25           object STORAGE with a options.  The options can be given either as
26           a string in the first form as OPTIONS_STRING.  The options take the
27           form key1='value1',key2='value2'.  The quotes are required.   In
28           the second case OPTIONS_HASH is a reference to a Perl hash of
29           options.
30
31       new_from_model MODEL
32           Create a new model from an existing RDF::Redland::Model MODEL (copy
33           constructor).
34

METHODS

36       size
37           Return the size of the model (number of statements).
38
39       sync
40           Synchronise the model to the underlying storage.
41
42       add SUBJECT PREDICATE OBJECT
43           Add a new statement to the model with SUBJECT, PREDICATE and
44           OBJECT.  These can be RDF::Redland::Node, RDF::Redland::URI or perl
45           URI objects.
46
47       add_typed_literal_statement SUBJECT PREDICATE STRING [XML_LANGUAGE
48       [DATATYPE]]
49           Add a new statement to the model containing a typed literal string
50           object STRING with (optional) XML language (xml:lang attribute)
51           XML_LANGUAGE and (optional) datatype URI DATATYPE.  XML_LANGUAGE or
52           DATATYPE can either or both be set to undef.
53
54       add_statement STATEMENT [CONTEXT] | NODE NODE NODE [CONTEXT]
55           Add RDF::Redland::Statement STATEMENT or the statement formed by
56           NODE NODE NODE to the model.  If the optional CONTEXT is given,
57           associate it with that context.  Any of NODE or CONTEXT can be a
58           RDF::Redland::Node, RDF::Redland::URI or perl URI object.
59
60       add_statements STREAM [CONTEXT]
61           Add the statements from the RDF::Redland::Stream STREAM to the
62           model.  If the optional CONTEXT is given, associate it with that
63           context.  CONTEXT can be a RDF::Redland::Node, RDF::Redland::URI or
64           perl URI object.
65
66       remove_statement STATEMENT [CONTEXT] | NODE NODE NODE [CONTEXT]
67           Remove RDF::Redland::Statement STATEMENT or the statement formed by
68           NODE NODE NODE from the model.  If the optional CONTEXT is given,
69           remove only the statement stored with that context.  Any of NODE or
70           CONTEXT can be a RDF::Redland::Node, RDF::Redland::URI or perl URI
71           object.
72
73       remove_context_statements CONTEXT
74           Remove all RDF::Redland::Statement STATEMENTs from the model with
75           the given CONTEXT context.  CONTEXT can be a RDF::Redland::Node,
76           RDF::Redland::URI or perl URI object.
77
78       contains_statement STATEMENT
79           Return non 0 if the model contains RDF::Redland::Statement
80           STATEMENT.
81
82       as_stream [CONTEXT]
83           Return a new RDF::Redland::Stream object seralising the entire
84           model, or just those statements with CONTEXT, as
85           RDF::Redland::Statement objects.  If given, CONTEXT can be a
86           RDF::Redland::Node, RDF::Redland::URI or perl URI object.
87
88       find_statements STATEMENT [CONTEXT]
89           Find all matching statements in the model matching partial
90           RDF::Redland::Statement STATEMENT (any of the subject, predicate,
91           object RDF::Redland::Node can be undef).  If CONTEXT is given,
92           finds statements only in that context.
93
94           In an array context, returns an array of the matching
95           RDF::Redland::Statement objects.  In a scalar context, returns the
96           RDF::Redland::Stream object representing the results.
97
98       sources ARC TARGET
99           Get all source RDF::Redland::Node objects for a given arc ARC,
100           target TARGET> RDF::Redland::Node objects as a list of
101           RDF::Redland::Node objects.
102
103       arcs SOURCE TARGET
104           Get all arc RDF::Redland::Node objects for a given source SOURCE,
105           target TARGET RDF::Redland::Node objects as a list of
106           RDF::Redland::Node objects.
107
108       targets SOURCE ARC
109           Get all target RDF::Redland::Node objects for a given source
110           SOURCE, arc ARC RDF::Redland::Node objects as a list of
111           RDF::Redland::Node objects.
112
113       sources_iterator ARC TARGET
114           Get all source RDF::Redland::Node objects for a given arc ARC,
115           target TARGET RDF::Redland::Node objects as an
116           RDF::Redland::Iterator or undef on failure.
117
118       arcs_iterator SOURCE TARGET
119           Get all arc RDF::Redland::Node objects for a given source SOURCE,
120           target TARGET RDF::Redland::Node objects as an
121           RDF::Redland::Iterator or undef on failure.
122
123       targets_iterator SOURCE ARC
124           Get all target RDF::Redland::Node objects for a given source
125           SOURCE, arc ARC RDF::Redland::Node objects as an
126           RDF::Redland::Iterator or undef on failure.
127
128       source ARC TARGET
129           Get one source RDF::Redland::Node object that matches a given arc
130           ARC, target TARGET RDF::Redland::Node objects or undef if there is
131           no match.
132
133       arc SOURCE TARGET
134           Get one arc RDF::Redland::Node object that matches a given source
135           SOURCE, target TARGET RDF::Redland::Node objects or undef if there
136           is no match.
137
138       target SOURCE ARC
139           Get one target RDF::Redland::Node object that matches a given
140           source SOURCE, arc ARC RDF::Redland::Node objects or undef if there
141           is no match.
142
143       contexts
144           Get all context RDF::Redland::Node objects in the model
145
146       feature URI [VALUE]
147           Get/set a model feature.  The feature is named via
148           RDF::Redland::URI URI and the value is a RDF::Redland::Node.  If
149           VALUE is given, the feature is set to that value, otherwise the
150           current value is returned.
151
152       query_execute QUERY
153           Execute the QUERY RDF::Redland::Query against the model returning a
154           result set RDF::Redland::QueryResults or undef on failure.
155
156       load URI [SYNTAX-NAME [ MIME-TYPE [SYNTAX-URI [HANDLER ]]]
157           Load content from URI into the model, guessing the parser.
158
159       to_string [BASE-URI [SYNTAX-NAME [ MIME-TYPE [SYNTAX-URI]]]
160           Serialize the model to a syntax.  If no serializer name is given,
161           the default serializer RDF/XML is used.
162

OLDER METHODS

164       serialise
165       serialize
166           Return a new RDF::Redland::Stream object seralising the model as
167           RDF::Redland::Statement objects.  Replaced by as_stream to reduce
168           confusion with the RDF::Redland::Serializer class.
169

SEE ALSO

171       RDF::Redland::Storage, RDF::Redland::Node and RDF::Redland::Statement
172

AUTHOR

174       Dave Beckett - http://www.dajobe.org/
175
176
177
178perl v5.12.3                      2008-07-03            RDF::Redland::Model(3)
Impressum