Skip to content

aggressive re-embedding #20

@cardinal27513

Description

@cardinal27513

Also just tried Markus' version of playground and it works
http://www.markus-lanthaler.com/jsonld/playground/

....
Just found that this is discussed in json-ld/json-ld.org#119
So it is addressed?

.....
If I've an object that will be referenced by multiple places, seems that only the 1st reference will be embedded and the rest wont be...

Here is my examples that I tried out in the playground...
ID_0 object has two objects. ID_1 and ID_2.

Then both ID_1 and ID_2, will have one field shared, ID_SHARE_1...
Then, if I've a frame as

---> Frame

{
"@context": {"C" : "http://c" },

"@type": "http://root",
"C:has_items" : {}
}

--> framed output... Shouldn't ID_SHARE_1 object should be embedded in both ID_1 and ID_2 objects???

{
  "@context": {
    "C": "http://c"
  },
  "@graph": [
  {
    "@id": "http://ID_0",
    "@type": "http://root",
    "C:has_items": [
    {
      "@id": "http://ID_1",
      "C:has_shared_item": {
        "@id": "http://ID_SHARE_1",
        "C:hasName": "I'm shared"
      }
    },
    {
      "@id": "http://ID_2",
      "C:has_shared_item": {
        "@id": "http://ID_SHARE_1"
      }
    }]
  }]
}

---->> Raw Input

{
"@context": {"C" : "http://c" },

"@graph": [

  {
  "@id" : "http://ID_SHARE_1",
  "C:hasName": "I'm shared"
  },

  {
   "@id": "http://ID_1",
   "C:has_shared_item" : 
    {
      "@id": "http://ID_SHARE_1"
    }
  },
  {
   "@id": "http://ID_2",
   "C:has_shared_item" : 
    {
      "@id": "http://ID_SHARE_1"
    }
  },

  { 
  "@id": "http://ID_0",
  "@type": "http://root",
   "C:has_items": [
      {"@id": "http://ID_1"},
      {"@id": "http://ID_2"}

    ]
  }
]
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions