twinql icon indicating copy to clipboard operation
twinql copied to clipboard

JSON-LD response should always include namedgraphs

Open dan-f opened this issue 9 years ago • 1 comments

e.g. the following query should return the following response:

@prefix foaf http://xmlns.com/foaf/0.1/

https://dan-f.databox.me/profile/card#me {
  foaf.name
}
[
  {
    "@id": "https://dan-f.databox.me/profile/card",
    "@graph": [
      {
        "@id": "https://dan-f.databox.me/profile/card#me",
        "http://xmlns.com/foaf/0.1/name": [
          {
            "@value": "Daniel Friedman"
          }
        ]
      }
    ]
  }
]

dan-f avatar Apr 04 '17 19:04 dan-f

In case of 'Social Graph' example from http://dan-f.me/twinql/ would it respond with multiple named graphs? Maybe WebID profiles of individuals don't make the best example, but if we imagine instead profiles of organizations. Client could make updates to them if user has write permission in ACL.

{
  "@context": {
    "foaf": "http://xmlns.com/foaf/0.1/"
  },
  "@graph": [
    {
      "@id": "https://dan-f.databox.me/profile/card",
      "@graph": [
        {
          "@id": "https://dan-f.databox.me/profile/card#me",
          "foaf:name": {
            "@value": "Daniel Friedman"
          },
          "foaf:knows": [
            "https://deiu.me/profile#me",
            "https://ilaria.databox.me/profile/card#me",
            "https://www.w3.org/People/Berners-Lee/card#i"
          ]
        }
      ]
    },
    {
      "@id": "https://dan-f.databox.me/profile/card",
      "@graph": [
        {
          "@id": "https://deiu.me/profile#me",
          "foaf:title": {
            "@value": "Dr"
          },
          "foaf:name": {
            "@value": "Andrei Vlad Sambra"
          }
        }
      ]
    },
    {
      "@id": "https://ilaria.databox.me/profile/card",
      "@graph": [
        {
          "@id": "https://ilaria.databox.me/profile/card#me",
          "foaf:title": null,
          "foaf:name": {
            "@value": "Ilaria"
          }
        }
      ]
    },
    {
      "@id": "https://www.w3.org/People/Berners-Lee/card",
      "@graph": [
        {
          "@id": "https://www.w3.org/People/Berners-Lee/card#i",
          "foaf:title": {
            "@value": "Sir"
          },
          "foaf:name": {
            "@value": "Timothy Berners-Lee"
          }
        }
      ]
    }
  ]
}

elf-pavlik avatar May 13 '17 13:05 elf-pavlik