diff --git a/2 - Metadata and Catalogue.ipynb b/2 - Metadata and Catalogue.ipynb index 21eb213ece6cd7a1960a4d9898049fba0a6958ed..85ad7e097dd6a3ea36d2139262315595f54ce865 100644 --- a/2 - Metadata and Catalogue.ipynb +++ b/2 - Metadata and Catalogue.ipynb @@ -140,6 +140,67 @@ "![simpledc xml schema](./media/simpledc.png)\n" ] }, + { + "cell_type": "markdown", + "metadata": { + "slideshow": { + "slide_type": "subslide" + } + }, + "source": [ + "* JSON\n", + " * a string = { \"name\":\"John\" }\n", + " * a number = { \"age\":30 }\n", + " * an object (JSON object) = {\"employee\":{ \"name\":\"John\", \"age\":30, \"city\":\"New York\" }}\n", + " * an array = {\"employees\":[ \"John\", \"Anna\", \"Peter\" ]}\n", + " * a boolean = { \"sale\":true }\n", + " * null = { \"middlename\":null }" + ] + }, + { + "cell_type": "markdown", + "metadata": { + "slideshow": { + "slide_type": "subslide" + } + }, + "source": [ + "* JSON-LD\n", + " * JSON for Linked Data\n", + " * keywords\n", + " * @context to provide additional mappings from JSON to an RDF model (map terms to IRIs)\n", + " * @id to uniquely identify things\n", + " * @type to set the data type of a node or typed value\n", + " * @container to set the default container type for a term\n", + " * \"@container\": \"@set\" defines a container as an unordered set" + ] + }, + { + "cell_type": "markdown", + "metadata": { + "slideshow": { + "slide_type": "subslide" + } + }, + "source": [ + "```javascript\n", + "{\n", + " \"@context\": {\n", + " \"name\": \"http://xmlns.com/foaf/0.1/name\",\n", + " \"homepage\": {\n", + " \"@id\": \"http://xmlns.com/foaf/0.1/workplaceHomepage\",\n", + " \"@type\": \"@id\"\n", + " },\n", + " \"Person\": \"http://xmlns.com/foaf/0.1/Person\"\n", + " },\n", + " \"@id\": \"https://me.example.com\",\n", + " \"@type\": \"Person\",\n", + " \"name\": \"John Smith\",\n", + " \"homepage\": \"https://www.example.com/\"\n", + "}\n", + "```" + ] + }, { "cell_type": "markdown", "metadata": { @@ -165,6 +226,43 @@ "* [https://open-na.hosted.exlibrisgroup.com/alma/contexts/bib](https://open-na.hosted.exlibrisgroup.com/alma/contexts/bib)" ] }, + { + "cell_type": "code", + "execution_count": 1, + "metadata": { + "slideshow": { + "slide_type": "slide" + } + }, + "outputs": [ + { + "data": { + "text/plain": [ + "{'date': '9999',\n", + " 'note': 'Aus: (Sammelband von 63 Hochzeitsgedichten).',\n", + " 'identifier': [{'label': '(DE-599)OBVAC10480601'},\n", + " {'label': '(Aleph)010690174ACC01'},\n", + " {'label': '(AT-OBV)AC10480601'},\n", + " {'label': 'AC10480601'}],\n", + " '@type': 'Book',\n", + " 'place_of_publication': 's.l.',\n", + " 'language': 'http://id.loc.gov/vocabulary/iso639-2/ger',\n", + " '@id': 'https://open-na.hosted.exlibrisgroup.com/alma/43ACC_NETWORK/bibs/990106901740203331',\n", + " 'title': 'Bey dem hochadelichen Helmrich- und Bassronischen Beylager, welches ... zu sonderbahren Ehren beyder Vermählten ...',\n", + " '@context': 'https://open-na.hosted.exlibrisgroup.com/alma/contexts/bib'}" + ] + }, + "execution_count": 1, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "import requests\n", + "cont=requests.get(\"https://open-na.hosted.exlibrisgroup.com/alma/43ACC_NETWORK/bibs/990106901740203331\")\n", + "cont.json()" + ] + }, { "cell_type": "markdown", "metadata": { @@ -246,7 +344,7 @@ }, { "cell_type": "code", - "execution_count": 1, + "execution_count": 2, "metadata": { "slideshow": { "slide_type": "slide"