Skip to content

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

Open
@laszbalo

Description

@laszbalo

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions