DiaColloDB::Relation::TDF::Query - collocation db, profiling relation: PDL: query hacks
##======================================================================== ## PRELIMINARIES use DiaColloDB::Relation::TDF::Query; ##======================================================================== ## Constructors etc. $vq = CLASS_OR_OBJECT->new(%args); ##======================================================================== ## API: compilation $vq_or_undef = $vq->compile(%opts); $vq_or_undef = $vq->compileLocal(%opts); $vq_or_undef = $vq->compileOptions(%opts); ##======================================================================== ## Utils: set operations $vq = $vq->_intersect($vq2); $vq = $vq->_union($vq2); ##======================================================================== ## Wrappers: DDC::XS::Object $vq = $DDC_XS_OBJECT->__dcvs_compile($vq,%opts);
DiaColloDB::Relation::TDF::Query provides an object-oriented interface for parsing and evaluating queries in DDC syntax with respect to a sparse (term x document) frequency index as represented by a DiaColloDB::Relation::TDF object.
DiaColloDB::Relation::TDF::Query inherits from DiaColloDB::Logger.
$vq = CLASS_OR_OBJECT->new(%args); $vq = CLASS_OR_OBJECT->new($cquery);
Create and return a new tdf-query object from a parsed DDC::XS::CQuery object. %args, %$vq:
cq => $cquery, ##-- underlying DDC::XS::CQuery object ti => $ti_pdl, ##-- pdl ($NTi) : selected term-indices (undef: all) ci => $ci_pdl, ##-- pdl ($NCi) : selected cat-indices (undef: all)
$vq_or_undef = $vq->compile(%opts);
Wraps $vq->compileLocal(). %opts: as for DiaColloDB::profile(), also
coldb => $coldb, ##-- DiaColloDB context (for enums) tdf => $tdf, ##-- DiaColloDB::Relation::TDF context (for meta-enums)
$vq_or_undef = $vq->compileLocal(%opts);
Calls $vq->{cq}->__dcvs_compile($vq,%opts) to compile the query conditions into $vq->{ti} and $vq->{ci}, followed by $vq->compileOptions(). %opts: as for DiaColloDB::profile(), also:
$vq_or_undef = $vq->compileOptions(%opts);
merges underlying DDC::XS::CQueryOptions restrictions into $vq piddles. %opts: as for the compile() method.
$vq = $vq->_intersect($vq2);
destructive intersection on component piddles.
$vq = $vq->_union($vq2);
destructive union on component piddles.
The DiaColloDB::Relation::TDF::Query package extends the DDC::XS::Object subclasses with additional methods for compiling DiaColloDB::Relation::TDF::Query objects from DDC::XS::CQuery and/or DDC::XS::CQFilter objects representing a fully parsed DDC query.
$vq = $DDC_XS_OBJECT->__dcvs_compile($vq,%opts);
Compiles $DDC_XS_OBJECT (a DDC::XS::Object) into a DiaColloDB::Relation::TDF::Query object $vq. Returns $vq on success, or undef on failure. %opts: as for DiaColloDB::Relation::TDF::Query::compile().
Supported subclasses:
Fallback method to report errors.
Dummy method for universal wildcard queries.
Used for bareword queries, doesn't really support DDC-style re-inflection or term-expansion.
Used for set-valued bareword queries, doesn't really support DDC-style re-inflection or term-expansion.
Used for %LEMMA lemma queries, doesn't really support DDC-style re-inflection or term-expansion.
Boolean conjunction operator evaluates to union of sub-query term-targets and the intersection of the sub-query category-targets, restricted to the corresponding term-teargets, so a query (A && B) behaves as a sparse matrix mapping each document d in any category c containing both A and B to f(A,d)+f(B,d).
d
c
A
B
f(A,d)+f(B,d)
TODO: make this restriction actually work on document (signature) level rather than category level, for better resolution.
Dispatch methods compiles filters.
Bryan Jurish <moocow@cpan.org>
Copyright (C) 2015-2016 by Bryan Jurish
This package is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.14.2 or, at your option, any later version of Perl 5 you may have available.
DDC::XS::CQuery(3pm), DiaColloDB::Relation::TDF(3pm), DiaColloDB(3pm), perl(1), ...
To install DiaColloDB, copy and paste the appropriate command in to your terminal.
cpanm
cpanm DiaColloDB
CPAN shell
perl -MCPAN -e shell install DiaColloDB
For more information on module installation, please visit the detailed CPAN module installation guide.