[P1] Add safe bounded text/token iteration to native CouchDB map DSL #28
Labels
No labels
bug
dependencies
docker
documentation
duplicate
enhancement
github_actions
good first issue
help wanted
invalid
question
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
nsaspy/prolog-query-server#28
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Goal
Extend the native CouchDB
language: "prolog"map DSL so a design view can safely tokenize existing text fields and emit one row per lexical occurrence. The immediate consumer is Star Funds social mention counting over StarIntelSocialMPost.content.This supersedes the earlier
word_counts-array design. Do not require precomputed word-count documents. The view should derive counts directly from the source document.Required safe DSL
The minimal surface should support expressions/actions equivalent to:
Example:
Time-keyed example:
date_updatedis used by the Star Funds view as initial knowledge/ingest time; provider-authored time remains a separate source field/semantic.Token semantics
"Trump trump"emits twotrumprows);"oil, oil!"emits twooilrows);Security requirements
call/1, dynamic predicate invocation, source execution, shell access, file access, or executableadd_libbehavior.item/item(Path)is only valid under iterator scope.for_each/2collection must evaluate to a JSON/Prolog list.time_part/2accepts only a fixed unit whitelist and numeric Unix timestamps.Reduce compatibility
Map output must continue to work unchanged with existing
sum.,count.,min.,max., andstats.reduce/rereduce behavior.Tests
item(Path)lookup;whereconditions;itemoutsidefor_each/2;Done when
A CouchDB Prolog view can derive
[word,...] -> 1rows directly fromSocialMPost.content, safely and deterministically, without precomputedword_countsdocuments or executable Prolog from CouchDB documents.