Class SquishQuery
In: lib/squish.rb
Parent: Object

Methods

Attributes

all_vars  [RW]  incl parsed query state
clauses  [RW]  incl parsed query state
from_args  [RW]  incl parsed query state
full_clauses  [RW]  incl parsed query state
select_args  [RW]  incl parsed query state
using_args  [RW]  incl parsed query state
where_args  [RW]  incl parsed query state
xmlns  [RW]  incl parsed query state

Public Class methods

query a graph using squish (returns ResultSet)

 Sample Web service plugins: Google/backlinks

todo: a general API for such things would be nice. This is rather arbitrary.

Public Instance methods

expand namespaces and store in expanded_clauses

update self.all_vars based on variables named in self.clauses

the optional FROM keyword

 -> where_lpar (todo: to where_keyword)

Other functions (should move to basicrdf.rb someday)

obj_expr where clause, object expression -> where_rpar

pred_expr where clause, predicate expression -> sub_expr

Hmm, don‘t understand why needed a method for an array field todo: read docs on attr_accessor

sub_expr where clause, subject expression -> obj_expr

Output in Algae syntax (URI for spec?) todo: look at commas, throw exception for ’*’ or workaround as below

      - for this, need an query.allvarnames() method
      - warn if there's a FROM clause, or figure out Algae syntax
      - find out Algae notation for using ns prefixes

Squish2SQL facilities

output requested variables as contents of a Squish SELECT clause

eg: "?x, ?y, ?z"

todo: refactor to hide the * case from apps that want a clean list of vars, ie. sharecode w/ algae function. self.sels is bad data.

using_keyword: final clause (optional), deals with namespace expansions

where_lpar: ’(’ where clause, left paren

-> deal with each pred_expr or drop out of WHERE via using_keyword

where_rpar: where clause, right paren -> where_lpar

[Validate]