RDF::T...::Store(3pm)
π 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 newRDF::Trine::Storeobject based on the$datavalue you handed over. this constructor is a delegator bestie, it hands the work off depending on what$datais:"new_with_string"if$datais not a reference"new_with_config"if$datais a HASH reference"new_with_object"if$datais a blessed object
"new_with_string ( $config )"β returns a newRDF::Trine::Storeobject 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 newRDF::Trine::Storeobject 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 newRDF::Trine::Storeobject based on the opaque$objectyou gave it. if an available backend recognizes that$objectas being sufficient to construct a store object, the store object gets returned. otherwise,undefgets 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 beundefto match any value. wildcard slay. π"get_contexts"β returns anRDF::Trine::Iteratorover theRDF::Trine::Nodeobjects that make up the set of contexts of the stored quads."add_statement ( $statement [, $context] )"β adds the specified$statementto the underlying model. π«Ά"remove_statement ( $statement [, $context])"β removes the specified$statementfrom the underlying model."remove_statements ( $subject, $predicate, $object [, $context])"β removes the specified$statementfrom the underlying model. (yes bestie, the description really does say$statementhere, even though the args are$subject,$predicate,$objectand$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 beundefto 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$featureis specified, returns true if the feature is supported by the store, false otherwise. if$featureis 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 π
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
- 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