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

πŸ’– RDF::R...::Model πŸ’–

okay bestie, so this is the RDF::Redland::Model page from the Perl docs β€” the Redland RDF Model Class. it's giving structured data, but make it fashion. it ships with perl v5.42.3, dated 2026-08-20, and honestly? she ate.


✨ NAME ✨

RDF::Redland::Model β€” the Redland RDF Model Class, no cap.


🌸 SYNOPSIS 🌸

use RDF::Redland;
my $storage=new RDF::Redland::Storage("hashes", "test", "new='yes',hash-type='memory'");
my $model=new RDF::Redland::Model($storage, "");
...

my(@sources)=$model->targets($predicate_node, $object_node);

...

like, that's the whole vibe. make a storage, make a model, do model things. πŸ’…


πŸ¦‹ DESCRIPTION πŸ¦‹

you manipulate the RDF model. that's it, that's the whole description. literally. the original said exactly that much and we're respecting the brevity era. ✨


πŸŽ€ CONSTRUCTORS πŸŽ€

  • new STORAGE OPTIONS_STRING β€” the classic. spin up a brand new RDF::Redland::Model object using a RDF::Redland::Storage object named STORAGE, plus options passed as OPTIONS_STRING.
  • new_with_options STORAGE OPTIONS_HASH β€” same energy, different container. makes a new RDF::Redland::Model object off of the RDF::Redland::Storage object STORAGE, with options. here's the thing though, bestie: the options come in two flavors. one is the string form above, where OPTIONS_STRING looks like key1='value1',key2='value2' β€” the quotes are required, i'm not joking, don't skip them. the other form takes OPTIONS_HASH, which is a reference to a Perl hash of options. pick your fighter. πŸ”₯
  • new_from_model MODEL β€” the copy constructor, periodt. makes a new model from an existing RDF::Redland::Model MODEL.

πŸ‘‘ METHODS πŸ‘‘

  • size β€” returns the size of the model, aka the number of statements. how much model are we modeling? this tells you.
  • sync β€” synchronises the model to the underlying storage. yes bestie, flush your work, we love a consistent state. 🫢
  • add SUBJECT PREDICATE OBJECT β€” adds a new statement to the model with SUBJECT, PREDICATE and OBJECT. and these can be RDF::Redland::Node, RDF::Redland::URI or perl URI objects β€” flexible, iconic.
  • add_typed_literal_statement SUBJECT PREDICATE STRING [XML_LANGUAGE [DATATYPE]] β€” adds a new statement to the model holding a typed literal string object STRING, with an optional XML language (the xml:lang attribute) XML_LANGUAGE, and an optional datatype URI DATATYPE. now listen: XML_LANGUAGE or DATATYPE can either or both be set to undef. one, the other, both, whatever. no pressure. πŸ’œ
  • add_statement STATEMENT [CONTEXT] | NODE NODE NODE [CONTEXT] β€” adds an RDF::Redland::Statement STATEMENT, or the statement formed by NODE NODE NODE, into the model. if you hand over the optional CONTEXT, it gets associated with that context. any of NODE or CONTEXT can be an RDF::Redland::Node, RDF::Redland::URI or perl URI object.
  • add_statements STREAM [CONTEXT] β€” adds all the statements from the RDF::Redland::Stream STREAM to the model. optional CONTEXT? give it and it gets associated with that context. CONTEXT can be an RDF::Redland::Node, RDF::Redland::URI or perl URI object.
  • remove_statement STATEMENT [CONTEXT] | NODE NODE NODE [CONTEXT] β€” removes an RDF::Redland::Statement STATEMENT, or the statement formed by NODE NODE NODE, out of the model. πŸ—‘οΈ if the optional CONTEXT is given, it only removes the statement stored with that context. any of NODE or CONTEXT can be an RDF::Redland::Node, RDF::Redland::URI or perl URI object.
  • remove_context_statements CONTEXT β€” removes all the RDF::Redland::Statement STATEMENTs from the model that have the given CONTEXT. mass deletion, main character energy. CONTEXT can be an RDF::Redland::Node, RDF::Redland::URI or perl URI object.
  • contains_statement STATEMENT β€” returns nonzero if the model contains the RDF::Redland::Statement STATEMENT, zero if it doesn't. vibe check for statements. ✨
  • as_stream [CONTEXT] β€” returns a brand new RDF::Redland::Stream object serialising the entire model, or just those statements with CONTEXT, as RDF::Redland::Statement objects. if it's given, CONTEXT can be an RDF::Redland::Node, RDF::Redland::URI or perl URI object.
  • find_statements STATEMENT [CONTEXT] β€” finds all the matching statements in the model that match the partial RDF::Redland::Statement STATEMENT β€” and yes, any of the subject, predicate, object RDF::Redland::Nodes can be undef, wildcards bestie. if CONTEXT is given, it only finds statements in that context.
    • 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.
  • sources ARC TARGET β€” gets all source RDF::Redland::Node objects for a given arc ARC, target TARGET RDF::Redland::Node objects, as a list of RDF::Redland::Node objects.
  • arcs SOURCE TARGET β€” gets all arc RDF::Redland::Node objects for a given source SOURCE, target TARGET RDF::Redland::Node objects, as a list of RDF::Redland::Node objects.
  • targets SOURCE ARC β€” gets all target RDF::Redland::Node objects for a given source SOURCE, arc ARC RDF::Redland::Node objects, as a list of RDF::Redland::Node objects.
  • sources_iterator ARC TARGET β€” gets all source RDF::Redland::Node objects for a given arc ARC, target TARGET RDF::Redland::Node objects, as an RDF::Redland::Iterator, or undef on failure. 😭
  • arcs_iterator SOURCE TARGET β€” gets all arc RDF::Redland::Node objects for a given source SOURCE, target TARGET RDF::Redland::Node objects, as an RDF::Redland::Iterator, or undef on failure.
  • targets_iterator SOURCE ARC β€” gets all target RDF::Redland::Node objects for a given source SOURCE, arc ARC RDF::Redland::Node objects, as an RDF::Redland::Iterator, or undef on failure.
  • source ARC TARGET β€” gets one source RDF::Redland::Node object matching a given arc ARC, target TARGET RDF::Redland::Node objects, or undef if there's no match. singular queen. πŸ‘‘
  • arc SOURCE TARGET β€” gets one arc RDF::Redland::Node object matching a given source SOURCE, target TARGET RDF::Redland::Node objects, or undef if there's no match.
  • target SOURCE ARC β€” gets one target RDF::Redland::Node object matching a given source SOURCE, arc ARC RDF::Redland::Node objects, or undef if there's no match.
  • contexts β€” gets all the context RDF::Redland::Node objects in the model. (original had no period there and honestly, respect. )
  • feature URI [VALUE] β€” get or set a model feature. the feature is named via RDF::Redland::URI URI, and the value is an RDF::Redland::Node. if VALUE is given, the feature gets set to that value; otherwise the current value is what comes back. ✨
  • query_execute QUERY β€” executes the QUERY RDF::Redland::Query against the model, returning a result set RDF::Redland::QueryResults, or undef on failure. big brain moment fr fr. πŸ”₯
  • load URI [SYNTAX-NAME [ MIME-TYPE [SYNTAX-URI [HANDLER ]]] β€” loads content from URI into the model, guessing the parser. yes, the brackets are uneven in the original, we're keeping it, no notes. πŸ’€
  • to_string [BASE-URI [SYNTAX-NAME [ MIME-TYPE [SYNTAX-URI]]] β€” serializes the model to a syntax. if no serializer name is given, the default serializer RDF/XML is used. 🌈

πŸ™ˆ OLDER METHODS πŸ™ˆ

these are the legacy girlies. still here, still working, but the docs say they got replaced. handle with care, bestie.

  • serialise β€” returns a new RDF::Redland::Stream object serialising the model as RDF::Redland::Statement objects. replaced by as_stream to reduce confusion with the RDF::Redland::Serializer class.
  • serialize β€” same deal, same description, spelled the other way. returns a new RDF::Redland::Stream object serialising the model as RDF::Redland::Statement objects. replaced by as_stream to reduce confusion with the RDF::Redland::Serializer class.

🌟 SEE ALSO 🌟

  • RDF::Redland::Storage
  • RDF::Redland::Node
  • RDF::Redland::Statement

go read those too, the lore is deep. πŸ¦‹


πŸ’… AUTHOR πŸ’…

Dave Beckett β€” http://www.dajobe.org/

legend behavior, honestly. πŸ‘‘


note to self and to you: this whole page lives in the perl v5.42.3 distribution, page dated 2026-08-20, and it's the RDF::R...::Model(3pm) manual page. take care of her, she's iconic. πŸŽ€βœ¨ bye bestie, go model some RDF. 🫢
πŸ“¦ where this page comes from