exist icon indicating copy to clipboard operation
exist copied to clipboard

Fix the Node/Item XDM Relationship

Open adamretter opened this issue 5 years ago • 24 comments

Small enhancement built on https://github.com/eXist-db/exist/pull/3363

But... it changes the on-disk format of the Native Value Index (values.dbx), and so requires a major release.

adamretter avatar May 12 '20 19:05 adamretter

@line-o I don't think that needs to be done.

adamretter avatar May 12 '20 20:05 adamretter

It makes much more sense to have it as -1, when it is the only negative value. Comparable to ['a' , 'b'].indexOf('c')

line-o avatar May 12 '20 20:05 line-o

@line-o That's one perspective... feel free to send a follow-up PR.

adamretter avatar May 12 '20 22:05 adamretter

What is the status of the PR?

dizzzz avatar Jun 15 '20 10:06 dizzzz

@dizzzz When you have the chance could you restart the AppVeyor CI on this PR? Thanks!

joewiz avatar Jan 12 '21 19:01 joewiz

sorry... image

probably if we rebase, a new build is triggered

dizzzz avatar Jan 13 '21 07:01 dizzzz

NO_SUCH_VALUE was changed from -1 to -99 in 3102f46fd2f24282b7d27372a4a8c219eee7c01d I would like the reordering of Value types to include this to be -1 again.

line-o avatar Feb 13 '23 19:02 line-o

I would propose to shift the current mapping of node types by one which would make the relationship quite clear as all types that are subtypes of NODE would have a higher integer value;

    public static final int NODE = 1;
    public final static int ELEMENT = 2;
    public final static int ATTRIBUTE = 3;
    public final static int TEXT = 4;
    public final static int PROCESSING_INSTRUCTION = 5;
    public final static int COMMENT = 6;
    public final static int DOCUMENT = 7;

line-o avatar Feb 14 '23 15:02 line-o

I would propose to shift the current mapping of node types by one which would make the relationship quite clear as all types that are subtypes of NODE would have a higher integer value;

@line-o I am not sure if I understand what you are suggesting? At the moment in this PR I have:

    public final static int NODE = 56;
    public final static int ATTRIBUTE = 57;
    public final static int COMMENT = 58;
    public final static int DOCUMENT = 59;
    public final static int ELEMENT = 60;
    public final static int NAMESPACE = 61;
    public final static int PROCESSING_INSTRUCTION = 62;
    public final static int TEXT = 63;

It looks to me from the above that "all types that are subtypes of NODE" already "have a higher integer value" than NODE. Can you explain further what you were suggesting please?

adamretter avatar Feb 21 '23 10:02 adamretter

The changes look good, from a first look. Ignore earlier comment, as it did not show the new commits at the time of writing.

@adamretter

Still wondering why -99 is so important. I will introduce a PR changing that if it is not done here.

line-o avatar Feb 21 '23 11:02 line-o

@adamretter seem to have some license header problem, that needs to be fixed first

reinhapa avatar Feb 28 '23 15:02 reinhapa

@adamretter there seem to be some license header problems left

reinhapa avatar Feb 28 '23 15:02 reinhapa

I checked the unsigned binary values of

  • -1 : 1111111111111111
  • -99 : 1111111110011101
  • -2147483648 : 10000000000000000000000000000000

line-o avatar Feb 28 '23 15:02 line-o

rebase/merge needed

dizzzz avatar Mar 05 '23 10:03 dizzzz

image

dizzzz avatar Mar 13 '23 19:03 dizzzz

Uploading image.png…

dizzzz avatar Mar 13 '23 19:03 dizzzz

The value is a non-discussion ; it could be -42 too :-/
-1 might bee too obvious and could have a different meaning; we use symbols anyway. Leave it as is? Need rebase though / merge conflict needs to be resolved.

We'd really have this PR in

dizzzz avatar Mar 14 '23 21:03 dizzzz

Some test fail too..

@reinhapa Yes, I added a whole load of new tests which show existing problems in eXist-db, I have just one case left to solve and then we should pass them all. When I do I will post updates XQTS numbers to. Stay tuned...

adamretter avatar Oct 16 '23 09:10 adamretter

@reinhapa Yes, I added a whole load of new tests which show existing problems in eXist-db, I have just one case left to solve and then we should pass them all. When I do I will post updates XQTS numbers to. Stay tuned...

Looking forward to it

reinhapa avatar Oct 16 '23 11:10 reinhapa

again, I do not really care; if for debugging 99 is easier to spot in debugger, please leave it that way. I feel that it makes a good reason. I'd like to stop this discussion please.

dizzzz avatar Nov 20 '23 19:11 dizzzz

Needed

  • rebase
  • reformat
  • check tests

dizzzz avatar Nov 20 '23 19:11 dizzzz

I'd like to see the PR pulled in as-is, the discussion is interesting (..) but not so important I'd say. Waste of time/energy....

dizzzz avatar Apr 24 '24 18:04 dizzzz