Versions Compared

Key

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


Page Properties
hiddentrue
idPROGRESS

Product Version
Report Note
Assignee

Resources & Remarks

Modification History

NameDateProduct VersionAction
Antje11 JUN 20212021 SummerPage created and writing started.


...

Section
bordertrue


Column

Table of Contents

Table of Contents
exclude(Table of Contents|Read on|Another Tutorial|Another Concept Article|Another interesting Tutorial)


Introduction

yuuvis® Momentum offers a property type for the storage of structured data in JSON format. Thus, it is possible to store interleaved data structures in a queryable way without defining each single sub-property in the schema. The structured data properties should NOT be considered to replace the concept of a well-defined schema. They should be used only if the handling of objects' metadata via the conventional property definitions is not reasonable. Especially, if the structure of metadata and/or the availability of properties differs a lot for the individual object instances, the schema might grow up to a really long list of scarcely used properties. This can be avoided by the usage of a property field that can store a JSON structure as value. In this tutorial, the registration information of media in a library is considered an example use case. For this purpose, the set of information for each medium is provided in JSON structure following the concept of BibJSON.

Requirements

This tutorial is dedicated to experienced users. Please find information on requirements, maven and client configuration in our "Importing Documents via Core API" tutorial, on which the variables' names are based. The handling of any IOException is demonstrated there, too.

...

The successfully executed import returns the entire sets of metadata for each object, enriched with the system properties.

Code Block
languageyml
linenumberstrue
collapsetrue
{
    "objects": [
        {
            "properties": {
                "system:objectId": {
                    "value": "922a27baaab2b4d9-f478e829-4fa645dd-b94c981a-19d42d46e13a"},2f19a688592d"
                },
                "system:baseTypeId": {
                    "value": "system:document"
                },
                "system:objectTypeId":{"value":"appBibjsonsample:medium"}, {
                    "value": "appBibjsonsample:medium"
                },
                "system:createdBy": {
                    "value": "275c826c-6a61-4e89-9512-8d935a1631e5"},"system:creationDate":{
                },
                "system:creationDate": {
                    "value": "2021-06-14T1214T13:4610:3252.870Z"},280Z"
                },
                "system:lastModifiedBy": {
                    "value": "275c826c-6a61-4e89-9512-8d935a1631e5"},
                },
                "system:lastModificationDate": {
                    "value": "2021-06-14T1214T13:4610:3252.870Z"},280Z"
                },
                "system:versionNumber":{"value":1}, {
                    "value": 1
                },
                "system:tenant": {
                    "value": "default"},"system:traceId":{
                },
                "system:traceId": {
                    "value": "1f5715bec164414a"},5681d3bddb4279de"
                },
                "appBibjsonsample:bibjson": {
                    "value":{"type":"book", {
                        "type": "book",
                        "title": "My Book Title",
                        "author":[{"name":"Heinrich Schuetzel"},{"name":"Maximilian Sturz"}],"year":"1995","owner":"My Library","id":"ID_of_book","url":"http://mylibrary.com/ebooks/36513466534","publisher":"Example Verlag Mustershagen","edition":{"number":2,"language":"English"},"identifier":[{"id":"0002-9327","type":"issn"}]}},"appBibjsonsample:locations":{"value":["central library, CN-3214-5324","branch library east, 43-654b"]}}}]}
{"objects":[{"properties":{"system:objectId":{"value":"c442cffc-e555-443c-9573-7f825847833a"},"system:baseTypeId":{"value":"system:document"},"system:objectTypeId":{"value":"appBibjsonsample:medium"},"system:createdBy":{"value":"275c826c-6a61-4e89-9512-8d935a1631e5"},"system:creationDate":{"value":"2021-06-14T12:46:33.330Z"},"system:lastModifiedBy":{"value":"275c826c-6a61-4e89-9512-8d935a1631e5"},"system:lastModificationDate":{"value":"2021-06-14T12:46:33.330Z"},"system:versionNumber":{"value":1},"system:tenant":{"value":"default"},"system:traceId":{"value":"9ece9caad9169a31"},"appBibjsonsample:bibjson":{"value":{"metadata":{"collection":"ym_concepts","label":"yuuvis(R) Momentum Core Concepts","description":"Documentation for yuuvis(R) Momentum Core in a structured, theoretical way, with links to the tutorial section.","id":"ID_of_collection","owner":"OS","created":"2020-06-09T15:04:12.944771","modified":"2021-06-10T11:05:17.166993","source":"https://help.optimal-systems.com/yuuvis_develop/display/YMY/x/-4BkAg","records":2},"records":[{"collection":"ym_concepts","type":"article","title":"Schema - Defining Object Types","id":"ID_of_schema_article","link":"https://help.optimal-systems.com/yuuvis_develop/display/YMY/x/AYFkAg","author":[{"name":"Heinrich Schuetzel"},{"name":"George Trader"},{"name":"Johann Fluss"}],"created":"2020-06-09T15:04:12.944771","modified":"2021-06-10T08:53:23.532949"},{"collection":"ym_concepts","type":"article","title":"Search Query Language","id":"ID_of_query_article","link":"https://help.optimal-systems.com/yuuvis_develop/display/YMY/x/gIFkAg","author":[{"name":"Andrea Schumann"},{"name":"Franz Lissner"},{"name":"Hans Kammer"},{"name":"Johann Fluss"}],"created":"2020-06-16T14:03:01.833660","modified":"2021-06-02T09:54:12.643040"}]}}}}]}

Search Queries

The individual sub-fields within the JSON value for the property appbibjsonsample:bibjson are queryable. In this chapter, some example search queries are explained.

All objects of type medium.

Code Block
languagesql
SELECT * FROM appBibjsonsample:medium

Return only the bibjson value

Code Block
languagesql
SELECT appBibjsonsample:bibjson FROM appBibjsonsample:medium

Return only parts of the bibjson value

Code Block
languagesql
SELECT appBibjsonsample:bibjson.title,appBibjsonsample:bibjson.author[1].name,appBibjsonsample:bibjson.metadata.id FROM appBibjsonsample:medium

If the path is unknown, a '*' wildcard can be used.

Code Block
languagesql
SELECT appBibjsonsample:bibjson.metadata.id FROM appBibjsonsample:medium WHERE appBibjsonsample:bibjson.* = 'ID_of_schema_article'

Search within a list and usage of CONTAINS

Code Block
languagesql
SELECT appBibjsonsample:bibjson.title FROM appBibjsonsample:medium WHERE appBibjsonsample:bibjson.author[*].name CONTAINS('Sturz') [
                            {
                                "name": "Heinrich Schuetzel"
                            },
                            {
                                "name": "Maximilian Sturz"
                            }
                        ],
                        "year": "1995",
                        "owner": "My Library",
                        "id": "ID_of_book",
                        "url": "http://mylibrary.com/ebooks/36513466534",
                        "publisher": "Example Verlag Mustershagen",
                        "edition": {
                            "number": 2,
                            "language": "English"
                        },
                        "identifier": [
                            {
                                "id": "0002-9327",
                                "type": "issn"
                            }
                        ]
                    }
                },
                "appBibjsonsample:locations": {
                    "value": [
                        "central library, CN-3214-5324",
                        "branch library east, 43-654b"
                    ]
                }
            }
        }
    ]
}


Code Block
languageyml
linenumberstrue
collapsetrue
{
    "objects": [
        {
            "properties": {
                "system:objectId": {
                    "value": "3d4a67be-3341-4317-bb57-c48ea7ab0a1a"
                },
                "system:baseTypeId": {
                    "value": "system:document"
                },
                "system:objectTypeId": {
                    "value": "appBibjsonsample:medium"
                },
                "system:createdBy": {
                    "value": "275c826c-6a61-4e89-9512-8d935a1631e5"
                },
                "system:creationDate": {
                    "value": "2021-06-14T13:11:57.770Z"
                },
                "system:lastModifiedBy": {
                    "value": "275c826c-6a61-4e89-9512-8d935a1631e5"
                },
                "system:lastModificationDate": {
                    "value": "2021-06-14T13:11:57.770Z"
                },
                "system:versionNumber": {
                    "value": 1
                },
                "system:tenant": {
                    "value": "default"
                },
                "system:traceId": {
                    "value": "22839c5775801e9c"
                },
                "appBibjsonsample:bibjson": {
                    "value": {
                        "metadata": {
                            "collection": "ym_concepts",
                            "label": "yuuvis(R) Momentum Core Concepts",
                            "description": "Documentation for yuuvis(R) Momentum Core in a structured, theoretical way, with links to the tutorial section.",
                            "id": "ID_of_collection",
                            "owner": "OS",
                            "created": "2020-06-09T15:04:12.944771",
                            "modified": "2021-06-10T11:05:17.166993",
                            "source": "https://help.optimal-systems.com/yuuvis_develop/display/YMY/x/-4BkAg",
                            "records": 2
                        },
                        "records": [
                            {
                                "collection": "ym_concepts",
                                "type": "article",
                                "title": "Schema - Defining Object Types",
                                "id": "ID_of_schema_article",
                                "link": "https://help.optimal-systems.com/yuuvis_develop/display/YMY/x/AYFkAg",
                                "author": [
                                    {
                                        "name": "Heinrich Schuetzel"
                                    },
                                    {
                                        "name": "George Trader"
                                    },
                                    {
                                        "name": "Johann Fluss"
                                    }
                                ],
                                "created": "2020-06-09T15:04:12.944771",
                                "modified": "2021-06-10T08:53:23.532949"
                            },
                            {
                                "collection": "ym_concepts",
                                "type": "article",
                                "title": "Search Query Language",
                                "id": "ID_of_query_article",
                                "link": "https://help.optimal-systems.com/yuuvis_develop/display/YMY/x/gIFkAg",
                                "author": [
                                    {
                                        "name": "Andrea Schumann"
                                    },
                                    {
                                        "name": "Franz Lissner"
                                    },
                                    {
                                        "name": "Hans Kammer"
                                    },
                                    {
                                        "name": "Johann Fluss"
                                    }
                                ],
                                "created": "2020-06-16T14:03:01.833660",
                                "modified": "2021-06-02T09:54:12.643040"
                            }
                        ]
                    }
                }
            }
        }
    ]
}


Search Queries

The individual sub-fields within the JSON value for the property appbibjsonsample:bibjson are queryable. In this chapter, some example search queries are explained.

All objects of type medium.

Code Block
languagesql
SELECT * FROM appBibjsonsample:medium


Code Block
languageyml
linenumberstrue
collapsetrue
{
    "objects": [
        {
            "properties": {
                "system:traceId": {
                    "value": "5681d3bddb4279de"
                },
                "system:objectTypeId": {
                    "value": "appBibjsonsample:medium"
                },
                "appBibjsonsample:bibjson": {
                    "value": {
                        "type": "book",
                        "title": "My Book Title",
                        "author": [
                            {
                                "name": "Heinrich Schuetzel"
                            },
                            {
                                "name": "Maximilian Sturz"
                            }
                        ],
                        "year": "1995",
                        "owner": "My Library",
                        "id": "ID_of_book",
                        "url": "http://mylibrary.com/ebooks/36513466534",
                        "publisher": "Example Verlag Mustershagen",
                        "edition": {
                            "number": 2,
                            "language": "English"
                        },
                        "identifier": [
                            {
                                "id": "0002-9327",
                                "type": "issn"
                            }
                        ]
                    }
                },
                "system:versionNumber": {
                    "value": 1
                },
                "system:createdBy": {
                    "value": "275c826c-6a61-4e89-9512-8d935a1631e5"
                },
                "system:creationDate": {
                    "value": "2021-06-14T13:10:52.280Z"
                },
                "system:lastModificationDate": {
                    "value": "2021-06-14T13:10:52.280Z"
                },
                "system:baseTypeId": {
                    "value": "system:document"
                },
                "system:tenant": {
                    "value": "default"
                },
                "appBibjsonsample:locations": {
                    "value": [
                        "central library, CN-3214-5324",
                        "branch library east, 43-654b"
                    ]
                },
                "system:lastModifiedBy": {
                    "value": "275c826c-6a61-4e89-9512-8d935a1631e5"
                },
                "system:objectId": {
                    "value": "aab2b4d9-e829-45dd-981a-2f19a688592d"
                }
            }
        },
        {
            "properties": {
                "system:traceId": {
                    "value": "22839c5775801e9c"
                },
                "system:objectTypeId": {
                    "value": "appBibjsonsample:medium"
                },
                "appBibjsonsample:bibjson": {
                    "value": {
                        "metadata": {
                            "collection": "ym_concepts",
                            "label": "yuuvis(R) Momentum Core Concepts",
                            "description": "Documentation for yuuvis(R) Momentum Core in a structured, theoretical way, with links to the tutorial section.",
                            "id": "ID_of_collection",
                            "owner": "OS",
                            "created": "2020-06-09T15:04:12.944771",
                            "modified": "2021-06-10T11:05:17.166993",
                            "source": "https://help.optimal-systems.com/yuuvis_develop/display/YMY/x/-4BkAg",
                            "records": 2
                        },
                        "records": [
                            {
                                "collection": "ym_concepts",
                                "type": "article",
                                "title": "Schema - Defining Object Types",
                                "id": "ID_of_schema_article",
                                "link": "https://help.optimal-systems.com/yuuvis_develop/display/YMY/x/AYFkAg",
                                "author": [
                                    {
                                        "name": "Heinrich Schuetzel"
                                    },
                                    {
                                        "name": "George Trader"
                                    },
                                    {
                                        "name": "Johann Fluss"
                                    }
                                ],
                                "created": "2020-06-09T15:04:12.944771",
                                "modified": "2021-06-10T08:53:23.532949"
                            },
                            {
                                "collection": "ym_concepts",
                                "type": "article",
                                "title": "Search Query Language",
                                "id": "ID_of_query_article",
                                "link": "https://help.optimal-systems.com/yuuvis_develop/display/YMY/x/gIFkAg",
                                "author": [
                                    {
                                        "name": "Andrea Schumann"
                                    },
                                    {
                                        "name": "Franz Lissner"
                                    },
                                    {
                                        "name": "Hans Kammer"
                                    },
                                    {
                                        "name": "Johann Fluss"
                                    }
                                ],
                                "created": "2020-06-16T14:03:01.833660",
                                "modified": "2021-06-02T09:54:12.643040"
                            }
                        ]
                    }
                },
                "system:lastModificationDate": {
                    "value": "2021-06-14T13:11:57.770Z"
                },
                "system:versionNumber": {
                    "value": 1
                },
                "system:baseTypeId": {
                    "value": "system:document"
                },
                "system:tenant": {
                    "value": "default"
                },
                "system:createdBy": {
                    "value": "275c826c-6a61-4e89-9512-8d935a1631e5"
                },
                "system:creationDate": {
                    "value": "2021-06-14T13:11:57.770Z"
                },
                "system:lastModifiedBy": {
                    "value": "275c826c-6a61-4e89-9512-8d935a1631e5"
                },
                "system:objectId": {
                    "value": "3d4a67be-3341-4317-bb57-c48ea7ab0a1a"
                }
            }
        }
    ],
    "numItems": 2,
    "hasMoreItems": false,
    "totalNumItems": 2
}


Return only the bibjson value

Code Block
languagesql
SELECT appBibjsonsample:bibjson FROM appBibjsonsample:medium


Code Block
languageyml
linenumberstrue
collapsetrue
{
    "objects": [
        {
            "properties": {
                "appBibjsonsample:bibjson": {
                    "value": {
                        "type": "book",
                        "title": "My Book Title",
                        "author": [
                            {
                                "name": "Heinrich Schuetzel"
                            },
                            {
                                "name": "Maximilian Sturz"
                            }
                        ],
                        "year": "1995",
                        "owner": "My Library",
                        "id": "ID_of_book",
                        "url": "http://mylibrary.com/ebooks/36513466534",
                        "publisher": "Example Verlag Mustershagen",
                        "edition": {
                            "number": 2,
                            "language": "English"
                        },
                        "identifier": [
                            {
                                "id": "0002-9327",
                                "type": "issn"
                            }
                        ]
                    }
                }
            }
        },
        {
            "properties": {
                "appBibjsonsample:bibjson": {
                    "value": {
                        "metadata": {
                            "collection": "ym_concepts",
                            "label": "yuuvis(R) Momentum Core Concepts",
                            "description": "Documentation for yuuvis(R) Momentum Core in a structured, theoretical way, with links to the tutorial section.",
                            "id": "ID_of_collection",
                            "owner": "OS",
                            "created": "2020-06-09T15:04:12.944771",
                            "modified": "2021-06-10T11:05:17.166993",
                            "source": "https://help.optimal-systems.com/yuuvis_develop/display/YMY/x/-4BkAg",
                            "records": 2
                        },
                        "records": [
                            {
                                "collection": "ym_concepts",
                                "type": "article",
                                "title": "Schema - Defining Object Types",
                                "id": "ID_of_schema_article",
                                "link": "https://help.optimal-systems.com/yuuvis_develop/display/YMY/x/AYFkAg",
                                "author": [
                                    {
                                        "name": "Heinrich Schuetzel"
                                    },
                                    {
                                        "name": "George Trader"
                                    },
                                    {
                                        "name": "Johann Fluss"
                                    }
                                ],
                                "created": "2020-06-09T15:04:12.944771",
                                "modified": "2021-06-10T08:53:23.532949"
                            },
                            {
                                "collection": "ym_concepts",
                                "type": "article",
                                "title": "Search Query Language",
                                "id": "ID_of_query_article",
                                "link": "https://help.optimal-systems.com/yuuvis_develop/display/YMY/x/gIFkAg",
                                "author": [
                                    {
                                        "name": "Andrea Schumann"
                                    },
                                    {
                                        "name": "Franz Lissner"
                                    },
                                    {
                                        "name": "Hans Kammer"
                                    },
                                    {
                                        "name": "Johann Fluss"
                                    }
                                ],
                                "created": "2020-06-16T14:03:01.833660",
                                "modified": "2021-06-02T09:54:12.643040"
                            }
                        ]
                    }
                }
            }
        }
    ],
    "numItems": 2,
    "hasMoreItems": false,
    "totalNumItems": 2
}


Return only parts of the bibjson value

Code Block
languagesql
SELECT appBibjsonsample:bibjson.title,appBibjsonsample:bibjson.author[1].name,appBibjsonsample:bibjson.metadata.id FROM appBibjsonsample:medium


Code Block
languageyml
linenumberstrue
collapsetrue
{
    "objects": [
        {
            "properties": {
                "appBibjsonsample:bibjson": {
                    "value": {
                        "title": "My Book Title",
                        "author": [
                            null,
                            {
                                "name": "Maximilian Sturz"
                            }
                        ]
                    }
                }
            }
        },
        {
            "properties": {
                "appBibjsonsample:bibjson": {
                    "value": {
                        "metadata": {
                            "id": "ID_of_collection"
                        }
                    }
                }
            }
        }
    ],
    "numItems": 2,
    "hasMoreItems": false,
    "totalNumItems": 2
}


If the path is unknown, a '*' wildcard can be used.

Code Block
languagesql
SELECT appBibjsonsample:bibjson.metadata.id FROM appBibjsonsample:medium WHERE appBibjsonsample:bibjson.* = 'ID_of_schema_article'


Code Block
languageyml
linenumberstrue
collapsetrue
{
    "objects": [
        {
            "properties": {
                "appBibjsonsample:bibjson": {
                    "value": {
                        "metadata": {
                            "id": "ID_of_collection"
                        }
                    }
                }
            }
        }
    ],
    "numItems": 1,
    "hasMoreItems": false,
    "totalNumItems": 1
}


Search within a list and usage of CONTAINS

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


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


Search within the records of collections

Code Block
languagesql
SELECT appBibjsonsample:bibjson.records.title,appBibjsonsample:bibjson.metadata.id FROM appBibjsonsample:medium WHERE appBibjsonsample:bibjson.records[*].created IN LASTYEAR()


Code Block
languageyml
linenumberstrue
collapsetrue
{
    "objects": [],
    "numItems": 0,
    "hasMoreItems": false,
    "totalNumItems": 0
}

Summary

Info
iconfalse

Read on

Section


Column
width25%

Another Tutorial

Brief summary of the article linked.


Column
width25%

Another Concept Article

Brief summary of the article linked.


Column
width25%

Another interesting Tutorial

Brief summary of the article linked.