Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

@list Order Preservation is Broken on server / Nexus #75

Closed
Jackamus29 opened this issue Jan 9, 2024 · 3 comments
Closed

@list Order Preservation is Broken on server / Nexus #75

Jackamus29 opened this issue Jan 9, 2024 · 3 comments
Labels
bug Something isn't working

Comments

@Jackamus29
Copy link
Collaborator

Describe the bug
When inserting a list of values using the @container type of @list, I expect to get back the same order of values in query results.

To Reproduce

  1. Create ledger
{
  "ledger": "list-order-test",
  "@context": {
    "ex": "http://example.org/ns/",
    "ex:age": {
      "@container": "@list"
    }
  },
  "insert": [
    {
      "@id": "zeti",
      "ex:age": [97, 19, 97, 19, 97]
    }
  ]
}
  1. Query
{
  "from": "list-order-test",
  "@context": {
    "ex": "http://example.org/ns/",
    "ex:age": {
      "@container": "@list"
    }
  },
  "selectDistinct": { "?s": ["*"] },
  "where": {
    "@id": "?s",
    "ex:age": "?age"
  }
}

Expected result

[
  {
    "@id": "zeti",
    "ex:age": [
      97,
      19,
      97,
      19,
      97
    ]
  }
]

Actual result

[
  {
    "@id": "zeti",
    "ex:age": [
      19,
      19,
      97,
      97,
      97
    ]
  }
]
@Jackamus29 Jackamus29 added the bug Something isn't working label Jan 9, 2024
@aaj3f aaj3f changed the title Order of values inserted as @list is not preserved @list Order Preservation is Broken on server / Nexus Jan 22, 2024
@aaj3f
Copy link
Collaborator

aaj3f commented Jan 22, 2024

@Jackamus29 & I confirmed that even the exact test in db (https://github.com/fluree/db/blob/1507c85ab3490c4419a65e236183317a2b43196b/test/fluree/db/query/json_ld_basic_test.clj#L131-L149) when issued via server does not preserve order in query results.

@aaj3f
Copy link
Collaborator

aaj3f commented Jan 22, 2024

Related to #74

@Jackamus29
Copy link
Collaborator Author

Confirmed fix from fluree/db#720
Thanks @dpetran!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants