RDF::Query::Util(3pm)
π RDF::Query::Util β the group chat edition π
okay bestie, so this is RDF::Query::Util(3pm) from the User Contributed Perl Documentation corner of the internet, and it's basically the little toolbelt π§° of odds-and-ends that makes working with RDF::Query actually bearable. no cap.
πΈ NAME πΈ
RDF::Query::Util β miscellaneous utility functions to support work with RDF::Query. it's giving "supportive bestie who holds your bag while you slay." π«Ά
β¨ VERSION β¨
this doc is describing RDF::Query::Util version 2.919. yes queen, we're keeping receipts. π
π SYNOPSIS π
here's the vibe, literally just copy-paste energy:
use RDF::Query::Util;
my $query = &RDF::Query::Util::cli_make_query;
my $model = &RDF::Query::Util::cli_make_model;
$query->execute( $model );
...
the ... at the end is doing so much heavy lifting and honestly? same. π
π¦ FUNCTIONS π¦
cli_make_query_and_model
returns a query object, a model, and an args HASHref, all based on the arguments chilling in @ARGV. those arguments get parsed using cli_make_query and make_model. it's a three-for-one deal, iconic behavior. π
cli_make_query
returns a RDF::Query object based on the arguments in @ARGV. these arguments get parsed using &cli_parse_args. lowkey important detail: if the -e flag is not present, the query gets loaded from a file named by the argument in @ARGV that comes immediately after the final argument parsed by &cli_parse_args. so like. order matters bestie. don't be chaotic. π
cli_make_model
calls make_model with arguments from @ARGV and hands you back the constructed model object. π
cli_make_model will usually be called after cli_make_query, which lets a typical CLI invocation look like:
prog.pl [flags] [query file] [data files]
see? flags, then query file, then data files. the pipeline is pipeline-ing. β¨
make_model ( @files )
returns a model object that's suitable for use in a call to $query->execute, loaded up with RDF from the files and/or URLs listed in @files.
this model may be any of the supported models, but as currently implemented it will be a RDF::Trine::Model object. so like, dream big, but realistically that's what you're getting. π
cli_parse_args
parses CLI arguments straight out of @ARGV and returns a HASH with the recognized key/values. all the allowable arguments are listed right below, so keep scrolling bestie. π
π COMMAND LINE ARGUMENTS π
-e strβ specifies the query stringstr. your query, right there, inline. no file needed. slay. π-l langβ specifies the query languagelangthat's being used. this should be one of:sparql,sparql11, orrdql. those are the only three, no inventing new ones, periodt. π«-Oβ turns on optimization. capital letter, capital energy. π₯-oβ turns off optimization. lowercase, lowercase vibes. and yes,-Oand-oare different flags, case-sensitive bestie, do not mix them up. π-c classβ specifies the perl class used to construct the query object. defaults toRDF::Query. β¨-fβ implies-c RDF::Query::Federate. one flag, and suddenly you're federating. the way that works?? iconic. π¦-F locβ specifies the URL or path to a filelocwhich contains an RDF service description. the described service is used as an underlying triplestore for query answering. this implies-f. πΈ-E urlβ specifies the URL of a remove SPARQL endpoint to be used as a data source. the endpoint is used as an underlying triplestore for query answering. this implies-ftoo. (yes, the original really does say "remove" β we're keeping it exactly as written, no editing the queen's words. π«Ά)-s database-typeβ specifies the database type to use for the underlying data model.-u userβ no description given in the original, it's serving mystery. π-p passwordβ also no description. the silence is loud. π-m modelβ also also no description. three little flags living their truth with zero explanation. π
π AUTHOR π
Gregory Todd Williams <gwilliams@cpan.org> β thank you for your service, king. π
and that's the whole page bestie!! π written from perl v5.40.1, dated 2025-08-18, and it's RDF::Query::Util(3pm) through and through. now go forth and execute( $model ) with your whole chest. mwah. πβ¨π
π¦ where this page comes from
- ubuntu resolute: librdf-query-perl 2.919-2 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu stonking: librdf-query-perl 2.919-2 Β· 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