JSON Flavours

Bo Ferri edited this page Oct 4, 2016 · 2 revisions
Clone this wiki locally

GDM JSON

  • SPO GDM statements
  • media type = "application/gdm+json"
[
  {
    "http://data.slub-dresden.de/datamodels/DataModel-574990f5-4785-4020-b86a-9765bb084f16/records/5f7019a6-96e3-4aae-aaac-da743e2840b9": [
      {
        "s": {
          "uri": "http://data.slub-dresden.de/datamodels/DataModel-574990f5-4785-4020-b86a-9765bb084f16/records/5f7019a6-96e3-4aae-aaac-da743e2840b9"
        },
        "p": "http://www.w3.org/1999/02/22-rdf-syntax-ns#type",
        "o": {
          "uri": "http://data.slub-dresden.de/resources/1/schema#RecordType"
        }
      },
      {
        "s": {
          "uri": "http://data.slub-dresden.de/datamodels/DataModel-574990f5-4785-4020-b86a-9765bb084f16/records/5f7019a6-96e3-4aae-aaac-da743e2840b9"
        },
        "p": "http://data.slub-dresden.de/resources/1/schema#id",
        "o": {
          "v": "1234"
        }
      },
      {
        "s": {
          "uri": "http://data.slub-dresden.de/datamodels/DataModel-574990f5-4785-4020-b86a-9765bb084f16/records/5f7019a6-96e3-4aae-aaac-da743e2840b9"
        },
        "p": "http://data.slub-dresden.de/resources/1/schema#name",
        "o": {
          "v": "bla"
        }
      },
      {
        "s": {
          "uri": "http://data.slub-dresden.de/datamodels/DataModel-574990f5-4785-4020-b86a-9765bb084f16/records/5f7019a6-96e3-4aae-aaac-da743e2840b9"
        },
        "p": "http://data.slub-dresden.de/resources/1/schema#description",
        "o": {
          "v": "bla bla"
        }
      },
      {
        "s": {
          "uri": "http://data.slub-dresden.de/datamodels/DataModel-574990f5-4785-4020-b86a-9765bb084f16/records/5f7019a6-96e3-4aae-aaac-da743e2840b9"
        },
        "p": "http://data.slub-dresden.de/resources/1/schema#isbn",
        "o": {
          "v": "76587658765"
        }
      },
      {
        "s": {
          "uri": "http://data.slub-dresden.de/datamodels/DataModel-574990f5-4785-4020-b86a-9765bb084f16/records/5f7019a6-96e3-4aae-aaac-da743e2840b9"
        },
        "p": "http://data.slub-dresden.de/resources/1/schema#year",
        "o": {
          "v": "1970"
        }
      }
    ]
  },
  {
    "http://data.slub-dresden.de/datamodels/DataModel-574990f5-4785-4020-b86a-9765bb084f16/records/4c28b579-08d9-4dc1-9874-5fcd8a662919": [
      {
        "s": {
          "uri": "http://data.slub-dresden.de/datamodels/DataModel-574990f5-4785-4020-b86a-9765bb084f16/records/4c28b579-08d9-4dc1-9874-5fcd8a662919"
        },
        "p": "http://www.w3.org/1999/02/22-rdf-syntax-ns#type",
        "o": {
          "uri": "http://data.slub-dresden.de/resources/1/schema#RecordType"
        }
      },
      {
        "s": {
          "uri": "http://data.slub-dresden.de/datamodels/DataModel-574990f5-4785-4020-b86a-9765bb084f16/records/4c28b579-08d9-4dc1-9874-5fcd8a662919"
        },
        "p": "http://data.slub-dresden.de/resources/1/schema#id",
        "o": {
          "v": "2343"
        }
      },
      {
        "s": {
          "uri": "http://data.slub-dresden.de/datamodels/DataModel-574990f5-4785-4020-b86a-9765bb084f16/records/4c28b579-08d9-4dc1-9874-5fcd8a662919"
        },
        "p": "http://data.slub-dresden.de/resources/1/schema#name",
        "o": {
          "v": "blub"
        }
      },
      {
        "s": {
          "uri": "http://data.slub-dresden.de/datamodels/DataModel-574990f5-4785-4020-b86a-9765bb084f16/records/4c28b579-08d9-4dc1-9874-5fcd8a662919"
        },
        "p": "http://data.slub-dresden.de/resources/1/schema#description",
        "o": {
          "v": "blub blub"
        }
      },
      {
        "s": {
          "uri": "http://data.slub-dresden.de/datamodels/DataModel-574990f5-4785-4020-b86a-9765bb084f16/records/4c28b579-08d9-4dc1-9874-5fcd8a662919"
        },
        "p": "http://data.slub-dresden.de/resources/1/schema#isbn",
        "o": {
          "v": "65786576576"
        }
      },
      {
        "s": {
          "uri": "http://data.slub-dresden.de/datamodels/DataModel-574990f5-4785-4020-b86a-9765bb084f16/records/4c28b579-08d9-4dc1-9874-5fcd8a662919"
        },
        "p": "http://data.slub-dresden.de/resources/1/schema#year",
        "o": {
          "v": "1960"
        }
      }
    ]
  },

[...]


]

GDM Ordered JSON

  • with attribute order in entities
  • GDM compact JSON
  • media type = "application/gdm+compact+json"
[ {
    "http://data.slub-dresden.de/datamodels/2/records/0d801d16-cbb4-461c-b660-ac4b003d240b" : [ {
        "http://www.w3.org/1999/02/22-rdf-syntax-ns#type" : "http://data.slub-dresden.de/resources/1/schema#RecordType"
    }, {
        "http://data.slub-dresden.de/resources/1/schema#id" : "1234"
    }, {
        "http://data.slub-dresden.de/resources/1/schema#name" : "bla"
    }, {
        "http://data.slub-dresden.de/resources/1/schema#description" : "bla bla"
    }, {
        "http://data.slub-dresden.de/resources/1/schema#isbn" : "76587658765"
    }, {
        "http://data.slub-dresden.de/resources/1/schema#year" : "1970"
    } ]
}, {
    "http://data.slub-dresden.de/datamodels/2/records/93b048f2-d0e9-4f71-8877-5a1615caeced" : [ {
        "http://www.w3.org/1999/02/22-rdf-syntax-ns#type" : "http://data.slub-dresden.de/resources/1/schema#RecordType"
    }, {
        "http://data.slub-dresden.de/resources/1/schema#id" : "2343"
    }, {
        "http://data.slub-dresden.de/resources/1/schema#name" : "blub"
    }, {
        "http://data.slub-dresden.de/resources/1/schema#description" : "blub blub"
    }, {
        "http://data.slub-dresden.de/resources/1/schema#isbn" : "65786576576"
    }, {
        "http://data.slub-dresden.de/resources/1/schema#year" : "1960"
    } ]
},

[...]

]

GDM FE JSON

  • with attribute order in entities and separated record identifier and record content parts)
  • GDM Compact FE JSON
  • media type = "application/gdm+compact+fe+json"
[
  {
    "__record_id": "http://data.slub-dresden.de/datamodels/DataModel-d3de7db9-ffcf-4d3b-836f-5d736fea2f55/records/030bf238-6081-4d03-8afc-b8550b0fd670",
    "__record_data": [
      {
        "http://data.slub-dresden.de/datamodels/DataModel-d3de7db9-ffcf-4d3b-836f-5d736fea2f55/schema#description": "blx blx"
      },
      {
        "http://www.w3.org/1999/02/22-rdf-syntax-ns#type": "http://purl.org/ontology/bibo/Document"
      }
    ]
  },
  {
    "__record_id": "http://data.slub-dresden.de/datamodels/DataModel-d3de7db9-ffcf-4d3b-836f-5d736fea2f55/records/970e27de-2db8-4ea4-9428-0d959d67af4f",
    "__record_data": [
      {
        "http://data.slub-dresden.de/datamodels/DataModel-d3de7db9-ffcf-4d3b-836f-5d736fea2f55/schema#description": "blub blub"
      },
      {
        "http://www.w3.org/1999/02/22-rdf-syntax-ns#type": "http://purl.org/ontology/bibo/Document"
      }
    ]
  },
  
 [...]

]

GDM Simple JSON

  • no attribute order in entities + no URIs for attribute identifier)
  • media type = "application/gdm+simple+json"
[
  {
    "http://data.slub-dresden.de/datamodels/2/records/0d801d16-cbb4-461c-b660-ac4b003d240b": {
      "http://www.w3.org/1999/02/22-rdf-syntax-ns#type": "http://data.slub-dresden.de/resources/1/schema#RecordType",
      "http://data.slub-dresden.de/resources/1/schema#id": "1234",
      "http://data.slub-dresden.de/resources/1/schema#name": "bla",
      "http://data.slub-dresden.de/resources/1/schema#description": "bla bla",
      "http://data.slub-dresden.de/resources/1/schema#isbn": "76587658765",
      "http://data.slub-dresden.de/resources/1/schema#year": "1970"
    }
  },
  {
    "http://data.slub-dresden.de/datamodels/2/records/93b048f2-d0e9-4f71-8877-5a1615caeced": {
      "http://www.w3.org/1999/02/22-rdf-syntax-ns#type": "http://data.slub-dresden.de/resources/1/schema#RecordType",
      "http://data.slub-dresden.de/resources/1/schema#id": "2343",
      "http://data.slub-dresden.de/resources/1/schema#name": "blub",
      "http://data.slub-dresden.de/resources/1/schema#description": "blub blub",
      "http://data.slub-dresden.de/resources/1/schema#isbn": "65786576576",
      "http://data.slub-dresden.de/resources/1/schema#year": "1960"
    }
  },

[...]

]

GDM Simple Short JSON

  • no attribute order in entities
  • media type = "application/gdm+simple+short+json"
[
  {
    "http://data.slub-dresden.de/datamodels/2/records/0d801d16-cbb4-461c-b660-ac4b003d240b": {
      "type": "http://data.slub-dresden.de/resources/1/schema#RecordType",
      "id": "1234",
      "name": "bla",
      "description": "bla bla",
      "isbn": "76587658765",
      "year": "1970"
    }
  },
  {
    "http://data.slub-dresden.de/datamodels/2/records/93b048f2-d0e9-4f71-8877-5a1615caeced": {
      "type": "http://data.slub-dresden.de/resources/1/schema#RecordType",
      "id": "2343",
      "name": "blub",
      "description": "blub blub",
      "isbn": "65786576576",
      "year": "1960"
    }
  },

[...]

]

Simple JSON

  • no attribute order in entities + no URIs for attribute identifier + no (internal) record identifiers
  • media type = "application/json"
[
  {
    "type": "http://data.slub-dresden.de/resources/1/schema#RecordType",
    "id": "1234",
    "name": "bla",
    "description": "bla bla",
    "isbn": "76587658765",
    "year": "1970"
  },
  {
    "type": "http://data.slub-dresden.de/resources/1/schema#RecordType",
    "id": "2343",
    "name": "blub",
    "description": "blub blub",
    "isbn": "65786576576",
    "year": "1960"
  },

[...]

]