Skip to content

Framing algorithm misses subjects with @default key in the frame #155

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

Open
laszbalo opened this issue Nov 3, 2016 · 2 comments
Open

Framing algorithm misses subjects with @default key in the frame #155

laszbalo opened this issue Nov 3, 2016 · 2 comments
Labels

Comments

@laszbalo
Copy link

laszbalo commented Nov 3, 2016

Consider this dummy document:

{
  "@context": {
    "ex": "http://example.org/vocab#"
  },
  "ex:a": "a",
  "ex:c": {
    "ex:foo": "bar"
  } 
}

and this frame:

{
  "@context": {
    "ex": "http://example.org/vocab#"
  },
  "@requireAll": true,
  "ex:foo": {
    "@default": "baz"
  }
}

Your current implementation returns with following document:

{
  "@context": {
    "ex": "http://example.org/vocab#"
  },
  "@graph": [
    {
      "@id": "_:b1",
      "ex:foo": "bar"
    }
  ]
}

However, I belive, that the result should contain both subjects, like this:
(actually this is the result what I want to achieve)

{
  "@context": {
    "ex": "http://example.org/vocab#"
  },
  "@graph": [
    {
      "@id": "_:b0",
      "ex:a": "a",
      "ex:c": {
        "@id": "_:b1",
        "ex:foo": "bar"
      },
      "ex:foo": "baz"
    },
    {
      "@id": "_:b1",
      "ex:foo": "bar"
    }
  ]
}

In the draft version 1.1, under step 3.6, it says:

Otherwise, a subject matches if requireAll is true and all the non-keyword properties in frame exist in node with any value, or properties missing in node each have a property in frame which has a dictionary value containing only the key @default with any value.

In my case:

  • requireAll is set to true explicitly, despite true is the default
  • property ex:foo missing from the node but exists in frame; also
  • has a dictionary value containing only the key @default with the value of "baz"

Did I misunderstand how the algorithm works or is this a feature which has not been implemented yet?

By the way, tried out @lanthaler's processor and it returns both subjects, which I think is the correct behavior. permalink

@dlongley
Copy link
Member

dlongley commented Nov 3, 2016

Seems like a bug or a not implemented to me; will need to look more closely.

@dlongley
Copy link
Member

@davidlehn -- can you take a look here?

@dlongley dlongley added the bug label May 26, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants