tmlab / tmql

Automatically exported from code.google.com/p/tmql
1 stars 0 forks source link

UNION as in set-theory is missing #51

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
As it is documented UNION is actually a symbolic pattern for fn:concat.
This is misleading as UNION mostly is interpreted as in set-theory therefor it 
should be renamed to CONCAT?

A UNION as in set-theory should be introduced.

Currently we can not use fn:uniq on the result as it causes a Out of Memory.

Original issue reported on code.google.com by michael....@gmail.com on 28 Apr 2011 at 2:19

GoogleCodeExporter commented 9 years ago
I don't understand the Problem. Union in Set theory means the Combination of a 
Set A and B. If we add all elements of B to A ( Concat ) the result is the Same 
isn't it? Except the order.

What you mean with out of Memory?

It should be possible to use uniq on Union results, like

fn:uniq( // Person UNION // animal )

If you got an Error please post the query

Original comment by Sven.Kro...@googlemail.com on 28 Apr 2011 at 2:48

GoogleCodeExporter commented 9 years ago
In a union one would only have distinct elements. Concat does not care for 
doublets.

fn:get-topic-types() UNION fn:get-supertypes( fn:get-topic-types() ) returns 
City as doublet for attached map.

Using fn:uniq on this query results in:
java.lang.OutOfMemoryError: Java heap space:Java::JavaLang::OutOfMemoryError

Original comment by michael....@gmail.com on 28 Apr 2011 at 3:00

Attachments:

GoogleCodeExporter commented 9 years ago
The bug was fixed and UNION work as expected because of the set theory.

Original comment by Sven.Kro...@googlemail.com on 29 Apr 2011 at 8:27

GoogleCodeExporter commented 9 years ago
IMO Michael is right that the current definition of UNION is confusing

Topic map:

    topic.

TMQL query:

    //tm:subject union //tm:subject

Result: 

    [topic, topic]

Expected result: 

    [topic]

So, UNION works not as expected and implements definitely not the UNION 
operator for mathematical sets 

Original comment by lars.he...@gmail.com on 30 Apr 2011 at 1:11

GoogleCodeExporter commented 9 years ago
UNION may work as expected (since it seems to be a simple alias for concat or 
join) but your argument that works acc. to the definition for mathematical sets 
is wrong, that is. 

Original comment by lars.he...@gmail.com on 30 Apr 2011 at 1:28