RDF::T...:Memory(3pm)
π 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 beundefto match any value.undef= wildcard, iykyk. π₯get_contextsβ returns anRDF::Trine::Iteratorover theRDF::Trine::Nodeobjects comprising the set of contexts of the stored quads. all the contexts, lined up, adorable. πadd_statement ( $statement [, $context] )β adds the specified$statementto the underlying model. boom, added.remove_statement ( $statement [, $context])β removes the specified$statementfrom the underlying model. bye bestie. πremove_statements ( $subject, $predicate, $object [, $context])β removes the specified$statementfrom 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 beundefto 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$featureis specified, returns true if the feature is supported by the store, false otherwise. if$featureis 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 π
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
- debian trixie: librdf-trine-perl 1.019-4 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu noble: librdf-trine-perl 1.019-4 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu resolute: librdf-trine-perl 1.019-4 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu stonking: librdf-trine-perl 1.019-4 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms