RDF::Q...er::SQL(3pm)

✨ NAME ✨

RDF::Query::Compiler::SQL β€” the little icon that compiles a SPARQL query directly to SQL. no middleman, no cap, it just does the thing πŸ’…

(the manual page for this one is filed under RDF::Q...er::SQL(3pm), bestie, don't let the truncated title scare you 🫢)


🌸 VERSION 🌸

This document describes RDF::Query::Compiler::SQL version 2.919. yes, that's the whole vibe check, that's the number πŸŽ€


πŸ’€ STATUS πŸ’€

Okay so… not to be dramatic but this module's API and functionality should be considered deprecated. like, it's giving "still works but don't make it your whole personality" energy 😭

If you genuinely need functionality that this module provides, please get in touch β€” the perlrdF girlies are at <http://www.perlrdf.org/> and they would love to hear from you πŸ’–

fr fr, deprecated means deprecated. build new stuff on something else, bestie.

πŸ‘‘ METHODS πŸ‘‘

πŸ¦‹ new ( $parse_tree )

Returns a new compiler object. fresh out the box, squeaky clean, ready to compile ✨

πŸ¦‹ compile ()

Returns a SQL query string for the specified parse tree. the whole point of the exercise, honestly πŸ”₯

πŸ¦‹ emit_select

Returns a SQL query string representing the query. SELECT statement, served hot πŸ“

πŸ¦‹ limit_clause

Returns a SQL LIMIT clause β€” or an empty string if the query does not need limiting. no limit, no clause, no problem πŸ’…

πŸ¦‹ order_by_clause

Returns a SQL ORDER BY clause β€” or an empty string if the query does not use ordering. if there's no ordering to be done, she simply does not speak πŸ™ˆ

πŸ¦‹ variable_columns ( $var )

Given a variable name, returns the set of column aliases that store the values for the column β€” that's the values for Literals, URIs, and Blank Nodes. three flavors, one variable, iconic behavior 🌈

πŸ¦‹ add_variable_values_joins

Modifies the query by adding LEFT JOINs to the tables in the database that contain the node values (for literals, resources, and blank nodes). she's joining the group chat, literally 🫢

πŸ¦‹ patterns2sql ( \@triples, \$level, %args )

Builds the SQL query in instance data from the supplied @triples. $level is used as a unique identifier for recursive calls β€” yes ma'am, recursion, we keep track of our depth in this house 😀

%args may contain callback closures for the following keys:

'where_hook'
'from_hook'

When present, these closures are used to add SQL FROM and WHERE clauses to the query instead of adding them directly to the object's instance data. your hooks, your rules, main character energy πŸ‘‘

πŸ¦‹ expr2sql ( $expression, \$level, %args )

Returns a SQL expression for the supplied query $expression. $level is used as a unique identifier for recursive calls. same recursion situation, same chaotic little counter ✨

%args may contain callback closures for the following keys:

'where_hook'
'from_hook'

When present, these closures are used to add necessary SQL FROM and WHERE clauses to the query. delegation? we love to see it πŸ’œ

πŸ¦‹ _mysql_hash ( $data )

Returns a hash value for the supplied $data string. This value is computed using the same algorithm that Redland's mysql storage backend uses. compatibility queen, we stay matching πŸ”₯

πŸ¦‹ _mysql_node_hash ( $node )

Returns a hash value (computed by _mysql_hash) for the supplied $node. The hash value is based on the string value of the node and the node type. two ingredients, one hash, chef's kiss πŸ‘©β€πŸ³

πŸ¦‹ qualify_uri ( $uri )

Returns a fully qualified URI from the supplied $uri. $uri may already be a qualified URI, or a parse tree for a qualified URI or QName. If $uri is a QName, the namespaces defined in the query parse tree are used to fully qualify. glow-up complete, she's fully qualified now πŸ’…βœ¨

πŸ¦‹ add_function ( $uri, $function )

Associates the custom function $function (a CODE reference) with the specified URI, allowing the function to be called by query FILTERs. custom function, custom rules, we stan a plug-in moment 🧚

πŸ¦‹ get_function ( $uri )

If $uri is associated with a query function, returns a CODE reference to the function. Otherwise returns undef. and if it's undef? she's just not there, bestie, don't take it personally 😭


πŸŽ€ AUTHOR πŸŽ€

Gregory Williams <gwilliams@cpan.org>

absolute legend, no notes πŸ’–


okay that's the whole page!! this was perl v5.40.1, dated 2025-08-18, and you read the RDF::Q...er::SQL(3pm) manpage β€” slay, go compile something gorgeous, ily, bye bestie πŸ¦‹βœ¨πŸ’…

πŸ“¦ where this page comes from