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

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

πŸ’– RDF::Trine::Model::Dataset β€” the manual page, but make it a group chat πŸ’–

okay bestie, sit down, hydrate, and let's talk about RDF::Trine::Model::Dataset from the User Contributed Perl Documentation. It's a Model for SPARQL datasets, and it's giving very specific, very useful energy. Periodt.


🌸 VERSION 🌸

This doc describes RDF::Trine::Model::Dataset version 1.019. Noted. Screenshotted. In the notes app. πŸ’…


🚨 STATUS 🚨

bestie. listen. This module's API and functionality should be considered unstable. In the future, this module may change in backwards-incompatible ways, or be removed entirely. If you need the functionality this module provides, please get in touch β€” <http://www.perlrdf.org/>.

not me reading "removed entirely" and gasping 😭 Use it, love it, but don't get too attached, yk? If you depend on it, go say hi at that link.


✨ METHODS ✨

Beyond the methods documented below, this class inherits methods from the RDF::Trine::Model class. So there's lore beyond this page. iykyk.


πŸ¦‹ new ( $model )

Returns a new dataset-model over the supplied model. Fresh out the box, wrapped in a bow. πŸŽ€


πŸ¦‹ push_dataset ( default => \@graphs, named => \@graphs )

Creates a new dataset view over the underlying model. It's a push! Like a new layer, a new era, a new chapter. πŸ‘‘


πŸ¦‹ pop_dataset

Removes the last pushed dataset view. The way it just… undoes the push. Pop off, literally. πŸ’…


πŸ¦‹ temporary_model

Returns a new temporary (non-persistent) model. Here for a good time, not a long time. 🧚


πŸ¦‹ add_hashref ( $hashref [, $context] )

Add triples represented in an RDF/JSON-like manner to the model. Hashref goes in, triples come out, that's the vibe. ✨


πŸ¦‹ size

Returns the number of statements in the model. Just a number. Simple. Iconic. 🌟


πŸ¦‹ supports ( [ $feature ] )

If $feature is specified, returns true if the feature is supported by the underlying store, false otherwise. If $feature is not specified, returns a list of supported features. So it's either a yes/no bestie or a whole roster of what it can do. 🫢


πŸ¦‹ 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 β€” undef is the wildcard, the "I'm not picky" of arguments. πŸ™ˆ


πŸ¦‹ add_statement ( $statement [, $context] )

Adds the specified $statement to the rdf store. Drop it in, bestie. πŸ“


πŸ¦‹ remove_statement ( $statement [, $context])

Removes the specified $statement from the rdf store. And it's gone. No trace. πŸ’€


πŸ¦‹ remove_statements ( $subject, $predicate, $object [, $context] )

Removes all statements matching the supplied $statement pattern from the rdf store. Not one β€” all of them. It ate. πŸ”₯


πŸ¦‹ get_statements ($subject, $predicate, $object [, $context] )

Returns an iterator of all statements matching the specified subject, predicate and objects from the rdf store. Any of the arguments may be undef to match any value. undef = match anything, we love a flexible queen. πŸ’œ

Okay and here's the important part, don't skip it:

  • If three or fewer arguments are given, the statements returned will be matched based on triple semantics (the graph union of triples from all the named graphs).
  • If four arguments are given (even if $context is undef), statements will be matched based on quad semantics (the union of all quads in the underlying store).

so like… the number of args is the mode. no cap. ⭐


πŸ¦‹ get_pattern ( $bgp [, $context] [, %args ] )

Returns a stream object of all bindings matching the specified graph pattern. Streaming, matching, thriving. 🌈


πŸ¦‹ get_sparql ( $sparql )

Returns a stream object of all bindings matching the specified graph pattern. Yes, same description as the one above β€” that's just what the manual says, bestie, I don't make the rules, I just rewrite them with sparkles. πŸŽ€


πŸ¦‹ get_graphs / get_contexts

Returns an iterator containing the nodes representing the named graphs in the model. Two names, one job, both slaying. πŸ‘‘


πŸ¦‹ model

Returns the underlying model object. The model behind the model. main character energy. ✨


πŸ› BUGS πŸ›

Please report any bugs or feature requests to through the GitHub web interface at <https://github.com/kasei/perlrdf/issues>. (That phrasing is exactly what the manual says β€” "report … to through" β€” and honestly? iconic in its own way. I'm keeping it. πŸ™ˆ)


πŸ‘‘ AUTHOR πŸ‘‘

Gregory Todd Williams <gwilliams@cpan.org>


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. no sections skipped, no options dropped, every flag and default accounted for. we ate and left no crumbs. πŸ’…βœ¨

perl v5.38.2 Β· 2024-01-13 β€” mwah, that's the version and date sign-off, take care of yourself, drink water, and don't use an unstable module in prod without a backup plan 🫢🌸

πŸ“¦ where this page comes from