RDF::T...::Store(3pm)

πŸ“¦
version 1.019 Β· 7 versions
, in debian trixie, ubuntu noble, ubuntu resolute, ubuntu stonking

πŸ’– RDF::T...::Store β€” the perl manual page, but make it cute πŸ’–

okay bestie, gather round, because we're reading the RDF::T...::Store(3pm) page from the User Contributed Perl Documentation and honestly? it's giving base class energy and I'm obsessed.


✨ NAME ✨

RDF::Trine::Store β€” the RDF triplestore base class. that's it, that's the whole vibe. πŸŽ€


🌸 VERSION 🌸

This document describes RDF::Trine::Store version 1.019. periodt. πŸ’…


πŸ¦‹ DESCRIPTION πŸ¦‹

so RDF::Trine::Store is the base class AND the common API for all the triple/quadstore implementations that live inside the RDF::Trine framework. lowkey iconic of it.

bestie listen β€” in general this is for people implementing new stores. if you're just trying to interact with a store (read, insert, delete triples, the usual), you want the RDF::Trine::Model interface instead. the model is the middleman between you/the client and the underlying store. don't skip the middleman. πŸ™ˆ

for the RDF::Trine framework to actually use your store implementation, it must implement a required set of functionality:

  • "new"
  • "get_statements"
  • "get_contexts"
  • "add_statement"
  • "remove_statement"
  • "count_statements"
  • "supports"

and implementations may also provide these methods, but only if a native implementation would be more efficient than the default that RDF::Trine::Store gives you:

  • "get_pattern"
  • "get_sparql"
  • "remove_statements"
  • "size"
  • "nuke"
  • "_begin_bulk_ops"
  • "_end_bulk_ops"

like, optional but make it faster, yk? ⚑


🫢 METHODS 🫢

  • "new ( $data )" β€” returns a brand new RDF::Trine::Store object based on the $data value you handed over. this constructor is a delegator bestie, it hands the work off depending on what $data is:
    • "new_with_string" if $data is not a reference
    • "new_with_config" if $data is a HASH reference
    • "new_with_object" if $data is a blessed object
  • "new_with_string ( $config )" β€” returns a new RDF::Trine::Store object based on the configuration string you passed in. the format of that string tells you which Store subclass gets instantiated, plus any constructor arguments it needs. these are separated by a semicolon. an example config string for the DBI store would be:
DBI;mymodel;DBI:mysql:database=rdf;user;password

the format of the constructor arguments (aka everything after the first ';') is specific to the Store subclass. so read their docs, not this one. πŸ’€

  • "new_with_config ( \%config )" β€” returns a new RDF::Trine::Store object based on the configuration hashref you supplied. this requires the Store subclass to be supplied with a "storetype" key, and the other keys are required by the Store subclasses β€” so please refer to each subclass for specific documentation. an example invocation for the DBI store may be:
my $store = RDF::Trine::Store->new_with_config({
              storetype => 'DBI',
              name      => 'mymodel',
              dsn       => 'DBI:mysql:database=rdf',
              username  => 'dahut',
              password  => 'Str0ngPa55w0RD'
            });
  • "new_with_object ( $object )" β€” returns a new RDF::Trine::Store object based on the opaque $object you gave it. if an available backend recognizes that $object as being sufficient to construct a store object, the store object gets returned. otherwise, undef gets returned. no store for you, sorry bestie. 😭
  • "nuke" β€” permanently removes the store and its data. like, GONE gone. irreversible. this is the main character villain arc of methods. πŸ’€
  • "class_by_name ( $name )" β€” returns the class of the storage implementation with that given name. for example, 'Memory' would return 'RDF::Trine::Store::Memory'. cute, right?
  • "temporary_store" β€” returns a new temporary triplestore (using appropriate default values). pop-up store, no commitment. ✨
  • "get_statements ($subject, $predicate, $object [, $context] )" β€” returns a stream object of all the statements matching the subject, predicate and objects you specified. any of the arguments may be undef to match any value. wildcard slay. 🌈
  • "get_contexts" β€” returns an RDF::Trine::Iterator over the RDF::Trine::Node objects that make up the set of contexts of the stored quads.
  • "add_statement ( $statement [, $context] )" β€” adds the specified $statement to the underlying model. 🫢
  • "remove_statement ( $statement [, $context])" β€” removes the specified $statement from the underlying model.
  • "remove_statements ( $subject, $predicate, $object [, $context])" β€” removes the specified $statement from the underlying model. (yes bestie, the description really does say $statement here, even though the args are $subject, $predicate, $object and $context β€” I'm just reporting the lore fr fr. πŸ‘€)
  • "count_statements ($subject, $predicate, $object)" β€” returns a count of all the statements matching the specified subject, predicate and objects. any of the arguments may be undef to match any value.
  • "size" β€” returns the number of statements in the store. the receipts. 🧾
  • "etag" β€” if the store has the capability and the knowledge to support caching, this returns a persistent token that will stay consistent for as long as the store's data doesn't change. this token is acceptable for use as an HTTP ETag. caching queen behavior. πŸ‘‘
  • "supports ( [ $feature ] )" β€” if $feature is specified, returns true if the feature is supported by the store, false otherwise. if $feature is not specified, returns a list of supported features. vibe check, but for features. βœ…

πŸ’€ BUGS πŸ’€

please report any bugs or feature requests through the GitHub web interface at <https://github.com/kasei/perlrdf/issues>. we love a paper trail. πŸ™ˆ


πŸ‘‘ AUTHOR πŸ‘‘

Gregory Todd Williams "<gwilliams@cpan.org>" β€” the author. the moment. the legend.


Copyright (c) 2006-2012 Gregory Todd Williams. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.


and that's the whole page bestie!! πŸ’– this beauty shipped with perl v5.38.2 and got dated 2024-01-13 β€” so if you're reading it way later, hi, hope the triplestore is still slaying. mwah! πŸ’…βœ¨

πŸ“¦ where this page comes from