.\" Automatically generated by Pod::Man 4.14 (Pod::Simple 3.43) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" Set up some character translations and predefined strings. \*(-- will .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left .\" double quote, and \*(R" will give a right double quote. \*(C+ will .\" give a nicer C++. Capital omega is used to do unbreakable dashes and .\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, .\" nothing in troff, for use with C<>. .tr \(*W- .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' .ie n \{\ . ds -- \(*W- . ds PI pi . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch . ds L" "" . ds R" "" . ds C` "" . ds C' "" 'br\} .el\{\ . ds -- \|\(em\| . ds PI \(*p . ds L" `` . ds R" '' . ds C` . ds C' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is >0, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .\" .\" Avoid warning from groff about undefined register 'F'. .de IX .. .nr rF 0 .if \n(.g .if rF .nr rF 1 .if (\n(rF:(\n(.g==0)) \{\ . if \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{\ . nr % 0 . nr F 2 . \} . \} .\} .rr rF .\" ======================================================================== .\" .IX Title "RDF::Redland::Model 3pm" .TH RDF::Redland::Model 3pm "2023-01-31" "perl v5.36.0" "User Contributed Perl Documentation" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH "NAME" RDF::Redland::Model \- Redland RDF Model Class .SH "SYNOPSIS" .IX Header "SYNOPSIS" .Vb 4 \& use RDF::Redland; \& my $storage=new RDF::Redland::Storage("hashes", "test", "new=\*(Aqyes\*(Aq,hash\-type=\*(Aqmemory\*(Aq"); \& my $model=new RDF::Redland::Model($storage, ""); \& ... \& \& my(@sources)=$model\->targets($predicate_node, $object_node); \& \& ... .Ve .SH "DESCRIPTION" .IX Header "DESCRIPTION" Manipulate the \s-1RDF\s0 model. .SH "CONSTRUCTORS" .IX Header "CONSTRUCTORS" .IP "new \s-1STORAGE OPTIONS_STRING\s0" 4 .IX Item "new STORAGE OPTIONS_STRING" .PD 0 .IP "new_with_options \s-1STORAGE OPTIONS_HASH\s0" 4 .IX Item "new_with_options STORAGE OPTIONS_HASH" .PD Create a new RDF::Redland::Model object using RDF::Redland::Storage object \fI\s-1STORAGE\s0\fR with a options. The options can be given either as a string in the first form as \fI\s-1OPTIONS_STRING\s0\fR. The options take the form key1='value1',key2='value2'. The quotes are required. In the second case \fI\s-1OPTIONS_HASH\s0\fR is a reference to a Perl hash of options. .IP "new_from_model \s-1MODEL\s0" 4 .IX Item "new_from_model MODEL" Create a new model from an existing RDF::Redland::Model \fI\s-1MODEL\s0\fR (copy constructor). .SH "METHODS" .IX Header "METHODS" .IP "size" 4 .IX Item "size" Return the size of the model (number of statements). .IP "sync" 4 .IX Item "sync" Synchronise the model to the underlying storage. .IP "add \s-1SUBJECT PREDICATE OBJECT\s0" 4 .IX Item "add SUBJECT PREDICATE OBJECT" Add a new statement to the model with \fI\s-1SUBJECT\s0\fR, \&\fI\s-1PREDICATE\s0\fR and \fI\s-1OBJECT\s0\fR. These can be RDF::Redland::Node, RDF::Redland::URI or perl \s-1URI\s0 objects. .IP "add_typed_literal_statement \s-1SUBJECT PREDICATE STRING\s0 [\s-1XML_LANGUAGE\s0 [\s-1DATATYPE\s0]]" 4 .IX Item "add_typed_literal_statement SUBJECT PREDICATE STRING [XML_LANGUAGE [DATATYPE]]" Add a new statement to the model containing a typed literal string object \&\fI\s-1STRING\s0\fR with (optional) \s-1XML\s0 language (xml:lang attribute) \fI\s-1XML_LANGUAGE\s0\fR and (optional) datatype \s-1URI\s0 \fI\s-1DATATYPE\s0\fR. \fI\s-1XML_LANGUAGE\s0\fR or \fI\s-1DATATYPE\s0\fR can either or both be set to undef. .IP "add_statement \s-1STATEMENT\s0 [\s-1CONTEXT\s0] | \s-1NODE NODE NODE\s0 [\s-1CONTEXT\s0]" 4 .IX Item "add_statement STATEMENT [CONTEXT] | NODE NODE NODE [CONTEXT]" Add RDF::Redland::Statement \fI\s-1STATEMENT\s0\fR or the statement formed by \fI\s-1NODE NODE NODE\s0\fR to the model. If the optional \fI\s-1CONTEXT\s0\fR is given, associate it with that context. Any of \fI\s-1NODE\s0\fR or \fI\s-1CONTEXT\s0\fR can be a RDF::Redland::Node, RDF::Redland::URI or perl \s-1URI\s0 object. .IP "add_statements \s-1STREAM\s0 [\s-1CONTEXT\s0]" 4 .IX Item "add_statements STREAM [CONTEXT]" Add the statements from the RDF::Redland::Stream \fI\s-1STREAM\s0\fR to the model. If the optional \fI\s-1CONTEXT\s0\fR is given, associate it with that context. \&\fI\s-1CONTEXT\s0\fR can be a RDF::Redland::Node, RDF::Redland::URI or perl \s-1URI\s0 object. .IP "remove_statement \s-1STATEMENT\s0 [\s-1CONTEXT\s0] | \s-1NODE NODE NODE\s0 [\s-1CONTEXT\s0]" 4 .IX Item "remove_statement STATEMENT [CONTEXT] | NODE NODE NODE [CONTEXT]" Remove RDF::Redland::Statement \fI\s-1STATEMENT\s0\fR or the statement formed by \fI\s-1NODE NODE NODE\s0\fR from the model. If the optional \fI\s-1CONTEXT\s0\fR is given, remove only the statement stored with that context. Any of \fI\s-1NODE\s0\fR or \fI\s-1CONTEXT\s0\fR can be a RDF::Redland::Node, RDF::Redland::URI or perl \s-1URI\s0 object. .IP "remove_context_statements \s-1CONTEXT\s0" 4 .IX Item "remove_context_statements CONTEXT" Remove all RDF::Redland::Statement \fI\s-1STATEMENT\s0\fRs from the model with the given \fI\s-1CONTEXT\s0\fR context. \&\fI\s-1CONTEXT\s0\fR can be a RDF::Redland::Node, RDF::Redland::URI or perl \s-1URI\s0 object. .IP "contains_statement \s-1STATEMENT\s0" 4 .IX Item "contains_statement STATEMENT" Return non 0 if the model contains RDF::Redland::Statement \fI\s-1STATEMENT\s0\fR. .IP "as_stream [\s-1CONTEXT\s0]" 4 .IX Item "as_stream [CONTEXT]" Return a new RDF::Redland::Stream object seralising the entire model, or just those statements with \fI\s-1CONTEXT\s0\fR, as RDF::Redland::Statement objects. If given, \fI\s-1CONTEXT\s0\fR can be a RDF::Redland::Node, RDF::Redland::URI or perl \s-1URI\s0 object. .IP "find_statements \s-1STATEMENT\s0 [\s-1CONTEXT\s0]" 4 .IX Item "find_statements STATEMENT [CONTEXT]" Find all matching statements in the model matching partial RDF::Redland::Statement \&\fI\s-1STATEMENT\s0\fR (any of the subject, predicate, object RDF::Redland::Node can be undef). If \fI\s-1CONTEXT\s0\fR is given, finds statements only in that context. .Sp In an array context, returns an array of the matching RDF::Redland::Statement objects. In a scalar context, returns the RDF::Redland::Stream object representing the results. .IP "sources \s-1ARC TARGET\s0" 4 .IX Item "sources ARC TARGET" Get all source RDF::Redland::Node objects for a given arc \fI\s-1ARC\s0\fR, target \fI\s-1TARGET\s0\fR> RDF::Redland::Node objects as a list of RDF::Redland::Node objects. .IP "arcs \s-1SOURCE TARGET\s0" 4 .IX Item "arcs SOURCE TARGET" Get all arc RDF::Redland::Node objects for a given source \fI\s-1SOURCE\s0\fR, target \fI\s-1TARGET\s0\fR RDF::Redland::Node objects as a list of RDF::Redland::Node objects. .IP "targets \s-1SOURCE ARC\s0" 4 .IX Item "targets SOURCE ARC" Get all target RDF::Redland::Node objects for a given source \fI\s-1SOURCE\s0\fR, arc \fI\s-1ARC\s0\fR RDF::Redland::Node objects as a list of RDF::Redland::Node objects. .IP "sources_iterator \s-1ARC TARGET\s0" 4 .IX Item "sources_iterator ARC TARGET" Get all source RDF::Redland::Node objects for a given arc \fI\s-1ARC\s0\fR, target \&\fI\s-1TARGET\s0\fR RDF::Redland::Node objects as an RDF::Redland::Iterator or undef on failure. .IP "arcs_iterator \s-1SOURCE TARGET\s0" 4 .IX Item "arcs_iterator SOURCE TARGET" Get all arc RDF::Redland::Node objects for a given source \fI\s-1SOURCE\s0\fR, target \&\fI\s-1TARGET\s0\fR RDF::Redland::Node objects as an RDF::Redland::Iterator or undef on failure. .IP "targets_iterator \s-1SOURCE ARC\s0" 4 .IX Item "targets_iterator SOURCE ARC" Get all target RDF::Redland::Node objects for a given source \fI\s-1SOURCE\s0\fR, arc \fI\s-1ARC\s0\fR RDF::Redland::Node objects as an RDF::Redland::Iterator or undef on failure. .IP "source \s-1ARC TARGET\s0" 4 .IX Item "source ARC TARGET" Get one source RDF::Redland::Node object that matches a given arc \fI\s-1ARC\s0\fR, target \fI\s-1TARGET\s0\fR RDF::Redland::Node objects or undef if there is no match. .IP "arc \s-1SOURCE TARGET\s0" 4 .IX Item "arc SOURCE TARGET" Get one arc RDF::Redland::Node object that matches a given source \fI\s-1SOURCE\s0\fR, target \fI\s-1TARGET\s0\fR RDF::Redland::Node objects or undef if there is no match. .IP "target \s-1SOURCE ARC\s0" 4 .IX Item "target SOURCE ARC" Get one target RDF::Redland::Node object that matches a given source \&\fI\s-1SOURCE\s0\fR, arc \fI\s-1ARC\s0\fR RDF::Redland::Node objects or undef if there is no match. .IP "contexts" 4 .IX Item "contexts" Get all context RDF::Redland::Node objects in the model .IP "feature \s-1URI\s0 [\s-1VALUE\s0]" 4 .IX Item "feature URI [VALUE]" Get/set a model feature. The feature is named via RDF::Redland::URI \&\fI\s-1URI\s0\fR and the value is a RDF::Redland::Node. If \fI\s-1VALUE\s0\fR is given, the feature is set to that value, otherwise the current value is returned. .IP "query_execute \s-1QUERY\s0" 4 .IX Item "query_execute QUERY" Execute the \fI\s-1QUERY\s0\fR RDF::Redland::Query against the model returning a result set RDF::Redland::QueryResults or undef on failure. .IP "load \s-1URI\s0 [\s-1SYNTAX\-NAME\s0 [ MIME-TYPE [\s-1SYNTAX\-URI\s0 [\s-1HANDLER\s0 ]]]" 4 .IX Item "load URI [SYNTAX-NAME [ MIME-TYPE [SYNTAX-URI [HANDLER ]]]" Load content from \fI\s-1URI\s0\fR into the model, guessing the parser. .IP "to_string [\s-1BASE\-URI\s0 [\s-1SYNTAX\-NAME\s0 [ MIME-TYPE [\s-1SYNTAX\-URI\s0]]]" 4 .IX Item "to_string [BASE-URI [SYNTAX-NAME [ MIME-TYPE [SYNTAX-URI]]]" Serialize the model to a syntax. If no serializer name is given, the default serializer \s-1RDF/XML\s0 is used. .SH "OLDER METHODS" .IX Header "OLDER METHODS" .IP "serialise" 4 .IX Item "serialise" .PD 0 .IP "serialize" 4 .IX Item "serialize" .PD Return a new RDF::Redland::Stream object seralising the model as RDF::Redland::Statement objects. Replaced by as_stream to reduce confusion with the RDF::Redland::Serializer class. .SH "SEE ALSO" .IX Header "SEE ALSO" RDF::Redland::Storage, RDF::Redland::Node and RDF::Redland::Statement .SH "AUTHOR" .IX Header "AUTHOR" Dave Beckett \- http://www.dajobe.org/