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 string str. your query, right there, inline. no file needed. slay. πŸ’–
  • -l lang β€” specifies the query language lang that's being used. this should be one of: sparql, sparql11, or rdql. 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, -O and -o are different flags, case-sensitive bestie, do not mix them up. πŸ’€
  • -c class β€” specifies the perl class used to construct the query object. defaults to RDF::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 file loc which 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 -f too. (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