fluree / core

Fluree releases and public bug reports
0 stars 0 forks source link

Bug with `@base` in query when using IRI literal #88

Open Jackamus29 opened 5 months ago

Jackamus29 commented 5 months ago

Describe the bug When querying a subject by it's IRI with @base, it appears that the IRI is not correctly expanded.

To Reproduce

  1. Create ledger with data

    {
    "ledger": "base-test",
    "@context": {
    "@base": "https://flur.ee/"
    },
    "insert": [
    {
      "@id": "freddy",
      "@type": "Yeti",
      "name": "Freddy"
    }
    ]
    }
  2. Query using @base and IRI literal

    {
    "from": "base-test",
    "@context": {
    "@base": "https://flur.ee/"
    },
    "select": {
    "freddy": [
      "*"
    ]
    }
    }

    =>

    []
  3. where+select query with @base and IRI literal

    {
    "from": "base-test",
    "@context": {
    "@base": "https://flur.ee/"
    },
    "where": {
    "@id": "freddy",
    "?p": "?o"
    },
    "select": [
    "?p",
    "?o"
    ]
    }

    =>

    []

Expected behavior The expected results are shown when manually expanding the IRI:

{
  "from": "base-test",
  "@context": {
    "@base": "https://flur.ee/"
  },
  "select": {
    "https://flur.ee/freddy": [
      "*"
    ]
  }
}

=>

[
  {
    "@id": "freddy",
    "@type": "Yeti",
    "name": "Freddy"
  }
]
Jackamus29 commented 5 months ago

This issue could be related to https://github.com/fluree/core/issues/53