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

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

πŸ’– NAME πŸ’–

okay so bestie, gather round: RDF::Trine::Store::Memory β€” it's a simple in-memory RDF store. that's it, that's the whole vibe. it lives in the User Contributed Perl Documentation, section 3pm, and yes it's giving iconic little perl module energy. πŸ¦‹


✨ VERSION ✨

this doc describes RDF::Trine::Store::Memory version 1.019. periodt. πŸ’…


πŸŽ€ SYNOPSIS πŸŽ€

like, here's how you even get it into your life:

use RDF::Trine::Store::Memory;

that's the whole thing. slay. ✨


🌸 DESCRIPTION 🌸

RDF::Trine::Store::Memory provides an in-memory triple-store. no disk, no drama, just triples vibing in RAM. lowkey perfect for testing and highkey perfect for when you want things fast. 🧚


πŸ‘‘ METHODS πŸ‘‘

bestie, listen: beyond the methods documented right here, this class also inherits methods from the RDF::Trine::Store class. so it's not just these, it's these plus the family inheritance. main character lineage fr fr. πŸ’œ

  • new () β€” returns a new memory-backed storage object. fresh out the box, empty, ready. ✨
  • new_with_config ( $hashref ) β€” returns a new storage object configured with a hashref with certain keys as arguments. so you hand it a hashref, it hands you a store.

the storetype key must be Memory for this backend. no substitutions, bestie. that's the vibe check. 🚨

this module also supports initializing the store from a file or URL, in which case a sources key may be used. that key holds an arrayref of hashrefs. to load a file, you may give the file name with a file key in the hashref, and to load a URL, use url. see example below. furthermore, the following keys may be used:

  • syntax β€” the syntax of the parsed file or URL.
  • base_uri β€” the base URI to be used for a parsed file.
  • graph β€” NOT IMPLEMENTED. use this URI as a graph name for the contents of the file or URL. (sadly this one did not eat. 😭 it is literally not implemented, don't come for me.)

the following example initializes a Memory store based on a local file and a remote URL:

my $store = RDF::Trine::Store->new_with_config(
              {
                storetype => 'Memory',
                sources => [
                  {
                    file => 'test-23.ttl',
                    syntax => 'turtle',
                  },
                  {
                    url => 'http://www.kjetil.kjernsmo.net/foaf',
                    syntax => 'rdfxml',
                    graph => 'http://example.org/graph/remote-users'
                  }
                ]
              });
  • temporary_store β€” returns a temporary (empty) triple store. emphasis on empty, she comes with nothing. 🫢
  • get_statements ( $subject, $predicate, $object [, $context] ) β€” returns a stream object of all statements matching the specified subject, predicate and objects. any of the arguments may be undef to match any value. undef = wildcard, iykyk. πŸ”₯
  • get_contexts β€” returns an RDF::Trine::Iterator over the RDF::Trine::Node objects comprising the set of contexts of the stored quads. all the contexts, lined up, adorable. 🌈
  • add_statement ( $statement [, $context] ) β€” adds the specified $statement to the underlying model. boom, added.
  • remove_statement ( $statement [, $context]) β€” removes the specified $statement from the underlying model. bye bestie. πŸ’€
  • remove_statements ( $subject, $predicate, $object [, $context]) β€” removes the specified $statement from the underlying model.
okay tiny note: yes, this one's description in the original literally says "the specified $statement" even though it takes $subject, $predicate, $object [, $context]. i'm telling you exactly what it says, no editing, no guessing. πŸ™ˆ
  • count_statements ( $subject, $predicate, $object, $context ) β€” returns a count of all the statements matching the specified subject, predicate, object, and context. any of the arguments may be undef to match any value. numbers, bestie, we love a count. ⭐
  • etag β€” if the store has the capability and knowledge to support caching, returns a persistent token that will remain consistent as long as the store's data doesn't change. this token is acceptable for use as an HTTP ETag. it stays the same until the data changes β€” loyalty fr fr. πŸ’–
  • size β€” returns the number of statements in the store. how many? exactly that many. πŸ“
  • 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. give it a name, get a boolean; give it nothing, get the whole list. versatile queen. πŸ‘‘

πŸ› BUGS πŸ›

please report any bugs or feature requests to through the GitHub web interface at <https://github.com/kasei/perlrdf/issues>. (yes that sentence is exactly as written, "report any bugs or feature requests to through" β€” we don't gatekeep, we report. πŸ’…)


πŸ’œ AUTHOR πŸ’œ

Gregory Todd Williams "<gwilliams@cpan.org>". legend behaviour. 🫢


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. iconic, generous, legally slay. ✨


and that's a wrap bestie πŸŽ€ this was RDF::Trine::Store::Memory from the perl v5.38.2 docs, dated 2024-01-13. go forth and store your triples in memory, no cap. πŸŒˆπŸ’–

πŸ“¦ where this page comes from