Attean...:SPARQL(3pm)

✨ NAME ✨

AtteanX::Parser::SPARQL β€” SPARQL 1.1 Parser. You're reading the Attean...:SPARQL(3pm) page from the User Contributed Perl Documentation, and it's lowkey iconic. πŸ’–

🌸 VERSION 🌸

This document describes AtteanX::Parser::SPARQL version 0.035. yes, 0.035, write it down bestie.

πŸ¦‹ SYNOPSIS πŸ¦‹

okay so here's the vibe, code first:

use AtteanX::Parser::SPARQL;
my $algbrea = AtteanX::Parser::SPARQL->parse($sparql);
# or:
my $parser     = AtteanX::Parser::SPARQL->new();
my ($algebra) = $parser->parse_list_from_bytes($sparql);

# or to allow parsing of SPARQL 1.1 Updates:

my $algbrea = AtteanX::Parser::SPARQL->parse_update($sparql);
# or:
my $parser = AtteanX::Parser::SPARQL->new(update => 1);
my ($algebra) = $parser->parse_list_from_bytes($sparql);

Notice that $algbrea is spelled like that in the original synopsis β€” we're keeping it exactly, no β€œfixing” the variable name, periodt.

πŸ’… DESCRIPTION πŸ’…

This module implements a recursive-descent parser for SPARQL 1.1 using the AtteanX::Parser::SPARQLLex tokenizer. tokenizer bestie, it's giving lex realness. Successful parsing results in an object whose type is one of: Attean::Algebra::Query, Attean::Algebra::Update, or Attean::Algebra::Sequence. That's the whole type trio, no cap.

πŸ‘‘ ROLES πŸ‘‘

This class consumes Attean::API::Parser, Attean::API::AtOnceParser, and Attean::API::AbbreviatingParser. three roles, all consumed, slay.

πŸŽ€ ATTRIBUTES πŸŽ€

These are the attributes, exactly as the page lists them. The original doesn't spell out what each one does, so we're not inventing lore β€” just handing you the names, bestie:

  • canonical_media_type
  • media_types
  • file_extensions
  • handled_type
  • lexer
  • args
  • build
  • update
  • namespaces
  • baseURI
  • filters
  • blank_nodes
  • has_blank_nodes_map

πŸ”₯ METHODS πŸ”₯

Some methods get a description, some are just a signature and a dream. Here's the full lineup:

  • parse ( $sparql ) β€” Parse the $sparql query string and return the resulting Attean::API::Algebra object. query mode: activated.
  • parse_update ( $sparql ) β€” Parse the $sparql update string and return the resulting Attean::API::Algebra object. update mode: also activated.
  • parse_list_from_io( $fh ) β€” listed as a method; the original page gives no extra description here. (just the signature, no extra lore)
  • parse_list_from_bytes( $bytes ) β€” same deal: listed as a method, with no extra description in the original. signature only, bestie.
  • parse_nodes ( $string ) β€” Returns a list of Attean::API::Term or Attean::API::Variable objects, parsed in SPARQL syntax from the supplied $string. Parsing is ended either upon seeing a DOT, or reaching the end of the string. DOT or done, those are the rules.
  • error β€” Returns the error encountered during the last parse. the last parse's receipts, basically.
  • new_binary_expression ( $operator, @operands ) β€” Returns a new binary expression structure.
  • new_function_expression ( $function, @operands ) β€” Returns a new function expression structure.

πŸ’€ BUGS πŸ’€

Please report any bugs or feature requests through the GitHub web interface at https://github.com/kasei/attean/issues. the issue tracker is right there, go off.

🌈 SEE ALSO 🌈

This section is empty in the original page β€” no SEE ALSO references listed. nothing to see here, literally.

πŸ“ AUTHOR πŸ“

Gregory Todd Williams "<gwilliams@cpan.org>". author icon behavior.

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


Sign-off: this page is from perl v5.40.0, dated 2025-01-26, and it's the Attean...:SPARQL(3pm) manual. byeeee πŸ’–

πŸ“¦ where this page comes from