Hi Kestutis --

I am definitely NOT Christian, but the general pattern of these things
looks like:

let $known as xs:string+ := db:open('master')/descendant::key/string()
let $samples as xs:string+ := db:open('samples')/descendant::key/string()

return $samples[not(. = $known)]

That is, you get a sequence of all the key values you care about in the
canonical DB.  You get a similar sequence of all the key values you care
about in the sample DB.  (What those would really be depends on your actual
data and how it's structured; I'm assuming that you've got an element named
"key" in there, but I doubt that's actually the case.)

The return clause says:
"for every member of the sequence $samples, keep it in the returned
sequence only if the predicate (= the expression in the square brackets) is
true"

The predicate says "the context item (= the current member of the sequence
being considered) is compared to the canonical list using sequence
comparison which will return true if any member of the sequence on the left
is a member of the sequence on the right.  The not function negates this
value, so we're testing for when the context item is not a member of the
known values."

So you get only those values which are in the samples but not the master DB.

let $master := (1,2,3,5,9,14,8,91)
let $sample := (3,5,11)

return $sample[not(. = $master)]

is a trivial example you could run in the BaseX GUI.

I hope this is close to an answer to the question you wanted to ask.

-- 
Graydon Saunders  | graydon...@gmail.com
Þæs oferéode, ðisses swá mæg.
-- Deor  ("That passed, so may this.")

On Sun, Feb 19, 2023 at 4:33 PM <kjkati...@gmail.com> wrote:

> Labas, Christian,
>
>                Dar neturiu Lietuviska font tai rasisiu Angliskai.
>
>
>
>                What I am looking for is documentation on how to perform
> simple UNION’s and/or JOIN’s.
>
>                I have two DB’s with data. DB1 has a small sample data set.
> DB2 is a master data repository.
>
> I need to find DB1 data that does not exist in the master repository.
> Sound simple enough, but I need examples with the proper syntax.
>
> Thanks in advance for your time and help.
>
> Linkejimai, KAS
>
>
>
> Kestutis J Katinas
>

Reply via email to