Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

Version 1 Next »

Follow our code examples to get an idea on how to define and specify structured data properties and on how to query them.

Table of Contents

Introduction

Requirements

Definition in the Schema


Example Schema
<?xml version="1.0" encoding="utf-8"?>
<schema xmlns="http://optimal-systems.org/ns/dmscloud/schema/v5.0/"
        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xsi:schemaLocation="http://optimal-systems.org/ns/dmscloud/schema/v5.0/ dmsCloud-schema.xsd">

    <propertyStructuredDataDefinition>
        <id>bibjsonsample:bibjson</id>
        <description>field for the BibJSON structure identifying and describing the medium</description>
        <propertyType>structureddata</propertyType>
        <cardinality>single</cardinality>
        <required>false</required>
    </propertyStructuredDataDefinition>
    <propertyStringDefinition>
        <id>bibjsonsample:locations</id>
        <description>field for storage locations of printed versions of the medium</description>
        <propertyType>string</propertyType>
        <cardinality>multi</cardinality>
        <required>false</required>
    </propertyStringDefinition>
    <typeDocumentDefinition>
        <id>bibjsonsample:medium</id>
        <baseId>system:document</baseId>
        <propertyReference>bibjsonsample:bibjson</propertyReference>
        <propertyReference>bibjsonsample:locations</propertyReference>
        <contentStreamAllowed>allowed</contentStreamAllowed>
    </typeDocumentDefinition>

</schema>

Specify Values during Import

import request book
{
  "objects": [{
    "properties": {
      "objectTypeId": {
        "value": "appBibjsonsample:medium"
      },
      "appBibjsonsample:bibjson": {
        "value": {
          "type": "book",
          "title": "My Book Title",
          "author": [
            {"name": "Sturz, Maximilian"}
          ],
          "year": "1995",
          "owner": "My Library",
          "id": "ID_of_book",
          "url": "http://mylibrary.com/ebooks/ID_of_book",
          "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"
        ]
      }
    }
  }]
}
import request collection
{
  "objects": [{
    "properties": {
      "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",
              "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"
            }
          ]
        }
      }
    }
  }]
}
response of the import
{"objects":[{"properties":{"system:objectId":{"value":"4e6907ae-ea72-439d-a2f6-33fbbee5adde"},"system:baseTypeId":{"value":"system:document"},"system:objectTypeId":{"value":"appBibjsonsample:medium"},"system:createdBy":{"value":"275c826c-6a61-4e89-9512-8d935a1631e5"},"system:creationDate":{"value":"2021-06-11T11:41:00.230Z"},"system:lastModifiedBy":{"value":"275c826c-6a61-4e89-9512-8d935a1631e5"},"system:lastModificationDate":{"value":"2021-06-11T11:41:00.230Z"},"system:versionNumber":{"value":1},"system:tenant":{"value":"default"},"system:traceId":{"value":"c143d4b235273f7b"},"appBibjsonsample:bibjson":{"value":{"type":"book","title":"My Book Title","author":[{"name":"Sturz, Maximilian"}],"year":"1995","owner":"My Library","id":"36513466534","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":"bbdfb9e3-c192-4378-936d-9101a0fd8cc0"},"system:baseTypeId":{"value":"system:document"},"system:objectTypeId":{"value":"appBibjsonsample:medium"},"system:createdBy":{"value":"275c826c-6a61-4e89-9512-8d935a1631e5"},"system:creationDate":{"value":"2021-06-11T11:41:00.490Z"},"system:lastModifiedBy":{"value":"275c826c-6a61-4e89-9512-8d935a1631e5"},"system:lastModificationDate":{"value":"2021-06-11T11:41:00.490Z"},"system:versionNumber":{"value":1},"system:tenant":{"value":"default"},"system:traceId":{"value":"6cc8bad490501a39"},"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":"cdc7095f-a5ce-486d-92a7-6d0955d969ee","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":"569bbbf7-7163-4541-9921-d2fa2d82be02","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":"122bed86-32c6-4ef8-8362-001d2066a97a","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

Search for values of keys that are always accessible via the same path within the JSON value.

SELECT system:objectId FROM appBibjsonsample:medium WHERE appBibjsonsample:bibjson.id = 'ID_of_book'

Returns

{
	"objects":[
	  {
        "properties":{
		  "system:objectId":{
			"value":"4e6907ae-ea72-439d-a2f6-33fbbee5adde"
		}
      }
    }
  ],
  "numItems":1,
  "hasMoreItems":false,
  "totalNumItems":1
}


Summary

Read on

Another Tutorial

Brief summary of the article linked.

Another Concept Article

Brief summary of the article linked.

Another interesting Tutorial

Brief summary of the article linked.

  • No labels