Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
languageyml
titleresponse body
linenumberstrue
collapsetrue
{
    "objects": [
        {
            "properties": {
                "appBibjsonsample:bibjson": {
                    "value": {
                        "title": "My Book Title"
                    }
                }
            }
        }
    ],
    "numItems": 1,
    "hasMoreItems": false,
    "totalNumItems": 1
}

Example 7

Use .. in order to replace unknown parts of a path. The query below specifies a search for objects where the property appBibjsonsample:bibjson contains Schuetzel in the value for the key author[*].name that can be located at any hierarchical level within the JSON. Furthermore, only only key-value mappings for keys named id will be displayed in the response body.

Code Block
languagesql
SELECT appBibjsonsample:bibjson..id FROM appBibjsonsample:medium WHERE appBibjsonsample:bibjson..author[*].name CONTAINS('Schuetzel')


Code Block
languageyml
titleresponse body
linenumberstrue
collapsetrue
{
    "objects": [
        {
            "properties": {
                "appBibjsonsample:bibjson": {
                    "value": {
                        "id": "ID_of_book",
                        "identifier": [
                            {
                                "id": "0002-9327"
                            }
                        ]
                    }
                }
            }
        },
        {
            "properties": {
                "appBibjsonsample:bibjson": {
                    "value": {
                        "metadata": {
                            "id": "ID_of_collection"
                        },
                        "records": [
                            {
                                "id": "ID_of_schema_article"
                            },
                            {
                                "id": "ID_of_query_article"
                            }
                        ]
                    }
                }
            }
        }
    ],
    "numItems": 2,
    "hasMoreItems": false,
    "totalNumItems": 2
}

Summary

The property type structureddata allows for the storage of interleaved data structures in a queryable way without defining each single sub-property in the schema. This tutorial gave some explanations on how to define such a property in the schema, how to set a value during an object creation and how to address the individual sub-values in search queries, in the example context of a library.

...