diff --git a/2 - Metadata and Catalogue.ipynb b/2 - Metadata and Catalogue.ipynb index 5afd444c521571234c8fdce2e9c5061f448bf27d..551cf1b98803d2585e89dc1eeb03b1cf32fa817e 100644 --- a/2 - Metadata and Catalogue.ipynb +++ b/2 - Metadata and Catalogue.ipynb @@ -27,7 +27,8 @@ "\n", "* Overview data formats\n", "* Overview container formats\n", - "* Overview protocols" + "* Overview protocols\n", + "* Overview SPARQL" ] }, { @@ -205,6 +206,22 @@ "```" ] }, + { + "cell_type": "markdown", + "metadata": { + "slideshow": { + "slide_type": "subslide" + } + }, + "source": [ + "* RDF (Resource Description Framework) W3C standard for modeling information\n", + "* RDF Triples\n", + " * describe everything as subject, predicate and object expression\n", + " * subject denotes the resource\n", + " * predicate, a term used to describe the subject\n", + " * object, the thing that the verb is acting upon, can be another resource, or just a literal value" + ] + }, { "cell_type": "markdown", "metadata": { @@ -216,6 +233,29 @@ "[https://json-ld.org/playground/](https://json-ld.org/playground/)" ] }, + { + "cell_type": "markdown", + "metadata": { + "slideshow": { + "slide_type": "subslide" + } + }, + "source": [ + "* JSON-LD Processing Algorithms \n", + " * JSON-LD Expaneded\n", + " * replaces terms with the URIs they expand to\n", + " * necessary for further transformations\n", + " * removes context\n", + " * JSOM-LD Compacted\n", + " * removes context\n", + " * makes it easier to read\n", + " * JSON-LD Flattened\n", + " * all properties of a node are collected in a __single__ JSON object \n", + " * a labeled directed graph ()\n", + " * JSON-LD Framing\n", + " * [https://w3c.github.io/json-ld-framing/](https://w3c.github.io/json-ld-framing/)" + ] + }, { "cell_type": "markdown", "metadata": { @@ -646,6 +686,1628 @@ " print('setSpec value for selective harvesting: ' + oai_set.setSpec)\n", " print('Name of the set (setName): ' + oai_set.setName + '\\n')" ] + }, + { + "cell_type": "markdown", + "metadata": { + "slideshow": { + "slide_type": "slide" + } + }, + "source": [ + "* SPARQL\n", + " * Query language for the semantic web\n", + " * since 2008 W3C recommendation\n", + " * since 2013 SPARQL 1.1 W3C recommend" + ] + }, + { + "cell_type": "markdown", + "metadata": { + "slideshow": { + "slide_type": "subslide" + } + }, + "source": [ + "* 4 Types of SPARQL Queries\n", + " * SELECT: select values and return them (we will only use that)\n", + " * CONSTRUCT: create a new Graph\n", + " * ASK: Boolean (True/False)\n", + " * DESCRIBE: Describe a resource" + ] + }, + { + "cell_type": "markdown", + "metadata": { + "slideshow": { + "slide_type": "subslide" + } + }, + "source": [ + "\n", + " * Declear prefix shortcuts (optional)\n", + " * PREFIX foo: <...>\n", + " * Query result clause\n", + " * SELECT ...\n", + " * Define the dataset (optional)\n", + " * FROM <...>\n", + " * Query pattern\n", + " * WHERE {\n", + " ...\n", + " }\n", + " * Query modifiers (optional):\n", + " * Group BY ...\n", + " * HAVING\n", + " * ORDER BY\n", + " * LIMIT\n", + " * OFFSET\n", + " * VALUES\n" + ] + }, + { + "cell_type": "code", + "execution_count": 73, + "metadata": { + "slideshow": { + "slide_type": "slide" + } + }, + "outputs": [], + "source": [ + "from rdflib import Graph\n", + "import pandas as pd" + ] + }, + { + "cell_type": "code", + "execution_count": 39, + "metadata": { + "slideshow": { + "slide_type": "subslide" + } + }, + "outputs": [ + { + "data": { + "text/html": [ + "
\n", + "\n", + "\n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + "
012
0http://d-nb.info/gnd/118540238http://d-nb.info/standards/elementset/gnd#plac...http://d-nb.info/gnd/4065105-8
1http://d-nb.info/gnd/118540238http://d-nb.info/standards/elementset/gnd#vari...Gete, J.V.
2http://d-nb.info/gnd/118540238http://d-nb.info/standards/elementset/gnd#vari...Gete, Jogann Vol'fgang fon
3Ne3fc9cda376f4286b16ccc752d36d281http://d-nb.info/standards/elementset/gnd#fore...Wolfgang
4http://d-nb.info/gnd/118540238http://d-nb.info/standards/elementset/gnd#rela...http://d-nb.info/gnd/1085154025
5http://d-nb.info/gnd/118540238http://d-nb.info/standards/elementset/gnd#vari...Naa976c9bc0684e8bb126a4ba2bc97032
6http://d-nb.info/gnd/118540238http://d-nb.info/standards/elementset/gnd#vari...Ǧūta, Yūhān Wulfǧānǧ fūn
7http://d-nb.info/gnd/118540238http://d-nb.info/standards/elementset/gnd#vari...Nefb70c4291124fab989684f7a384fe38
8http://d-nb.info/gnd/118540238http://d-nb.info/standards/elementset/gnd#vari...N07b0d552440246b0abfbbdffa35fa03f
9Nff66bf54af1149bc86bd2ba3df4ecfadhttp://d-nb.info/standards/elementset/gnd#surnameGiote
10http://d-nb.info/gnd/118540238http://d-nb.info/standards/elementset/gnd#vari...Kote, Johann Volfgang
11http://d-nb.info/gnd/118540238http://d-nb.info/standards/elementset/gnd#vari...Hëte, &Euml;han Vol'fhanh
12http://d-nb.info/gnd/118540238http://d-nb.info/standards/elementset/gnd#vari...Göte
13http://d-nb.info/gnd/118540238http://d-nb.info/standards/elementset/gnd#vari...גתה, יוהן וולפגנג פון
14http://d-nb.info/gnd/118540238http://d-nb.info/standards/elementset/gnd#vari...Kote, J. V.
15http://d-nb.info/gnd/118540238http://d-nb.info/standards/elementset/gnd#vari...Göthe, J. W. von
16http://d-nb.info/gnd/118540238http://d-nb.info/standards/elementset/gnd#oldA...(DE-588)1095607278
17http://d-nb.info/gnd/118540238http://www.w3.org/1999/02/22-rdf-syntax-ns#typehttp://d-nb.info/standards/elementset/gnd#Diff...
18http://d-nb.info/gnd/118540238http://d-nb.info/standards/elementset/gnd#vari...Goethe, I. W.
19http://d-nb.info/gnd/118540238http://d-nb.info/standards/elementset/gnd#vari...Giote, J. W.
20http://d-nb.info/gnd/118540238http://d-nb.info/standards/elementset/gnd#vari...N26a14a384d164f70a548b001fc3a702f
21N4e955b2ab7404190b1b53d5a4e306909http://d-nb.info/standards/elementset/gnd#surnameGete
22http://d-nb.info/gnd/118540238http://d-nb.info/standards/elementset/gnd#vari...Gūta
23N25e814b61c554835a0deddd23e8cebd0http://d-nb.info/standards/elementset/gnd#fore...Iogann Vol'fgang
24http://d-nb.info/gnd/118540238http://d-nb.info/standards/elementset/gnd#vari...Ndffad4623aed4bf5b3c934e7f83f02ea
25http://d-nb.info/gnd/118540238http://d-nb.info/standards/elementset/gnd#vari...Goe te
26http://d-nb.info/gnd/118540238http://d-nb.info/standards/elementset/gnd#vari...Goethe, Johann Wolfgang v.
27Ne8ff4c14027a41e4ad880d08004fbea9http://d-nb.info/standards/elementset/gnd#surnameĠūtih
28http://d-nb.info/gnd/118540238http://d-nb.info/standards/elementset/gnd#prof...http://d-nb.info/gnd/4037215-7
29N191b4976c94c47a2b88ac931378afe1fhttp://d-nb.info/standards/elementset/gnd#fore...Jan Wolfang
............
677http://d-nb.info/gnd/118540238http://d-nb.info/standards/elementset/gnd#vari...Goethe, J. W. von
678http://d-nb.info/gnd/118540238http://d-nb.info/standards/elementset/gnd#vari...N8385bc99fabf41aabd0ca61d549977a6
679Nefb70c4291124fab989684f7a384fe38http://d-nb.info/standards/elementset/gnd#surnameGiote
680http://d-nb.info/gnd/118540238http://d-nb.info/standards/elementset/gnd#vari...Goethe, Johann W. von
681Nf369c1a73c3a489d9d6d915e7f4fe964http://d-nb.info/standards/elementset/gnd#prefixv.
682http://d-nb.info/gnd/118540238http://www.w3.org/2002/07/owl#sameAshttp://d-nb.info/gnd/185808069
683http://d-nb.info/gnd/118540238http://d-nb.info/standards/elementset/gnd#vari...Gkaite, Giochan Bolphnkannk êphonë
684Ne8ff4c14027a41e4ad880d08004fbea9http://d-nb.info/standards/elementset/gnd#prefixfūn
685N9dc4c209581642ceaf29a55e89fee755http://d-nb.info/standards/elementset/gnd#fore...V.
686http://d-nb.info/gnd/118540238http://d-nb.info/standards/elementset/gnd#vari...Ncd15232381e2403f9dc755e5c5c02787
687N814917d47f7443e0b8fc9dbe3ddd43b6http://d-nb.info/standards/elementset/gnd#pers...Ge de
688N5bbc43c691344ab595e59837a9163057http://d-nb.info/standards/elementset/gnd#fore...ヨハン・ヴォルフガング・フォン
689http://d-nb.info/gnd/118540238http://d-nb.info/standards/elementset/gnd#acqu...http://d-nb.info/gnd/118727907
690http://d-nb.info/gnd/118540238http://d-nb.info/standards/elementset/gnd#vari...Goithios, I.V.
691Na98f62af260142e28f528f192c6778achttp://d-nb.info/standards/elementset/gnd#surnameGoethe
692http://d-nb.info/gnd/118540238http://d-nb.info/standards/elementset/gnd#biog...Staatsmann, Geheimrat
693http://d-nb.info/gnd/118540238http://d-nb.info/standards/elementset/gnd#vari...N42a4a757cafb4e1f9eb057bc2dad2cf8
694http://d-nb.info/gnd/118540238http://d-nb.info/standards/elementset/gnd#vari...Гёте, Йоҳанн Волфганг
695http://d-nb.info/gnd/118540238http://d-nb.info/standards/elementset/gnd#vari...Goethe, Wolfgang von
696http://d-nb.info/gnd/118540238http://www.w3.org/2002/07/owl#sameAshttp://d-nb.info/gnd/1131918517
697http://d-nb.info/gnd/118540238http://d-nb.info/standards/elementset/gnd#vari...Gyot'e, Yohan Wolfgang
698N3e2d670f9bee4c6cae886cf66cee1d65http://d-nb.info/standards/elementset/gnd#pers...Gede
699Nb55ff0e4a0984fceb982221c923336c2http://d-nb.info/standards/elementset/gnd#fore...Giov. L.
700http://d-nb.info/gnd/118540238http://d-nb.info/standards/elementset/gnd#fami...http://d-nb.info/gnd/11687256X
701http://d-nb.info/gnd/118540238http://d-nb.info/standards/elementset/gnd#prof...http://d-nb.info/gnd/4046517-2
702http://d-nb.info/gnd/118540238http://www.w3.org/2002/07/owl#sameAshttp://d-nb.info/gnd/1095607278
703http://d-nb.info/gnd/118540238http://d-nb.info/standards/elementset/gnd#oldA...(DE-588)185848826
704http://d-nb.info/gnd/118540238http://d-nb.info/standards/elementset/gnd#vari...N191b4976c94c47a2b88ac931378afe1f
705http://d-nb.info/gnd/118540238http://d-nb.info/standards/elementset/gnd#vari...Ġūtah, Yūhān Fūlfġānḡ
706http://d-nb.info/gnd/118540238http://d-nb.info/standards/elementset/gnd#vari...Goethe, J.W.
\n", + "

707 rows × 3 columns

\n", + "
" + ], + "text/plain": [ + " 0 \\\n", + "0 http://d-nb.info/gnd/118540238 \n", + "1 http://d-nb.info/gnd/118540238 \n", + "2 http://d-nb.info/gnd/118540238 \n", + "3 Ne3fc9cda376f4286b16ccc752d36d281 \n", + "4 http://d-nb.info/gnd/118540238 \n", + "5 http://d-nb.info/gnd/118540238 \n", + "6 http://d-nb.info/gnd/118540238 \n", + "7 http://d-nb.info/gnd/118540238 \n", + "8 http://d-nb.info/gnd/118540238 \n", + "9 Nff66bf54af1149bc86bd2ba3df4ecfad \n", + "10 http://d-nb.info/gnd/118540238 \n", + "11 http://d-nb.info/gnd/118540238 \n", + "12 http://d-nb.info/gnd/118540238 \n", + "13 http://d-nb.info/gnd/118540238 \n", + "14 http://d-nb.info/gnd/118540238 \n", + "15 http://d-nb.info/gnd/118540238 \n", + "16 http://d-nb.info/gnd/118540238 \n", + "17 http://d-nb.info/gnd/118540238 \n", + "18 http://d-nb.info/gnd/118540238 \n", + "19 http://d-nb.info/gnd/118540238 \n", + "20 http://d-nb.info/gnd/118540238 \n", + "21 N4e955b2ab7404190b1b53d5a4e306909 \n", + "22 http://d-nb.info/gnd/118540238 \n", + "23 N25e814b61c554835a0deddd23e8cebd0 \n", + "24 http://d-nb.info/gnd/118540238 \n", + "25 http://d-nb.info/gnd/118540238 \n", + "26 http://d-nb.info/gnd/118540238 \n", + "27 Ne8ff4c14027a41e4ad880d08004fbea9 \n", + "28 http://d-nb.info/gnd/118540238 \n", + "29 N191b4976c94c47a2b88ac931378afe1f \n", + ".. ... \n", + "677 http://d-nb.info/gnd/118540238 \n", + "678 http://d-nb.info/gnd/118540238 \n", + "679 Nefb70c4291124fab989684f7a384fe38 \n", + "680 http://d-nb.info/gnd/118540238 \n", + "681 Nf369c1a73c3a489d9d6d915e7f4fe964 \n", + "682 http://d-nb.info/gnd/118540238 \n", + "683 http://d-nb.info/gnd/118540238 \n", + "684 Ne8ff4c14027a41e4ad880d08004fbea9 \n", + "685 N9dc4c209581642ceaf29a55e89fee755 \n", + "686 http://d-nb.info/gnd/118540238 \n", + "687 N814917d47f7443e0b8fc9dbe3ddd43b6 \n", + "688 N5bbc43c691344ab595e59837a9163057 \n", + "689 http://d-nb.info/gnd/118540238 \n", + "690 http://d-nb.info/gnd/118540238 \n", + "691 Na98f62af260142e28f528f192c6778ac \n", + "692 http://d-nb.info/gnd/118540238 \n", + "693 http://d-nb.info/gnd/118540238 \n", + "694 http://d-nb.info/gnd/118540238 \n", + "695 http://d-nb.info/gnd/118540238 \n", + "696 http://d-nb.info/gnd/118540238 \n", + "697 http://d-nb.info/gnd/118540238 \n", + "698 N3e2d670f9bee4c6cae886cf66cee1d65 \n", + "699 Nb55ff0e4a0984fceb982221c923336c2 \n", + "700 http://d-nb.info/gnd/118540238 \n", + "701 http://d-nb.info/gnd/118540238 \n", + "702 http://d-nb.info/gnd/118540238 \n", + "703 http://d-nb.info/gnd/118540238 \n", + "704 http://d-nb.info/gnd/118540238 \n", + "705 http://d-nb.info/gnd/118540238 \n", + "706 http://d-nb.info/gnd/118540238 \n", + "\n", + " 1 \\\n", + "0 http://d-nb.info/standards/elementset/gnd#plac... \n", + "1 http://d-nb.info/standards/elementset/gnd#vari... \n", + "2 http://d-nb.info/standards/elementset/gnd#vari... \n", + "3 http://d-nb.info/standards/elementset/gnd#fore... \n", + "4 http://d-nb.info/standards/elementset/gnd#rela... \n", + "5 http://d-nb.info/standards/elementset/gnd#vari... \n", + "6 http://d-nb.info/standards/elementset/gnd#vari... \n", + "7 http://d-nb.info/standards/elementset/gnd#vari... \n", + "8 http://d-nb.info/standards/elementset/gnd#vari... \n", + "9 http://d-nb.info/standards/elementset/gnd#surname \n", + "10 http://d-nb.info/standards/elementset/gnd#vari... \n", + "11 http://d-nb.info/standards/elementset/gnd#vari... \n", + "12 http://d-nb.info/standards/elementset/gnd#vari... \n", + "13 http://d-nb.info/standards/elementset/gnd#vari... \n", + "14 http://d-nb.info/standards/elementset/gnd#vari... \n", + "15 http://d-nb.info/standards/elementset/gnd#vari... \n", + "16 http://d-nb.info/standards/elementset/gnd#oldA... \n", + "17 http://www.w3.org/1999/02/22-rdf-syntax-ns#type \n", + "18 http://d-nb.info/standards/elementset/gnd#vari... \n", + "19 http://d-nb.info/standards/elementset/gnd#vari... \n", + "20 http://d-nb.info/standards/elementset/gnd#vari... \n", + "21 http://d-nb.info/standards/elementset/gnd#surname \n", + "22 http://d-nb.info/standards/elementset/gnd#vari... \n", + "23 http://d-nb.info/standards/elementset/gnd#fore... \n", + "24 http://d-nb.info/standards/elementset/gnd#vari... \n", + "25 http://d-nb.info/standards/elementset/gnd#vari... \n", + "26 http://d-nb.info/standards/elementset/gnd#vari... \n", + "27 http://d-nb.info/standards/elementset/gnd#surname \n", + "28 http://d-nb.info/standards/elementset/gnd#prof... \n", + "29 http://d-nb.info/standards/elementset/gnd#fore... \n", + ".. ... \n", + "677 http://d-nb.info/standards/elementset/gnd#vari... \n", + "678 http://d-nb.info/standards/elementset/gnd#vari... \n", + "679 http://d-nb.info/standards/elementset/gnd#surname \n", + "680 http://d-nb.info/standards/elementset/gnd#vari... \n", + "681 http://d-nb.info/standards/elementset/gnd#prefix \n", + "682 http://www.w3.org/2002/07/owl#sameAs \n", + "683 http://d-nb.info/standards/elementset/gnd#vari... \n", + "684 http://d-nb.info/standards/elementset/gnd#prefix \n", + "685 http://d-nb.info/standards/elementset/gnd#fore... \n", + "686 http://d-nb.info/standards/elementset/gnd#vari... \n", + "687 http://d-nb.info/standards/elementset/gnd#pers... \n", + "688 http://d-nb.info/standards/elementset/gnd#fore... \n", + "689 http://d-nb.info/standards/elementset/gnd#acqu... \n", + "690 http://d-nb.info/standards/elementset/gnd#vari... \n", + "691 http://d-nb.info/standards/elementset/gnd#surname \n", + "692 http://d-nb.info/standards/elementset/gnd#biog... \n", + "693 http://d-nb.info/standards/elementset/gnd#vari... \n", + "694 http://d-nb.info/standards/elementset/gnd#vari... \n", + "695 http://d-nb.info/standards/elementset/gnd#vari... \n", + "696 http://www.w3.org/2002/07/owl#sameAs \n", + "697 http://d-nb.info/standards/elementset/gnd#vari... \n", + "698 http://d-nb.info/standards/elementset/gnd#pers... \n", + "699 http://d-nb.info/standards/elementset/gnd#fore... \n", + "700 http://d-nb.info/standards/elementset/gnd#fami... \n", + "701 http://d-nb.info/standards/elementset/gnd#prof... \n", + "702 http://www.w3.org/2002/07/owl#sameAs \n", + "703 http://d-nb.info/standards/elementset/gnd#oldA... \n", + "704 http://d-nb.info/standards/elementset/gnd#vari... \n", + "705 http://d-nb.info/standards/elementset/gnd#vari... \n", + "706 http://d-nb.info/standards/elementset/gnd#vari... \n", + "\n", + " 2 \n", + "0 http://d-nb.info/gnd/4065105-8 \n", + "1 Gete, J.V. \n", + "2 Gete, Jogann Vol'fgang fon \n", + "3 Wolfgang \n", + "4 http://d-nb.info/gnd/1085154025 \n", + "5 Naa976c9bc0684e8bb126a4ba2bc97032 \n", + "6 Ǧūta, Yūhān Wulfǧānǧ fūn \n", + "7 Nefb70c4291124fab989684f7a384fe38 \n", + "8 N07b0d552440246b0abfbbdffa35fa03f \n", + "9 Giote \n", + "10 Kote, Johann Volfgang \n", + "11 Hëte, Ëhan Vol'fhanh \n", + "12 Göte \n", + "13 גתה, יוהן וולפגנג פון \n", + "14 Kote, J. V. \n", + "15 Göthe, J. W. von \n", + "16 (DE-588)1095607278 \n", + "17 http://d-nb.info/standards/elementset/gnd#Diff... \n", + "18 Goethe, I. W. \n", + "19 Giote, J. W. \n", + "20 N26a14a384d164f70a548b001fc3a702f \n", + "21 Gete \n", + "22 Gūta \n", + "23 Iogann Vol'fgang \n", + "24 Ndffad4623aed4bf5b3c934e7f83f02ea \n", + "25 Goe te \n", + "26 Goethe, Johann Wolfgang v. \n", + "27 Ġūtih \n", + "28 http://d-nb.info/gnd/4037215-7 \n", + "29 Jan Wolfang \n", + ".. ... \n", + "677 Goethe, J. W. von \n", + "678 N8385bc99fabf41aabd0ca61d549977a6 \n", + "679 Giote \n", + "680 Goethe, Johann W. von \n", + "681 v. \n", + "682 http://d-nb.info/gnd/185808069 \n", + "683 Gkaite, Giochan Bolphnkannk êphonë \n", + "684 fūn \n", + "685 V. \n", + "686 Ncd15232381e2403f9dc755e5c5c02787 \n", + "687 Ge de \n", + "688 ヨハン・ヴォルフガング・フォン \n", + "689 http://d-nb.info/gnd/118727907 \n", + "690 Goithios, I.V. \n", + "691 Goethe \n", + "692 Staatsmann, Geheimrat \n", + "693 N42a4a757cafb4e1f9eb057bc2dad2cf8 \n", + "694 Гёте, Йоҳанн Волфганг \n", + "695 Goethe, Wolfgang von \n", + "696 http://d-nb.info/gnd/1131918517 \n", + "697 Gyot'e, Yohan Wolfgang \n", + "698 Gede \n", + "699 Giov. L. \n", + "700 http://d-nb.info/gnd/11687256X \n", + "701 http://d-nb.info/gnd/4046517-2 \n", + "702 http://d-nb.info/gnd/1095607278 \n", + "703 (DE-588)185848826 \n", + "704 N191b4976c94c47a2b88ac931378afe1f \n", + "705 Ġūtah, Yūhān Fūlfġānḡ \n", + "706 Goethe, J.W. \n", + "\n", + "[707 rows x 3 columns]" + ] + }, + "execution_count": 39, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "#authority file Goethe: https://d-nb.info/gnd/118540238\n", + "goethe_rdf = \"https://d-nb.info/gnd/118540238/about/lds.rdf\"\n", + "#authority file Kreisky: https://d-nb.info/gnd/118566512\n", + "kreisky_rdf = \"https://d-nb.info/gnd/118566512/about/lds.rdf\"\n", + "#subject heading 'Medizin': https://d-nb.info/gnd/4038243-6\n", + "medicine_rdf = \"https://d-nb.info/gnd/4038243-6/about/lds.rdf\"\n", + "\n", + "#list all triples in authority file Goethe\n", + "g=Graph()\n", + "g.parse(goethe_rdf)\n", + "properties = g.query('''\n", + " SELECT ?s ?p ?o \n", + " WHERE {\n", + " ?s ?p ?o .\n", + " }\n", + "''')\n", + "df_goethe = pd.DataFrame(properties)\n", + "df_goethe" + ] + }, + { + "cell_type": "code", + "execution_count": 43, + "metadata": { + "slideshow": { + "slide_type": "subslide" + } + }, + "outputs": [ + { + "data": { + "text/html": [ + "
\n", + "\n", + "\n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + "
012
0http://d-nb.info/gnd/4038243-6http://www.w3.org/2002/07/owl#sameAshttp://www.wikidata.org/entity/Q11190
1http://d-nb.info/gnd/040382435/abouthttp://purl.org/dc/terms/licensehttp://creativecommons.org/publicdomain/zero/1.0/
2http://d-nb.info/gnd/4038243-6http://d-nb.info/standards/elementset/gnd#vari...Heilkunst
3http://d-nb.info/gnd/4038243-6http://www.w3.org/2004/02/skos/core#exactMatchhttp://zbw.eu/stw/descriptor/15658-5
4http://d-nb.info/gnd/4038243-6http://d-nb.info/standards/elementset/gnd#gndS...http://d-nb.info/standards/vocab/gnd/gnd-sc#27.1a
5http://d-nb.info/gnd/4038243-6http://d-nb.info/standards/elementset/gnd#vari...Medicine
6http://d-nb.info/gnd/4038243-6http://www.w3.org/1999/02/22-rdf-syntax-ns#typehttp://d-nb.info/standards/elementset/gnd#Subj...
7http://d-nb.info/gnd/4038243-6http://d-nb.info/standards/elementset/gnd#gndI...4038243-6
8http://d-nb.info/gnd/4038243-6http://d-nb.info/standards/elementset/gnd#rela...http://dewey.info/class/610/
9http://d-nb.info/gnd/4038243-6http://www.w3.org/2007/05/powder-s#describedbyhttp://d-nb.info/gnd/040382435/about
10http://d-nb.info/gnd/4038243-6http://d-nb.info/standards/elementset/gnd#oldA...(DE-588c)4038243-6
11http://d-nb.info/gnd/4038243-6http://d-nb.info/standards/elementset/gnd#vari...Humanmedizin
12http://d-nb.info/gnd/040382435/abouthttp://purl.org/dc/terms/modified2017-01-25T16:58:26
13http://d-nb.info/gnd/4038243-6http://d-nb.info/standards/elementset/gnd#pref...Medizin
\n", + "
" + ], + "text/plain": [ + " 0 \\\n", + "0 http://d-nb.info/gnd/4038243-6 \n", + "1 http://d-nb.info/gnd/040382435/about \n", + "2 http://d-nb.info/gnd/4038243-6 \n", + "3 http://d-nb.info/gnd/4038243-6 \n", + "4 http://d-nb.info/gnd/4038243-6 \n", + "5 http://d-nb.info/gnd/4038243-6 \n", + "6 http://d-nb.info/gnd/4038243-6 \n", + "7 http://d-nb.info/gnd/4038243-6 \n", + "8 http://d-nb.info/gnd/4038243-6 \n", + "9 http://d-nb.info/gnd/4038243-6 \n", + "10 http://d-nb.info/gnd/4038243-6 \n", + "11 http://d-nb.info/gnd/4038243-6 \n", + "12 http://d-nb.info/gnd/040382435/about \n", + "13 http://d-nb.info/gnd/4038243-6 \n", + "\n", + " 1 \\\n", + "0 http://www.w3.org/2002/07/owl#sameAs \n", + "1 http://purl.org/dc/terms/license \n", + "2 http://d-nb.info/standards/elementset/gnd#vari... \n", + "3 http://www.w3.org/2004/02/skos/core#exactMatch \n", + "4 http://d-nb.info/standards/elementset/gnd#gndS... \n", + "5 http://d-nb.info/standards/elementset/gnd#vari... \n", + "6 http://www.w3.org/1999/02/22-rdf-syntax-ns#type \n", + "7 http://d-nb.info/standards/elementset/gnd#gndI... \n", + "8 http://d-nb.info/standards/elementset/gnd#rela... \n", + "9 http://www.w3.org/2007/05/powder-s#describedby \n", + "10 http://d-nb.info/standards/elementset/gnd#oldA... \n", + "11 http://d-nb.info/standards/elementset/gnd#vari... \n", + "12 http://purl.org/dc/terms/modified \n", + "13 http://d-nb.info/standards/elementset/gnd#pref... \n", + "\n", + " 2 \n", + "0 http://www.wikidata.org/entity/Q11190 \n", + "1 http://creativecommons.org/publicdomain/zero/1.0/ \n", + "2 Heilkunst \n", + "3 http://zbw.eu/stw/descriptor/15658-5 \n", + "4 http://d-nb.info/standards/vocab/gnd/gnd-sc#27.1a \n", + "5 Medicine \n", + "6 http://d-nb.info/standards/elementset/gnd#Subj... \n", + "7 4038243-6 \n", + "8 http://dewey.info/class/610/ \n", + "9 http://d-nb.info/gnd/040382435/about \n", + "10 (DE-588c)4038243-6 \n", + "11 Humanmedizin \n", + "12 2017-01-25T16:58:26 \n", + "13 Medizin " + ] + }, + "execution_count": 43, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "#list all triples in subject heading 'Medizin'\n", + "g=Graph()\n", + "g.parse(medicine_rdf)\n", + "properties = g.query('''\n", + " SELECT ?s ?p ?o \n", + " WHERE {\n", + " ?s ?p ?o .\n", + " }\n", + "''')\n", + "df_medicine = pd.DataFrame(properties)\n", + "df_medicine" + ] + }, + { + "cell_type": "code", + "execution_count": 71, + "metadata": { + "slideshow": { + "slide_type": "subslide" + } + }, + "outputs": [ + { + "data": { + "text/html": [ + "
\n", + "\n", + "\n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + "
0
0http://www.w3.org/1999/02/22-rdf-syntax-ns#type
1http://purl.org/dc/terms/license
2http://d-nb.info/standards/elementset/gnd#gndI...
3http://www.w3.org/2004/02/skos/core#exactMatch
4http://www.w3.org/2002/07/owl#sameAs
5http://purl.org/dc/terms/modified
6http://d-nb.info/standards/elementset/gnd#oldA...
7http://d-nb.info/standards/elementset/gnd#vari...
8http://d-nb.info/standards/elementset/gnd#pref...
9http://www.w3.org/2007/05/powder-s#describedby
10http://d-nb.info/standards/elementset/gnd#gndS...
11http://d-nb.info/standards/elementset/gnd#rela...
\n", + "
" + ], + "text/plain": [ + " 0\n", + "0 http://www.w3.org/1999/02/22-rdf-syntax-ns#type\n", + "1 http://purl.org/dc/terms/license\n", + "2 http://d-nb.info/standards/elementset/gnd#gndI...\n", + "3 http://www.w3.org/2004/02/skos/core#exactMatch\n", + "4 http://www.w3.org/2002/07/owl#sameAs\n", + "5 http://purl.org/dc/terms/modified\n", + "6 http://d-nb.info/standards/elementset/gnd#oldA...\n", + "7 http://d-nb.info/standards/elementset/gnd#vari...\n", + "8 http://d-nb.info/standards/elementset/gnd#pref...\n", + "9 http://www.w3.org/2007/05/powder-s#describedby\n", + "10 http://d-nb.info/standards/elementset/gnd#gndS...\n", + "11 http://d-nb.info/standards/elementset/gnd#rela..." + ] + }, + "execution_count": 71, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "#list all distinct predicates in subject heading 'Medizin'\n", + "g=Graph()\n", + "g.parse(medicine_rdf)\n", + "properties = g.query('''\n", + " SELECT DISTINCT ?p \n", + " WHERE {\n", + " ?s ?p ?o .\n", + " }\n", + "''')\n", + "df_medicine = pd.DataFrame(properties)\n", + "df_medicine" + ] + }, + { + "cell_type": "code", + "execution_count": 46, + "metadata": { + "slideshow": { + "slide_type": "subslide" + } + }, + "outputs": [ + { + "data": { + "text/html": [ + "
\n", + "\n", + "\n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + "
0
0Medicine
1Heilkunst
2Humanmedizin
\n", + "
" + ], + "text/plain": [ + " 0\n", + "0 Medicine\n", + "1 Heilkunst\n", + "2 Humanmedizin" + ] + }, + "execution_count": 46, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "#list all ariantNameForTheSubjectHeading 'Medizin'\n", + "g=Graph()\n", + "g.parse(medicine_rdf)\n", + "properties = g.query('''\n", + " PREFIX gndo: \n", + " SELECT ?o \n", + " WHERE {\n", + " ?s gndo:variantNameForTheSubjectHeading ?o .\n", + " #?s gndo:preferredNameForTheSubjectHeading ?o .\n", + " }\n", + "''')\n", + "df_medicine = pd.DataFrame(properties)\n", + "df_medicine" + ] + }, + { + "cell_type": "code", + "execution_count": 52, + "metadata": { + "slideshow": { + "slide_type": "subslide" + } + }, + "outputs": [ + { + "data": { + "text/html": [ + "
\n", + "\n", + "\n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + "
01
0http://d-nb.info/gnd/4066009-62
1Bundeskanzler 1970-19831
2(DE-588a)1185665121
3Bruno1
4http://www.wikidata.org/entity/Q445171
5http://dbpedia.org/resource/Bruno_Kreisky1
6Kreisky, Bruno1
7http://d-nb.info/gnd/1210360731
8http://d-nb.info/standards/vocab/gnd/gnd-sc#16.5p1
9https://de.wikipedia.org/wiki/Bruno_Kreisky1
101185665121
11http://viaf.org/viaf/319984841
12Politiker, Oesterreich1
13http://d-nb.info/standards/elementset/gnd#Diff...1
141990-07-291
15http://d-nb.info/standards/vocab/gnd/gender#male1
16http://www.isni.org/00000001126087671
17http://id.loc.gov/authorities/n500439481
18http://d-nb.info/gnd/4046517-21
192016-12-16T22:40:251
20http://www.filmportal.de/person/5B113A52F8F14A...1
21http://d-nb.info/gnd/118566512/about1
22http://d-nb.info/gnd/2029382-31
23N6d057aa2f1874c6dbef28ea5e55459481
241911-01-221
25Kreisky1
26(DE-588c)4032993-81
27http://d-nb.info/standards/vocab/gnd/geographi...1
28http://creativecommons.org/publicdomain/zero/1.0/1
\n", + "
" + ], + "text/plain": [ + " 0 1\n", + "0 http://d-nb.info/gnd/4066009-6 2\n", + "1 Bundeskanzler 1970-1983 1\n", + "2 (DE-588a)118566512 1\n", + "3 Bruno 1\n", + "4 http://www.wikidata.org/entity/Q44517 1\n", + "5 http://dbpedia.org/resource/Bruno_Kreisky 1\n", + "6 Kreisky, Bruno 1\n", + "7 http://d-nb.info/gnd/121036073 1\n", + "8 http://d-nb.info/standards/vocab/gnd/gnd-sc#16.5p 1\n", + "9 https://de.wikipedia.org/wiki/Bruno_Kreisky 1\n", + "10 118566512 1\n", + "11 http://viaf.org/viaf/31998484 1\n", + "12 Politiker, Oesterreich 1\n", + "13 http://d-nb.info/standards/elementset/gnd#Diff... 1\n", + "14 1990-07-29 1\n", + "15 http://d-nb.info/standards/vocab/gnd/gender#male 1\n", + "16 http://www.isni.org/0000000112608767 1\n", + "17 http://id.loc.gov/authorities/n50043948 1\n", + "18 http://d-nb.info/gnd/4046517-2 1\n", + "19 2016-12-16T22:40:25 1\n", + "20 http://www.filmportal.de/person/5B113A52F8F14A... 1\n", + "21 http://d-nb.info/gnd/118566512/about 1\n", + "22 http://d-nb.info/gnd/2029382-3 1\n", + "23 N6d057aa2f1874c6dbef28ea5e5545948 1\n", + "24 1911-01-22 1\n", + "25 Kreisky 1\n", + "26 (DE-588c)4032993-8 1\n", + "27 http://d-nb.info/standards/vocab/gnd/geographi... 1\n", + "28 http://creativecommons.org/publicdomain/zero/1.0/ 1" + ] + }, + "execution_count": 52, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "#count all objects in authority file Kreisky\n", + "g=Graph()\n", + "g.parse(kreisky_rdf)\n", + "properties = g.query('''\n", + " SELECT ?o (COUNT(*) AS ?cnt) {\n", + " ?s ?p ?o .\n", + " } GROUP BY ?o ORDER BY DESC(?cnt)\n", + "''')\n", + "df_kreisky = pd.DataFrame(properties)\n", + "df_kreisky" + ] + }, + { + "cell_type": "code", + "execution_count": 74, + "metadata": { + "slideshow": { + "slide_type": "subslide" + } + }, + "outputs": [ + { + "data": { + "text/html": [ + "
\n", + "\n", + "\n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + "
01
0http://www.w3.org/2002/07/owl#sameAs6
1http://d-nb.info/standards/elementset/gnd#oldA...2
2http://d-nb.info/standards/elementset/gnd#biog...2
3http://d-nb.info/standards/elementset/gnd#pref...1
4http://d-nb.info/standards/elementset/gnd#gender1
5http://purl.org/dc/terms/license1
6http://d-nb.info/standards/elementset/gnd#prof...1
7http://d-nb.info/standards/elementset/gnd#fami...1
8http://d-nb.info/standards/elementset/gnd#affi...1
9http://d-nb.info/standards/elementset/gnd#plac...1
10http://d-nb.info/standards/elementset/gnd#gndI...1
11http://d-nb.info/standards/elementset/gnd#surname1
12http://d-nb.info/standards/elementset/gnd#fore...1
13http://d-nb.info/standards/elementset/gnd#date...1
14http://d-nb.info/standards/elementset/gnd#date...1
15http://purl.org/dc/terms/modified1
16http://d-nb.info/standards/elementset/gnd#gndS...1
17http://d-nb.info/standards/elementset/gnd#geog...1
18http://xmlns.com/foaf/0.1/page1
19http://www.w3.org/2007/05/powder-s#describedby1
20http://d-nb.info/standards/elementset/gnd#pref...1
21http://www.w3.org/1999/02/22-rdf-syntax-ns#type1
22http://d-nb.info/standards/elementset/gnd#plac...1
\n", + "
" + ], + "text/plain": [ + " 0 1\n", + "0 http://www.w3.org/2002/07/owl#sameAs 6\n", + "1 http://d-nb.info/standards/elementset/gnd#oldA... 2\n", + "2 http://d-nb.info/standards/elementset/gnd#biog... 2\n", + "3 http://d-nb.info/standards/elementset/gnd#pref... 1\n", + "4 http://d-nb.info/standards/elementset/gnd#gender 1\n", + "5 http://purl.org/dc/terms/license 1\n", + "6 http://d-nb.info/standards/elementset/gnd#prof... 1\n", + "7 http://d-nb.info/standards/elementset/gnd#fami... 1\n", + "8 http://d-nb.info/standards/elementset/gnd#affi... 1\n", + "9 http://d-nb.info/standards/elementset/gnd#plac... 1\n", + "10 http://d-nb.info/standards/elementset/gnd#gndI... 1\n", + "11 http://d-nb.info/standards/elementset/gnd#surname 1\n", + "12 http://d-nb.info/standards/elementset/gnd#fore... 1\n", + "13 http://d-nb.info/standards/elementset/gnd#date... 1\n", + "14 http://d-nb.info/standards/elementset/gnd#date... 1\n", + "15 http://purl.org/dc/terms/modified 1\n", + "16 http://d-nb.info/standards/elementset/gnd#gndS... 1\n", + "17 http://d-nb.info/standards/elementset/gnd#geog... 1\n", + "18 http://xmlns.com/foaf/0.1/page 1\n", + "19 http://www.w3.org/2007/05/powder-s#describedby 1\n", + "20 http://d-nb.info/standards/elementset/gnd#pref... 1\n", + "21 http://www.w3.org/1999/02/22-rdf-syntax-ns#type 1\n", + "22 http://d-nb.info/standards/elementset/gnd#plac... 1" + ] + }, + "execution_count": 74, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "#count all predicates in authority file Kreisky\n", + "g=Graph()\n", + "g.parse(kreisky_rdf)\n", + "properties = g.query('''\n", + " SELECT ?p(COUNT(*) AS ?cnt) {\n", + " ?s ?p ?o .\n", + " } GROUP BY ?p ORDER BY DESC(?cnt)\n", + "''')\n", + "df_kreisky = pd.DataFrame(properties)\n", + "df_kreisky" + ] + }, + { + "cell_type": "code", + "execution_count": 72, + "metadata": { + "slideshow": { + "slide_type": "subslide" + } + }, + "outputs": [ + { + "data": { + "text/html": [ + "
\n", + "\n", + "\n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + "
0
0http://viaf.org/viaf/31998484
1http://www.wikidata.org/entity/Q44517
2http://id.loc.gov/authorities/n50043948
3http://www.filmportal.de/person/5B113A52F8F14A...
4http://www.isni.org/0000000112608767
5http://dbpedia.org/resource/Bruno_Kreisky
\n", + "
" + ], + "text/plain": [ + " 0\n", + "0 http://viaf.org/viaf/31998484\n", + "1 http://www.wikidata.org/entity/Q44517\n", + "2 http://id.loc.gov/authorities/n50043948\n", + "3 http://www.filmportal.de/person/5B113A52F8F14A...\n", + "4 http://www.isni.org/0000000112608767\n", + "5 http://dbpedia.org/resource/Bruno_Kreisky" + ] + }, + "execution_count": 72, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "#resource linked from \n", + "g=Graph()\n", + "g.parse('https://d-nb.info/gnd/118566512/about/lds.rdf')\n", + "properties = g.query('''\n", + " PREFIX owl: \n", + " SELECT ?o \n", + " WHERE {\n", + " ?s owl:sameAs ?o .\n", + " }\n", + "''')\n", + "df_kreisky = pd.DataFrame(properties)\n", + "df_kreisky" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [] } ], "metadata": { @@ -665,7 +2327,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.7.1" + "version": "3.6.7" } }, "nbformat": 4,