32
Data Type Registry and PID Information Types Tutorial Gesellschaft f¨ ur wissenschaftliche Datenverarbeitung mbH G¨ ottingen (GWDG) Am Fassberg, 37077 G¨ ottingen ulrich.schwardmann [at] gwdg.de 28 November 2016, Potsdam

Data Type Registry and PID Information Types

  • Upload
    others

  • View
    5

  • Download
    0

Embed Size (px)

Citation preview

Data Type Registryand PID Information Types

Tutorial

Gesellschaft fur wissenschaftliche Datenverarbeitung mbH Gottingen(GWDG)

Am Fassberg, 37077 Gottingenulrich.schwardmann [at] gwdg.de

28 November 2016, Potsdam

DTR and PIDInfoTypes

PIDInformationTypes

WarumDatentypenregistrieren ?

Die ePIC DTR

Beispiele furPID-InfoTypeInstanzen

Zugriff aufPID-InfoTypes

Prufung einerPID-InfoType-Instanz

Profile beiePIC-PID-Services

Was fehltnoch ?

Content

1 PID Information Types

2 Warum Datentypen registrieren ?

3 Die ePIC DTR

4 Beispiele fur PID-InfoType Instanzen

5 Zugriff auf PID-InfoTypes

6 Prufung einer PID-InfoType-Instanz

7 Profile bei ePIC-PID-Services

8 Was fehlt noch ?

2 / 32

DTR and PIDInfoTypes

PIDInformationTypes

WarumDatentypenregistrieren ?

Die ePIC DTR

Beispiele furPID-InfoTypeInstanzen

Zugriff aufPID-InfoTypes

Prufung einerPID-InfoType-Instanz

Profile beiePIC-PID-Services

Was fehltnoch ?

PID Information Types

3 / 32

DTR and PIDInfoTypes

PIDInformationTypes

WarumDatentypenregistrieren ?

Die ePIC DTR

Beispiele furPID-InfoTypeInstanzen

Zugriff aufPID-InfoTypes

Prufung einerPID-InfoType-Instanz

Profile beiePIC-PID-Services

Was fehltnoch ?

PID Information Types und RDA

RDA hat sich bereits in den ersten Plenaries mit Types undPID Information Types beschaftigt:

WG Data Type Registry (DTR), Ziele:• Spezifikation einer DTR• Prototypische Implementierung einer DTR

WG PID Information Types, Ziele:• allgemeine Beschreibung derartiger Metadaten• Spezifikation einer PIT-API

Adaptionen:• verschiedene DTRs exisitieren, u.a. die ePIC DTR• PIT API ist prototypisch implementiert• das Handle System stellt mit v8 eine andere API bereit

4 / 32

DTR and PIDInfoTypes

PIDInformationTypes

WarumDatentypenregistrieren ?

Die ePIC DTR

Beispiele furPID-InfoTypeInstanzen

Zugriff aufPID-InfoTypes

Prufung einerPID-InfoType-Instanz

Profile beiePIC-PID-Services

Was fehltnoch ?

PID Information Types und Reusability

PID InfoTypes sind zusatzliche Metadaten

ahnlich wie bei Mime-Types werden sie schon vor demDatenzugriff ausgewertet

sie werden daher direkt verknupft mit der PID• fur Handle-PIDs werden sie direkt in die Handle-DB

geschrieben

ahnlich wie Mime-Types ist eine Standardisieringnotwendig

• die Uberprufung der Einhaltung des Standards ist aberwegen der Variabilitat komplexer

Beispiele:• Datenintegritat: Checksum, Große, ...• Datenverfugbarkeit: Embargos, Loschung, ...• Ort-Zeit-Angaben: GeoLocs, Entstehung, Veranderung, ...• Provenance: Creator, DC5, Versionen, Kopien, ...

5 / 32

DTR and PIDInfoTypes

PIDInformationTypes

WarumDatentypenregistrieren ?

Die ePIC DTR

Beispiele furPID-InfoTypeInstanzen

Zugriff aufPID-InfoTypes

Prufung einerPID-InfoType-Instanz

Profile beiePIC-PID-Services

Was fehltnoch ?

Warum Datentypen registrieren ?

6 / 32

DTR and PIDInfoTypes

PIDInformationTypes

WarumDatentypenregistrieren ?

Die ePIC DTR

Beispiele furPID-InfoTypeInstanzen

Zugriff aufPID-InfoTypes

Prufung einerPID-InfoType-Instanz

Profile beiePIC-PID-Services

Was fehltnoch ?

Wie also sollte ein PID Info Type aussehen?

Namen sind keine hinreichende Characteristik fur InfoTypes

Identifikation sollte unabhangig vom Namen sein• verschiedene Schemata fur den gleichen Namen sollten

moglich sein• umgekehrt sollten fur das gleiche Schema auch mehrere

Namen erlaubt sein

InfoTypes brauchen Schemata zur syntaktischen Uberprufung

InfoTypes sollen fur automatische Prozesse wieMimeTypes funktionieren:

• schon vor dem Zugriff auf die Daten sollen wichtigeInformationen uber die Daten vorliegen

• dies erfordert eine hohe Zuverlassigkeit derInfoType-Inhalte

7 / 32

DTR and PIDInfoTypes

PIDInformationTypes

WarumDatentypenregistrieren ?

Die ePIC DTR

Beispiele furPID-InfoTypeInstanzen

Zugriff aufPID-InfoTypes

Prufung einerPID-InfoType-Instanz

Profile beiePIC-PID-Services

Was fehltnoch ?

Wie also sollte ein PID Info Type aussehen?

verwende deshalb eine Data Type Registry,• die Definitions von InfoType Characteristiken enthalt• InfoTypes durch PIDs identifiziert,• InfoTypes durch Name und Beschreibung interpretierbar

macht,• und idealerweise ein Schema fur die InfoTypes angibt.

8 / 32

DTR and PIDInfoTypes

PIDInformationTypes

WarumDatentypenregistrieren ?

Die ePIC DTR

Beispiele furPID-InfoTypeInstanzen

Zugriff aufPID-InfoTypes

Prufung einerPID-InfoType-Instanz

Profile beiePIC-PID-Services

Was fehltnoch ?

Die ePIC DTR

9 / 32

DTR and PIDInfoTypes

PIDInformationTypes

WarumDatentypenregistrieren ?

Die ePIC DTR

Beispiele furPID-InfoTypeInstanzen

Zugriff aufPID-InfoTypes

Prufung einerPID-InfoType-Instanz

Profile beiePIC-PID-Services

Was fehltnoch ?

Die ePIC DTR StartseiteBeispiele unter: http://dtr.pidconsortium.eu/

PID InfoType Zustande sind:• in preparation (21.T11148), candidate, approved,

deprecated (21.11104)

Startbildschirm der PID InfoType Registry for preparation:http://dtr-test.pidconsortium.eu/

10 / 32

DTR and PIDInfoTypes

PIDInformationTypes

WarumDatentypenregistrieren ?

Die ePIC DTR

Beispiele furPID-InfoTypeInstanzen

Zugriff aufPID-InfoTypes

Prufung einerPID-InfoType-Instanz

Profile beiePIC-PID-Services

Was fehltnoch ?

ePIC DTR Abfragen: PID-InfoTypeshttp://dtr-test.pidconsortium.eu/

#objects/?query=type:"PID-InfoType"

11 / 32

DTR and PIDInfoTypes

PIDInformationTypes

WarumDatentypenregistrieren ?

Die ePIC DTR

Beispiele furPID-InfoTypeInstanzen

Zugriff aufPID-InfoTypes

Prufung einerPID-InfoType-Instanz

Profile beiePIC-PID-Services

Was fehltnoch ?

ePIC DTR Abfragen: PID-InfoTypes as JSONhttp://dtr-test.pidconsortium.eu/

objects/?query=type:"PID-InfoType"

12 / 32

DTR and PIDInfoTypes

PIDInformationTypes

WarumDatentypenregistrieren ?

Die ePIC DTR

Beispiele furPID-InfoTypeInstanzen

Zugriff aufPID-InfoTypes

Prufung einerPID-InfoType-Instanz

Profile beiePIC-PID-Services

Was fehltnoch ?

ePIC DTR Abfragen: Suche latitudehttp://dtr-test.pidconsortium.eu/

#objects/?query=latitude

13 / 32

DTR and PIDInfoTypes

PIDInformationTypes

WarumDatentypenregistrieren ?

Die ePIC DTR

Beispiele furPID-InfoTypeInstanzen

Zugriff aufPID-InfoTypes

Prufung einerPID-InfoType-Instanz

Profile beiePIC-PID-Services

Was fehltnoch ?

ePIC DTR Abfragen: PID-InfoType latitude APIhttp://dtr-test.pidconsortium.eu/

#objects/21.T11148/5fcccdcf1d079c4a85c9

14 / 32

DTR and PIDInfoTypes

PIDInformationTypes

WarumDatentypenregistrieren ?

Die ePIC DTR

Beispiele furPID-InfoTypeInstanzen

Zugriff aufPID-InfoTypes

Prufung einerPID-InfoType-Instanz

Profile beiePIC-PID-Services

Was fehltnoch ?

JSON-Struktur von PID-InfoTypes

name : der Name des Typs

description : die Beschreibung des Typs

identifier : der PID des Typs

provenance : Herkunft, Erzeuger, Zeiten etc.

properties : die verwendeten Untertypen• representationsAndSemantics : die Eigenschaften

verwendeten Untertypen

representationsAndSemantics : die Eigenschaften desTyps

validationSchema : das Schema des Typs

standards : fur den Typ relevante Standards

15 / 32

DTR and PIDInfoTypes

PIDInformationTypes

WarumDatentypenregistrieren ?

Die ePIC DTR

Beispiele furPID-InfoTypeInstanzen

Zugriff aufPID-InfoTypes

Prufung einerPID-InfoType-Instanz

Profile beiePIC-PID-Services

Was fehltnoch ?

PID-InfoType longitude: JSONhttp://dtr-test.pidconsortium.eu/

objects/21.T11148/5fcccdcf1d079c4a85c9

16 / 32

DTR and PIDInfoTypes

PIDInformationTypes

WarumDatentypenregistrieren ?

Die ePIC DTR

Beispiele furPID-InfoTypeInstanzen

Zugriff aufPID-InfoTypes

Prufung einerPID-InfoType-Instanz

Profile beiePIC-PID-Services

Was fehltnoch ?

PID-InfoType longitude: JSON

17 / 32

DTR and PIDInfoTypes

PIDInformationTypes

WarumDatentypenregistrieren ?

Die ePIC DTR

Beispiele furPID-InfoTypeInstanzen

Zugriff aufPID-InfoTypes

Prufung einerPID-InfoType-Instanz

Profile beiePIC-PID-Services

Was fehltnoch ?

Was sind PID BasicInfoTypes?Struktur

name : der Name des Typs

description : die Beschreibung des Typs

identifier : PID des Typs

provenance : Herkunft, Erzeuger, Zeiten etc.

validationSchema : das Schema des Typs

standards : fur den Typ relevante Standards

dataType" : Datentyp: integer, string

regexp : regular expression (bei String)

flavour : der regexp, i.e. ecma-262-RegExp

enum : Aufzahlung erlaubter Werte

default : Angabe eines Defaults, wenn kein Wertangegeben

restrict : Beschrankugen wie minimum, maxLength, ...

18 / 32

DTR and PIDInfoTypes

PIDInformationTypes

WarumDatentypenregistrieren ?

Die ePIC DTR

Beispiele furPID-InfoTypeInstanzen

Zugriff aufPID-InfoTypes

Prufung einerPID-InfoType-Instanz

Profile beiePIC-PID-Services

Was fehltnoch ?

Beispiele fur PIDs mit PID-InfoType (Instanzen)

19 / 32

DTR and PIDInfoTypes

PIDInformationTypes

WarumDatentypenregistrieren ?

Die ePIC DTR

Beispiele furPID-InfoTypeInstanzen

Zugriff aufPID-InfoTypes

Prufung einerPID-InfoType-Instanz

Profile beiePIC-PID-Services

Was fehltnoch ?

Wie sieht eine PID mit InfoType aus?erzeugen:

curl -u ’user:pwrd’ -H ’Accept:application/json’

-H ’Content-Type:application/json’ -X POST --data

’[{”type”:”21.T11148/5fcccdcf1d079c4a85c9”,”parsed data”:”90.0◦S”}]’http://pid.gwdg.de/handles/21.11101/

anzeigen uber Handle Proxy:

http://hdl.handle.net/21.11101/0000-0001-8787-E?noredirect

20 / 32

DTR and PIDInfoTypes

PIDInformationTypes

WarumDatentypenregistrieren ?

Die ePIC DTR

Beispiele furPID-InfoTypeInstanzen

Zugriff aufPID-InfoTypes

Prufung einerPID-InfoType-Instanz

Profile beiePIC-PID-Services

Was fehltnoch ?

Was sind valide und nicht valide Instanzen?http://dtr.pidconsortium.eu/

xmpls/valid/21.T11148/

21 / 32

DTR and PIDInfoTypes

PIDInformationTypes

WarumDatentypenregistrieren ?

Die ePIC DTR

Beispiele furPID-InfoTypeInstanzen

Zugriff aufPID-InfoTypes

Prufung einerPID-InfoType-Instanz

Profile beiePIC-PID-Services

Was fehltnoch ?

Was sind valide und nicht valide Instanzen?wget -O - http://dtr.pidconsortium.eu/

xmpls/invalid/21.T11148/5fcccdcf1d079c4a85c9

im Browser evt. Artefakte bei der Unicode-Darstellung

22 / 32

DTR and PIDInfoTypes

PIDInformationTypes

WarumDatentypenregistrieren ?

Die ePIC DTR

Beispiele furPID-InfoTypeInstanzen

Zugriff aufPID-InfoTypes

Prufung einerPID-InfoType-Instanz

Profile beiePIC-PID-Services

Was fehltnoch ?

Zugriff auf PID-InfoTypeshole den Inhalt eines Wertes eines PID InfoTypes undzeige ihn an:

wget -O -

http://dtr.pidconsortium.eu:8081/objects/21.T11148/

5fcccdcf1d079c4a85c9 | python -c ”import sys,

json; print json.load(sys.stdin)[’name’]”

23 / 32

DTR and PIDInfoTypes

PIDInformationTypes

WarumDatentypenregistrieren ?

Die ePIC DTR

Beispiele furPID-InfoTypeInstanzen

Zugriff aufPID-InfoTypes

Prufung einerPID-InfoType-Instanz

Profile beiePIC-PID-Services

Was fehltnoch ?

Prufung einer PID-InfoType-Instanz

24 / 32

DTR and PIDInfoTypes

PIDInformationTypes

WarumDatentypenregistrieren ?

Die ePIC DTR

Beispiele furPID-InfoTypeInstanzen

Zugriff aufPID-InfoTypes

Prufung einerPID-InfoType-Instanz

Profile beiePIC-PID-Services

Was fehltnoch ?

hole den JSON Inhalt einer PIDuber Proxy mit REST API: hdl.handle.net/api/handles/wget -o /dev/null -O -

http://hdl.handle.net/api/handles/

21.11101/0000-0001-8787-E | python -m json.tool

25 / 32

DTR and PIDInfoTypes

PIDInformationTypes

WarumDatentypenregistrieren ?

Die ePIC DTR

Beispiele furPID-InfoTypeInstanzen

Zugriff aufPID-InfoTypes

Prufung einerPID-InfoType-Instanz

Profile beiePIC-PID-Services

Was fehltnoch ?

hole den Inhalt eines Typsinnerhalb der PID

wget -o /dev/null -O -

http://hdl.handle.net/api/handles/21.11101/0000-0001-8787-E

| python -c ”import sys, json; print

json.load(sys.stdin)[’values’][0][’data’][’value’]”

26 / 32

DTR and PIDInfoTypes

PIDInformationTypes

WarumDatentypenregistrieren ?

Die ePIC DTR

Beispiele furPID-InfoTypeInstanzen

Zugriff aufPID-InfoTypes

Prufung einerPID-InfoType-Instanz

Profile beiePIC-PID-Services

Was fehltnoch ?

validiere mit Online-JSON-ValdatorsBeispiele: http://www.jsonschemavalidator.net/ oderhttp://jsonschemalint.com/ ...

Hole den Wert eines InfoTypes innerhalb der PID (s.o.)Hole den Inhalt des ’validationSchema’-Wertes desPID InfoTypes (s.o.)

27 / 32

DTR and PIDInfoTypes

PIDInformationTypes

WarumDatentypenregistrieren ?

Die ePIC DTR

Beispiele furPID-InfoTypeInstanzen

Zugriff aufPID-InfoTypes

Prufung einerPID-InfoType-Instanz

Profile beiePIC-PID-Services

Was fehltnoch ?

nutze die Python Library PITclient.py

wget https://gitlab.gwdg.de/uschwar1/

PIT-DTR-Type-Verification/raw/master/PITclient.py

Die Python Bibliothek enthalt eine Reihe nutzlicher Funktionenzum Bearbeiten von Werten in PIDs und PID InfoTypes.

Beispiele (Auswahl):• Type-Instanzen in einer PID

get a list of all types in this PIDcontains this PID a type with TypeID?get complete content in PID for given typeget value for type in PIDvalidates value in PID against schema of type

• Inhalt von Type-Definitionen

get the content in DTR of typeget name/description/schema of a type

28 / 32

DTR and PIDInfoTypes

PIDInformationTypes

WarumDatentypenregistrieren ?

Die ePIC DTR

Beispiele furPID-InfoTypeInstanzen

Zugriff aufPID-InfoTypes

Prufung einerPID-InfoType-Instanz

Profile beiePIC-PID-Services

Was fehltnoch ?

Wie wird der Inhalt eines PID-InfoType gepruft

die Funktion typeInPidValidatesAgainstSchema inPITclient.py validiert eine Typ-Instanz in einer PID gegendas Type-Schema

29 / 32

DTR and PIDInfoTypes

PIDInformationTypes

WarumDatentypenregistrieren ?

Die ePIC DTR

Beispiele furPID-InfoTypeInstanzen

Zugriff aufPID-InfoTypes

Prufung einerPID-InfoType-Instanz

Profile beiePIC-PID-Services

Was fehltnoch ?

Profile bei ePIC-PID-Services

ePIC erlaubt pro Prefix die variable Definition eines Satzesvon Mandatory und Optional PID-InfoTypes

• Dies wird Profil genannt, ist also:

eine Liste von Mandatory und OptionalPID-InfoTypes-Listenund als PID-InfoType in der DTR definiert:

profile-ePIC in 21.T11148/f1a6f33d301e13a9da2b

jeder Prefix wird mit einem Handle definiert undbeschrieben

• dort konnen also auch InfoTypes hinterlegt werden• wie zum Beispiel das Profil des Prefix

mit den beschriebenen Methoden kann dann das Profileines Prefixes ausgelesen werden

• und so die in einer PID mit diesem Prefix erwartbarenPID-InfoTypes ermittelt werden

30 / 32

DTR and PIDInfoTypes

PIDInformationTypes

WarumDatentypenregistrieren ?

Die ePIC DTR

Beispiele furPID-InfoTypeInstanzen

Zugriff aufPID-InfoTypes

Prufung einerPID-InfoType-Instanz

Profile beiePIC-PID-Services

Was fehltnoch ?

Was fehlt noch ?

Wie lege ich einen PID-InfoType an ?

Kann ich auch Typen anderer DTRs nutzen ?

Wie erfahre ich, welche Typen schon in einer DTRdefiniert sind?

Wie geschieht die automatische Schema-Generierung beiePIC ?

Welche Teile der PID-InfoType-Definition werden dabeigenutzt ?

31 / 32

DTR and PIDInfoTypes

PIDInformationTypes

WarumDatentypenregistrieren ?

Die ePIC DTR

Beispiele furPID-InfoTypeInstanzen

Zugriff aufPID-InfoTypes

Prufung einerPID-InfoType-Instanz

Profile beiePIC-PID-Services

Was fehltnoch ?

Vielen Dank

Noch mehr Fragen ???KontaKt@ePIC:

[email protected]

KontaKt@GWDG:

Tibor KalmanT: 0551 201-1541, E: [email protected]

Ulrich SchwardmannT: 0551 201-1542, E: [email protected]

32 / 32