Attean...re::DBI(3pm)

πŸ“¦
version 0.003 Β· 5 versions
, in ubuntu resolute, ubuntu stonking

πŸ’– NAME πŸ’–

AtteanX::Store::DBI β€” it's a database quad-store, bestie. That's the whole vibe.


✨ VERSION ✨

This doc is describing AtteanX::Store::DBI version 0.003. Locked in. πŸ”’


🌸 SYNOPSIS 🌸

use Attean;
my $store = Attean->get_store('DBI')->new( dbh => $dbh );

That's it. That's the whole glow-up. ✨


πŸ¦‹ DESCRIPTION πŸ¦‹

So like. AtteanX::Store::DBI gives you a quad-store that's backed by a relational database. RDF, but make it SQL. The way it just… stores quads in a database? Obsessed, honestly. πŸ’…


πŸŽ€ ATTRIBUTES πŸŽ€

  • dbh β€” the database handle. Your connection to the whole thing. Main character, lowkey.

πŸ‘‘ ROLES πŸ‘‘

This class consumes all of these, periodt:

  • Attean::API::QuadStore
  • Attean::API::MutableQuadStore
  • Attean::API::BulkUpdatableStore

Three roles. It said yes to all of them. Queen behavior. πŸ‘‘


πŸ’œ METHODS πŸ’œ

  • new ( dbh => $dbh ) β€” hands you back a brand-new quad-store object, backed by the database that the $dbh you passed in is pointing at. Fresh out the box. 🎁
  • init() β€” makes all the tables and indexes you need so the database can actually do quadstore things. Setting up the whole aesthetic. πŸ› οΈ
  • temporary_store() β€” returns a temporary store. It's in-memory, and it's SQLite. That's the whole deal. πŸ’­
  • get_quads ( $subject, $predicate, $object, $graph ) β€” returns a stream object of every statement that matches the subject, predicate and objects you asked for. Any of the args can be undef and that means "match literally anything", or you can hand it an ARRAY reference of terms that are allowed in that respective quad position. So flexible of it. 🫢
  • count_quads ( $subject, $predicate, $object, $graph ) β€” same energy as above, but instead of a stream you get the count of all statements matching. Again: any arg can be undef to match anything, or an ARRAY reference of terms allowable in that respective quad position. Counting is self-care. πŸ”’
  • get_graphs β€” returns an iterator over the Attean::API::Term objects that make up the set of graphs of the stored quads. Iterator era. πŸ”
  • add_quad ( $quad ) β€” drops the $quad you give it into the underlying model. πŸ’Œ
  • remove_quad ( $statement ) β€” takes the $statement you give it out of the underlying model. Gone. Not invited back. πŸšͺ
  • create_graph( $graph ) β€” for the memory quad-store this is a no-op function. It does nothing. It's just standing there. 🧍
  • drop_graph( $graph ) β€” removes every quad that has the given $graph. All of them. πŸ’€
  • clear_graph( $graph ) β€” removes every quad that has the given $graph. (Yeah it's the same as drop_graph. Siblings. πŸ‘―)
  • begin_transaction β€” begins a database transaction. 🚦
  • abort_transaction β€” rolls back the current database transaction. Undo, but for databases. ↩️
  • end_transaction β€” commits the current database transaction. No take-backs. βœ…
  • begin_bulk_updates β€” begins a database transaction. (Bulk edition. πŸ“¦)
  • end_bulk_updates β€” commits the current database transaction. (Bulk edition, committed. πŸ“¦βœ…)
  • database_type β€” returns the database type name as a string, like 'mysql', 'sqlite', or 'postgresql'. Name-dropping but make it technical. 🏷️
  • initialize_version β€” inserts data into the attean_version table. πŸ—‚οΈ
  • create_schema_file β€” returns the path to the file holding the database DDL for quadstore creation for the current database type, if available, and undef otherwise. ⚠️ if available, babes.
  • drop_schema_file β€” returns the path to the file holding the database DDL for quadstore deletion for the current database type, if available, and undef otherwise. Same caveat, opposite direction. πŸ—‘οΈ
  • available_database_types β€” returns the names of the database types that the system actually has schemas for, to create and drop quadstore tables. No schemas, no service. πŸ™…
  • dbi_connect_args ( $type, %args )
  • dbi_connect_args ( %args ) β€” returns a quad "$dsn, $user, $password, \%connect_args" that's suitable for passing to DBI->connect, so you can get a database handle to use when you're constructing an AtteanX::Store::DBI quadstore. 🫱

Your %args must contain a value for the "database" key. Required. Non-negotiable.

It may also contain values for these optional keys: "user", "password", "host", and "port". Optional cuties. πŸŽ€

If you invoke it as a class method, the $type parameter is required, and it has to be one of the database types returned by available_database_types. Pick from the list, bestie.

If you invoke it as an object method, the $type parameter must not be included β€” that info gets pulled straight off the AtteanX::Store::DBI object instead. Don't double up. πŸ™ˆ

  • plans_for_algebra( $algebra, $model, $active_graphs, $default_graphs ) β€” for BGP algebras, returns a DBI-specific Attean::API::Plan object. For anything else, returns undef. BGP only, iykyk. 🧠
  • cost_for_plan( $plan ) β€” returns the estimated cost for a DBI-specific query plan, and undef otherwise. Budgeting, but make it query planning. πŸ’Έ

πŸ› BUGS πŸ›

Found a bug? Want a feature? Please report it through the GitHub web interface at <https://github.com/kasei/perlrdf2/issues>. We'll look at it fr fr. πŸ™


🌈 AUTHOR 🌈

Gregory Todd Williams "<gwilliams@cpan.org>" β€” the icon who wrote this. πŸ‘‘


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


okay that's the whole page, bestie β€” AtteanX::Store::DBI version 0.003, straight from perl v5.40.1 on 2025-12-20. now go build a quadstore, you absolute legend πŸ’…πŸ¦‹πŸ’–

πŸ“¦ where this page comes from