diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 58e2ca286..213ec1ea4 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -8,7 +8,7 @@ env: jobs: test-integration: name: Integration Tests - runs-on: ubuntu-latest + runs-on: ubuntu-20.04 steps: - name: Checkout source uses: actions/checkout@v1 @@ -31,7 +31,7 @@ jobs: with: python-version: 3.9 - name: Install python package dependencies - run: sudo apt-get install libxml2-dev libxslt-dev python3-dev libgtk-3-dev libgstreamer1.0-0 gstreamer1.0-plugins-base freeglut3-dev libwebkitgtk-1.0-0 libjpeg-dev libpng-dev libtiff-dev libsdl-dev libnotify-dev libsm-dev + run: sudo apt-get install libxml2-dev libxslt-dev python3-dev libgstreamer1.0-0 gstreamer1.0-plugins-base freeglut3-dev libjpeg-dev libpng-dev libtiff-dev libsdl-dev libnotify-dev libsm-dev - name: run test-integration run: | make upgrade-dist-tools diff --git a/.gitignore b/.gitignore index 1d65f7e8c..1190daeaa 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,5 @@ .tmp +**/.DS_Store # Byte-compiled / optimized / DLL files __pycache__/ diff --git a/docs/dsp-tools-create.md b/docs/dsp-tools-create.md index 857d04a1d..e3c8bb5de 100644 --- a/docs/dsp-tools-create.md +++ b/docs/dsp-tools-create.md @@ -1,9 +1,17 @@ -# JSON ontology definition format +# JSON data model definition format ## Introduction -This document contains all the information you need to create an ontology that's used by DSP. - -In the first section you find a rough overview of the ontology definition, all the necessary components with a +This document contains all the information you need to create an data model that's used by DSP. According to +Wikipedia, da [data model](https://en.wikipedia.org/wiki/Data_model) is "_is an abstract model that organizes elements +of data and standardizes how they relate to one another and to the properties of real-world entities._" Further it +states: "_A data model explicitly determines the structure of data. Data models are typically specified by a data +specialist, data librarian, or a digital humanities scholar in a data modeling notation_". In this section we will +describe one of the notations that is used by the _dsp-tools_ to create a data model in the dsp repository. The dsp +repository is loosely based on [Linked Open Data](https://en.wikipedia.org/wiki/Linked_data) where also the term +_"ontology"_ is used for the data model. It should be noted that in this context an ontology is not used in the +philosophical sense. + +In the first section you find a rough overview of the data model definition, all the necessary components with a definition and a short example of the definition. ## A short overview @@ -11,7 +19,7 @@ In the following section, you find all the mentioned parts with a detailed expla at the basic fields that belong to an ontology definition. This serves as an overview for you to which you can return at any time while you read the description. -A complete ontology definition looks like this: +A complete data model definition looks like this: ```json { @@ -147,56 +155,67 @@ as well e.i. "keywords": []. `"lists": [,,...]` Often in order to characterize or classify a real world object, we use a sequential or hierarchical list of terms. For -example a hypothetical classification of classical music genres could be as : - -- Orchestral music - - Symphony - - Symphony poem - - Overture - - Concerto - - Ballet - - Incidential music - - Suite -- Chamber music - - String trio - - Piano trio - - String quartet - - Piano quartet - - String quintet - - Piano quintet - - Other -- Solo instrumental - - Organ - - Piano - - Harpsichord - - Spinet - - Guitar - - Lute - - Violin - - Flute - - Other -- Vocal Music - - Choir - - Oratorios - - Passions - - Cantatas - - Masses - - Motets - - Madrigals - - Psalms - - Solo - - Songs - - Arias -- Opera - - Comic opera - - Serious Opera - - Opera Semiseria - - Opera Conrnique - - Grand opera - - Opera verismo +example a classification of disciplines in the Humanities might look like follows: + +- Performing arts + - Music + - Chamber music + - Church music + - Conducting + - Choirs + - Orchestras + - Music history + - Musictheory + - Musicology + - Jazz + - Pop/Rock + - Dance + - Choreography + - Theatre + - Acting + - Directing + - Playwriting + - Scenography + - Movies/Television + - Animation + - Live action +- Visual arts + - Fine arts + - Drawing + - Painting + - Photography + - Applied Arts + - Animation + - Architecture + - Decorative arts +- History + - Ancient history + - Modern history +- Languages and literature + - Linguistics + - Grammar + - Etymology + - Phonetics + - Semantics + - Literature + - Fiction + - Non-fiction + - Theory of literature +- Philosophy + - Aesthetics + - Applied philosophy + - Epistemology + - Justification + - Reasoning + - Metaphysics + - Determinism and free will + - Ontology + - Philosophy of mind + - Teleology + DSP allows to define such controlled vocabularies or thesauri. They can be arranged "flat" or in "hierarchies" (as the -given example about music genres is). The definition of these entities are called "lists" in the DSP. Thus, the +given example about the disciplines in Humanities is). The definition of these entities are called "lists" in the DSP. Thus, the list object is used to give the resources of the ontology a taxonomic quality. A taxonomy makes it possible to categorize a resource. The big advantage of a taxonomic structure as it is implemented by the DSP is that the user can subcategorize the objects. This allows the user to formulate his search requests more or less @@ -230,7 +249,8 @@ therefore flat. A resource can be assigned to a taxonomic node within its properties. So a resource of type "musical work" with the title "La Traviata" would have the property/attribute "musical-genre" with the value "Grand opera". Within the DSP, each property or attribute has an assigned cardinality. Sometimes, a taxonomy allows that an object may belong to -different categories at the same time (e.g. an image which depicts several categories at the same time). In these cases, a cardinality > 1 allows to add multiple attributes +different categories at the same time (e.g. an image which depicts several categories at the same time). In these cases, +a cardinality > 1 allows to add multiple attributes of the same time. See further below the description of the [cardinalities](#cardinalities) A node of the Taxonomy may have the following elements: @@ -243,50 +263,112 @@ It needs to specify at least one language. is _optional_. - _nodes_: Array of subnodes. If you have a non-hierarchical taxonomy (i.e. a taxonomy with only 2 levels, the root level and another level), you don't have child nodes. Therefore the nodes element can be omitted in case of a flat - taxonomy. + taxonomy. + +Each list must have exactely one root node which has the same form bu denotes the list itself. Here is an example on how to build a taxonomic structure with the help of JSON: ```json - "lists": [ +"lists": [ + { + "name": "my_list", + "labels": {"en": "Disciplines of the Humanities"}, + "comments": {"en": "This ist is just a silly example", "fr": "un example un peu fou"}, + "nodes": [ { - "name": "classicalmusicgenres", - "labels": { "de": "Musikkategorien für klassische Musik", "en": "Genres of classical music" }, + "name": "node_1_1", + "labels": {"en": "Performing arts"}, + "comments": {"en": "Arts that are events", "de": "Künste mit performativem Character"}, "nodes": [ - { - "name": "orchestral", - "labels": { "en": "Orchestral music", "de": "Orchestermusik" }, - "comments": { "en": "Multiple instruments together", "de": "Mehrere Instrumente zusammen" }, + { + "name": "node_2_2", + "labels": {"en": "Music"}, "nodes": [ { - "name": "symphony", - "labels": { "en": "Symphony", "de": "Symphonie" } + "name": "node_3_3", + "labels": {"en": "Chamber music"} + }, + { + "name": "node_4_3", + "labels": {"en": "Church music"} + }, + { + "name": "node_5_3", + "labels": {"en": "Conducting"}, + "nodes": [ + { + "name": "node_6_4", + "labels": {"en": "Choirs"} + }, + { + "name": "node_7_4", + "labels": {"en": "Orchestras"} + } + ] }, { - "name": "symphonicpoem", - "labels": { "en": "Symphonic poem", "de": "Symphonische Dichtung" } + "name": "node_8_3", + "labels": { "en": "Music history" } }, { - "name": "overture", - "labels": { "en": "Overture", "de": "Overtüre" } + "name": "node_9_3", + "labels": {"en": "Musictheory"} }, { - "name": "concerto", - "labels": { "en": "Conerto", "de": "Konzert" } + "name": "node_10_3", + "labels": {"en": "Musicology" }, - ... + { + "name": "node_11_3", + "labels": {"en": "Jazz"} + }, + { + "name": "node_12_3", + "labels": {"en": "Pop/Rock/Blues"} + } ] - }, - { - "name": "chambermusic", - "labels": { "en": "Chamber music", "de": "Kammermusik" }, - "nodes": [...] - }, - ... + } ] - } + }, + {...},{...} ] + } +] ``` +#### Lists from Excel + +A list can also be imported from an excel sheet. The excel must have the following format (currently only a single +language is supported): + +![img_1.png](img_1.png) + +In such a case, the excel-file can directly be referenced in the list definition by defining a special list node: +```json + { + "name": "fromexcel", + "labels": { + "en": "Fromexcel" + }, + "nodes": { + "file": "excel-list.xlsx", + "worksheet": "Tabelle1" + } + } + +``` +The nodes section then must contain the fields + +- _file_: Path to the excel file +- _worksheet_: The name of the worksheet in the excel + +The nodenames are composed from the label by concatenating the words in the label, with the first word starting wit a +lower case character and the other words starting with an upper case character. So the label `Chamber music` would +become the name `chamberMusic`. _Please note that the label must be unqiue for one list. If in a hierarchical list the +same label is used several times, the nodename will be expanded by adding underlines "_" at the end until the name is +unique_. + + As already mentioned before, the _lists_ element is optional. If there are no lists, this element has to be omitted. ### Groups diff --git a/docs/dsp-tools-excel.md b/docs/dsp-tools-excel.md new file mode 100644 index 000000000..681a63014 --- /dev/null +++ b/docs/dsp-tools-excel.md @@ -0,0 +1,13 @@ +[![PyPI version](https://badge.fury.io/py/knora.svg)](https://badge.fury.io/py/knora) + +# DSP tools to use Excel-files for data modelling and data import +Dsp-tools is able to directly read and process excel files and output the appropriate JSON and/or XML-files for +importing data to the dsp-repository. + +## Flat and hierarchical lists +Lists or "controlled vocabularies" are sets of fixed terms that are used to characterize something. Hierarchical lists +correspond to classifications or taxonomies. + +The format of the excel is described [here](./dsp-tools-create.md#lists-from-excel). + + diff --git a/docs/dsp-tools-xmlupload.md b/docs/dsp-tools-xmlupload.md index 050c17b13..b5d71ea0f 100644 --- a/docs/dsp-tools-xmlupload.md +++ b/docs/dsp-tools-xmlupload.md @@ -1,6 +1,6 @@ [![PyPI version](https://badge.fury.io/py/knora.svg)](https://badge.fury.io/py/knora) -# Knora XML-file format for importing data +# DSP XML-file format for importing data The import file is a standard XML file as decribed below. ## Preamble @@ -180,7 +180,7 @@ Example: The ``-element may contain the following tags describing properties (data fields): -- _``_: In case of the StillImageResource contains the path to the image file. +- _``_: In case of the StillImageResource contains the path to the image file. - _``_: Contains text values - _``_: Contains color values - _``_: Contains date values @@ -197,61 +197,21 @@ The ``-element may contain the following tags describing properties (d - _``_: Contains URI values - _``_: Contains boolean values -#### ``-element -The ``-element contains the path to an image file. It must only be used if the -resource is a `StillImageRepresentation` and must be the first element! +#### ``-element +The ``-element contains the path to abitstream object like an image file, a ZIP-file, an audio-file etc. +It must only be used if the resource is a `StillImageRepresentation`, an `AudioRepresentation`, a `DocumentRepresentation` etc. +and must be the first element! _Options_: - none -_Note_: There is only _one_ ``-element allowed per StillImageRepresentation! +_Note_: There is only _one_ ``-element allowed per Representation! Example: ```xml -postcards.dir/images/EURUS015a.jpg +postcards.dir/images/EURUS015a.jpg ``` -#### ``-element -The ``-element contains the path to an sound file. It must only be used if the -resource is a `AudioRepresentation` and must be the first element! - -_Options_: -- none - -_Note_: There is only _one_ ``-element allowed per AudioRepresentation! - -Example: -```xml -concerts.dir/files/SOTW.wav -``` - -#### ``-element -The ``-element contains the path to an movie file. It must only be used if the -resource is a `MovingImageRepresentation` and must be the first element! - -_Options_: -- none - -_Note_: There is only _one_ ``-element allowed per MovingImageRepresentation! - -Example: -```xml -movies.dir/files/the_general.mp4 -``` - -#### ``-element -The ``-element contains the path to an document file. It must only be used if the -resource is a `DocumentRepresentation` and must be the first element! - -_Options_: -- none - -_Note_: There is only _one_ ``-element allowed per DocumentRepresentation! - -Example: -```xml -facsimiles/files/we_the_people.pdf -``` #### ``-element diff --git a/docs/dsp-tools.md b/docs/dsp-tools.md deleted file mode 100644 index 0fbcf0b24..000000000 --- a/docs/dsp-tools.md +++ /dev/null @@ -1,78 +0,0 @@ -[![PyPI version](https://badge.fury.io/py/dsp-tools.svg)](https://badge.fury.io/py/dsp-tools) - -# dsp-tools -In order to work with a DaSCH Service Platform server (DSP-server), the user has to create a data -models (aka `ontologies`) of her/his data. This data model is defined in a special JSON-file which -then can be transmitted to the DSP-server. If the DSP-server is aware of the data model, conforming data -can be uploaded to the server. - -Often, data is initially added in large quantities. Such `bulk data imports` can also be performed using the -dsp-tools. For this purpose, the data has first to be converted in a special XML-file that can be read by -dsp-tools. The dsp-tools program will read this file and upload all data to the DSP-server. - -Thus, the command `dsp-tools` can be used to upload a data model (ontology) from a JSON file to a DaSCH Service Platform (DSP) -server, to dump a data model from a DSP server to a JSON file, or to upload data to a DSP server from -a XML file - -- `dsp-tools create` creates an ontology. Furthermore, the script reads a JSON file containing the data model - (ontology) definition, connects to the DSP server and creates the data model. -- `dsp-tools get` reads an ontology from a server and creates a JSON file that can be used again by - `dsp-tools create` to implement the data model on another server -- `dsp-tools xmlupload` to upload data from a XML file (bulk data import) - -## Usage - -### Create an ontology on a server - -```bash -$ dsp-tools create [options] data_model_definition.json -``` -The above command line supports the following options: - -- _"-s server" | "--server server"_: URL of the DSP server [default: localhost:3333]. -- _"-u username" | "--user username"_: Username to log into DSP [default: root@example.com]. -- _"-p password" | "--password password"_: Password for login to the DSP server [default: test]. -- _"-V" | "--validate"_: If this flag is set, only the validation of the JSON runs. -- _"-l" | "--lists"_: This only creates the lists using a [simplified schema](#json-for-lists). Please note - that in this case the project __must__ exist. -- _"-v" | "--verbose"_: Print out some information about progress - -This command is used to read a JSON-based definition of an ontology and create it on the -given DSP-server. So for example you can have the command: - -``` -$ dsp-tools create -s https://api.dsl.server.org data_model_definition.json -``` - -which would load the ontology defined in `data_model_definition.json` onto the server given -by the `-s`-options. - -### Get an ontology from a server - -```bash -$ dsp-tools get [options] output-file -``` - -The above command line supports the following options: - -- _"-s server" | "--server server"_: URL of the Knora server [default: localhost:3333]. -- _"-u username" | "--user username"_: Username to log into Knora [default: root@example.com]. -- _"-p password" | "--password password"_: Password for login to the Knora server [default: test]. -- _"-P project" | "--project shortcode|shortname|iri"_: Shortcode, shortname or iri of project -- _"-v" | "--verbose"_: Print out some information about progress - -### Upload data to a DSP server - -```bash -$ dsp-tools xmlupload [options] xml-data-file -``` - -This command line uploads all the data defined in the XML file. It supports the following options: - -- _"-s server" | "--server server"_: URL of the Knora server [default: localhost:3333]. -- _"-u username" | "--user username"_: Username to log into Knora [default: root@example.com]. -- _"-p password" | "--password password"_: Password for login to the Knora server [default: test]. - - parser_upload.add_argument("-i", "--imgdir", type=str, default=".", help="Path to folder containing the images") - parser_upload.add_argument("-S", "--sipi", type=str, default="http://0.0.0.0:1024", help="URL of SIPI server") - diff --git a/docs/img.png b/docs/img.png new file mode 100644 index 000000000..d0b7bd926 Binary files /dev/null and b/docs/img.png differ diff --git a/docs/img_1.png b/docs/img_1.png new file mode 100644 index 000000000..d0b7bd926 Binary files /dev/null and b/docs/img_1.png differ diff --git a/docs/index.md b/docs/index.md index 8a8bb705d..059de7ecc 100644 --- a/docs/index.md +++ b/docs/index.md @@ -1,21 +1,29 @@ [![PyPI version](https://badge.fury.io/py/dsp-tools.svg)](https://badge.fury.io/py/dsp-tools) # dsp-tools -dsp-tools is a python package containing +In order to work with a DaSCH Service Platform server (DSP-server), the user has to create a data +model (aka `ontologies`) of her/his data. This data model is defined in a special JSON-file which +then can be transmitted to the DSP-server. If the DSP-server is aware of the data model, conforming data +can be uploaded to the server. -- a command line tool for data model (ontology) creation and manipulation based on JSON input file -- Python3 modules that implement CRUD (Create, Read, Update, Delete) operations for projects, users, groups and - ontologies +Often, data is initially added in large quantities. Such `bulk data imports` can also be performed using the +dsp-tools. For this purpose, the data has first to be converted in a special XML-file that can be read by +dsp-tools. The dsp-tools program will read this file and upload all data to the DSP-server. -The package consists of: +Thus, the command `dsp-tools` can be used to upload a data model (ontology) from a JSON file to a DaSCH Service Platform (DSP) +server, to dump a data model from a DSP server to a JSON file, or to upload data to a DSP server from +a XML file -- `dsplib` Python modules for accessing Knora using the API (ontology creation, data import/export etc.) -- `dsp-tools` A command line program to perfrom several operations on a DSP server: - - create an ontology out of a simple JSON description - - dump an existing ontology from a DSP server to a JSON file - - Bulk-upload of data from a XML data file +- `dsp-tools create` creates a data model. Furthermore, the script reads a JSON file containing the data model + (ontology) definition, connects to the DSP server and creates the data model. +- `dsp-tools get` reads a data model from a server and creates a JSON file that can be used again by + `dsp-tools create` to implement the data model on another server +- `dsp-tools xmlupload` to upload data from a XML file (bulk data import) +- `dsp-tools excel` to convert an Excel-file into a JSON and/or XML file for the `create` or `xmlupload` options. -# Install +## Usage + +### Installation To install the latest version published on PyPI run: ``` @@ -27,7 +35,86 @@ To update to the latest version run: $ pip3 install --upgrade dsp-tools ``` -# Developer + + +### Create an data model on a server + +```bash +$ dsp-tools create [options] data_model_definition.json +``` +The above command line supports the following options: + +- _"-s server" | "--server server"_: URL of the DSP server [default: localhost:3333]. +- _"-u username" | "--user username"_: Username to log into DSP [default: root@example.com]. +- _"-p password" | "--password password"_: Password for login to the DSP server [default: test]. +- _"-V" | "--validate"_: If this flag is set, only the validation of the JSON runs. +- _"-l" | "--lists"_: This only creates the lists using a [simplified schema](#json-for-lists). Please note + that in this case the project __must__ exist. +- _"-v" | "--verbose"_: Print out some information about progress + +This command is used to read a JSON-based definition of an ontology and create it on the +given DSP-server. So for example you can have the command: + +``` +$ dsp-tools create -s https://api.dsl.server.org data_model_definition.json +``` + +which would load the ontology defined in `data_model_definition.json` onto the server given +by the `-s`-options. + +The description about the JSON format can be found [here](./dsp-tools-create.md). + +### Get an ontology from a server + +```bash +$ dsp-tools get [options] output-file +``` + +The above command line supports the following options: + +- _"-s server" | "--server server"_: URL of the Knora server [default: localhost:3333]. +- _"-u username" | "--user username"_: Username to log into Knora [default: root@example.com]. +- _"-p password" | "--password password"_: Password for login to the Knora server [default: test]. +- _"-P project" | "--project shortcode|shortname|iri"_: Shortcode, shortname or iri of project +- _"-v" | "--verbose"_: Print out some information about progress + +### Upload data to a DSP server + +```bash +$ dsp-tools xmlupload [options] xml-data-file +``` + +This command line uploads all the data defined in the XML file. It supports the following options: + +- _"-s server" | "--server server"_: URL of the Knora server [default: http://0.0.0.0:3333]. +- _"-u username" | "--user username"_: Username to log into Knora [default: root@example.com]. +- _"-p password" | "--password password"_: Password for login to the Knora server [default: test]. +- _"-i dirpath" | "--imgdir"dirpath"_: Path to the directory where the bitstream objects are stored [default: "."]. +- _"-s sipiserver" | "--sipi sipiserver"_: URL of the SIPI IIIF-server [default: http://0.0.0.0:1024] +- _"xmlfile"_: Path to xml-File containing the data. + +The description about the XML-format for the data is found [here](./dsp-tools-xmlupload.md). + +### Convert an Excel file for use with dsp tools + +```bash +$ dsp-tools excel [options] excel-file output-file +``` + +The excel command supports the following options: + +- _"-S sheetname" | "--sheet sheetname"_: Name of the excel worksheet to use [default: Tabelle1]. +- _"-s shortcode" | "--shortcode shortcode"_: The 4 digit hexcode given to the project the list belongs to [required]. +- _"-l listname" | "--listname listname"_: Name to be used for the list and to be inserted into thge list definitionfile [required]. +- _"-L label" | "--label label"_: The label text to be used for the list [required]. +- _"-x lang" | "--lang lang"_: The language the list labels and commentary is given [default: en]. +- _"-v" | "--verbose"_: Print out some information about progress. +- _"excel-file"_: Input file in the Excel "*.xlsx"-Format. +- _"output-file"_: Output file containing the JSON-formatted definition of the list. + +A description of the required Excel format is found [here](./dsp-tools-create.md#lists-from-excel). + +## Information for Developers ## Makefile @@ -57,11 +144,12 @@ $ pip3 freeze > requirements.txt ``` ## Testing +Please note that testing requires launching the complete dsp-api stack which is based on docker images. +Therefore You need to install the [docker desktop client](https://www.docker.com/products). +Make test will run the complete test suite for dsp-tools. ```bash -$ pip3 install pytest -$ pip3 install --editable . -$ pytest +make test ``` ## Publishing @@ -79,23 +167,11 @@ You can install the package locally from the dist: $ python3 -m pip ./dist/some_name.whl ``` -Upload package with `twine`, - -first create `~/.pypirc`: - -```bash -[distutils] -index-servers=pypi -[pypi] -repository = https://upload.pypi.org/legacy/ -username =your_username_on_pypi -``` - -then upload: +Upload package also with `make`: ```bash -$ python3 -m pip install --upgrade tqdm twine -$ python3 -m twine upload dist/* +$ make dist +$ make upload ``` For local development: diff --git a/examples/README.md b/examples/README.md deleted file mode 100644 index 9ef42ca65..000000000 --- a/examples/README.md +++ /dev/null @@ -1,23 +0,0 @@ -# Examples - -## Install knora-py - -```bash -$ pip3 install knora -``` - -## Create an ontology - -To create an ontology, run from inside this folder: - -```bash -$ knora-create-ontology example-onto.json -``` - -## Create resources - -To create resources, run from inside this folder: - -```bash -$ python3 example_create_resource.py -``` diff --git a/examples/example.tif b/examples/example.tif deleted file mode 100644 index 6ffeb6420..000000000 Binary files a/examples/example.tif and /dev/null differ diff --git a/examples/example_create_resource.py b/examples/example_create_resource.py deleted file mode 100644 index 94aad2e1f..000000000 --- a/examples/example_create_resource.py +++ /dev/null @@ -1,58 +0,0 @@ -import os -from typing import List, Set, Dict, Tuple, Optional -from pprint import pprint -import argparse -import json -from jsonschema import validate -from knora import KnoraError, KnoraStandoffXml, Knora, Sipi - - -parser = argparse.ArgumentParser() -parser.add_argument("-s", "--server", type=str, default="http://0.0.0.0:3333", help="URL of the Knora server") -parser.add_argument("-S", "--sipi", type=str, default="http://0.0.0.0:1024", help="URL of SIPI server") -parser.add_argument("-u", "--user", default="testuser@test.org", help="Username for Knora") -parser.add_argument("-p", "--password", default="test", help="The password for login") -parser.add_argument("-P", "--projectcode", default="00FE", help="Project short code") -parser.add_argument("-O", "--ontoname", default="kpt", help="Shortname of ontology") - -args = parser.parse_args() - - -con = Knora(args.server) -con.login(args.user, args.password) - -graph = con.get_ontology_graph(args.projectcode, args.ontoname) -# print(graph) -# exit(0) -schema = con.create_schema(args.projectcode, args.ontoname) -# pprint(schema) -# exit(0) - - -inst1_info = con.create_resource(schema, "MyObject", "obj_inst1", { - "mySimpleText": "Dies ist ein Text!", - "myRichText": "\n

this is text

with standoff
", - "myColor": "#ff7700", - "myDate": "1966:CE:1967-05-21", - "myDecimal": {'value': "3.14159", 'comment': "Die Zahl PI"}, - "myGeoname": "2661604", - "myList": "options:opt2", - "myInteger": 7, - "myInterval": "13.57:15.88", - # "myTime": "2019-10-23T13.45:12Z", - "myBoolean": True -}) -pprint(inst1_info) - -# first upload image to SIPI -sipi = Sipi(sipi, con.get_token()) -res = sipi.upload_image('test.tif') -pprint(res) - -fileref = res['uploadedFiles'][0]['internalFilename'] -inst2_info = con.create_resource(schema, "MyImage", "image_inst1", { - "titleprop": "Stained glass", - "linkprop": inst1_info['iri'] -}, None, fileref) -pprint(inst2_info) - diff --git a/knora/BUILD b/knora/BUILD.bazel similarity index 100% rename from knora/BUILD rename to knora/BUILD.bazel diff --git a/knora/BiZ-onto.json b/knora/BiZ-onto.json deleted file mode 100644 index 0f651d463..000000000 --- a/knora/BiZ-onto.json +++ /dev/null @@ -1,717 +0,0 @@ -{ - "prefixes": { - "foaf": "http://xmlns.com/foaf/0.1/", - "dcterms": "http://purl.org/dc/terms/" - }, - "project": { - "shortcode": "0828", - "shortname": "BiZ", - "longname": "Bildung in Zahlen", - "descriptions": { - "de": "Bildung in Zahlen", - "fr": "L'éducation en chiffres" - }, - "keywords": [ - "Bildung", - "Bildungsstatistik" - ], - "lists": [ - { - "name": "raum", - "labels": { - "de": "Bildungsraum" - }, - "nodes": [ - { - "name": "ag", - "labels": { - "de": "AG" - } - }, - { - "name": "ar", - "labels": { - "de": "AR" - } - }, - { - "name": "ai", - "labels": { - "de": "AI" - } - }, - { - "name": "bl", - "labels": { - "de": "BL" - } - }, - { - "name": "bs", - "labels": { - "de": "BS" - } - }, - { - "name": "be", - "labels": { - "de": "BE" - } - }, - { - "name": "fr", - "labels": { - "de": "FR" - } - }, - { - "name": "ge", - "labels": { - "de": "GE" - } - }, - { - "name": "gl", - "labels": { - "de": "GL" - } - }, - { - "name": "gr", - "labels": { - "de": "GR" - } - }, - { - "name": "ju", - "labels": { - "de": "JU" - } - }, - { - "name": "lu", - "labels": { - "de": "LU" - } - }, - { - "name": "ne", - "labels": { - "de": "NE" - } - }, - { - "name": "nw", - "labels": { - "de": "NW" - } - }, - { - "name": "ow", - "labels": { - "de": "OW" - } - }, - { - "name": "sg", - "labels": { - "de": "SG" - } - }, - { - "name": "sh", - "labels": { - "de": "SH" - } - }, - { - "name": "SZ", - "labels": { - "de": "SZ" - } - }, - { - "name": "so", - "labels": { - "de": "SO" - } - }, - { - "name": "ti", - "labels": { - "de": "TI" - } - }, - { - "name": "tg", - "labels": { - "de": "TG" - } - }, - { - "name": "ur", - "labels": { - "de": "UR" - } - }, - { - "name": "vd", - "labels": { - "de": "VD" - } - }, - { - "name": "vs", - "labels": { - "de": "VS" - } - }, - { - "name": "zh", - "labels": { - "de": "ZH" - } - }, - { - "name": "zg", - "labels": { - "de": "ZG" - } - } - ] - }, - { - "name": "bildungssystematiken", - "labels": { - "de": "Bildungssystematiken" - }, - "nodes": [ - { - "name": "obligatorisch", - "labels": { - "de": "Obligatorische Schule" - } - }, - { - "name": "gymnasium", - "labels": { - "de": "Gymnasium" - } - } - ] - }, - { - "name": "bildungsgang", - "labels": { - "de": "Bildungsgang" - }, - "nodes": [ - { - "name": "primarschule_kanton", - "labels": { - "de": "Primarschule [Kanton]" - } - }, - { - "name": "mädchenarbeitsschule_kanton", - "labels": { - "de": "Mädchenarbeitsschule [Kanton]" - } - }, - { - "name": "hilfsklasse_kanton", - "labels": { - "de": "Hilfsklasse [Kanton]" - } - }, - { - "name": "erweiterte_oberschule_kanton", - "labels": { - "de": "Erweiterte Oberschule [Kanton]" - } - }, - { - "name": "anpassungsklasse_kanton", - "labels": { - "de": "Anpassungsklasse [Kanton]" - } - }, - { - "name": "weiterbildungsklasse_kanton", - "labels": { - "de": "Weiterbildungsklasse [Kanton]" - } - }, - { - "name": "privat_primarschule_kanton", - "labels": { - "de": "Privat Primarschule [Kanton]" - } - } - ] - }, - { - "name": "traegerschaft", - "labels": { - "de": "Trägerschaft" - }, - "nodes": [ - { - "name": "oeffentlich", - "labels": { - "de": "öffentlich" - } - }, - { - "name": "privat", - "labels": { - "de": "privat" - } - } - ] - } - ], - "groups": [ - { - "name": "biz-editors", - "description": "Editors for the BiZ-project", - "selfjoin": false, - "status": true - } - ], - "users": [ - { - "username": "bizedit", - "email": "bizedit@test.org", - "givenName": "biz-given", - "familyName": "biz-family", - "password": "biz1234", - "lang": "en", - "groups": [":biz-editors"], - "projects": [":admin","anything:member"] - } - ], - "ontologies": [ - { - "name": "biz", - "label": "Bildung in Zahlen", - "properties": [ - { - "name": "schulcode", - "object": "TextValue", - "labels": { - "de": "Schulcode" - }, - "gui_element": "SimpleText", - "gui_attributes": { - "size": 32, - "maxlength": 128 - } - }, - { - "name": "schulname", - "object": "TextValue", - "labels": { - "de": "Name der Schule" - }, - "gui_element": "SimpleText", - "gui_attributes": { - "size": 32, - "maxlength": 128 - } - }, - { - "name": "bildungsgang", - "object": "ListValue", - "labels": { - "de": "Bildungsgang" - }, - "gui_element": "Pulldown", - "gui_attributes": { - "hlist": "bildungsgang" - } - }, - { - "name": "persname", - "object": "TextValue", - "labels": { - "de": "Name" - }, - "gui_element": "SimpleText", - "gui_attributes": { - "size": 32, - "maxlength": 128 - } - }, - { - "name": "tabellencode", - "object": "TextValue", - "labels": { - "de": "Tabellencode" - }, - "gui_element": "SimpleText", - "gui_attributes": { - "size": 32, - "maxlength": 128 - } - }, - { - "name": "fuerschule", - "super": [ - "hasLinkTo" - ], - "object": ":Schule", - "labels": { - "en": "Schule" - }, - "gui_element": "Searchbox", - "gui_attributes": { - "numprops": 1 - } - }, - { - "name": "downloadlink", - "object": "TextValue", - "labels": { - "de": "Download" - }, - "gui_element": "SimpleText", - "gui_attributes": { - "size": 32, - "maxlength": 128 - } - }, - { - "name": "raum", - "object": "ListValue", - "labels": { - "de": "Raum" - }, - "gui_element": "Pulldown", - "gui_attributes": { - "hlist": "raum" - } - }, - { - "name": "zeitraum", - "object": "DateValue", - "labels": { - "de": "Zeitraum" - }, - "gui_element": "Date" - }, - { - "name": "bildungssystematik", - "object": "ListValue", - "labels": { - "de": "Bildungssystematik" - }, - "gui_element": "Pulldown", - "gui_attributes": { - "hlist": "bildungssystematiken" - } - }, - { - "name": "traegerschaft", - "object": "ListValue", - "labels": { - "de": "Trägerschaft" - }, - "gui_element": "Pulldown", - "gui_attributes": { - "hlist": "traegerschaft" - } - }, - { - "name": "summe", - "object": "BooleanValue", - "labels": { - "de": "Summe" - }, - "gui_element": "Checkbox" - }, - { - "name": "maennlich", - "object": "BooleanValue", - "labels": { - "de": "Männlich" - }, - "gui_element": "Checkbox" - }, - { - "name": "weiblich", - "object": "BooleanValue", - "labels": { - "de": "Weiblich" - }, - "gui_element": "Checkbox" - }, - { - "name": "sprachregion", - "object": "BooleanValue", - "labels": { - "de": "Sprachregion" - }, - "gui_element": "Checkbox" - }, - { - "name": "anstellungsstatus", - "object": "BooleanValue", - "labels": { - "de": "Anstellungsstatus" - }, - "gui_element": "Checkbox" - }, - { - "name": "herkunft", - "object": "BooleanValue", - "labels": { - "de": "Herkunft [Land]" - }, - "gui_element": "Checkbox" - }, - { - "name": "klassenfuehrung", - "object": "BooleanValue", - "labels": { - "de": "Klassenführung" - }, - "gui_element": "Checkbox" - }, - { - "name": "absenztyp", - "object": "BooleanValue", - "labels": { - "de": "Absenztyp" - }, - "gui_element": "Checkbox" - }, - { - "name": "massnahmetyp", - "object": "BooleanValue", - "labels": { - "de": "Massnahmetyp" - }, - "gui_element": "Checkbox" - }, - { - "name": "quelle", - "object": "TextValue", - "labels": { - "de": "Quelle" - }, - "gui_element": "SimpleText", - "gui_attributes": { - "size": 64, - "maxlength": 128 - } - }, - { - "name": "autor", - "super": [ - "hasLinkTo" - ], - "object": ":Person", - "labels": { - "de": "Autor" - }, - "gui_element": "Searchbox", - "gui_attributes": { - "numprops": 1 - } - }, - { - "name": "autor_aufbereitung", - "super": [ - "hasLinkTo" - ], - "object": ":Person", - "labels": { - "de": "Autor Aufbereitung" - }, - "gui_element": "Searchbox", - "gui_attributes": { - "numprops": 1 - } - }, - { - "name": "projektleitung", - "super": [ - "hasLinkTo" - ], - "object": ":Person", - "labels": { - "de": "Projektleitung" - }, - "gui_element": "Searchbox", - "gui_attributes": { - "numprops": 1 - } - }, - { - "name": "publikationsdatum", - "object": "DateValue", - "labels": { - "de": "Publikationsdatum" - }, - "gui_element": "Date" - } - ], - "resources": [ - { - "name": "Schule", - "super": "Resource", - "labels": { - "de": "Schule" - }, - "cardinalities": [ - { - "propname": ":schulcode", - "gui_order": 1, - "cardinality": "1" - }, - { - "propname": ":schulname", - "gui_order": 2, - "cardinality": "1" - }, - { - "propname": ":bildungsgang", - "gui_order": 3, - "cardinality": "1" - } - ] - }, - { - "name": "Person", - "super": "Resource", - "labels": { - "de": "Person" - }, - "cardinalities": [ - { - "propname": ":persname", - "gui_order": 1, - "cardinality": "1" - } - ] - }, - { - "name": "Tabellenmetadaten", - "super": "Resource", - "labels": { - "de": "Tabellenmetadaten" - }, - "cardinalities": [ - { - "propname": ":tabellencode", - "gui_order": 1, - "cardinality": "1" - }, - { - "propname": ":fuerschule", - "gui_order": 2, - "cardinality": "1" - }, - { - "propname": ":downloadlink", - "cardinality": "1", - "gui_order": 3 - }, - { - "propname": ":raum", - "gui_order": 4, - "cardinality": "0-1" - }, - { - "propname": ":zeitraum", - "gui_order": 5, - "cardinality": "1" - }, - { - "propname": ":bildungssystematik", - "gui_order": 6, - "cardinality": "1" - }, - { - "propname": ":traegerschaft", - "gui_order": 7, - "cardinality": "0-1" - }, - { - "propname": ":summe", - "cardinality": "1", - "gui_order": 8 - }, - { - "propname": ":maennlich", - "gui_order": 9, - "cardinality": "1" - }, - { - "propname": ":weiblich", - "gui_order": 10, - "cardinality": "1" - }, - { - "propname": ":sprachregion", - "gui_order": 11, - "cardinality": "1" - }, - { - "propname": ":anstellungsstatus", - "gui_order": 12, - "cardinality": "1" - }, - { - "propname": ":herkunft", - "gui_order": 13, - "cardinality": "1" - }, - { - "propname": ":klassenfuehrung", - "gui_order": 14, - "cardinality": "1" - }, - { - "propname": ":absenztyp", - "gui_order": 15, - "cardinality": "1" - }, - { - "propname": ":massnahmetyp", - "gui_order": 16, - "cardinality": "1" - }, - { - "propname": ":quelle", - "gui_order": 17, - "cardinality": "0-n" - }, - { - "propname": ":autor", - "gui_order": 18, - "cardinality": "0-n" - }, - { - "propname": ":autor_aufbereitung", - "gui_order": 19, - "cardinality": "0-n" - }, - { - "propname": ":projektleitung", - "gui_order": 20, - "cardinality": "0-n" - }, - { - "propname": ":publikationsdatum", - "gui_order": 21, - "cardinality": "1" - } - ] - } - ] - } - ] - } -} diff --git a/knora/DaSCH_Logo_RGB.png b/knora/DaSCH_Logo_RGB.png deleted file mode 100644 index 9ba5491b9..000000000 Binary files a/knora/DaSCH_Logo_RGB.png and /dev/null differ diff --git a/knora/MLS-import-libraries.py b/knora/MLS-import-libraries.py deleted file mode 100644 index 7b188035d..000000000 --- a/knora/MLS-import-libraries.py +++ /dev/null @@ -1,84 +0,0 @@ -import csv -import argparse -from pprint import pprint -from knora import KnoraError, knora, BulkImport -from xml.dom.minidom import parse -import xml.dom.minidom - -parser = argparse.ArgumentParser() -parser.add_argument("xmlfile", help="path to FileMaker XML Export file") -parser.add_argument("-s", "--server", type=str, default="http://0.0.0.0:3333", help="URL of the Knora server") -parser.add_argument("-u", "--user", default="root@example.com", help="Username for Knora") -parser.add_argument("-p", "--password", default="test", help="The password for login") -parser.add_argument("-P", "--projectcode", required=True, help="Project short code") -parser.add_argument("-O", "--ontoname", required=True, help="Shortname of ontology") -parser.add_argument("-x", "--xml", default="data.xml", help="Name of bulk import XML-File") -parser.add_argument("--start", default="1", help="Start with given line") -parser.add_argument("--stop", default="all", help="End with given line ('all' reads all lines") - -args = parser.parse_args() - -con = knora(args.server, args.user, args.password) -schema = con.create_schema(args.projectcode, args.ontoname) - -bulk = BulkImport(schema) - -mapping = { - "Eindeutige_Sigle": None, - "Land": None, - "Stadt": None, - "Beschreibung": "librarydescription", - "Bibliothekssigle_ohne_Land" : "sigle", - "Email": None, - "Kontakadresse": None, - "Kontakdatum": None, - "Kontakperson": None, - "Kontaktiert": None, - "Kontaktnotizen": None, - "Land_Kuerzel": None, - "Online_Katalog": "catalogue", - "PK_Bibl": None, - "Telephonnr": None, - "Web_site": "libraryweblink", - "Zitierbare_Sigle": "None" -} - -DOMTree = xml.dom.minidom.parse(args.xmlfile) -collection = DOMTree.documentElement -fields = collection.getElementsByTagName("FIELD") - -valpos = [] -for field in fields: - name = field.getAttribute('NAME') - valpos.append(name) - - -rows = collection.getElementsByTagName("ROW") -for row in rows: - datas = row.getElementsByTagName("DATA") - i = 0 - record = {} - for data in datas: - if data.firstChild is not None: - if valpos[i] == "PK_Bibl": - library_id = data.firstChild.nodeValue - if valpos[i] == "Beschreibung": - record["librarydescription"] = data.firstChild.nodeValue - if valpos[i] == "Bibliothekssigle_ohne_Land": - record["sigle"] = data.firstChild.nodeValue - if valpos[i] == "Online_Katalog": - record["catalogue"] = data.firstChild.nodeValue.strip("#") - if valpos[i] == "Web_site": - record["libraryweblink"] = data.firstChild.nodeValue.strip("#") - i += 1 - - if record.get("sigle") is None: - record["sigle"] = "XXX" - pprint(record) - print("ID=" + str(library_id)) - print("=========================") - bulk.add_resource( - 'library', - 'LIB_' + str(library_id), record["sigle"], record) - -bulk.write_xml(args.xml) \ No newline at end of file diff --git a/knora/MLS-onto.json b/knora/MLS-onto.json deleted file mode 100644 index a0ddff550..000000000 --- a/knora/MLS-onto.json +++ /dev/null @@ -1,2056 +0,0 @@ -{ - "prefixes": { - "foaf": "http://xmlns.com/foaf/0.1/", - "dcterms": "http://purl.org/dc/terms/" - }, - "project": { - "shortcode": "0809", - "shortname": "MLS", - "longname": "Musikalisches Lexikon der Schweiz", - "descriptions": { - "de": "Musikalisches Lexikon der Schweiz" - }, - "keywords": ["Musik", "Musikwissenschaft"], - "lists": [ - { - "name": "sex", - "labels": { - "de": "Geschlecht" - }, - "nodes": [ - { - "name": "male", - "labels": { - "de": "männlich" - } - }, - { - "name": "female", - "labels": { - "de": "weiblich" - } - } - ] - }, - { - "name": "persfunctions", - "labels": { - "de": "Personentätigkeiten" - }, - "nodes": [ - { - "name": "PF_1", - "labels": { - "de": "Komposition" - } - }, - { - "name": "PF_2", - "labels": { - "de": "Interpretation" - } - }, - { - "name": "PF_4", - "labels": { - "de": "Musiktheorie" - } - }, - { - "name": "PF_5", - "labels": { - "de": "Tonmeister/in" - } - }, - { - "name": "PF_5365", - "labels": { - "de": "Minnesänger" - } - }, - { - "name": "PF_5367", - "labels": { - "de": "Stadtmusiker" - } - }, - { - "name": "PF_5369", - "labels": { - "de": "Musikdruck" - } - }, - { - "name": "PF_5370", - "labels": { - "de": "Lehrtätigkeit" - } - }, - { - "name": "PF_5376", - "labels": { - "de": "Musikdirektor/in" - } - }, - { - "name": "PF_5395", - "labels": { - "de": "Mathematik" - } - }, - { - "name": "PF_5396", - "labels": { - "de": "Philosophie" - } - }, - { - "name": "PF_5397", - "labels": { - "de": "Physik" - } - }, - { - "name": "PF_5405", - "labels": { - "de": "Theologie" - } - }, - { - "name": "PF_5406", - "labels": { - "de": "Choralmagister" - } - }, - { - "name": "PF_5408", - "labels": { - "de": "Kantor" - } - }, - { - "name": "PF_5409", - "labels": { - "de": "Arrangeur" - } - }, - { - "name": "PF_5410", - "labels": { - "de": "Kapellmeister" - } - }, - { - "name": "PF_5411", - "labels": { - "de": "Korrepetition" - } - }, - { - "name": "PF_5412", - "labels": { - "de": "Chordirektion" - } - }, - { - "name": "PF_5420", - "labels": { - "de": "Konstrukteur" - } - }, - { - "name": "PF_5421", - "labels": { - "de": "Klangmaler" - } - }, - { - "name": "PF_5422", - "labels": { - "de": "Malerei" - } - }, - { - "name": "PF_5426", - "labels": { - "de": "Orgelbauer" - } - }, - { - "name": "PF_5430", - "labels": { - "de": "Orgelexperte" - } - }, - { - "name": "PF_5432", - "labels": { - "de": "Kabarett" - } - }, - { - "name": "PF_5433", - "labels": { - "de": "Abt" - } - }, - { - "name": "PF_5434", - "labels": { - "de": "Pfarramt" - } - }, - { - "name": "PF_5435", - "labels": { - "de": "Musikförderung" - } - }, - { - "name": "PF_5436", - "labels": { - "de": "Musikpädagogik" - } - }, - { - "name": "PF_5437", - "labels": { - "de": "Dramaturgie" - } - }, - { - "name": "PF_5441", - "labels": { - "de": "Zahnarzt" - } - }, - { - "name": "PF_5445", - "labels": { - "de": "Humanist/in" - } - }, - { - "name": "PF_5448", - "labels": { - "de": "Musikwissenschaft" - } - }, - { - "name": "PF_5449", - "labels": { - "de": "Regie" - } - }, - { - "name": "PF_5454", - "labels": { - "de": "Publizist/in" - } - }, - { - "name": "PF_5455", - "labels": { - "de": "Autor/in" - } - }, - { - "name": "PF_5459", - "labels": { - "de": "Editor/in" - } - }, - { - "name": "PF_5464", - "labels": { - "de": "Klavierfabrikant" - } - }, - { - "name": "PF_5465", - "labels": { - "de": "Abteileiter" - } - }, - { - "name": "PF_5467", - "labels": { - "de": "Musikedition" - } - }, - { - "name": "PF_5469", - "labels": { - "de": "Konventuale" - } - }, - { - "name": "PF_5474", - "labels": { - "de": "Pastor" - } - }, - { - "name": "PF_5477", - "labels": { - "de": "Improvisation" - } - }, - { - "name": "PF_5485", - "labels": { - "de": "Schauspieler" - } - }, - { - "name": "PF_5488", - "labels": { - "de": "Direktor/in" - } - }, - { - "name": "PF_5491", - "labels": { - "de": "Bischof" - } - }, - { - "name": "PF_5492", - "labels": { - "de": "Volksmusik" - } - }, - { - "name": "PF_5494", - "labels": { - "de": "Musikinstruktor" - } - }, - { - "name": "PF_5495", - "labels": { - "de": "Musikverlag" - } - }, - { - "name": "PF_5501", - "labels": { - "de": "Solorepetition" - } - }, - { - "name": "PF_5504", - "labels": { - "de": "Konzertmeister/in" - } - }, - { - "name": "PF_5511", - "labels": { - "de": "Prorektor" - } - }, - { - "name": "PF_5519", - "labels": { - "de": "Kustos" - } - }, - { - "name": "PF_5520", - "labels": { - "de": "Dichtung" - } - }, - { - "name": "PF_5521", - "labels": { - "de": "Militärinstruktor" - } - }, - { - "name": "PF_5522", - "labels": { - "de": "Rektorat" - } - }, - { - "name": "PF_5523", - "labels": { - "de": "Journalismus" - } - }, - { - "name": "PF_5524", - "labels": { - "de": "Kaplan" - } - }, - { - "name": "PF_5527", - "labels": { - "de": "Klavierbauer" - } - }, - { - "name": "PF_5528", - "labels": { - "de": "Musikhistoriker/in" - } - }, - { - "name": "PF_5537", - "labels": { - "de": "Verbandspräsident/in" - } - }, - { - "name": "PF_5538", - "labels": { - "de": "Orchesterleitung" - } - }, - { - "name": "PF_5544", - "labels": { - "de": "Jazzmusik" - } - }, - { - "name": "PF_5546", - "labels": { - "de": "Kongressleiter" - } - }, - { - "name": "PF_5551", - "labels": { - "de": "Kapitular" - } - }, - { - "name": "PF_5553", - "labels": { - "de": "Bibliothekar/in" - } - }, - { - "name": "PF_5555", - "labels": { - "de": "Mönch" - } - }, - { - "name": "PF_5557", - "labels": { - "de": "Direktion" - } - }, - { - "name": "PF_5558", - "labels": { - "de": "Chorleitung" - } - }, - { - "name": "PF_5559", - "labels": { - "de": "Amt" - } - }, - { - "name": "PF_5560", - "labels": { - "de": "Musikleitung" - } - }, - { - "name": "PF_5563", - "labels": { - "de": "Performance" - } - }, - { - "name": "PF_5568", - "labels": { - "de": "Vikar" - } - }, - { - "name": "PF_5570", - "labels": { - "de": "Moderation" - } - }, - { - "name": "PF_5577", - "labels": { - "de": "Mäzen" - } - }, - { - "name": "PF_5578", - "labels": { - "de": "Radio" - } - }, - { - "name": "PF_5582", - "labels": { - "de": "Prediger" - } - }, - { - "name": "PF_5583", - "labels": { - "de": "Dekan" - } - }, - { - "name": "PF_5586", - "labels": { - "de": "Eremit" - } - }, - { - "name": "PF_5587", - "labels": { - "de": "Schulmeister\n" - } - }, - { - "name": "PF_5588", - "labels": { - "de": "Reformation" - } - }, - { - "name": "PF_5589", - "labels": { - "de": "Konzertleitung" - } - }, - { - "name": "PF_5591", - "labels": { - "de": "Magister" - } - }, - { - "name": "PF_5593", - "labels": { - "de": "Giesser" - } - }, - { - "name": "PF_5594", - "labels": { - "de": "Pädagogik" - } - }, - { - "name": "PF_5596", - "labels": { - "de": "Bergbauer" - } - }, - { - "name": "PF_5603", - "labels": { - "de": "Instrumentenbauer" - } - }, - { - "name": "PF_5605", - "labels": { - "de": "Konzertbegleitung" - } - }, - { - "name": "PF_5609", - "labels": { - "de": "Korrespondenz" - } - }, - { - "name": "PF_5610", - "labels": { - "de": "Dozent/in" - } - }, - { - "name": "PF_5613", - "labels": { - "de": "Bandleader/in" - } - }, - { - "name": "PF_5614", - "labels": { - "de": "Kunstförderung" - } - }, - { - "name": "PF_5615", - "labels": { - "de": "Kulturförderung" - } - }, - { - "name": "PF_5616", - "labels": { - "de": "Professe" - } - }, - { - "name": "PF_5617", - "labels": { - "de": "Liedsammlung" - } - }, - { - "name": "PF_5618", - "labels": { - "de": "Redaktion" - } - }, - { - "name": "PF_5619", - "labels": { - "de": "Administration" - } - }, - { - "name": "PF_5620", - "labels": { - "de": "Militär" - } - }, - { - "name": "PF_5621", - "labels": { - "de": "Kaufmann" - } - }, - { - "name": "PF_5627", - "labels": { - "de": "Präperation Herbarium" - } - }, - { - "name": "PF_5629", - "labels": { - "de": "Druckerei" - } - }, - { - "name": "PF_5631", - "labels": { - "de": "Studiomusiker/in" - } - }, - { - "name": "PF_5636", - "labels": { - "de": "Musikredaktion" - } - }, - { - "name": "PF_5637", - "labels": { - "de": "Propst" - } - }, - { - "name": "PF_5638", - "labels": { - "de": "Bürgermeister" - } - }, - { - "name": "PF_5639", - "labels": { - "de": "Gastprofessor" - } - }, - { - "name": "PF_5642", - "labels": { - "de": "Produktionsleitung" - } - }, - { - "name": "PF_5643", - "labels": { - "de": "Filmdrehbuchautor" - } - }, - { - "name": "PF_5644", - "labels": { - "de": "Vorstandsmitglied" - } - }, - { - "name": "PF_5645", - "labels": { - "de": "Forschungskomission" - } - }, - { - "name": "PF_5646", - "labels": { - "de": "Archivleitung" - } - }, - { - "name": "PF_5649", - "labels": { - "de": "Kirchenmusik\n" - } - }, - { - "name": "PF_5650", - "labels": { - "de": "Musikrat" - } - }, - { - "name": "PF_5651", - "labels": { - "de": "Stiftungsrat" - } - }, - { - "name": "PF_5652", - "labels": { - "de": "Kommissionspräsident" - } - }, - { - "name": "PF_5653", - "labels": { - "de": "Regionator" - } - }, - { - "name": "PF_5654", - "labels": { - "de": "Choralsammlung" - } - }, - { - "name": "PF_5655", - "labels": { - "de": "Inspektion" - } - }, - { - "name": "PF_5656", - "labels": { - "de": "Musikforschung" - } - }, - { - "name": "PF_5657", - "labels": { - "de": "Königin" - } - }, - { - "name": "PF_5658", - "labels": { - "de": "Illustrator/in" - } - }, - { - "name": "PF_5659", - "labels": { - "de": "Priester\n" - } - }, - { - "name": "PF_5663", - "labels": { - "de": "Konzerttätigkeit" - } - }, - { - "name": "PF_5664", - "labels": { - "de": "Opertätigkeit" - } - }, - { - "name": "PF_5666", - "labels": { - "de": "Franziskaner" - } - }, - { - "name": "PF_5668", - "labels": { - "de": "Festivaltätigkeit" - } - }, - { - "name": "PF_5669", - "labels": { - "de": "Stiftungstätigkeit" - } - }, - { - "name": "PF_5670", - "labels": { - "de": "Musikgesellschaft" - } - }, - { - "name": "PF_5671", - "labels": { - "de": "Eventmanager/in" - } - }, - { - "name": "PF_5672", - "labels": { - "de": "Wettbewerbsgründung" - } - }, - { - "name": "PF_5673", - "labels": { - "de": "Preisträger/in" - } - }, - { - "name": "PF_5675", - "labels": { - "de": "Katechet" - } - }, - { - "name": "PF_5678", - "labels": { - "de": "Seelsorger/in" - } - }, - { - "name": "PF_5679", - "labels": { - "de": "Glockengiesser" - } - }, - { - "name": "PF_5682", - "labels": { - "de": "Instrumentenstimmung" - } - }, - { - "name": "PF_5685", - "labels": { - "de": "Lektorat" - } - }, - { - "name": "PF_5686", - "labels": { - "de": "Schriftleitung" - } - }, - { - "name": "PF_5687", - "labels": { - "de": "Landwirtschaft" - } - }, - { - "name": "PF_5688", - "labels": { - "de": "Klanginstallation" - } - }, - { - "name": "PF_5689", - "labels": { - "de": "Elektronik" - } - }, - { - "name": "PF_5690", - "labels": { - "de": "Bundesrat" - } - }, - { - "name": "PF_5697", - "labels": { - "de": "Psychologie" - } - }, - { - "name": "PF_5699", - "labels": { - "de": "Musikreferent/in" - } - }, - { - "name": "PF_5700", - "labels": { - "de": "Musikkomitee" - } - }, - { - "name": "PF_5701", - "labels": { - "de": "Musikberatung" - } - }, - { - "name": "PF_5702", - "labels": { - "de": "Vereinspräsidium" - } - }, - { - "name": "PF_5708", - "labels": { - "de": "Visitation" - } - }, - { - "name": "PF_5709", - "labels": { - "de": "Politik" - } - }, - { - "name": "PF_5713", - "labels": { - "de": "Kinematografie" - } - }, - { - "name": "PF_5714", - "labels": { - "de": "Instrumentensammlung" - } - }, - { - "name": "PF_5715", - "labels": { - "de": "Musikbibliothek" - } - }, - { - "name": "PF_5716", - "labels": { - "de": "Klostermitglied" - } - }, - { - "name": "PF_5719", - "labels": { - "de": "Psalmenbearbeitung" - } - }, - { - "name": "PF_5720", - "labels": { - "de": "Präzeptor" - } - }, - { - "name": "PF_5721", - "labels": { - "de": "Noviziat" - } - }, - { - "name": "PF_5723", - "labels": { - "de": "Nationalrat\n" - } - }, - { - "name": "PF_5724", - "labels": { - "de": "Diplomatie" - } - }, - { - "name": "PF_5726", - "labels": { - "de": "Ministerium" - } - }, - { - "name": "PF_5727", - "labels": { - "de": "Rechtswissenschaft" - } - }, - { - "name": "PF_5728", - "labels": { - "de": "Schultheiss" - } - }, - { - "name": "PF_5732", - "labels": { - "de": "Medizin" - } - }, - { - "name": "PF_5734", - "labels": { - "de": "Benediktinerabtei" - } - }, - { - "name": "PF_5735", - "labels": { - "de": "Philologie" - } - }, - { - "name": "PF_5736", - "labels": { - "de": "Botanik" - } - }, - { - "name": "PF_5740", - "labels": { - "de": "Kanzlei" - } - }, - { - "name": "PF_5741", - "labels": { - "de": "Kanoniker" - } - }, - { - "name": "PF_5743", - "labels": { - "de": "Handwerk" - } - }, - { - "name": "PF_5748", - "labels": { - "de": "Hospitant" - } - }, - { - "name": "PF_5750", - "labels": { - "de": "Rezensent/in" - } - }, - { - "name": "PF_5751", - "labels": { - "de": "Archäologie" - } - }, - { - "name": "PF_5752", - "labels": { - "de": "Numismatik" - } - }, - { - "name": "PF_5753", - "labels": { - "de": "Kompilator" - } - }, - { - "name": "PF_5754", - "labels": { - "de": "Notationskunde" - } - }, - { - "name": "PF_5759", - "labels": { - "de": "Notist/in\n" - } - }, - { - "name": "PF_5773", - "labels": { - "de": "Autodidakt/in" - } - }, - { - "name": "PF_5776", - "labels": { - "de": "Widmungsträger/in" - } - }, - { - "name": "PF_5785", - "labels": { - "de": "Spitalmeister" - } - }, - { - "name": "PF_5787", - "labels": { - "de": "Hugenott" - } - }, - { - "name": "PF_5790", - "labels": { - "de": "Holzbildhauerei" - } - }, - { - "name": "PF_5794", - "labels": { - "de": "Jury" - } - }, - { - "name": "PF_5799", - "labels": { - "de": "Hofschauspiel" - } - }, - { - "name": "PF_5808", - "labels": { - "de": "Plattenproduktion" - } - }, - { - "name": "PF_5809", - "labels": { - "de": "Werbetexter/in" - } - }, - { - "name": "PF_5819", - "labels": { - "de": "Ãœbersetzer/in" - } - }, - { - "name": "PF_5838", - "labels": { - "de": "Erziehungsrat" - } - }, - { - "name": "PF_5845", - "labels": { - "de": "Dramatiker" - } - }, - { - "name": "PF_5847", - "labels": { - "de": "Intendant/in" - } - }, - { - "name": "PF_5850", - "labels": { - "de": "Sänger/in" - } - }, - { - "name": "PF_5851", - "labels": { - "de": "Singer-Songwriter" - } - }, - { - "name": "PF_5852", - "labels": { - "de": "Drehbuchautor/in" - } - }, - { - "name": "PF_5854", - "labels": { - "de": "Schriftsteller/in" - } - }, - { - "name": "PF_5863", - "labels": { - "de": "Kunstgeschichte" - } - }, - { - "name": "PF_5865", - "labels": { - "de": "Archidiakon" - } - }, - { - "name": "PF_5866", - "labels": { - "de": "Zunftmeister" - } - }, - { - "name": "PF_5869", - "labels": { - "de": "Scholaster" - } - }, - { - "name": "PF_5870", - "labels": { - "de": "Antistes" - } - }, - { - "name": "PF_5871", - "labels": { - "de": "Stadtschreiber/in" - } - }, - { - "name": "PF_5872", - "labels": { - "de": "Stadtammann" - } - }, - { - "name": "PF_5873", - "labels": { - "de": "Grafik" - } - }, - { - "name": "PF_5874", - "labels": { - "de": "Glasmalerei" - } - }, - { - "name": "PF_5877", - "labels": { - "de": "Kunstsammlung" - } - }, - { - "name": "PF_5881", - "labels": { - "de": "Vogt" - } - }, - { - "name": "PF_5882", - "labels": { - "de": "Theater" - } - }, - { - "name": "PF_5884", - "labels": { - "de": "Bühnenbild" - } - }, - { - "name": "PF_5886", - "labels": { - "de": "Zirkus" - } - }, - { - "name": "PF_5887", - "labels": { - "de": "Tanz" - } - }, - { - "name": "PF_5888", - "labels": { - "de": "Akrobatik" - } - }, - { - "name": "PF_5889", - "labels": { - "de": "Theaterkritik" - } - }, - { - "name": "PF_5893", - "labels": { - "de": "Bebop" - } - }, - { - "name": "PF_5895", - "labels": { - "de": "Erasmuswesen" - } - }, - { - "name": "PF_5896", - "labels": { - "de": "Gedichtsammlung" - } - }, - { - "name": "PF_5897", - "labels": { - "de": "Theaterreform" - } - }, - { - "name": "PF_5898", - "labels": { - "de": "Inszenierungstheorie" - } - }, - { - "name": "PF_5900", - "labels": { - "de": "Akustik" - } - }, - { - "name": "PF_5902", - "labels": { - "de": "Psalmensammlung" - } - }, - { - "name": "PF_5903", - "labels": { - "de": "Rhetorik" - } - }, - { - "name": "PF_5906", - "labels": { - "de": "Kirchengesang" - } - }, - { - "name": "PF_5907", - "labels": { - "de": "Diakon" - } - }, - { - "name": "PF_5915", - "labels": { - "de": "Succentor" - } - }, - { - "name": "PF_5917", - "labels": { - "de": "Filmmusik" - } - }, - { - "name": "PF_5918", - "labels": { - "de": "Ballett" - } - }, - { - "name": "PF_5925", - "labels": { - "de": "Orientalistik" - } - }, - { - "name": "PF_5926", - "labels": { - "de": "Kirchengeschichte" - } - }, - { - "name": "PF_5933", - "labels": { - "de": "Musikpsychologie" - } - }, - { - "name": "PF_5961", - "labels": { - "de": "Suisa" - } - }, - { - "name": "PF_5968", - "labels": { - "de": "Àsthetik" - } - }, - { - "name": "PF_5972", - "labels": { - "de": "Korrektor/in" - } - }, - { - "name": "PF_5982", - "labels": { - "de": "Agronomie" - } - }, - { - "name": "PF_5983", - "labels": { - "de": "Philanthropie" - } - }, - { - "name": "PF_5984", - "labels": { - "de": "Computermusik" - } - }, - { - "name": "PF_5985", - "labels": { - "de": "Karmelit" - } - }, - { - "name": "PF_5986", - "labels": { - "de": "Historiker/in" - } - }, - { - "name": "PF_5987", - "labels": { - "de": "Naturwissenschaft" - } - }, - { - "name": "PF_5989", - "labels": { - "de": "Staatsverwaltung" - } - }, - { - "name": "PF_5990", - "labels": { - "de": "Gemeindeverwaltung" - } - }, - { - "name": "PF_5992", - "labels": { - "de": "Feuilletonkritik" - } - }, - { - "name": "PF_5998", - "labels": { - "de": "Fernsehproduktion" - } - }, - { - "name": "PF_5999", - "labels": { - "de": "Linguistik" - } - }, - { - "name": "PF_6001", - "labels": { - "de": "Musikpräfekt" - } - } - ] - }, - { - "name": "articletype", - "labels": { - "de": "Artikeltyp" - }, - "nodes": [ - { - "name": "person", - "labels": { - "de": "Person" - } - }, - { - "name": "institution", - "labels": { - "de": "Institution" - } - }, - { - "name": "list", - "labels": { - "de": "Liste" - } - }, - { - "name": "location", - "labels": { - "de": "Ort" - } - }, - { - "name": "thing", - "labels": { - "de": "Sache" - } - } - ] - } - ], - "ontology": { - "name": "mls", - "label": "Musikalisches Lexikon der Schweiz", - "resources": [ - { - "name": "lexicon", - "super": "Resource", - "labels": { - "de": "Lexikon" - }, - "properties": [ - { - "name": "shortname", - "object": "TextValue", - "labels": { - "de": "Kürzel" - }, - "gui_element": "SimpleText", - "gui_attributes": ["size=32", "maxlength=128"], - "cardinality": "1" - }, - { - "name": "citationform", - "object": "TextValue", - "labels": { - "de": "Zitierform" - }, - "gui_element": "SimpleText", - "gui_attributes": ["size=32", "maxlength=128"], - "cardinality": "1" - }, - { - "name": "lexiconcomment", - "object": "TextValue", - "labels": { - "de": "Kommentar" - }, - "gui_element": "Textarea", - "gui_attributes": ["width=99%", "rows=2"], - "cardinality": "0-n" - }, - { - "name": "lexiconweblink", - "object": "UriValue", - "labels": { - "de": "Link KVK" - }, - "gui_element": "SimpleText", - "gui_attributes": ["size=64", "maxlength=128"], - "cardinality": "0-1" - }, - { - "name": "inLibrary", - "super": ["hasLinkTo"], - "object": "mls:library", - "labels": { - "de": "in Bibliothek" - }, - "gui_element": "Searchbox", - "gui_attributes": ["numprops=1"], - "cardinality": "0-n" - } - ] - }, - { - "name": "lemma", - "super": "Resource", - "labels": { - "de": "Musikalisches Lexikon der Schweiz" - }, - "properties": [ - { - "name": "Lemmaval", - "object": "TextValue", - "labels": { - "de": "Lemma" - }, - "gui_element": "SimpleText", - "gui_attributes": ["size=32", "maxlength=128"], - "cardinality": "1" - }, - { - "name": "isDeceased", - "object": "BooleanValue", - "labels": { - "de": "verstorben" - }, - "gui_element": "Checkbox", - "gui_attributes": [], - "cardinality": "0-1" - }, - { - "name": "isRelevant", - "object": "BooleanValue", - "labels": { - "de": "relevant" - }, - "gui_element": "Checkbox", - "gui_attributes": [], - "cardinality": "0-1" - - }, - { - "name": "lemmadescription", - "object": "TextValue", - "labels": { - "de": "Beschreibung" - }, - "gui_element": "Textarea", - "gui_attributes": ["width=99%", "rows=2"], - "cardinality": "0-1" - }, - { - "name": "lemmatype", - "object": "ListValue", - "labels": { - "de": "Lemmatyp" - }, - "gui_element": "Pulldown", - "gui_attributes": ["hlist=articletype"], - "cardinality": "1" - }, - { - "name": "hasSex", - "object": "ListValue", - "labels": { - "de": "Geschlecht" - }, - "gui_element": "Pulldown", - "gui_attributes": ["hlist=sex"], - "cardinality": "0-1" - }, - { - "name": "lemmacomment", - "object": "TextValue", - "labels": { - "de": "Kommentar" - }, - "gui_element": "Textarea", - "gui_attributes": ["width=99%", "rows=2"], - "cardinality": "0-n" - }, - { - "name": "startdate", - "object": "DateValue", - "labels": { - "de": "Anfangsdatum" - }, - "gui_element": "Date", - "gui_attributes": [], - "cardinality": "0-1" - }, - { - "name": "startinfo", - "object": "TextValue", - "labels": { - "de": "Anfangsinfo" - }, - "gui_element": "SimpleText", - "gui_attributes": ["size=32", "maxlength=32"], - "cardinality": "0-1" - }, - { - "name": "enddate", - "object": "DateValue", - "labels": { - "de": "Enddatum" - }, - "gui_element": "Date", - "gui_attributes": [], - "cardinality": "0-1" - }, - { - "name": "endinfo", - "object": "TextValue", - "labels": { - "de": "Endinfo" - }, - "gui_element": "SimpleText", - "gui_attributes": ["size=32", "maxlength=32"], - "cardinality": "0-1" - }, - { - "name": "gnd", - "object": "TextValue", - "labels": { - "de": "GND" - }, - "gui_element": "SimpleText", - "gui_attributes": ["size=32", "maxlength=32"], - "cardinality": "0-1" - }, - { - "name": "viaf", - "object": "TextValue", - "labels": { - "de": "VIAF" - }, - "gui_element": "SimpleText", - "gui_attributes": ["size=32", "maxlength=32"], - "cardinality": "0-1" - }, - { - "name": "firstname", - "super": ["hasValue", "foaf:givenName"], - "object": "TextValue", - "labels": { - "de": "Vorname" - }, - "gui_element": "SimpleText", - "gui_attributes": ["size=32", "maxlength=32"], - "cardinality": "0-1" - }, - { - "name": "variants", - "object": "TextValue", - "labels": { - "de": "Varianten" - }, - "gui_element": "SimpleText", - "gui_attributes": ["size=32", "maxlength=32"], - "cardinality": "0-n" - }, - { - "name": "birthlocation", - "object": "GeonameValue", - "labels": { - "de": "Ort Geburt" - }, - "gui_element": "Geonames", - "gui_attributes": [], - "cardinality": "0-1" - }, - { - "name": "worklocation", - "object": "GeonameValue", - "labels": { - "de": "Ort Tätigkeit" - }, - "gui_element": "Geonames", - "gui_attributes": [], - "cardinality": "0-1" - }, - { - "name": "dyinglocation", - "object": "GeonameValue", - "labels": { - "de": "Ort Tod" - }, - "gui_element": "Geonames", - "gui_attributes": [], - "cardinality": "0-1" - }, - { - "name": "sublemma", - "super": ["hasLinkTo"], - "object": "mls:lemma", - "labels": { - "de": "Untergeordnetes Lemma" - }, - "gui_element": "Searchbox", - "gui_attributes": [], - "cardinality": "0-n" - } - ] - }, - { - "name": "library", - "super": "Resource", - "labels": { - "de": "Bibliothek" - }, - "properties": [ - { - "name": "sigle", - "object": "TextValue", - "labels": { - "de": "Sigle" - }, - "gui_element": "SimpleText", - "gui_attributes": ["size=16", "maxlength=16"], - "cardinality": "1" - }, - { - "name": "location", - "object": "GeonameValue", - "labels": { - "de": "Ort" - }, - "gui_element": "Geonames", - "gui_attributes": [], - "cardinality": "0-1" - }, - { - "name": "librarydescription", - "object": "TextValue", - "labels": { - "de": "Beschreibung" - }, - "gui_element": "SimpleText", - "gui_attributes": ["size=64", "maxlength=128"], - "cardinality": "0-1" - }, - { - "name": "libraryweblink", - "object": "UriValue", - "labels": { - "de": "Web-Link" - }, - "gui_element": "SimpleText", - "gui_attributes": ["size=64", "maxlength=128"], - "cardinality": "0-1" - }, - { - "name": "catalogue", - "object": "UriValue", - "labels": { - "de": "Katalog" - }, - "gui_element": "SimpleText", - "gui_attributes": ["size=64", "maxlength=128"], - "cardinality": "0-1" - }, - { - "name": "address", - "object": "TextValue", - "labels": { - "de": "Adresse/Kontakt" - }, - "gui_element": "Textarea", - "gui_attributes": ["width=99%", "rows=3"], - "cardinality": "0-1" - }, - { - "name": "librarycomment", - "object": "TextValue", - "labels": { - "de": "Kommentar" - }, - "gui_element": "Textarea", - "gui_attributes": ["width=99%", "rows=2"], - "cardinality": "0-n" - } - ] - }, - { - "name": "article", - "super": "Resource", - "labels": { - "de": "Artikel" - }, - "properties": [ - { - "name": "articletype", - "object": "ListValue", - "labels": { - "de": "Artikeltyp" - }, - "gui_element": "Pulldown", - "gui_attributes": ["hlist=articletype"], - "cardinality": "1" - }, - { - "name":"hasLemma", - "super": ["hasLinkTo"], - "object": "mls:lemma", - "labels": { - "de": "Lemma" - }, - "gui_element": "Searchbox", - "gui_attributes": ["numprops=1"], - "cardinality": "1" - }, - { - "name": "origspelling", - "object": "TextValue", - "labels": { - "de": "Originalschreibung" - }, - "gui_element": "SimpleText", - "gui_attributes": ["size=64", "maxlength=128"], - "cardinality": "0-1" - }, - { - "name":"hasLexicon", - "super": ["hasLinkTo"], - "object": "mls:lexicon", - "labels": { - "de": "in Lexikon" - }, - "gui_element": "Searchbox", - "gui_attributes": ["numprops=1"], - "cardinality": "1" - }, - { - "name": "pages", - "object": "TextValue", - "labels": { - "de": "Seite" - }, - "gui_element": "SimpleText", - "gui_attributes": ["size=16", "maxlength=16"], - "cardinality": "0-1" - }, - { - "name": "articletext", - "object": "TextValue", - "labels": { - "de": "Artikel" - }, - "gui_element": "Textarea", - "gui_attributes": ["rows=5", "width=99%", "wrap=soft"], - "cardinality": "1" - }, - { - "name": "numlines", - "object": "IntValue", - "labels": { - "de": "Zeilen" - }, - "gui_element": "SimpleText", - "gui_attributes": ["size=6", "maxlength=6"], - "cardinality": "0-1" - }, - { - "name": "articlecomment", - "object": "TextValue", - "labels": { - "de": "Kommentar" - }, - "gui_element": "Textarea", - "gui_attributes": ["width=99%", "rows=2"], - "cardinality": "0-n" - }, - { - "name": "state", - "object": "TextValue", - "labels": { - "de": "Zustand" - }, - "gui_element": "SimpleText", - "gui_attributes": ["size=32","maxlength=32"], - "cardinality": "0-1" - }, - { - "name": "internallex", - "object": "TextValue", - "labels": { - "de": "Interne Lexicographische Information" - }, - "gui_element": "SimpleText", - "gui_attributes": ["size=128", "maxlength=128"], - "cardinality": "0-1" - }, - { - "name": "link", - "object": "UriValue", - "labels": { - "de": "Link" - }, - "gui_element": "SimpleText", - "gui_attributes": ["size=128", "maxlength=128"], - "cardinality": "0-1" - }, - { - "name": "shortinfo", - "object": "TextValue", - "labels": { - "de": "Kurzinformation" - }, - "gui_element": "Textarea", - "gui_attributes": ["width=99%", "rows=2"], - "cardinality": "0-1" - }, - { - "name": "theatrelexcode", - "object": "TextValue", - "labels": { - "de": "Theaterlexikon Code" - }, - "gui_element": "SimpleText", - "gui_attributes": ["size=32", "maxlength=128"], - "cardinality": "0-1" - }, - { - "name": "ticinolexcode", - "object": "TextValue", - "labels": { - "de": "Link Dizionario Ticinese" - }, - "gui_element": "SimpleText", - "gui_attributes": ["size=32", "maxlength=128"], - "cardinality": "0-1" - }, - { - "name": "fonotecacode", - "object": "TextValue", - "labels": { - "de": "Fonoteca Code" - }, - "gui_element": "SimpleText", - "gui_attributes": ["size=32", "maxlength=128"], - "cardinality": "0-1" - }, - { - "name": "hlscode", - "object": "TextValue", - "labels": { - "de": "HLS Code" - }, - "gui_element": "SimpleText", - "gui_attributes": ["size=32", "maxlength=128"], - "cardinality": "0-1" - }, - { - "name": "oemlcode", - "object": "TextValue", - "labels": { - "de": "OEML Code" - }, - "gui_element": "SimpleText", - "gui_attributes": ["size=32", "maxlength=128"], - "cardinality": "0-1" - }, - { - "name": "subarticle", - "super": ["hasLinkTo"], - "object": "mls:article", - "labels": { - "de": "Untergeordneter Artikel" - }, - "gui_element": "Searchbox", - "gui_attributes": [], - "cardinality": "0-n" - } - ] - } - ] - } - } -} \ No newline at end of file diff --git a/knora/anything-test-data.xml b/knora/anything-test-data.xml deleted file mode 100644 index ce0b7d906..000000000 --- a/knora/anything-test-data.xml +++ /dev/null @@ -1,224 +0,0 @@ - - - - - RV - V - CR - CR - D - - - V - CR> - CR> - M> - - - V - V - CR - CR> - D> - - - V - CR - CR - M - - - - - Tree list node 02 - - - Tree list node 03 - - - The third object and a link to. - - - - The third object and a link to. - - - - Dies ist ein einfacher Text ohne Markup - Nochmals ein einfacher Text - - - JULIAN:CE:1401-05-17:CE:1402-01 - - - 4711 - - - 2.718281828459 - - - true - - - http://dasch.swiss/gaga - - - 12.5:14.2 - - - #00ff00 - - - - { - "status":"active", - "lineColor":"#ff3333", - "lineWidth":2, - "points":[ - {"x":0.08098591549295775,"y":0.16741071428571427}, - {"x":0.7394366197183099,"y":0.7299107142857143}], - "type":"rectangle", - "original_index":0 - } - - - - 5416656 - - - obj_0002 - - - - - - - Tree list node 10 - - - Tree list node 11 - - - What is this bold thing? - - - aa bbb cccc ddddd - - - 1888 - - - 42 - - - 3.14159 - - - false - - - http://unibas.ch/gugus - - - 24:100.075 - - - #33ff77 - - - - { - "status":"active", - "lineColor":"#ff3333", - "lineWidth":2, - "points":[ - {"x":0.08098591549295775,"y":0.16741071428571427}, - {"x":0.7394366197183099,"y":0.7299107142857143}], - "type":"rectangle", - "original_index":0 - } - - - - 5416656 - - - obj_0003 - - - - - - Tree list node 01 - - - Tree list node 02 - - - This is bold and string text! - - - aa bbb cccc ddddd - - - 1888 - - - 42 - - - 3.14159 - - - false - - - http://unibas.ch/gugus - - - 24:100.075 - - - #33ff77 - - - - { - "status":"active", - "lineColor":"#ff3333", - "lineWidth":2, - "points":[ - {"x":0.08098591549295775,"y":0.16741071428571427}, - {"x":0.7394366197183099,"y":0.7299107142857143}], - "type":"rectangle", - "original_index":0 - } - - - - 5416656 - - - - - gaga.tif - - - This is the famous Lena - - - - diff --git a/knora/bitstreams/TEMP11.TIF b/knora/bitstreams/TEMP11.TIF deleted file mode 100755 index ea27affc8..000000000 Binary files a/knora/bitstreams/TEMP11.TIF and /dev/null differ diff --git a/knora/bitstreams/TEMP12.TIF b/knora/bitstreams/TEMP12.TIF deleted file mode 100755 index 8664433c5..000000000 Binary files a/knora/bitstreams/TEMP12.TIF and /dev/null differ diff --git a/knora/bitstreams/TEMP13.TIF b/knora/bitstreams/TEMP13.TIF deleted file mode 100755 index 85570d645..000000000 Binary files a/knora/bitstreams/TEMP13.TIF and /dev/null differ diff --git a/knora/bitstreams/TEMP14.TIF b/knora/bitstreams/TEMP14.TIF deleted file mode 100755 index ca08fc801..000000000 Binary files a/knora/bitstreams/TEMP14.TIF and /dev/null differ diff --git a/knora/bitstreams/TEMP15.TIF b/knora/bitstreams/TEMP15.TIF deleted file mode 100755 index 459d2c03e..000000000 Binary files a/knora/bitstreams/TEMP15.TIF and /dev/null differ diff --git a/knora/bitstreams/test.csv b/knora/bitstreams/test.csv deleted file mode 100644 index a3f67618b..000000000 --- a/knora/bitstreams/test.csv +++ /dev/null @@ -1 +0,0 @@ -Building parts;;;;; Building parts;Architectural fragments;;;; Building parts;Architectural fragments;Wall fragments;;; Building parts;Architectural fragments;Ceiling fragments;;; Building parts;Bricks;;;; Building parts;Bricks;Mudbricks;;; Building parts;Bricks;Mudbricks;Cavetto bricks (mudbricks);; Building parts;Bricks;Fired bricks (burnt bricks);;; Building parts;Bricks;Fired bricks (burnt bricks);Bricks for fixing cones;; Building parts;Bricks;Fired bricks (burnt bricks);Cornice bricks;; Building parts;Bricks;Fired bricks (burnt bricks);Corner bricks (facade);; Building parts;Bricks;Fired bricks (burnt bricks);Cones;; Building parts;Bricks;Fired bricks (burnt bricks);Stamped bricks;; Building parts;Bricks;Fired bricks (burnt bricks);Torus bricks;; Building parts;Bricks;Fired bricks (burnt bricks);Cavetto bricks (fired);; Building parts;Bricks;Fired bricks (burnt bricks);Coptic pavement bricks;; Building parts;Blocks;;;; Building parts;Blocks;Slabs;;; Building parts;Cornerstones;;;; Building parts;Cornices;;;; Building parts;Doors;;;; Building parts;Doors;Door stops;;; Building parts;Doors;Door jambs;;; Building parts;Doors;Lintels (door);;; Building parts;Doors;Door handles;;; Building parts;Fasteners and fittings;;;; Building parts;Fasteners and fittings;Bands (fasteners);;; Building parts;Fasteners and fittings;Bolts;;; Building parts;Fasteners and fittings;Chains;;; Building parts;Fasteners and fittings;Dowels;;; Building parts;Fasteners and fittings;Fittings (architecture);;; Building parts;Fasteners and fittings;Fittings (architecture);Hasps;; Building parts;Fasteners and fittings;Fittings (architecture);Hooks;; Building parts;Fasteners and fittings;Fittings (architecture);Knobs;; Building parts;Fasteners and fittings;Fittings (architecture);Pegs;; Building parts;Fasteners and fittings;Keys;;; Building parts;Fasteners and fittings;Nails;;; Building parts;Fasteners and fittings;Rivets;;; Building parts;Fasteners and fittings;Spikes;;; Building parts;Fasteners and fittings;Split pins;;; Building parts;Fasteners and fittings;Staples;;; Building parts;Fasteners and fittings;Tacks;;; Building parts;Fasteners and fittings;Veneers;;; Building parts;Fasteners and fittings;Wire;;; Building parts;Fasteners and fittings;Tenons;;; Building parts;Pipes (conduits);;;; Building parts;Plaster (pieces of);;;; Building parts;Pyramidia;;;; Building parts;Supporting elements;;;; Building parts;Supporting elements;Architraves;;; Building parts;Supporting elements;Columns;;; Building parts;Supporting elements;Columns;Column bases;; Building parts;Supporting elements;Columns;Column capitals;; Building parts;Supporting elements;Columns;Column shafts;; Building parts;Supporting elements;Pillars;;; Building parts;Supporting elements;Posts;;; Clothing and accessories;;;;; Clothing and accessories;Clothing;;;; Clothing and accessories;Clothing;Aprons;;; Clothing and accessories;Clothing;Dresses;;; Clothing and accessories;Clothing;Tunics;;; Clothing and accessories;Clothing;Loin clothes;;; Clothing and accessories;Clothing;Scarves;;; Clothing and accessories;Clothing accessories;;;; Clothing and accessories;Clothing accessories;Belts;;; Clothing and accessories;Clothing accessories;Braces;;; Clothing and accessories;Clothing accessories;Buckles;;; Clothing and accessories;Clothing accessories;Buttons;;; Clothing and accessories;Clothing accessories;Pins;;; Clothing and accessories;Clothing accessories;Stud fasteners;;; Clothing and accessories;Clothing accessories;Straps;;; Clothing and accessories;Clothing accessories;Lace;;; Clothing and accessories;Clothing accessories;String;;; Clothing and accessories;Footwear;;;; Clothing and accessories;Footwear;Boots;;; Clothing and accessories;Footwear;Sandals;;; Clothing and accessories;Footwear;Shoes;;; Clothing and accessories;Footwear;Socks;;; Clothing and accessories;Headgear;;;; Clothing and accessories;Headgear;Caps;;; Clothing and accessories;Headgear;Hairnets;;; Clothing and accessories;Headgear;Hair pieces;;; Clothing and accessories;Headgear;Hats;;; Clothing and accessories;Headgear;Headgear accessories;;; Clothing and accessories;Headgear;Headgear accessories;Hair beads;; Clothing and accessories;Headgear;Headgear accessories;Hair pins;; Clothing and accessories;Headgear;Wigs;;; Cloth;;;;; Cloth;Bands (cloth);;;; Cloth;Bandages (mummy);;;; Cloth;Bandages (mummy);Eye socket fillings;;; Cloth;Bandages (mummy);Plugs;;; Cloth;Bandages (mummy);Fillings;;; Cloth;Blankets;;;; Cloth;Rags;;;; Cloth;Rugs;;;; Cloth;Panels (cloth);;;; Cloth;Sheets;;;; Cloth;Shrouds;;;; Cloth;Remains;;;; Cloth;Remains;Netting;;; Cloth;Remains;Thread;;; Cloth;Straps (mummy);;;; Containers;;;;; Containers;Accessories (containers);;;; Containers;Accessories (containers);Cretulae / mud sealings;;; Containers;Accessories (containers);Knobs (containers);;; Containers;Accessories (containers);Lids;;; Containers;Accessories (containers);Lids;Box lids;; Containers;Accessories (containers);Lids;Box lids;Canopic box lids; Containers;Accessories (containers);Lids;Box lids;Shabti box lids; Containers;Accessories (containers);Lids;Casket lids;; Containers;Accessories (containers);Lids;Coffin lids;; Containers;Accessories (containers);Lids;Coffin lids;Coffin lids anthropomorphic; Containers;Accessories (containers);Lids;Coffin lids;Coffin lids rectangular; Containers;Accessories (containers);Lids;Coffin lids;Coffin lids qrs; Containers;Accessories (containers);Lids;Sarcophagus lids;; Containers;Accessories (containers);Lids;Vessel lids;; Containers;Accessories (containers);Lids;Lid cloth;; Containers;Accessories (containers);Lids;Vessel stoppers;; Containers;Accessories (containers);Lids;Vessel stoppers;Vessel stoppers (external); Containers;Accessories (containers);Lids;Vessel stoppers;Vessel stoppers (internal); Containers;Accessories (containers);Lids;Canopic jar lids;; Containers;Accessories (containers);Stands;;; Containers;Accessories (containers);Strainers;;; Containers;Accessories (containers);Tags;;; Containers;Accessories (containers);Decoration;;; Containers;Bags;;;; Containers;Bags;Natron bags;;; Containers;Baskets;;;; Containers;Baskets;Basket lids;;; Containers;Cases;;;; Containers;Cases;Boxes;;; Containers;Cases;Boxes;Canopic boxes;; Containers;Cases;Boxes;Shabti boxes;; Containers;Cases;Boxes;Chests;; Containers;Cases;Coffins;;; Containers;Cases;Coffins;Coffins anthropomorphic;; Containers;Cases;Coffins;Coffins rectangular;; Containers;Cases;Coffins;Coffins qrs;; Containers;Cases;Coffins;Cartonnage cases;; Containers;Cases;Coffins;Coffins anthropoid;; Containers;Cases;Coffins;Mummy boards;; Containers;Cases;Caskets;;; Containers;Cases;Sarcophagi;;; Containers;Cases;Shrines;;; Containers;Horns (containers);;;; Containers;Tubes;;;; Containers;Vessels;;;; Containers;Vessels;Alabastra;;; Containers;Vessels;Mortars;;; Containers;Vessels;Cosmetic containers;;; Containers;Vessels;Cosmetic containers;Unguent pots;; Containers;Vessels;Glasses;;; Containers;Vessels;Painter's pots;;; Cosmetic equipment;;;;; Cosmetic equipment;Applicators;;;; Cosmetic equipment;Applicators;Kohl sticks;;; Cosmetic equipment;Cosmetics;;;; Cosmetic equipment;Cosmetics;Perfume cones;;; Cosmetic equipment;Cosmetics;Unguents;;; Cosmetic equipment;Combs;;;; Cosmetic equipment;Mirrors;;;; Cosmetic equipment;Mirrors;Handles (mirror);;; Cosmetic equipment;Mirrors;Disks (mirror);;; Cosmetic equipment;Palettes;;;; Cosmetic equipment;Razors;;;; Cosmetic equipment;Scissors;;;; Cosmetic equipment;Spoons;;;; Cosmetic equipment;Tweezers;;;; Cosmetic equipment;Toilet trays;;;; Furnitures and fittings;;;;; Furnitures and fittings;Beds;;;; Furnitures and fittings;Beds;Bedheads;;; Furnitures and fittings;Beds;Bases (bed);;; Furnitures and fittings;Beds;Legs (bed);;; Furnitures and fittings;Beds;Steads (bed);;; Furnitures and fittings;Chairs;;;; Furnitures and fittings;Chairs;Armrests (chair);;; Furnitures and fittings;Chairs;Backs (chair);;; Furnitures and fittings;Chairs;Legs (chair);;; Furnitures and fittings;Chairs;Seats (chair);;; Furnitures and fittings;Chairs;Side panels (chair);;; Furnitures and fittings;Cushions;;;; Furnitures and fittings;Furniture fittings;;;; Furnitures and fittings;Furniture inlays;;;; Furnitures and fittings;Headrests;;;; Furnitures and fittings;Matting;;;; Furnitures and fittings;Matting;Rush mats;;; Furnitures and fittings;Stools;;;; Furnitures and fittings;Stools;Legs (stool);;; Furnitures and fittings;Stools;Seats (stool);;; Furnitures and fittings;Tables;;;; Furnitures and fittings;Tables;Legs (table);;; Furnitures and fittings;Tables;Tops (table);;; Jewelry;;;;; Jewelry;Amulets;;;; Jewelry;Amulets;Ankh-amulets;;; Jewelry;Amulets;Anthropomorphic amulets;;; Jewelry;Amulets;Seal-amulets;;; Jewelry;Amulets;Udjat-amulets;;; Jewelry;Amulets;Crosses (christian);;; Jewelry;Amulets;Son of Horus amulets;;; Jewelry;Amulets;Winged Scarab amulets;;; Jewelry;Arms and legs jewelry;;;; Jewelry;Arms and legs jewelry;Anklets;;; Jewelry;Arms and legs jewelry;Armlets / bracelets;;; Jewelry;Arms and legs jewelry;Finger rings;;; Jewelry;Arms and legs jewelry;Finger rings;Finger ring mounts;; Jewelry;Arms and legs jewelry;Finger rings;Scarab finger rings;; Jewelry;Arms and legs jewelry;Finger rings;Penannular rings;; Jewelry;Arms and legs jewelry;Toe rings;;; Jewelry;Beads;;;; Jewelry;Beads;Amulet beads;;; Jewelry;Beads;Barrel beads (jewelry);;; Jewelry;Beads;Cowrie beads;;; Jewelry;Beads;Cylinder beads (jewelry);;; Jewelry;Beads;Ring beads;;; Jewelry;Beads;Scarab beads;;; Jewelry;Beads;Spacers;;; Jewelry;Bezels;;;; Jewelry;Breast and neck jewelry;;;; Jewelry;Breast and neck jewelry;Counterweights;;; Jewelry;Breast and neck jewelry;Terminals;;; Jewelry;Breast and neck jewelry;Collars;;; Jewelry;Breast and neck jewelry;Collars;Beads collars;; Jewelry;Breast and neck jewelry;Collars;Flower collars;; Jewelry;Breast and neck jewelry;Necklaces;;; Jewelry;Breast and neck jewelry;Necklets;;; Jewelry;Breast and neck jewelry;Pectorals;;; Jewelry;Breast and neck jewelry;Pectorals;Plaques (pectoral);; Jewelry;Breast and neck jewelry;Pendants;;; Jewelry;Breast and neck jewelry;Beads nets;;; Jewelry;Brooches;;;; Jewelry;Fittings (jewelry);;;; Jewelry;Head jewelry;;;; Jewelry;Head jewelry;Earrings;;; Jewelry;Head jewelry;Ear studs;;; Jewelry;Head jewelry;Headbands;;; Miscellaneous;;;;; Miscellaneous;Boundary marks;;;; Miscellaneous;Debitage;;;; Miscellaneous;Debris;;;; Miscellaneous;Industrial waste;;;; Miscellaneous;Industrial waste;Bars;;; Miscellaneous;Industrial waste;Dumps;;; Miscellaneous;Industrial waste;Faience fragments;;; Miscellaneous;Industrial waste;Metal fragments;;; Miscellaneous;Industrial waste;Plugs;;; Miscellaneous;Industrial waste;Rods;;; Miscellaneous;Industrial waste;Slag;;; Miscellaneous;Industrial waste;Wasters (ceramic, É);;; Miscellaneous;Microliths;;;; Miscellaneous;Ovoids;;;; Miscellaneous;Panels;;;; Miscellaneous;Pigments;;;; Miscellaneous;Raw material;;;; Miscellaneous;Slabs;;;; Miscellaneous;Slates;;;; Miscellaneous;Undefined;;;; Miscellaneous;Barrettes;;;; Miscellaneous;Chipping;;;; Miscellaneous;Samples;;;; Miscellaneous;Off-grids;;;; Miscellaneous;Modern items;;;; Miscellaneous;Modern items;Cigarette packages;;; Organic and inorganic remains;;;;; Organic and inorganic remains;Inorganic Remains;;;; Organic and inorganic remains;Inorganic Remains;Bitumen;;; Organic and inorganic remains;Inorganic Remains;Fossils;;; Organic and inorganic remains;Inorganic Remains;Fossils;Snails (fossils);; Organic and inorganic remains;Inorganic Remains;Geological samples;;; Organic and inorganic remains;Inorganic Remains;Metal samples;;; Organic and inorganic remains;Organic Remains;;;; Organic and inorganic remains;Organic Remains;Amber;;; Organic and inorganic remains;Organic Remains;Animal and human remains;;; Organic and inorganic remains;Organic Remains;Animal and human remains;Feathers;; Organic and inorganic remains;Organic Remains;Animal and human remains;Insect and arachnid remains;; Organic and inorganic remains;Organic Remains;Animal and human remains;Insect and arachnid remains;Beetles (remains); Organic and inorganic remains;Organic Remains;Animal and human remains;Insect and arachnid remains;Insect nests; Organic and inorganic remains;Organic Remains;Animal and human remains;Tusks (mammal);; Organic and inorganic remains;Organic Remains;Animal and human remains;Fish remains;; Organic and inorganic remains;Organic Remains;Animal and human remains;Fish remains;Fish; Organic and inorganic remains;Organic Remains;Animal and human remains;Reptile and amphibian remains;; Organic and inorganic remains;Organic Remains;Animal and human remains;Reptile and amphibian remains;Crocodile remains; Organic and inorganic remains;Organic Remains;Animal and human remains;Reptile and amphibian remains;Frog remains; Organic and inorganic remains;Organic Remains;Animal and human remains;Reptile and amphibian remains;Snake remains; Organic and inorganic remains;Organic Remains;Animal and human remains;Mummies;; Organic and inorganic remains;Organic Remains;Animal and human remains;Mummies;Mummies (bird); Organic and inorganic remains;Organic Remains;Animal and human remains;Mummies;Mummies (human); Organic and inorganic remains;Organic Remains;Animal and human remains;Mummies;Mummies (mammal); Organic and inorganic remains;Organic Remains;Animal and human remains;Bones;; Organic and inorganic remains;Organic Remains;Animal and human remains;Bones;Bones (human); Organic and inorganic remains;Organic Remains;Animal and human remains;Bones;Bones (human);Skulls (human) Organic and inorganic remains;Organic Remains;Animal and human remains;Bones;Bones (mammal); Organic and inorganic remains;Organic Remains;Animal and human remains;Bones;Bones (reptile); Organic and inorganic remains;Organic Remains;Animal and human remains;Bones;Bones (bird); Organic and inorganic remains;Organic Remains;Animal and human remains;Bones;Bones (bird);Skulls (bird) Organic and inorganic remains;Organic Remains;Animal and human remains;Teeth;; Organic and inorganic remains;Organic Remains;Animal and human remains;Teeth;Teeth (human); Organic and inorganic remains;Organic Remains;Animal and human remains;Teeth;Teeth (mammal); Organic and inorganic remains;Organic Remains;Animal and human remains;Teeth;Teeth (reptile); Organic and inorganic remains;Organic Remains;Animal and human remains;Hair and fur;; Organic and inorganic remains;Organic Remains;Animal and human remains;Hair and fur;Hair (human); Organic and inorganic remains;Organic Remains;Animal and human remains;Hair and fur;Bristle (mammal); Organic and inorganic remains;Organic Remains;Animal and human remains;Hair and fur;Fur (mammal); Organic and inorganic remains;Organic Remains;Animal and human remains;Hair and fur;Hair (mammal); Organic and inorganic remains;Organic Remains;Animal and human remains;Shells;; Organic and inorganic remains;Organic Remains;Animal and human remains;Shells;Shells (aquatic); Organic and inorganic remains;Organic Remains;Animal and human remains;Shells;Snail shells; Organic and inorganic remains;Organic Remains;Animal and human remains;Eggs;; Organic and inorganic remains;Organic Remains;Animal and human remains;Eggs;Eggs (bird); Organic and inorganic remains;Organic Remains;Animal and human remains;Eggs;Eggs (reptile); Organic and inorganic remains;Organic Remains;Animal and human remains;Viscera;; Organic and inorganic remains;Organic Remains;Animal and human remains;Viscera;Viscera (human); Organic and inorganic remains;Organic Remains;Animal and human remains;Viscera;Viscera (human);Intestines (human) Organic and inorganic remains;Organic Remains;Animal and human remains;Viscera;Viscera (human);Mummified viscera (human) Organic and inorganic remains;Organic Remains;Animal and human remains;Claws;; Organic and inorganic remains;Organic Remains;Animal and human remains;Claws;Claws (mammal); Organic and inorganic remains;Organic Remains;Animal and human remains;Claws;Claws (bird); Organic and inorganic remains;Organic Remains;Animal and human remains;Horns;; Organic and inorganic remains;Organic Remains;Animal and human remains;Skin and hide;; Organic and inorganic remains;Organic Remains;Animal and human remains;Skin and hide;Hides (mammal); Organic and inorganic remains;Organic Remains;Animal and human remains;Skin and hide;Skins (human); Organic and inorganic remains;Organic Remains;Animal and human remains;Mammalian Remains;; Organic and inorganic remains;Organic Remains;Animal and human remains;Human remains;; Organic and inorganic remains;Organic Remains;Food remains;;; Organic and inorganic remains;Organic Remains;Food remains;Bread;; Organic and inorganic remains;Organic Remains;Honeycomb;;; Organic and inorganic remains;Organic Remains;Plant remains;;; Organic and inorganic remains;Organic Remains;Plant remains;Fruits;; Organic and inorganic remains;Organic Remains;Plant remains;Fruits;Mandrake; Organic and inorganic remains;Organic Remains;Plant remains;Grains;; Organic and inorganic remains;Organic Remains;Plant remains;Grains;Wheat; Organic and inorganic remains;Organic Remains;Plant remains;Grasses;; Organic and inorganic remains;Organic Remains;Plant remains;Flowers;; Organic and inorganic remains;Organic Remains;Plant remains;Reeds;; Organic and inorganic remains;Organic Remains;Plant remains;Rushes;; Organic and inorganic remains;Organic Remains;Plant remains;Seeds;; Organic and inorganic remains;Organic Remains;Plant remains;Wreaths;; Organic and inorganic remains;Organic Remains;Plant remains;Garlands;; Organic and inorganic remains;Organic Remains;Plant remains;Bouquets;; Organic and inorganic remains;Organic Remains;Plant remains;Leaves;; Organic and inorganic remains;Organic Remains;Powder;;; Organic and inorganic remains;Organic Remains;Resins;;; Organic and inorganic remains;Prostheses;;;; Organic and inorganic remains;Prostheses;Eyeballs;;; Organic and inorganic remains;Prostheses;Corneas;;; Organic and inorganic remains;Prostheses;Pupils;;; Organic and inorganic remains;Prostheses;Iris;;; Organic and inorganic remains;Prostheses;Sclerae;;; Organic and inorganic remains;Prostheses;Teeth (prostheses);;; Organic and inorganic remains;Vessel contents;;;; Sculpture;;;;; Sculpture;Masks;;;; Sculpture;Masks;Funerary masks;;; Sculpture;Models;;;; Sculpture;Models;Architectural models;;; Sculpture;Models;Architectural models;Soul houses (funerary model);; Sculpture;Models;Architectural models;Houses (model);; Sculpture;Models;Boats and ships (model);;; Sculpture;Models;Boats and ships (model);Oars (models);; Sculpture;Models;Boats and ships (model);Rigging (models);; Sculpture;Offering tables and altars;;;; Sculpture;Offering tables and altars;Offering tables;;; Sculpture;Offering tables and altars;Altars;;; Sculpture;Statuary;;;; Sculpture;Statuary;Statues;;; Sculpture;Statuary;Statues;Anthropomorphic statues;; Sculpture;Statuary;Statues;Bases (statues);; Sculpture;Statuary;Statues;Zoomorphic statues;; Sculpture;Statuary;Figurines;;; Sculpture;Statuary;Figurines;Anthropomorphic figurines;; Sculpture;Statuary;Figurines;Fertility figurines (women on bed);; Sculpture;Statuary;Figurines;Shabtis;; Sculpture;Statuary;Figurines;Shabtis;Reis-Shabtis; Sculpture;Statuary;Figurines;Zoomorphic figurines;; Sculpture;Statuary;Figurines;Zoomorphic figurines;Scarabs (figurines); Sculpture;Stelae;;;; Sculpture;Stelae;False door stelae;;; Sculpture;Stelae;Stelae with rounded top;;; Sculpture;Stelae;Stelae with square top;;; Tools and equipment;;;;; Tools and equipment;Agricultural equipment;;;; Tools and equipment;Agricultural equipment;Branding irons;;; Tools and equipment;Agricultural equipment;Flails;;; Tools and equipment;Agricultural equipment;Flax-bats;;; Tools and equipment;Agricultural equipment;Hoes;;; Tools and equipment;Agricultural equipment;Mattocks;;; Tools and equipment;Agricultural equipment;Pruning hooks;;; Tools and equipment;Agricultural equipment;Rakes;;; Tools and equipment;Agricultural equipment;Scoops;;; Tools and equipment;Agricultural equipment;Seed trays;;; Tools and equipment;Agricultural equipment;Sickles;;; Tools and equipment;Animal equipment;;;; Tools and equipment;Animal equipment;Harnesses;;; Tools and equipment;Animal equipment;Harnesses;Harness fittings;; Tools and equipment;Animal equipment;Harnesses;Bridle bits;; Tools and equipment;Animal equipment;Harnesses;Ferrules;; Tools and equipment;Animal equipment;Harnesses;Stirrups;; Tools and equipment;Animal equipment;Rat traps;;; Tools and equipment;Animal equipment;Yokes;;; Tools and equipment;Arms and armours;;;; Tools and equipment;Arms and armours;Armours;;; Tools and equipment;Arms and armours;Arms;;; Tools and equipment;Arms and armours;Arms;Arrows;; Tools and equipment;Arms and armours;Arms;Arrows;Arrowheads; Tools and equipment;Arms and armours;Arms;Axes;; Tools and equipment;Arms and armours;Arms;Axes;Axeheads; Tools and equipment;Arms and armours;Arms;Axes;Axeheads;Flanged axeheads Tools and equipment;Arms and armours;Arms;Axes;Axeheads;Flat axeheads Tools and equipment;Arms and armours;Arms;Axes;Axeheads;Socketed axeheads Tools and equipment;Arms and armours;Arms;Bows;; Tools and equipment;Arms and armours;Arms;Daggers;; Tools and equipment;Arms and armours;Arms;Daggers;Fittings (dagger); Tools and equipment;Arms and armours;Arms;Daggers;Pommels (dagger); Tools and equipment;Arms and armours;Arms;Fighting sticks;; Tools and equipment;Arms and armours;Arms;Lances;; Tools and equipment;Arms and armours;Arms;Lances;Lance heads; Tools and equipment;Arms and armours;Arms;Maces;; Tools and equipment;Arms and armours;Arms;Maces;Mace heads; Tools and equipment;Arms and armours;Arms;Swords;; Tools and equipment;Cooking and food production equipment;;;; Tools and equipment;Cooking and food production equipment;Grain rubbers;;; Tools and equipment;Cooking and food production equipment;Millstones;;; Tools and equipment;Cooking and food production equipment;Mortars (cooking);;; Tools and equipment;Cooking and food production equipment;Pestles (cooking);;; Tools and equipment;Cooking and food production equipment;Spoons (cooking);;; Tools and equipment;Cooking and food production equipment;Spoons (cooking);Handles (spoons);; Tools and equipment;Cooking and food production equipment;Spoons (cooking);Ladles;; Tools and equipment;Fishing equipment;;;; Tools and equipment;Fishing equipment;Fish hooks;;; Tools and equipment;Fishing equipment;Harpoons;;; Tools and equipment;Fishing equipment;Sinkers;;; Tools and equipment;Manufacturing equipment;;;; Tools and equipment;Manufacturing equipment;Bead making equipment;;; Tools and equipment;Manufacturing equipment;Bead making equipment;Canes;; Tools and equipment;Manufacturing equipment;Casts;;; Tools and equipment;Manufacturing equipment;Clay strips;;; Tools and equipment;Manufacturing equipment;Crucibles;;; Tools and equipment;Manufacturing equipment;Fritting pans;;; Tools and equipment;Manufacturing equipment;Moulds;;; Tools and equipment;Manufacturing equipment;Potter's wheels;;; Tools and equipment;Mathematical equipment;;;; Tools and equipment;Mathematical equipment;Counting boards;;; Tools and equipment;Recreational equipment;;;; Tools and equipment;Recreational equipment;Balls;;; Tools and equipment;Recreational equipment;Games;;; Tools and equipment;Recreational equipment;Games;Dices;; Tools and equipment;Recreational equipment;Games;Gaming blocks;; Tools and equipment;Recreational equipment;Games;Gaming boards;; Tools and equipment;Recreational equipment;Games;Gaming pieces;; Tools and equipment;Recreational equipment;Games;Gaming rods;; Tools and equipment;Recreational equipment;Marbles;;; Tools and equipment;Recreational equipment;Musical instruments;;; Tools and equipment;Recreational equipment;Musical instruments;Bells;; Tools and equipment;Recreational equipment;Musical instruments;Clappers;; Tools and equipment;Recreational equipment;Musical instruments;Cymbals;; Tools and equipment;Recreational equipment;Musical instruments;Flutes;; Tools and equipment;Recreational equipment;Musical instruments;Harps;; Tools and equipment;Recreational equipment;Musical instruments;Pipes (musical);; Tools and equipment;Recreational equipment;Musical instruments;Rattles;; Tools and equipment;Recreational equipment;Musical instruments;Sistra;; Tools and equipment;Recreational equipment;Pipes (smoking);;; Tools and equipment;Recreational equipment;Toys;;; Tools and equipment;Recreational equipment;Toys;Dolls;; Tools and equipment;Religious equipment;;;; Tools and equipment;Religious equipment;Braziers;;; Tools and equipment;Religious equipment;Censers;;; Tools and equipment;Religious equipment;Charms;;; Tools and equipment;Religious equipment;Foundation deposits;;; Tools and equipment;Religious equipment;Foundation deposits;Foundation bricks;; Tools and equipment;Religious equipment;Foundation deposits;Foundation plaques;; Tools and equipment;Religious equipment;Incense burners;;; Tools and equipment;Religious equipment;Standards;;; Tools and equipment;Religious equipment;Wands;;; Tools and equipment;Textile and leather working equipment;;;; Tools and equipment;Textile and leather working equipment;Bobbins;;; Tools and equipment;Textile and leather working equipment;Bodkins;;; Tools and equipment;Textile and leather working equipment;Heddle jacks;;; Tools and equipment;Textile and leather working equipment;Looms;;; Tools and equipment;Textile and leather working equipment;Looms;Loomweights;; Tools and equipment;Textile and leather working equipment;Needles;;; Tools and equipment;Textile and leather working equipment;Needles;Netting needles;; Tools and equipment;Textile and leather working equipment;Needles;Sewing needles;; Tools and equipment;Textile and leather working equipment;Punches;;; Tools and equipment;Textile and leather working equipment;Reels / weights;;; Tools and equipment;Textile and leather working equipment;Shuttles;;; Tools and equipment;Textile and leather working equipment;Spacing bars;;; Tools and equipment;Textile and leather working equipment;Spindles;;; Tools and equipment;Textile and leather working equipment;Spools;;; Tools and equipment;Textile and leather working equipment;Weaving combs;;; Tools and equipment;Textile and leather working equipment;Weaving swords;;; Tools and equipment;Textile and leather working equipment;Whorls;;; Tools and equipment;Tools;;;; Tools and equipment;Tools;Adzes;;; Tools and equipment;Tools;Adzes;Adze blades;; Tools and equipment;Tools;Awls;;; Tools and equipment;Tools;Axes;;; Tools and equipment;Tools;Axes;Axeheads;; Tools and equipment;Tools;Axes;Axeheads;Flanged axeheads; Tools and equipment;Tools;Axes;Axeheads;Flat axeheads; Tools and equipment;Tools;Axes;Axeheads;Socketed axeheads; Tools and equipment;Tools;Blades;;; Tools and equipment;Tools;Brushes;;; Tools and equipment;Tools;Brushes;Brooms;; Tools and equipment;Tools;Burnishers;;; Tools and equipment;Tools;Callipers;;; Tools and equipment;Tools;Chisels;;; Tools and equipment;Tools;Cords;;; Tools and equipment;Tools;Drills;;; Tools and equipment;Tools;Drills;Drill bits;; Tools and equipment;Tools;Drills;Drill flywheels;; Tools and equipment;Tools;Emery blocks;;; Tools and equipment;Tools;End scrapers;;; Tools and equipment;Tools;Files;;; Tools and equipment;Tools;Fire sticks;;; Tools and equipment;Tools;Floats;;; Tools and equipment;Tools;Funnels;;; Tools and equipment;Tools;Gouges;;; Tools and equipment;Tools;Grinders;;; Tools and equipment;Tools;Hammers;;; Tools and equipment;Tools;Hammerstones;;; Tools and equipment;Tools;Knives;;; Tools and equipment;Tools;Knives;Knife blades;; Tools and equipment;Tools;Knives;Toilet knives;; Tools and equipment;Tools;Lighting equipment;;; Tools and equipment;Tools;Lighting equipment;Candlesticks;; Tools and equipment;Tools;Lighting equipment;Lamps;; Tools and equipment;Tools;Lighting equipment;Lamps;Lamp holders; Tools and equipment;Tools;Lighting equipment;Lamps;Lampstands; Tools and equipment;Tools;Lighting equipment;Lamps;Oil lamps; Tools and equipment;Tools;Lighting equipment;Lamps;Saucer lamps; Tools and equipment;Tools;Lighting equipment;Tapers;; Tools and equipment;Tools;Loops;;; Tools and equipment;Tools;Mallets;;; Tools and equipment;Tools;Measuring devices;;; Tools and equipment;Tools;Measuring devices;Scales;; Tools and equipment;Tools;Measuring devices;Cubit rods;; Tools and equipment;Tools;Measuring devices;Sundials;; Tools and equipment;Tools;Microblades;;; Tools and equipment;Tools;Money;;; Tools and equipment;Tools;Money;Coins;; Tools and equipment;Tools;Money;Pierced coins;; Tools and equipment;Tools;Money;Tokens;; Tools and equipment;Tools;Pestles;;; Tools and equipment;Tools;Pickaxes;;; Tools and equipment;Tools;Piercers;;; Tools and equipment;Tools;Plumb bobs;;; Tools and equipment;Tools;Polishers;;; Tools and equipment;Tools;Pounders;;; Tools and equipment;Tools;Rasps;;; Tools and equipment;Tools;Ropes;;; Tools and equipment;Tools;Saws;;; Tools and equipment;Tools;Saws;Saw blades;; Tools and equipment;Tools;Scissors;;; Tools and equipment;Tools;Sieves;;; Tools and equipment;Tools;Squares;;; Tools and equipment;Tools;Tongs;;; Tools and equipment;Tools;Wedges;;; Tools and equipment;Tools;Weights;;; Tools and equipment;Tools;Whetstones;;; Tools and equipment;Tools;Handles (tools handle);;; Tools and equipment;Tools;Staffs/ Rods;;; Tools and equipment;Writing equipment and tools;;;; Tools and equipment;Writing equipment and tools;Inkwells;;; Tools and equipment;Writing equipment and tools;Palettes (writing);;; Tools and equipment;Writing equipment and tools;Pen-cases;;; Tools and equipment;Writing equipment and tools;Pens;;; Tools and equipment;Writing equipment and tools;Pens;Reed pens;; Tools and equipment;Writing equipment and tools;Scribes' cases;;; Tools and equipment;Writing equipment and tools;Seals;;; Tools and equipment;Writing equipment and tools;Seals;Button seals;; Tools and equipment;Writing equipment and tools;Seals;Cowroid seals;; Tools and equipment;Writing equipment and tools;Seals;Cylinder seals;; Tools and equipment;Writing equipment and tools;Seals;Scarab blanks;; Tools and equipment;Writing equipment and tools;Seals;Scaraboid blanks;; Tools and equipment;Writing equipment and tools;Seals;Scaraboid seals;; Tools and equipment;Writing equipment and tools;Seals;Scarab seals;; Tools and equipment;Writing equipment and tools;Seals;Seal-amulets;; Tools and equipment;Writing equipment and tools;Seals;Stamp seal blanks;; Tools and equipment;Writing equipment and tools;Seals;Stamp seals;; Tools and equipment;Writing equipment and tools;Stamps;;; Tools and equipment;Writing equipment and tools;Tablets (writing);;; Tools and equipment;Writing equipment and tools;Writing boards;;; Tools and equipment;Chariots;;;; Writings and drawings;;;;; Writings and drawings;Ostraca;;;; Writings and drawings;Ostraca;Inscribed ostraca;;; Writings and drawings;Ostraca;Inscribed ostraca;Coptic ostraca;; Writings and drawings;Ostraca;Inscribed ostraca;Hieroglyphic ostraca;; Writings and drawings;Ostraca;Inscribed ostraca;Hieratic ostraca;; Writings and drawings;Ostraca;Inscribed ostraca;Demotic ostraca;; Writings and drawings;Ostraca;Inscribed ostraca;Arabic ostraca;; Writings and drawings;Ostraca;Figurative ostraca;;; Writings and drawings;Ostraca;Model ostraca;;; Writings and drawings;Papyri;;;; Writings and drawings;Papyri;Inscribed papyri;;; Writings and drawings;Papyri;Inscribed papyri;Coptic papyri;; Writings and drawings;Papyri;Inscribed papyri;Hieroglyphic papyri;; Writings and drawings;Papyri;Inscribed papyri;Hieratic papyri;; Writings and drawings;Papyri;Inscribed papyri;Demotic papyri;; Writings and drawings;Papyri;Inscribed papyri;Arabic papyri;; Writings and drawings;Papyri;Inscribed papyri;Abnormal hieratic papyri;; Writings and drawings;Papyri;Figurative papyri;;; Writings and drawings;Other Inscriptions;;;; Writings and drawings;Other Inscriptions;Coptic inscriptions;;; Writings and drawings;Other Inscriptions;Hieroglyphic inscriptions;;; Writings and drawings;Other Inscriptions;Hieratic inscriptions;;; Writings and drawings;Other Inscriptions;Demotic inscriptions;;; Writings and drawings;Other Inscriptions;Arabic inscriptions;;; Writings and drawings;Other Inscriptions;Name stones;;; Writings and drawings;Other Inscriptions;Labels;;; Writings and drawings;Other drawings;;;; Writings and drawings;Dockets;;;; Writings and drawings;Mummy tags;;;; Writings and drawings;Name stones;;;; Writings and drawings;Book bindings;;;; Writings and drawings;Work marks;;;; Writings and drawings;Newspapers;;;; Writings and drawings;Books;;;; Writings and drawings;Documents;;;; \ No newline at end of file diff --git a/knora/bitstreams/test.pdf b/knora/bitstreams/test.pdf deleted file mode 100644 index aaa1073ac..000000000 Binary files a/knora/bitstreams/test.pdf and /dev/null differ diff --git a/knora/dsp_tools.py b/knora/dsp_tools.py index e1c64b05e..140b43239 100644 --- a/knora/dsp_tools.py +++ b/knora/dsp_tools.py @@ -9,6 +9,7 @@ from dsplib.utils.onto_create_ontology import create_ontology from dsplib.utils.onto_get import get_ontology from dsplib.utils.xml_upload import xml_upload +from dsplib.utils.onto_process_excel import list_excel2json def program(args): @@ -29,11 +30,11 @@ def program(args): parser_create.add_argument("-u", "--user", default="root@example.com", help="Username for DSP server") parser_create.add_argument("-p", "--password", default="test", help="The password for login") parser_create.add_argument("-V", "--validate", action='store_true', help="Do only validation of JSON, no upload of the ontology") - parser_create.add_argument("datamodelfile", help="path to data model file") parser_create.add_argument("-L", "--listfile", type=str, default="lists.json", help="Name of list node informationfile") parser_create.add_argument("-l", "--lists", action='store_true', help="Only create the lists") parser_create.add_argument("-v", "--verbose", action="store_true", help="Verbose feedback") parser_create.add_argument("-d", "--dump", action="store_true", help="dump test files for DSP-API requests") + parser_create.add_argument("datamodelfile", help="path to data model file") parser_get = subparsers.add_parser('get', help='Get project/ontology information from server') parser_get.set_defaults(action="get") @@ -41,8 +42,8 @@ def program(args): parser_get.add_argument("-p", "--password", default="test", help="The password for login") parser_get.add_argument("-s", "--server", type=str, default="http://0.0.0.0:3333", help="URL of the DSP server") parser_get.add_argument("-P", "--project", type=str, help="Shortcode, shortname or iri of project", required=True) - parser_get.add_argument("outfile", help="path to data model file", default="onto.json") parser_get.add_argument("-v", "--verbose", action="store_true", help="Verbose feedback") + parser_get.add_argument("datamodelfile", help="path to data model file", default="onto.json") parser_upload = subparsers.add_parser('xmlupload', help='Upload data from XML file to server') parser_upload.set_defaults(action="xmlupload") @@ -52,8 +53,19 @@ def program(args): parser_upload.add_argument("-V", "--validate", action='store_true', help="Do only validation of JSON, no upload of the ontology") parser_upload.add_argument("-i", "--imgdir", type=str, default=".", help="Path to folder containing the images") parser_upload.add_argument("-S", "--sipi", type=str, default="http://0.0.0.0:1024", help="URL of SIPI server") - parser_upload.add_argument("xmlfile", help="path to xml file containing the data", default="data.xml") parser_upload.add_argument("-v", "--verbose", action="store_true", help="Verbose feedback") + parser_upload.add_argument("xmlfile", help="path to xml file containing the data", default="data.xml") + + parser_excellists = subparsers.add_parser('excel', help='Create lists JSON from excel files') + parser_excellists.set_defaults(action="excel") + parser_excellists.add_argument("-S", "--sheet", type=str, help="Name of excel sheet to be used", default="Tabelle1") + parser_excellists.add_argument("-s", "--shortcode", type=str, help="Shortcode of project", default="4123") + parser_excellists.add_argument("-l", "--listname", type=str, help="Name of list to be created", default="my_list") + parser_excellists.add_argument("-L", "--label", type=str, help="Label of list to be created", default="MyList") + parser_excellists.add_argument("-x", "--lang", type=str, help="Language for label", default="en") + parser_excellists.add_argument("-v", "--verbose", action="store_true", help="Verbose feedback") + parser_excellists.add_argument("excelfile", help="Path to the excel file containing the list data", default="lists.xlsx") + parser_excellists.add_argument("outfile", help="Path to the output JSON file containing the list data", default="list.json") args = parser.parse_args(args) @@ -71,10 +83,20 @@ def program(args): if args.validate: validate_ontology(args.datamodelfile) else: - create_ontology(args.datamodelfile, args.listfile, args.server, args.user, args.password, args.verbose, - args.dump if args.dump else False) + create_ontology(input_file=args.datamodelfile, + lists_file=args.listfile, + server=args.server, + user=args.user, + password=args.password, + verbose=args.verbose, + dump=args.dump if args.dump else False) elif args.action == "get": - get_ontology(args.project, args.outfile, args.server, args.user, args.password, args.verbose) + get_ontology(projident=args.project, + outfile=args.datamodelfile, + server=args.server, + user=args.user, + password=args.password, + verbose=args.verbose) elif args.action == "xmlupload": xml_upload(input_file=args.xmlfile, server=args.server, @@ -84,6 +106,15 @@ def program(args): sipi=args.sipi, verbose=args.verbose, validate=args.validate) + elif args.action == "excel": + list_excel2json(excelpath=args.excelfile, + sheetname=args.sheet, + shortcode=args.shortcode, + listname=args.listname, + label=args.label, + lang=args.lang, + outfile=args.outfile, + verbose=args.verbose) diff --git a/knora/dsplib/BUILD b/knora/dsplib/BUILD deleted file mode 100644 index e69de29bb..000000000 diff --git a/examples/BUILD b/knora/dsplib/BUILD.bazel similarity index 100% rename from examples/BUILD rename to knora/dsplib/BUILD.bazel diff --git a/knora/dsplib/models/BUILD b/knora/dsplib/models/BUILD.bazel similarity index 100% rename from knora/dsplib/models/BUILD rename to knora/dsplib/models/BUILD.bazel diff --git a/knora/dsplib/models/resource.py b/knora/dsplib/models/resource.py index 80941a8d6..6c7694244 100644 --- a/knora/dsplib/models/resource.py +++ b/knora/dsplib/models/resource.py @@ -5,19 +5,15 @@ from urllib.parse import quote_plus from pystrict import strict -from rfc3987 import parse from typing import List, Set, Dict, Tuple, Optional, Any, Union, Type from copy import deepcopy -from .group import Group -from .langstring import LangString from .helpers import OntoInfo, Actions, BaseError, Cardinality, Context from .connection import Connection from .model import Model from .project import Project from .listnode import ListNode from .ontology import Ontology -from .propertyclass import PropertyClass from .resourceclass import ResourceClass, HasProperty from .permission import PermissionValue, PermissionsIterator, Permissions from .value import KnoraStandoffXml, Value, TextValue, ColorValue, DateValue, DecimalValue, GeomValue, GeonameValue, \ @@ -135,6 +131,21 @@ def __init__(self, if propname not in self.knora_properties and self.properties.get(propname) is None: raise BaseError(f'Property "{propname}" is not part of data model!') + def value(self, item): + if self._values.get(item): + val = self._values[item] + if isinstance(val, list): + tmp = [x.value for x in val] + return tmp + else: + return val.value + else: + return None + + @property + def label(self) -> str: + return self._label + @property def iri(self) -> str: return self._iri diff --git a/knora/dsplib/models/value.py b/knora/dsplib/models/value.py index 5b5eaeb83..ce2b8ecbc 100644 --- a/knora/dsplib/models/value.py +++ b/knora/dsplib/models/value.py @@ -321,7 +321,26 @@ def __init__(self, @property def value(self) -> str: - return self._value + datestr = '' + if self._calendar: + datestr += self._calendar + ':' + if self._e1: + datestr += self._e1 + ':' + if self._y1: + datestr += str(self._y1) + '-' + if self._m1: + datestr += str(self._m1) + '-' + if self._d1: + datestr += str(self._d1) + if self._e2: + datestr += ':' + str(self._e2) + if self._y2: + datestr += ':' + str(self._y2) + if self._m2: + datestr += '-' + str(self._m2) + if self._d2: + datestr += '-' + str(self._d2) + return datestr @classmethod def fromJsonLdObj(cls, jsonld_obj: Any) -> Dict[str, Any]: diff --git a/knora/dsplib/utils/BUILD b/knora/dsplib/utils/BUILD deleted file mode 100644 index 4a0e448f4..000000000 --- a/knora/dsplib/utils/BUILD +++ /dev/null @@ -1,77 +0,0 @@ -# make the python rules available -load("@rules_python//python:defs.bzl", "py_binary", "py_library") - -# make the dependencies from requirements.txt available -load("@knora_py_deps//:requirements.bzl", "requirement") - -py_library( - name = "onto_commons", - visibility = ["//visibility:public"], - srcs = ["onto_commons.py"], - deps = [ - ":helpers", - ":listnode", - ":project", - ], - imports = [".."], -) - -py_library( - name = "onto_create_lists", - visibility = ["//visibility:public"], - srcs = ["onto_create_lists.py"], - deps = [ - ":helpers", - ":connection" - ":listnode", - ":project", - ":onto_commons", - requirement("jsonschema"), - ], - imports = [".", ".."], -) - -py_library( - name = "onto_create_ontology", - visibility = ["//visibility:public"], - srcs = ["onto_create_ontology.py"], - deps = [ - ":helpers", - ":langstring", - ":group", - ":user", - ":ontology", - ":propertyclass", - ":resourceclass" - ":connection" - ":listnode", - ":project", - ":onto_commons", - requirement("jsonschema"), - ], - imports = [".", ".."], -) - -py_library( - name = "onto_get", - visibility = ["//visibility:public"], - srcs = ["onto_get.py"], - deps = [ - ":connection", - ":project", - ":listnode", - ":ontology" - ], - imports = [".", ".."], -) - -py_library( - name = "onto_get", - visibility = ["//visibility:public"], - srcs = ["onto_get.py"], - deps = [ - requirement("jsonschema"), - ], - imports = ["."], -) - diff --git a/knora/dsplib/utils/BUILD.bazel b/knora/dsplib/utils/BUILD.bazel new file mode 100644 index 000000000..1806a24e9 --- /dev/null +++ b/knora/dsplib/utils/BUILD.bazel @@ -0,0 +1,98 @@ +# make the python rules available +load("@rules_python//python:defs.bzl", "py_binary", "py_library") + +# make the dependencies from requirements.txt available +load("@knora_py_deps//:requirements.bzl", "requirement") + +py_library( + name = "onto_commons", + visibility = ["//visibility:public"], + srcs = ["onto_commons.py"], + deps = [ + "//knora/dsplib/models:helpers", + "//knora/dsplib/models:listnode", + "//knora/dsplib/models:project", + ], + imports = [".."], +) + +py_library( + name = "onto_create_lists", + visibility = ["//visibility:public"], + srcs = ["onto_create_lists.py"], + deps = [ + "//knora/dsplib/models:helpers", + "//knora/dsplib/models:connection", + "//knora/dsplib/models:listnode", + "//knora/dsplib/models:project", + ":onto_commons", + requirement("jsonschema"), + ], + imports = [".", ".."], +) + +py_library( + name = "onto_validate", + visibility = ["//visibility:public"], + srcs = ["onto_validate.py"], + deps = [ + ":onto_commons", + ], + imports = [".", ".."], +) + + +py_library( + name = "onto_create_ontology", + visibility = ["//visibility:public"], + srcs = ["onto_create_ontology.py"], + deps = [ + "//knora/dsplib/models:helpers", + "//knora/dsplib/models:langstring", + "//knora/dsplib/models:group", + "//knora/dsplib/models:user", + "//knora/dsplib/models:ontology", + "//knora/dsplib/models:propertyclass", + "//knora/dsplib/models:resourceclass", + "//knora/dsplib/models:connection", + "//knora/dsplib/models:listnode", + "//knora/dsplib/models:project", + ":onto_commons", + requirement("jsonschema"), + ], + imports = [".", ".."], +) + +py_library( + name = "onto_get", + visibility = ["//visibility:public"], + srcs = ["onto_get.py"], + deps = [ + "//knora/dsplib/models:connection", + "//knora/dsplib/models:project", + "//knora/dsplib/models:listnode", + "//knora/dsplib/models:ontology", + requirement("jsonschema"), + ], + imports = [".", ".."], +) + +py_library( + name = "xml_upload", + visibility = ["//visibility:public"], + srcs = ["xml_upload.py"], + deps = [ + "//knora/dsplib/models:connection", + "//knora/dsplib/models:group", + "//knora/dsplib/models:project", + "//knora/dsplib/models:resource", + "//knora/dsplib/models:value", + "//knora/dsplib/models:permission", + "//knora/dsplib/models:sipi", + "//knora/dsplib/models:listnode", + "//knora/dsplib/models:ontology", + requirement("jsonschema"), + ], + imports = [".", ".."], +) + diff --git a/knora/dsplib/utils/knora-schema.json b/knora/dsplib/utils/knora-schema.json index 008b18057..ea8337543 100644 --- a/knora/dsplib/utils/knora-schema.json +++ b/knora/dsplib/utils/knora-schema.json @@ -75,6 +75,25 @@ } }, + "excelref": { + "type": "object", + "properties": { + "file": { + "type": "string" + }, + "worksheet": { + "type": "string" + }, + "startrow": { + "type": "integer" + }, + "startcol": { + "type": "integer" + } + }, + "required": ["file", "worksheet"] + }, + "user": { "type": "object", "properties": { @@ -144,10 +163,18 @@ "$ref": "#/definitions/comment" }, "nodes": { - "type": "array", - "items": { - "$ref": "#/definitions/node" - } + "oneOf": [ + { + "type": "array", + "items": { + "$ref": "#/definitions/node" + } + }, + { + "type": "object", + "$ref": "#/definitions/excelref" + } + ] } }, "required": ["name", "labels"], diff --git a/knora/dsplib/utils/onto_commons.py b/knora/dsplib/utils/onto_commons.py index d0edfb191..ebeed842a 100644 --- a/knora/dsplib/utils/onto_commons.py +++ b/knora/dsplib/utils/onto_commons.py @@ -1,8 +1,13 @@ from typing import List, Set, Dict, Tuple, Optional +from openpyxl import load_workbook, worksheet from ..models.connection import Connection from ..models.project import Project from ..models.listnode import ListNode +from ..models.langstring import Languages, LangString +from ..models.helpers import BaseError + +from pprint import pprint def list_creator(con: Connection, project: Project, parent_node: ListNode, nodes: List[dict]): nodelist = [] @@ -22,3 +27,89 @@ def list_creator(con: Connection, project: Project, parent_node: ListNode, nodes nodelist.append({newnode.name: {"id": newnode.id}}) return nodelist + +def validate_list_from_excel(filepath: str, + sheetname: str, + startrow: int = 1, + startcol: int = 1, + verbose: bool = False): + + def analyse_level(ws: worksheet, level: int, row: int, col: int, preval: List[str]) ->int: + cell = ws.cell(column=col, row=row) + if col > 1: + preval.append(ws.cell(column=col - 1, row=row).value) + while cell.value: + for idx, val in enumerate(preval[:-1]): + if val != ws.cell(column=idx + 1, row=row).value: + raise BaseError(f"Inconsistency in Excel list! {val} not equal {ws.cell(column=idx + 1, row=row).value}") + if ws.cell(column=col + 1, row=row).value: + row = analyse_level(ws=ws, level=level + 1, col=col + 1, row=row, preval=preval) + if not ws.cell(column=col, row=row).value: + if col > 1: + preval.pop() + return row + else: + if verbose: + print(f"Node on level={level}, value={cell.value} ok...") + row += 1 + cell = ws.cell(column=col, row=row) + if col > 1: + preval.pop() + return row - 1 + + wb = load_workbook(filename=filepath, read_only=True) + ws = wb[sheetname] + tmp = [] + analyse_level(ws=ws, level=1, row=startrow, col=startcol, preval=tmp) + + +def json_list_from_excel(rootnode: {}, filepath: str, sheetname: str, startrow: int = 1, startcol: int = 1): + + names: Set[str] = set() + + def analyse_level(ws: worksheet, parentnode: {}, row: int, col: int, preval: List[str]) ->int: + nodes: [] = [] + currentnode: {} + + cell = ws.cell(column=col, row=row) + if col > 1: + preval.append(ws.cell(column=col - 1, row=row).value) + while cell.value: + for idx, val in enumerate(preval[:-1]): + if val != ws.cell(column=idx + 1, row=row).value: + raise BaseError(f"Inconsistency in Excel list! {val} not equal {ws.cell(column=idx + 1, row=row).value}") + if ws.cell(column=col + 1, row=row).value: + row = analyse_level(ws=ws, parentnode=currentnode, col=col + 1, row=row, preval=preval) + if not ws.cell(column=col, row=row).value: + if col > 1: + preval.pop() + parentnode["nodes"] = nodes + return row + else: + tmpstr = cell.value + tmpstr = tmpstr.split(" ") + tmpstr = [w.title() for w in tmpstr] + tmpstr = "".join(tmpstr) + tmpstr = tmpstr[0].lower() + tmpstr[1:] + while tmpstr in names: + tmpstr = tmpstr + "_" + names.add(tmpstr) + currentnode = { + "name": tmpstr, + "labels": {"en": cell.value} + } + nodes.append(currentnode) + print(f"Adding list node: value={cell.value}") + row += 1 + cell = ws.cell(column=col, row=row) + if col > 1: + preval.pop() + parentnode["nodes"] = nodes + return row - 1 + + wb = load_workbook(filename=filepath, read_only=True) + ws = wb[sheetname] + tmp = [] + analyse_level(ws=ws, parentnode=rootnode, row=startrow, col=startcol, preval=tmp) + + diff --git a/knora/dsplib/utils/onto_create_lists.py b/knora/dsplib/utils/onto_create_lists.py index 3bbe18ce1..a9ca23149 100644 --- a/knora/dsplib/utils/onto_create_lists.py +++ b/knora/dsplib/utils/onto_create_lists.py @@ -6,7 +6,7 @@ from ..models.connection import Connection from ..models.project import Project from ..models.listnode import ListNode -from .onto_commons import list_creator +from .onto_commons import list_creator, validate_list_from_excel, json_list_from_excel def create_lists (input_file: str, output_file: str, server: str, user: str, password: str, verbose: bool) -> bool: current_dir = os.path.dirname(os.path.realpath(__file__)) @@ -18,8 +18,34 @@ def create_lists (input_file: str, output_file: str, server: str, user: str, pas with open(input_file) as f: datamodel = json.load(f) + # + # now let's see if there are any lists defined as reference to excel files + # + lists = datamodel["project"].get('lists') + if lists is not None: + newlists: [] = [] + for rootnode in lists: + if rootnode.get("nodes") is not None and isinstance(rootnode["nodes"], dict) and rootnode["nodes"].get("file") is not None: + newroot = { + "name": rootnode.get("name"), + "labels": rootnode.get("labels"), + "comments": rootnode.get("comments") + } + startrow = 1 if rootnode["nodes"].get("startrow") is None else rootnode["nodes"]["startrow"] + startcol = 1 if rootnode["nodes"].get("startcol") is None else rootnode["nodes"]["startcol"] + json_list_from_excel(rootnode=newroot, + filepath=rootnode["nodes"]["file"], + sheetname=rootnode["nodes"]["worksheet"], + startrow=startrow, + startcol=startcol) + newlists.append(newroot) + else: + newlists.append(rootnode) + datamodel["project"]["lists"] = newlists + # validate the data model definition in order to be sure that it is correct validate(datamodel, schema) + if verbose: print("Data model is syntactically correct and passed validation!") diff --git a/knora/dsplib/utils/onto_create_ontology.py b/knora/dsplib/utils/onto_create_ontology.py index 877028c7c..939f1ef56 100644 --- a/knora/dsplib/utils/onto_create_ontology.py +++ b/knora/dsplib/utils/onto_create_ontology.py @@ -14,8 +14,9 @@ from ..models.propertyclass import PropertyClass from ..models.resourceclass import ResourceClass -from .onto_commons import list_creator +from .onto_commons import list_creator, validate_list_from_excel, json_list_from_excel +from pprint import pprint def create_ontology(input_file: str, lists_file: str, @@ -30,12 +31,41 @@ def create_ontology(input_file: str, with open(os.path.join(current_dir, 'knora-schema.json')) as s: schema = json.load(s) + # read the data model definition with open(input_file) as f: datamodel = json.load(f) + # + # now let's see if there are any lists defined as reference to excel files + # + lists = datamodel["project"].get('lists') + if lists is not None: + newlists: [] = [] + for rootnode in lists: + if rootnode.get("nodes") is not None and isinstance(rootnode["nodes"], dict) and rootnode["nodes"].get("file") is not None: + newroot = { + "name": rootnode.get("name"), + "labels": rootnode.get("labels"), + } + if rootnode.get("comments") is not None: + newroot["comments"] = rootnode["comments"] + + startrow = 1 if rootnode["nodes"].get("startrow") is None else rootnode["nodes"]["startrow"] + startcol = 1 if rootnode["nodes"].get("startcol") is None else rootnode["nodes"]["startcol"] + json_list_from_excel(rootnode=newroot, + filepath=rootnode["nodes"]["file"], + sheetname=rootnode["nodes"]["worksheet"], + startrow=startrow, + startcol=startcol) + newlists.append(newroot) + else: + newlists.append(rootnode) + datamodel["project"]["lists"] = newlists + # validate the data model definition in order to be sure that it is correct validate(datamodel, schema) + if verbose: print("Data model is syntactically correct and passed validation!") diff --git a/knora/dsplib/utils/onto_process_excel.py b/knora/dsplib/utils/onto_process_excel.py new file mode 100644 index 000000000..1f41d67ab --- /dev/null +++ b/knora/dsplib/utils/onto_process_excel.py @@ -0,0 +1,43 @@ +import os +from typing import List, Set, Dict, Tuple, Optional +import json +from jsonschema import validate + +from ..models.helpers import Actions, BaseError, Context, Cardinality +from .onto_commons import list_creator, validate_list_from_excel, json_list_from_excel + + +def list_excel2json(excelpath: str, + sheetname: str, + shortcode: str, + listname: str, + label: str, + lang: str, + outfile: str, + verbose: bool): + current_dir = os.path.dirname(os.path.realpath(__file__)) + langs = ["en", "de", "fr", "it"] + + if lang not in langs: + raise BaseError(f"Language '{lang}' not supported!") + + rootnode = { + "name": listname, + "labels": { + lang: label + } + } + + json_list_from_excel(rootnode, excelpath, sheetname) + jsonobj = { + "project": { + "shortcode": shortcode, + "lists": [ + rootnode + ] + } + } + with open(os.path.join(current_dir, 'knora-schema-lists.json')) as s: + schema = json.load(s) + validate(jsonobj, schema) + json.dump(jsonobj, open(outfile, "w"), indent=4) diff --git a/knora/dsplib/utils/onto_validate.py b/knora/dsplib/utils/onto_validate.py index fabf2ad82..8adf84af0 100644 --- a/knora/dsplib/utils/onto_validate.py +++ b/knora/dsplib/utils/onto_validate.py @@ -2,6 +2,9 @@ import json from jsonschema import validate +from .onto_commons import validate_list_from_excel, json_list_from_excel + +from pprint import pprint def validate_list(input_file: str) -> None: current_dir = os.path.dirname(os.path.realpath(__file__)) @@ -27,7 +30,37 @@ def validate_ontology(input_file: str) -> None: with open(input_file) as f: datamodel = json.load(f) + # + # now let's see if there are any lists defined as reference to excel files + # + lists = datamodel["project"].get('lists') + if lists is not None: + newlists: [] = [] + for rootnode in lists: + if rootnode.get("nodes") is not None and isinstance(rootnode["nodes"], dict) and rootnode["nodes"].get("file") is not None: + newroot = { + "name": rootnode.get("name"), + "labels": rootnode.get("labels") + } + if rootnode.get("comments") is not None: + newroot["comments"] = rootnode["comments"] + startrow = 1 if rootnode["nodes"].get("startrow") is None else rootnode["nodes"]["startrow"] + startcol = 1 if rootnode["nodes"].get("startcol") is None else rootnode["nodes"]["startcol"] + json_list_from_excel(rootnode=newroot, + filepath=rootnode["nodes"]["file"], + sheetname=rootnode["nodes"]["worksheet"], + startrow=startrow, + startcol=startcol) + newlists.append(newroot) + else: + newlists.append(rootnode) + datamodel["project"]["lists"] = newlists + + json.dump(datamodel, open("gaga.json", "w"), indent=4) + # validate the data model definition in order to be sure that it is correct validate(datamodel, schema) + print("Data model is syntactically correct and passed validation!") + diff --git a/knora/dsplib/utils/xml_upload.py b/knora/dsplib/utils/xml_upload.py index 3f768622e..04b176100 100644 --- a/knora/dsplib/utils/xml_upload.py +++ b/knora/dsplib/utils/xml_upload.py @@ -7,7 +7,6 @@ from dsplib.models.connection import Connection from dsplib.models.group import Group -from dsplib.models.helpers import IriTest from dsplib.models.project import Project from dsplib.models.resource import ResourceInstanceFactory from dsplib.models.value import BooleanValue, ColorValue, DateValue, DecimalValue, IntValue, IntervalValue, TextValue, \ diff --git a/knora/dsplib/widgets/BUILD b/knora/dsplib/widgets/BUILD deleted file mode 100644 index 6cf27b838..000000000 --- a/knora/dsplib/widgets/BUILD +++ /dev/null @@ -1,15 +0,0 @@ -# make the python rules available -load("@rules_python//python:defs.bzl", "py_binary", "py_library") - -# make the dependencies from requirements.txt available -load("@knora_py_deps//:requirements.bzl", "requirement") - -py_library( - name = "doublepassword", - visibility = ["//visibility:public"], - srcs = ["doublepassword.py"], - deps = [ - requirement("wx"), - ], - imports = ["."], -) diff --git a/knora/dsplib/widgets/__init__.py b/knora/dsplib/widgets/__init__.py deleted file mode 100644 index e69de29bb..000000000 diff --git a/knora/dsplib/widgets/doublepassword.py b/knora/dsplib/widgets/doublepassword.py deleted file mode 100644 index bd752c5b4..000000000 --- a/knora/dsplib/widgets/doublepassword.py +++ /dev/null @@ -1,80 +0,0 @@ -from typing import Any, Union, List, Set, Dict, Tuple, Optional, Callable, TypedDict - -import wx - -class DoublePasswordCtrl(wx.Control): - - def __init__(self, - parent: wx.Window, - id: int = wx.ID_ANY, - pos: wx.Point = wx.DefaultPosition, - size: wx.Size = wx.DefaultSize, - style: int = wx.NO_BORDER, - validator: wx.Validator = wx.DefaultValidator, - name: str = "DoublePassword", - value: str = ""): - super().__init__(parent=parent, - id=id, - pos=pos, - size=size, - style=style, - validator=validator, - name=name) - - sizer = wx.BoxSizer(wx.VERTICAL) - halfheight = size.GetHeight() - if halfheight > 0: - halfheight = halfheight / 2 - self.password1 = wx.TextCtrl(parent=self, - name=name + '1', - value=value if value is not None else "", - size=wx.Size(size.GetWidth(), halfheight), - style=style | wx.TE_PASSWORD) - self.password1.Bind(wx.EVT_TEXT, self.text1_changed) - sizer.Add(self.password1) - - self.password2 = wx.TextCtrl(parent=self, - name=name + '2', - value=value if value is not None else "", - size=wx.Size(size.GetWidth(), halfheight), - style=style | wx.TE_PASSWORD) - self.password2.Bind(wx.EVT_TEXT, self.text2_changed) - sizer.Add(self.password2) - self.SetSizerAndFit(sizer) - - def text1_changed(self, event: wx.CommandEvent) -> None: - self.text_changed() - event.Skip() - - def text2_changed(self, event: wx.CommandEvent) -> None: - self.text_changed() - event.Skip() - - def text_changed(self) -> None: - event = wx.PyCommandEvent(wx.EVT_TEXT.typeId, self.GetId()) - self.GetEventHandler().ProcessEvent(event) - - def GetValue(self) -> Union[str, None]: - if self.password1.GetValue() == self.password2.GetValue(): - return self.password1.GetValue() - else: - return None - - def SetValue(self, value: str) -> None: - self.password1.SetValue(value) - self.password2.SetValue(value) - - def SetBackgroundColour(self, color): - self.password1.SetBackgroundColour(color) - self.password2.SetBackgroundColour(color) - - def SetFocus(self): - self.password1.SetFocus() - - def Refresh(self): - self.password1.Refresh() - self.password2.Refresh() - - def SetValidator(self, validator: wx.Validator = wx.DefaultValidator): - self.password1.SetValidator(validator) - self.password2.SetValidator(validator) diff --git a/knora/gaga.json b/knora/gaga.json deleted file mode 100644 index 1bd1bb3e8..000000000 --- a/knora/gaga.json +++ /dev/null @@ -1,84 +0,0 @@ -{ - "prefixes": { - "testonto": "http://0.0.0.0:3333/ontology/4123/testonto/v2" - }, - "project": { - "shortcode": "4123", - "shortname": "testproj", - "longname": "testproj", - "descriptions": { - "en": "testproj" - }, - "keywords": [ - "test" - ], - "lists": [], - "ontologies": [ - { - "name": "testonto", - "label": "testonto", - "properties": [ - { - "name": "prop1", - "super": [ - "hasValue" - ], - "object": "BooleanValue", - "labels": "prop1", - "gui_element": "Checkbox" - }, - { - "name": "prop2", - "super": [ - "hasColor" - ], - "object": "ColorValue", - "labels": "prop2", - "gui_element": "Colorpicker", - "gui_attributes": { - "ncolors": 16 - } - } - ], - "resources": [ - { - "name": "res1", - "labels": "res1", - "comments": "res1", - "super": "Resource", - "cardinalities": [ - { - "propname": ":prop1", - "cardinality": "0-1", - "gui_order": 0 - }, - { - "propname": ":prop2", - "cardinality": "0-1", - "gui_order": 1 - } - ] - }, - { - "name": "res2", - "labels": "res2", - "comments": "res2", - "super": "StillImageRepresentation", - "cardinalities": [ - { - "propname": ":prop1", - "cardinality": "0-1", - "gui_order": 2 - }, - { - "propname": ":prop2", - "cardinality": "0-1", - "gui_order": 3 - } - ] - } - ] - } - ] - } -} \ No newline at end of file diff --git "a/knora/icons/Betreuungszusage Doktorat Philosophisch Historische Fakultaet_B\303\251atrice Gauvain Kopie.pdf" "b/knora/icons/Betreuungszusage Doktorat Philosophisch Historische Fakultaet_B\303\251atrice Gauvain Kopie.pdf" deleted file mode 100644 index 7399981b4..000000000 Binary files "a/knora/icons/Betreuungszusage Doktorat Philosophisch Historische Fakultaet_B\303\251atrice Gauvain Kopie.pdf" and /dev/null differ diff --git a/knora/icons/favicon-16x16.png b/knora/icons/favicon-16x16.png deleted file mode 100644 index f504426f9..000000000 Binary files a/knora/icons/favicon-16x16.png and /dev/null differ diff --git a/knora/icons/favicon-32x32.png b/knora/icons/favicon-32x32.png deleted file mode 100644 index 913aa0e92..000000000 Binary files a/knora/icons/favicon-32x32.png and /dev/null differ diff --git a/knora/mls.json b/knora/mls.json deleted file mode 100644 index 3098a0020..000000000 --- a/knora/mls.json +++ /dev/null @@ -1,1743 +0,0 @@ -{ - "prefixes": { - "mls": "http://api.test.dasch.swiss/ontology/0807/mls/v2" - }, - "project": { - "shortcode": "0807", - "shortname": "mls", - "longname": "Musikalisches Lexikon der Schweiz", - "descriptions": { - "en": "Das MLS ist ein Informationssystem für alle, die sich für Musik in und aus der Schweiz interessieren. Es ist online frei zugänglich und informiert dank der Mehrsprachigkeit die Leserschaft In- und Ausland. Es dient den Musizierenden, der Forschung und Lehre an den Hochschulen, aber auch dem Schulunterricht an den höheren Schulen, den Archiven, Bibliotheken, Medienschaffenden, Musikschulen, dem Kulturmanagement, Musikvereinen sowie dem Publikum von Konzert, Oper und Festival." - }, - "keywords": [ - "Musik", - "Musikwissenschaft" - ], - "lists": [ - { - "name": "relevance", - "labels": { - "de": "Relevantes Lemma" - }, - "nodes": [ - { - "name": "rel_ja", - "labels": { - "de": "Ja" - } - }, - { - "name": "rel_1", - "labels": { - "de": "1" - } - }, - { - "name": "rel_2", - "labels": { - "de": "2" - } - }, - { - "name": "rel_3", - "labels": { - "de": "3" - } - }, - { - "name": "rel_4", - "labels": { - "de": "4" - } - }, - { - "name": "rel_5", - "labels": { - "de": "5" - } - }, - { - "name": "rel_nein", - "labels": { - "de": "Nein" - } - }, - { - "name": "rel_ausnahmefall", - "labels": { - "de": "Ausnahmefall" - } - }, - { - "name": "rel_sache_ort", - "labels": { - "de": "Sache / Ort" - } - }, - { - "name": "rel_irrelevant", - "labels": { - "de": "Irrelevant" - } - } - ] - }, - { - "name": "deceased", - "labels": { - "de": "Verstorben" - }, - "nodes": [ - { - "name": "dec_ja", - "labels": { - "de": "Ja" - } - }, - { - "name": "dec_nein", - "labels": { - "de": "Nein" - } - }, - { - "name": "dec_imw", - "labels": { - "de": "IMW" - } - }, - { - "name": "dec_umfeld", - "labels": { - "de": "Umfeld" - } - }, - { - "name": "dec_irrelevant", - "labels": { - "de": "Irrelevant" - } - }, - { - "name": "dec_verweis", - "labels": { - "de": "Verweis" - } - }, - { - "name": "dec_sache_ort", - "labels": { - "de": "Sache / Ort" - } - } - ] - }, - { - "name": "sex", - "labels": { - "de": "Geschlecht" - }, - "nodes": [ - { - "name": "male", - "labels": { - "de": "männlich" - } - }, - { - "name": "female", - "labels": { - "de": "weiblich" - } - }, - { - "name": "male+female", - "labels": { - "de": "weiblich & männliche Gruppe" - } - } - ] - }, - { - "name": "articletype", - "labels": { - "de": "Artikeltyp" - }, - "nodes": [ - { - "name": "person", - "labels": { - "de": "Person" - } - }, - { - "name": "institution", - "labels": { - "de": "Institution" - } - }, - { - "name": "list", - "labels": { - "de": "Liste" - } - }, - { - "name": "location", - "labels": { - "de": "Ort" - } - }, - { - "name": "thing", - "labels": { - "de": "Sache" - } - } - ] - } - ], - "ontologies": [ - { - "name": "mls", - "label": "Musikalisches Lexikon der Schweiz", - "properties": [ - { - "name": "hasALinkToLemma", - "super": [ - "hasLinkTo" - ], - "object": ":Lemma", - "labels": "Lemma", - "gui_element": "Searchbox", - "gui_attributes": { - "numprops": 1 - } - }, - { - "name": "hasALinkToLexicon", - "super": [ - "hasLinkTo" - ], - "object": ":Lexicon", - "labels": "in Lexikon", - "gui_element": "Searchbox", - "gui_attributes": { - "numprops": 1 - } - }, - { - "name": "hasAddress", - "super": [ - "hasValue" - ], - "object": "TextValue", - "labels": "Adresse/Kontakt", - "gui_element": "Textarea", - "gui_attributes": { - "rows": 3, - "width": "99%" - } - }, - { - "name": "hasArticleComment", - "super": [ - "hasValue" - ], - "object": "TextValue", - "labels": "Kommentar", - "gui_element": "Textarea", - "gui_attributes": { - "rows": 2, - "width": "99%" - } - }, - { - "name": "hasArticleText", - "super": [ - "hasValue" - ], - "object": "TextValue", - "labels": "Artikel", - "gui_element": "Textarea", - "gui_attributes": { - "rows": 5, - "width": "99%", - "wrap": "soft" - } - }, - { - "name": "hasArticletype", - "super": [ - "hasValue" - ], - "object": "ListValue", - "labels": "Artikeltyp", - "gui_element": "Pulldown", - "gui_attributes": { - "hlist": "articletype" - } - }, - { - "name": "hasCanton", - "super": [ - "hasValue" - ], - "object": "TextValue", - "labels": "Kanton", - "gui_element": "SimpleText", - "gui_attributes": { - "maxlength": "128", - "size": 64 - } - }, - { - "name": "hasCatalogue", - "super": [ - "hasValue" - ], - "object": "UriValue", - "labels": "Katalog", - "gui_element": "SimpleText", - "gui_attributes": { - "maxlength": "128", - "size": 64 - } - }, - { - "name": "hasCentury", - "super": [ - "hasValue" - ], - "object": "TextValue", - "labels": "Jahrhundertangabe", - "gui_element": "SimpleText", - "gui_attributes": { - "maxlength": "32", - "size": 32 - } - }, - { - "name": "hasChildLexiconReltype", - "super": [ - "hasValue" - ], - "object": "TextValue", - "labels": "Beziehungstyp zu untergeordnetem Lexikon", - "gui_element": "SimpleText", - "gui_attributes": { - "maxlength": "128", - "size": 64 - } - }, - { - "name": "hasCitationForm", - "super": [ - "hasValue" - ], - "object": "TextValue", - "labels": "Zitierform", - "gui_element": "SimpleText", - "gui_attributes": { - "maxlength": "128", - "size": 32 - } - }, - { - "name": "hasCountry", - "super": [ - "hasValue" - ], - "object": "TextValue", - "labels": "Land", - "gui_element": "SimpleText", - "gui_attributes": { - "maxlength": "128", - "size": 64 - } - }, - { - "name": "hasDeceasedValue", - "super": [ - "hasValue" - ], - "object": "ListValue", - "labels": "Verstorben", - "gui_element": "Pulldown", - "gui_attributes": { - "hlist": "deceased" - } - }, - { - "name": "hasEditFinished", - "super": [ - "hasValue" - ], - "object": "TextValue", - "labels": "Einträge fertig", - "gui_element": "SimpleText", - "gui_attributes": { - "maxlength": "32", - "size": 32 - } - }, - { - "name": "hasEditVendor", - "super": [ - "hasValue" - ], - "object": "TextValue", - "labels": "Einträge bearbeitet von", - "gui_element": "SimpleText", - "gui_attributes": { - "maxlength": "128", - "size": 32 - } - }, - { - "name": "hasEndDate", - "super": [ - "hasValue" - ], - "object": "TextValue", - "labels": "Enddatum", - "gui_element": "SimpleText", - "gui_attributes": { - "maxlength": "32", - "size": 32 - } - }, - { - "name": "hasEndDateInfo", - "super": [ - "hasValue" - ], - "object": "TextValue", - "labels": "Endinfo", - "gui_element": "SimpleText", - "gui_attributes": { - "maxlength": "32", - "size": 32 - } - }, - { - "name": "hasExamplarComment", - "super": [ - "hasValue" - ], - "object": "TextValue", - "labels": "Kommentar", - "gui_element": "SimpleText", - "gui_attributes": { - "maxlength": "128", - "size": 64 - } - }, - { - "name": "hasExamplarLinkToLibrary", - "super": [ - "hasLinkTo" - ], - "object": ":Library", - "labels": "In Bibliothek", - "gui_element": "Searchbox" - }, - { - "name": "hasExamplarNumber", - "super": [ - "hasValue" - ], - "object": "TextValue", - "labels": "Exemplarnummer", - "gui_element": "SimpleText", - "gui_attributes": { - "maxlength": "128", - "size": 64 - } - }, - { - "name": "hasExemplarLinkToLexicon", - "super": [ - "hasLinkTo" - ], - "object": ":Lexicon", - "labels": "In Lexikon", - "gui_element": "Searchbox" - }, - { - "name": "hasExemplarSignatur", - "super": [ - "hasValue" - ], - "object": "TextValue", - "labels": "Exemplarsignatur", - "gui_element": "SimpleText", - "gui_attributes": { - "maxlength": "128", - "size": 64 - } - }, - { - "name": "hasFamilyName", - "super": [ - "hasValue", - "http://xmlns.com/foaf/0.1/familyName" - ], - "object": "TextValue", - "labels": "Familienname", - "gui_element": "SimpleText", - "gui_attributes": { - "maxlength": "32", - "size": 32 - } - }, - { - "name": "hasFonotecacode", - "super": [ - "hasValue" - ], - "object": "TextValue", - "labels": "Fonoteca Code", - "gui_element": "SimpleText", - "gui_attributes": { - "maxlength": "128", - "size": 32 - } - }, - { - "name": "hasGivenName", - "super": [ - "hasValue", - "http://xmlns.com/foaf/0.1/givenName" - ], - "object": "TextValue", - "labels": "Vorname", - "gui_element": "SimpleText", - "gui_attributes": { - "maxlength": "32", - "size": 32 - } - }, - { - "name": "hasGnd", - "super": [ - "hasValue" - ], - "object": "TextValue", - "labels": "GND", - "gui_element": "SimpleText", - "gui_attributes": { - "maxlength": "32", - "size": 32 - } - }, - { - "name": "hasHlsCcode", - "super": [ - "hasValue" - ], - "object": "TextValue", - "labels": "HLS Code", - "gui_element": "SimpleText", - "gui_attributes": { - "maxlength": "128", - "size": 32 - } - }, - { - "name": "hasInternalLex", - "super": [ - "hasValue" - ], - "object": "TextValue", - "labels": "Interne Lexicographische Information", - "gui_element": "SimpleText", - "gui_attributes": { - "maxlength": "128", - "size": 128 - } - }, - { - "name": "hasLLComment", - "super": [ - "hasValue" - ], - "object": "TextValue", - "labels": "Kommentar", - "gui_element": "SimpleText", - "gui_attributes": { - "maxlength": "128", - "size": 64 - } - }, - { - "name": "hasLLLinkToLemma", - "super": [ - "hasLinkTo" - ], - "object": ":Lemma", - "labels": "Lemma", - "gui_element": "Searchbox" - }, - { - "name": "hasLLLinkToLocation", - "super": [ - "hasLinkTo" - ], - "object": ":Location", - "labels": "Ort", - "gui_element": "Searchbox" - }, - { - "name": "hasLLRelation", - "super": [ - "hasValue" - ], - "object": "TextValue", - "labels": "Bezug zum Ort", - "gui_element": "SimpleText", - "gui_attributes": { - "maxlength": "128", - "size": 64 - } - }, - { - "name": "hasLOComment", - "super": [ - "hasValue" - ], - "object": "TextValue", - "labels": "Kommentar", - "gui_element": "SimpleText", - "gui_attributes": { - "maxlength": "128", - "size": 64 - } - }, - { - "name": "hasLOLinkToLemma", - "super": [ - "hasLinkTo" - ], - "object": ":Lemma", - "labels": "Lemma", - "gui_element": "Searchbox" - }, - { - "name": "hasLOLinkToOccupation", - "super": [ - "hasLinkTo" - ], - "object": ":Occupation", - "labels": "Tätigkeit", - "gui_element": "Searchbox" - }, - { - "name": "hasLemmaComment", - "super": [ - "hasValue" - ], - "object": "TextValue", - "labels": "Kommentar", - "gui_element": "Textarea", - "gui_attributes": { - "rows": 2, - "width": "99%" - } - }, - { - "name": "hasLemmaDescription", - "super": [ - "hasValue" - ], - "object": "TextValue", - "labels": "Beschreibung", - "gui_element": "Textarea", - "gui_attributes": { - "rows": 2, - "width": "99%" - } - }, - { - "name": "hasLemmaText", - "super": [ - "hasValue" - ], - "object": "TextValue", - "labels": "Lemma", - "gui_element": "SimpleText", - "gui_attributes": { - "maxlength": "128", - "size": 32 - } - }, - { - "name": "hasLemmaType", - "super": [ - "hasValue" - ], - "object": "ListValue", - "labels": "Lemmatyp", - "gui_element": "Pulldown", - "gui_attributes": { - "hlist": "articletype" - } - }, - { - "name": "hasLexiconComment", - "super": [ - "hasValue" - ], - "object": "TextValue", - "labels": "Kommentar", - "gui_element": "Textarea", - "gui_attributes": { - "rows": 2, - "width": "99%" - } - }, - { - "name": "hasLexiconLexiconComment", - "super": [ - "hasValue" - ], - "object": "TextValue", - "labels": "Kommentar", - "gui_element": "SimpleText", - "gui_attributes": { - "maxlength": "128", - "size": 64 - } - }, - { - "name": "hasLexiconLinkToChild", - "super": [ - "hasLinkTo" - ], - "object": ":Lexicon", - "labels": "Untergeordnetes Lexikon", - "gui_element": "Searchbox" - }, - { - "name": "hasLexiconLinkToParent", - "super": [ - "hasLinkTo" - ], - "object": ":Lexicon", - "labels": "Ãœbergeordnetes Lexikon", - "gui_element": "Searchbox" - }, - { - "name": "hasLexiconList", - "super": [ - "hasValue" - ], - "object": "TextValue", - "labels": "Liste", - "gui_element": "SimpleText", - "gui_attributes": { - "maxlength": "128", - "size": 64 - } - }, - { - "name": "hasLexiconWeblink", - "super": [ - "hasValue" - ], - "object": "UriValue", - "labels": "Link KVK", - "gui_element": "SimpleText", - "gui_attributes": { - "maxlength": "128", - "size": 64 - } - }, - { - "name": "hasLibrary", - "super": [ - "hasLinkTo" - ], - "object": ":Library", - "labels": "in Bibliothek", - "gui_element": "Searchbox", - "gui_attributes": { - "numprops": 1 - } - }, - { - "name": "hasLibrarycomment", - "super": [ - "hasValue" - ], - "object": "TextValue", - "labels": "Kommentar", - "gui_element": "Textarea", - "gui_attributes": { - "rows": 2, - "width": "99%" - } - }, - { - "name": "hasLibrarydescription", - "super": [ - "hasValue" - ], - "object": "TextValue", - "labels": "Beschreibung", - "gui_element": "SimpleText", - "gui_attributes": { - "maxlength": "128", - "size": 64 - } - }, - { - "name": "hasLibraryweblink", - "super": [ - "hasValue" - ], - "object": "TextValue", - "labels": "Web-Link", - "gui_element": "SimpleText", - "gui_attributes": { - "maxlength": "128", - "size": 64 - } - }, - { - "name": "hasLocation", - "super": [ - "hasValue" - ], - "object": "TextValue", - "labels": "Ort", - "gui_element": "SimpleText", - "gui_attributes": { - "maxlength": "64", - "size": 32 - } - }, - { - "name": "hasLocationComment", - "super": [ - "hasValue" - ], - "object": "TextValue", - "labels": "Kommentar", - "gui_element": "SimpleText", - "gui_attributes": { - "maxlength": "128", - "size": 64 - } - }, - { - "name": "hasMedia1", - "super": [ - "hasValue" - ], - "object": "TextValue", - "labels": "Medien 1", - "gui_element": "SimpleText", - "gui_attributes": { - "maxlength": "128", - "size": 32 - } - }, - { - "name": "hasMedia2", - "super": [ - "hasValue" - ], - "object": "TextValue", - "labels": "Medien 2", - "gui_element": "SimpleText", - "gui_attributes": { - "maxlength": "128", - "size": 32 - } - }, - { - "name": "hasMedia3", - "super": [ - "hasValue" - ], - "object": "TextValue", - "labels": "Medien 3", - "gui_element": "SimpleText", - "gui_attributes": { - "maxlength": "128", - "size": 32 - } - }, - { - "name": "hasMedia4", - "super": [ - "hasValue" - ], - "object": "TextValue", - "labels": "Medien 4", - "gui_element": "SimpleText", - "gui_attributes": { - "maxlength": "128", - "size": 32 - } - }, - { - "name": "hasNewitemActiveDate", - "super": [ - "hasValue" - ], - "object": "DateValue", - "labels": "Aktiver Zeitraum", - "gui_element": "Date" - }, - { - "name": "hasNewsText", - "super": [ - "hasValue" - ], - "object": "TextValue", - "labels": "Titel", - "gui_element": "Textarea", - "gui_attributes": { - "rows": 5, - "width": "99%", - "wrap": "soft" - } - }, - { - "name": "hasNewsTitle", - "super": [ - "hasValue" - ], - "object": "TextValue", - "labels": "Titel", - "gui_element": "SimpleText", - "gui_attributes": { - "maxlength": "256", - "size": 64 - } - }, - { - "name": "hasNewsitemLinkToLemma", - "super": [ - "hasLinkTo" - ], - "object": ":Lemma", - "labels": "Lemma", - "gui_element": "Searchbox" - }, - { - "name": "hasNewsitemWeblink", - "super": [ - "hasValue" - ], - "object": "UriValue", - "labels": "Externer Link", - "gui_element": "SimpleText", - "gui_attributes": { - "maxlength": "128", - "size": 64 - } - }, - { - "name": "hasNumlines", - "super": [ - "hasValue" - ], - "object": "IntValue", - "labels": "Zeilen", - "gui_element": "SimpleText", - "gui_attributes": { - "maxlength": "6", - "size": 6 - } - }, - { - "name": "hasOCRFinished", - "super": [ - "hasValue" - ], - "object": "TextValue", - "labels": "OCR fertig", - "gui_element": "SimpleText", - "gui_attributes": { - "maxlength": "32", - "size": 32 - } - }, - { - "name": "hasOCRVendor", - "super": [ - "hasValue" - ], - "object": "TextValue", - "labels": "OCR bearbeitet von", - "gui_element": "SimpleText", - "gui_attributes": { - "maxlength": "128", - "size": 32 - } - }, - { - "name": "hasOccupation", - "super": [ - "hasValue" - ], - "object": "TextValue", - "labels": "Ausgeübte Tätigkeit", - "gui_element": "SimpleText", - "gui_attributes": { - "maxlength": "128", - "size": 64 - } - }, - { - "name": "hasOemlCode", - "super": [ - "hasValue" - ], - "object": "TextValue", - "labels": "OEML Code", - "gui_element": "SimpleText", - "gui_attributes": { - "maxlength": "128", - "size": 32 - } - }, - { - "name": "hasOrigspelling", - "super": [ - "hasValue" - ], - "object": "TextValue", - "labels": "Originalschreibung", - "gui_element": "SimpleText", - "gui_attributes": { - "maxlength": "128", - "size": 64 - } - }, - { - "name": "hasPages", - "super": [ - "hasValue" - ], - "object": "TextValue", - "labels": "Seite", - "gui_element": "SimpleText", - "gui_attributes": { - "maxlength": "16", - "size": 16 - } - }, - { - "name": "hasParentLexiconReltype", - "super": [ - "hasValue" - ], - "object": "TextValue", - "labels": "Beziehungstyp zu übergeordnetem Lexikon", - "gui_element": "SimpleText", - "gui_attributes": { - "maxlength": "128", - "size": 64 - } - }, - { - "name": "hasPlacename", - "super": [ - "hasValue" - ], - "object": "TextValue", - "labels": "Ortsname", - "gui_element": "SimpleText", - "gui_attributes": { - "maxlength": "128", - "size": 64 - } - }, - { - "name": "hasPseudonym", - "super": [ - "hasValue" - ], - "object": "TextValue", - "labels": "Pseudonym", - "gui_element": "SimpleText", - "gui_attributes": { - "maxlength": "32", - "size": 32 - } - }, - { - "name": "hasRelevanceValue", - "super": [ - "hasValue" - ], - "object": "ListValue", - "labels": "Relevantes Lemma", - "gui_element": "Pulldown", - "gui_attributes": { - "hlist": "relevance" - } - }, - { - "name": "hasScanFinished", - "super": [ - "hasValue" - ], - "object": "TextValue", - "labels": "Scan fertig", - "gui_element": "SimpleText", - "gui_attributes": { - "maxlength": "32", - "size": 32 - } - }, - { - "name": "hasScanVendor", - "super": [ - "hasValue" - ], - "object": "TextValue", - "labels": "Scan bearbeitet von", - "gui_element": "SimpleText", - "gui_attributes": { - "maxlength": "128", - "size": 32 - } - }, - { - "name": "hasSex", - "super": [ - "hasValue" - ], - "object": "ListValue", - "labels": "Geschlecht", - "gui_element": "Pulldown", - "gui_attributes": { - "hlist": "sex" - } - }, - { - "name": "hasShortInfo", - "super": [ - "hasValue" - ], - "object": "TextValue", - "labels": "Kurzinformation", - "gui_element": "Textarea", - "gui_attributes": { - "rows": 2, - "width": "99%" - } - }, - { - "name": "hasShortname", - "super": [ - "hasValue" - ], - "object": "TextValue", - "labels": "Kürzel", - "gui_element": "SimpleText", - "gui_attributes": { - "maxlength": "128", - "size": 32 - } - }, - { - "name": "hasSigle", - "super": [ - "hasValue" - ], - "object": "TextValue", - "labels": "Sigle", - "gui_element": "SimpleText", - "gui_attributes": { - "maxlength": "16", - "size": 16 - } - }, - { - "name": "hasStartDate", - "super": [ - "hasValue" - ], - "object": "TextValue", - "labels": "Anfangsdatum", - "gui_element": "SimpleText", - "gui_attributes": { - "maxlength": "32", - "size": 32 - } - }, - { - "name": "hasStartDateInfo", - "super": [ - "hasValue" - ], - "object": "TextValue", - "labels": "Anfangsinfo", - "gui_element": "SimpleText", - "gui_attributes": { - "maxlength": "32", - "size": 32 - } - }, - { - "name": "hasState", - "super": [ - "hasValue" - ], - "object": "TextValue", - "labels": "Zustand", - "gui_element": "SimpleText", - "gui_attributes": { - "maxlength": "32", - "size": 32 - } - }, - { - "name": "hasSubLemma", - "super": [ - "hasLinkTo" - ], - "object": ":Lemma", - "labels": "Untergeordnetes Lemma", - "gui_element": "Searchbox" - }, - { - "name": "hasSubarticle", - "super": [ - "hasLinkTo" - ], - "object": ":Article", - "labels": "Untergeordneter Artikel", - "gui_element": "Searchbox" - }, - { - "name": "hasTheaterLexCode", - "super": [ - "hasValue" - ], - "object": "TextValue", - "labels": "Theaterlexikon Code", - "gui_element": "SimpleText", - "gui_attributes": { - "maxlength": "128", - "size": 32 - } - }, - { - "name": "hasTicinoLexCode", - "super": [ - "hasValue" - ], - "object": "TextValue", - "labels": "Link Dizionario Ticinese", - "gui_element": "SimpleText", - "gui_attributes": { - "maxlength": "128", - "size": 32 - } - }, - { - "name": "hasVariants", - "super": [ - "hasValue" - ], - "object": "TextValue", - "labels": "Varianten", - "gui_element": "SimpleText", - "gui_attributes": { - "maxlength": "32", - "size": 32 - } - }, - { - "name": "hasViaf", - "super": [ - "hasValue" - ], - "object": "TextValue", - "labels": "VIAF", - "gui_element": "SimpleText", - "gui_attributes": { - "maxlength": "32", - "size": 32 - } - }, - { - "name": "hasWebLink", - "super": [ - "hasValue" - ], - "object": "TextValue", - "labels": "Link", - "gui_element": "SimpleText", - "gui_attributes": { - "maxlength": "128", - "size": 128 - } - }, - { - "name": "hasYear", - "super": [ - "hasValue" - ], - "object": "TextValue", - "labels": "Jahr", - "gui_element": "SimpleText", - "gui_attributes": { - "maxlength": "128", - "size": 32 - } - } - ], - "resources": [ - { - "name": "Article", - "labels": "Artikel", - "comments": "none", - "super": "Resource", - "cardinalities": [ - { - "propname": ":hasALinkToLemma", - "cardinality": "0-1" - }, - { - "propname": ":hasALinkToLexicon", - "cardinality": "0-1" - }, - { - "propname": ":hasArticleComment", - "cardinality": "0-n" - }, - { - "propname": ":hasArticleText", - "cardinality": "0-1" - }, - { - "propname": ":hasArticletype", - "cardinality": "0-1" - }, - { - "propname": ":hasFonotecacode", - "cardinality": "0-1" - }, - { - "propname": ":hasHlsCcode", - "cardinality": "0-1" - }, - { - "propname": ":hasInternalLex", - "cardinality": "0-1" - }, - { - "propname": ":hasNumlines", - "cardinality": "0-1" - }, - { - "propname": ":hasOemlCode", - "cardinality": "0-1" - }, - { - "propname": ":hasOrigspelling", - "cardinality": "0-1" - }, - { - "propname": ":hasPages", - "cardinality": "0-1" - }, - { - "propname": ":hasShortInfo", - "cardinality": "0-1" - }, - { - "propname": ":hasState", - "cardinality": "0-1" - }, - { - "propname": ":hasSubarticle", - "cardinality": "0-n" - }, - { - "propname": ":hasTheaterLexCode", - "cardinality": "0-1" - }, - { - "propname": ":hasTicinoLexCode", - "cardinality": "0-1" - }, - { - "propname": ":hasWebLink", - "cardinality": "0-1" - } - ] - }, - { - "name": "Exemplar", - "labels": "Exemplar", - "comments": "none", - "super": "Resource", - "cardinalities": [ - { - "propname": ":hasExamplarComment", - "cardinality": "0-1" - }, - { - "propname": ":hasExamplarLinkToLibrary", - "cardinality": "0-1" - }, - { - "propname": ":hasExamplarNumber", - "cardinality": "0-1" - }, - { - "propname": ":hasExemplarLinkToLexicon", - "cardinality": "0-1" - }, - { - "propname": ":hasExemplarSignatur", - "cardinality": "0-1" - } - ] - }, - { - "name": "Lemma", - "labels": "Musikalisches Lexikon der Schweiz", - "comments": "none", - "super": "Resource", - "cardinalities": [ - { - "propname": ":hasCentury", - "cardinality": "0-1" - }, - { - "propname": ":hasDeceasedValue", - "cardinality": "0-1" - }, - { - "propname": ":hasEndDate", - "cardinality": "0-1" - }, - { - "propname": ":hasEndDateInfo", - "cardinality": "0-1" - }, - { - "propname": ":hasFamilyName", - "cardinality": "0-1" - }, - { - "propname": ":hasGivenName", - "cardinality": "0-1" - }, - { - "propname": ":hasGnd", - "cardinality": "0-1" - }, - { - "propname": ":hasLemmaComment", - "cardinality": "0-n" - }, - { - "propname": ":hasLemmaDescription", - "cardinality": "0-1" - }, - { - "propname": ":hasLemmaText", - "cardinality": "0-1" - }, - { - "propname": ":hasLemmaType", - "cardinality": "0-1" - }, - { - "propname": ":hasPseudonym", - "cardinality": "0-n" - }, - { - "propname": ":hasRelevanceValue", - "cardinality": "0-1" - }, - { - "propname": ":hasSex", - "cardinality": "0-1" - }, - { - "propname": ":hasStartDate", - "cardinality": "0-1" - }, - { - "propname": ":hasStartDateInfo", - "cardinality": "0-1" - }, - { - "propname": ":hasSubLemma", - "cardinality": "0-n" - }, - { - "propname": ":hasVariants", - "cardinality": "0-n" - }, - { - "propname": ":hasViaf", - "cardinality": "0-1" - } - ] - }, - { - "name": "LemmaLocation", - "labels": "Lemma - Ort", - "comments": "none", - "super": "Resource", - "cardinalities": [ - { - "propname": ":hasLLComment", - "cardinality": "0-1" - }, - { - "propname": ":hasLLLinkToLemma", - "cardinality": "0-1" - }, - { - "propname": ":hasLLLinkToLocation", - "cardinality": "0-1" - }, - { - "propname": ":hasLLRelation", - "cardinality": "0-1" - } - ] - }, - { - "name": "LemmaOccupation", - "labels": "Lemma - Tätigkeit", - "comments": "none", - "super": "Resource", - "cardinalities": [ - { - "propname": ":hasLOComment", - "cardinality": "0-1" - }, - { - "propname": ":hasLOLinkToLemma", - "cardinality": "0-1" - }, - { - "propname": ":hasLOLinkToOccupation", - "cardinality": "0-1" - } - ] - }, - { - "name": "Lexicon", - "labels": "Lexikon", - "comments": "none", - "super": "Resource", - "cardinalities": [ - { - "propname": ":hasCitationForm", - "cardinality": "0-1" - }, - { - "propname": ":hasEditFinished", - "cardinality": "0-1" - }, - { - "propname": ":hasEditVendor", - "cardinality": "0-1" - }, - { - "propname": ":hasLexiconComment", - "cardinality": "0-n" - }, - { - "propname": ":hasLexiconWeblink", - "cardinality": "0-1" - }, - { - "propname": ":hasLibrary", - "cardinality": "0-n" - }, - { - "propname": ":hasMedia1", - "cardinality": "0-1" - }, - { - "propname": ":hasMedia2", - "cardinality": "0-1" - }, - { - "propname": ":hasMedia3", - "cardinality": "0-1" - }, - { - "propname": ":hasMedia4", - "cardinality": "0-1" - }, - { - "propname": ":hasOCRFinished", - "cardinality": "0-1" - }, - { - "propname": ":hasOCRVendor", - "cardinality": "0-1" - }, - { - "propname": ":hasScanFinished", - "cardinality": "0-1" - }, - { - "propname": ":hasScanVendor", - "cardinality": "0-1" - }, - { - "propname": ":hasShortname", - "cardinality": "0-1" - }, - { - "propname": ":hasYear", - "cardinality": "0-1" - } - ] - }, - { - "name": "LexiconLexicon", - "labels": "Ãœbergeordnetes Lexikon zu Untergeordnetem Lexikon", - "comments": "none", - "super": "Resource", - "cardinalities": [ - { - "propname": ":hasChildLexiconReltype", - "cardinality": "0-1" - }, - { - "propname": ":hasLexiconLexiconComment", - "cardinality": "0-1" - }, - { - "propname": ":hasLexiconLinkToChild", - "cardinality": "0-1" - }, - { - "propname": ":hasLexiconLinkToParent", - "cardinality": "0-1" - }, - { - "propname": ":hasLexiconList", - "cardinality": "0-1" - }, - { - "propname": ":hasParentLexiconReltype", - "cardinality": "0-1" - } - ] - }, - { - "name": "Library", - "labels": "Bibliothek", - "comments": "none", - "super": "Resource", - "cardinalities": [ - { - "propname": ":hasAddress", - "cardinality": "0-1" - }, - { - "propname": ":hasCatalogue", - "cardinality": "0-1" - }, - { - "propname": ":hasLibrarycomment", - "cardinality": "0-n" - }, - { - "propname": ":hasLibrarydescription", - "cardinality": "0-1" - }, - { - "propname": ":hasLibraryweblink", - "cardinality": "0-1" - }, - { - "propname": ":hasLocation", - "cardinality": "0-1" - }, - { - "propname": ":hasSigle", - "cardinality": "0-1" - } - ] - }, - { - "name": "Location", - "labels": "Ort", - "comments": "none", - "super": "Resource", - "cardinalities": [ - { - "propname": ":hasCanton", - "cardinality": "0-1" - }, - { - "propname": ":hasCountry", - "cardinality": "0-1" - }, - { - "propname": ":hasLocationComment", - "cardinality": "0-1" - }, - { - "propname": ":hasPlacename", - "cardinality": "0-1" - } - ] - }, - { - "name": "Newsitem", - "labels": "Newsitem with image", - "comments": "none", - "super": "StillImageRepresentation", - "cardinalities": [ - { - "propname": ":hasNewitemActiveDate", - "cardinality": "0-1" - }, - { - "propname": ":hasNewsText", - "cardinality": "0-1" - }, - { - "propname": ":hasNewsTitle", - "cardinality": "1" - }, - { - "propname": ":hasNewsitemLinkToLemma", - "cardinality": "0-1" - }, - { - "propname": ":hasNewsitemWeblink", - "cardinality": "0-1" - } - ] - }, - { - "name": "Occupation", - "labels": "Personentätigkeit", - "comments": "none", - "super": "Resource", - "cardinalities": [ - { - "propname": ":hasOccupation", - "cardinality": "0-1" - } - ] - } - ] - } - ] - } -} \ No newline at end of file diff --git a/knora/test.py b/knora/test.py deleted file mode 100644 index 162203310..000000000 --- a/knora/test.py +++ /dev/null @@ -1,99 +0,0 @@ -import os -from typing import List, Set, Dict, Tuple, Optional -from pprint import pprint -import argparse -import json -from jsonschema import validate -import sys - -from models.helpers import Actions, BaseError, Context, Cardinality -from models.langstring import Languages, LangStringParam, LangString -from models.connection import Connection, Error -from models.project import Project -from models.listnode import ListNode -from models.group import Group -from models.user import User -from models.ontology import Ontology -from models.propertyclass import PropertyClass -from models.resourceclass import ResourceClass - -class SetEncoder(json.JSONEncoder): - def default(self, obj): - if isinstance(obj, set): - return list(obj) - elif isinstance(obj, Context): - return obj.toJsonObj() - return json.JSONEncoder.default(self, obj) - -def program(args): - # - # parse the arguments of the command line - # - parser = argparse.ArgumentParser() - #parser.add_argument("datamodelfile", help="path to data model file") - parser.add_argument("-s", "--server", type=str, default="http://0.0.0.0:3333", help="URL of the Knora server") - parser.add_argument("-u", "--user", type=str, default="root@example.com", help="Username for Knora") - parser.add_argument("-p", "--password", type=str, default="test", help="The password for login") - parser.add_argument("-c", "--shortcode", type=str, help="Shortcode of the project") - parser.add_argument("-n", "--shortname", type=str, help="Shortname of the project") - parser.add_argument("-i", "--iri", type=str, help="Project iri") - args = parser.parse_args(args) - - current_dir = os.path.dirname(os.path.realpath(__file__)) - - # - # Connect to the DaSCH Service Platform API - # - con = Connection(args.server) - #con.login(args.user, args.password) - - # - # First we get the project information... - # - if args.shortcode: - project = Project(con=con, shortcode=args.shortcode) - elif args.shortname: - project = Project(con=con, shortname=args.shortname) - elif args.iri: - project = Project(con=con, shortname=args.iri) - else: - print("ERROR") - exit(-1) - project = project.read() - - projectobj = project.createDefinitionFileObj() - - # - # now collect the lists - # - listroots = ListNode.getAllLists(con=con, project_iri=project.id) - listobj = [] - for listroot in listroots: - complete_list = listroot.getAllNodes() - listobj.append(complete_list.createDefinitionFileObj()) - projectobj["lists"] = listobj - - projectobj["ontologies"] = [] - for ontology in project.ontologies: - oparts = ontology.split("/") - name = oparts[len(oparts) - 1] - shortcode = oparts[len(oparts) - 2] - lastmoddate, ontology = Ontology.getOntologyFromServer(con=con, shortcode=shortcode, name=name) - projectobj["ontologies"].append(ontology.createDefinitionFileObj()) - - umbrella = { - "prefixes": ontology.context.get_externals_used(), - "project": projectobj - } - - with open('data.json', 'w', encoding='utf8') as outfile: - json.dump(umbrella, outfile, indent=3, ensure_ascii=False) - - print(ontology.context) - -def main(): - program(sys.argv[1:]) - - -if __name__ == '__main__': - program(sys.argv[1:]) diff --git a/knora/testit.py b/knora/testit.py deleted file mode 100644 index 4250f5053..000000000 --- a/knora/testit.py +++ /dev/null @@ -1,76 +0,0 @@ -import sys -import os - -sys.path.append(os.path.dirname(os.path.realpath(__file__))) - -from dsplib.models.connection import Connection -from dsplib.models.resource import ResourceInstanceFactory -from dsplib.models.value import BooleanValue, ColorValue, DateValue, DecimalValue, IntValue, IntervalValue, TextValue, \ - UriValue, KnoraStandoffXml, make_value -from dsplib.models.permission import PermissionValue, Permissions, PermissionsIterator -from dsplib.models.sipi import Sipi -from pprint import pprint - -# -# Connect to server and make a login -# -con = Connection('http://0.0.0.0:3333') -con.login('root@example.com', 'test') - -# -# Make class factory for project 'anything. The factory creates classes that implement the CRUD methods -# for the given resource classes, that is to create, read, update and delete instances (=resources) of the given classesd -# -factory = ResourceInstanceFactory(con, 'anything') -resclassnames = factory.get_resclass_names() - -# -# Get an python class of a BlueThing resource class -# -BlueThing = factory.get_resclass('anything:BlueThing') - -print("====================================================") -an_old_thing = BlueThing(con=con, iri="http://rdfh.ch/0001/H6gBWUuJSuuO-CilHV8kQw").read() -an_old_thing.print() - -a_blue_thing = BlueThing(con=con, - label='BlueThing', - values={ - 'anything:hasBoolean': True, - 'anything:hasColor': ['#ff0033', '#0077FF'], - 'anything:hasDate': make_value(value='1833', comment='not verified!'), - 'anything:hasDecimal': 3.14159, - 'anything:hasInteger': "42", - 'anything:hasTimeStamp': "2004-04-12T13:20:00Z", - 'anything:hasInterval': [make_value(value="0.0:3.0", comment="first interval"), - make_value(value="3.5:3.7", comment="second interval")], - 'anything:hasRichtext': KnoraStandoffXml("This is bold text."), - 'anything:hasText': "Dies ist ein einfacher Text", - 'anything:hasUri': 'http://gaga.com:65500/gugus' - }).create() -print('IRI=', a_blue_thing.iri) -print('ARK=', a_blue_thing.ark) -print('VARK=', a_blue_thing.vark) - -new_blue_thing = a_blue_thing.read() -new_blue_thing.print() - -ThingPicture = factory.get_resclass('anything:ThingPicture') -sipi = Sipi('http://0.0.0.0:1024', con.get_token()) -img = sipi.upload_image('gaga.tif') -fileref = img['uploadedFiles'][0]['internalFilename'] -resperm = Permissions({PermissionValue.M: ["knora-admin:UnknownUser", "knora-admin:KnownUser"], - PermissionValue.CR: ["knora-admin:Creator", "knora-admin:ProjectAdmin"]}) -a_thing_picture = ThingPicture( - con=con, - label='ThingPicture', - stillimage=fileref, - permissions=resperm, - values={ - 'anything:hasPictureTitle': make_value(value="A Thing Picture named Lena", permissions=resperm) - } -).create() -print('??????????????????????????????????????????') - -a_thing_picture.print() - diff --git a/knora/xml2knora.py b/knora/xml2knora.py deleted file mode 100644 index 8bb9ece83..000000000 --- a/knora/xml2knora.py +++ /dev/null @@ -1,633 +0,0 @@ -from typing import List, Set, Dict, Tuple, Optional, Union -from enum import Enum -from lxml import etree -from pprint import pprint -import os -import argparse -import base64 -import json -import sys -import requests -import re -from knora import KnoraError, KnoraStandoffXml, Knora, Sipi - -#============================================================================== -# Some type defitions - -# -# A dictionary with key and values as strings -# -StrDict = Dict[str,str] - -# -# A thing that can either be a string or StrDict -# -StrObj = Union[str,StrDict] - -# -# A thing that either can be a single StrObj or a list of StrObj's -# -VarStrObj = Union[StrObj,List[StrObj]] - - - -# https://raw.githubusercontent.com/dhlab-basel/dasch-ark-resolver-data/master/data/shortcodes.csv - -class MyError(BaseException): - """ - Used for error handling - """ - def __init__(self, msg: str): - self.message = msg - - -class KnoraValue: - """ - Represents a single knora value - - A typical value has the form (example for complex text) - - :: - - PHA+YnM6IHdhaHJzY2hlaW5sa - - All options are optional. - """ - resrefs: List[str] - comment: str - permissions: str - value: Union[str,KnoraStandoffXml] - is_richtext: bool - - def __init__(self, - context: etree.iterparse, - node: Tuple, - type: str, - listname: Optional[str] = None) -> None: - """ - Constructor for parsing a value from a XML DOM - - :param context: Context for DOM node traversal - :param node: The DOM node to be processed - :param type: The Value type ('text','color','date','decimal','geometry','geoname','list', etc.) - :param listname: Name of the list [optional] (used for list values) - """ - - self.resrefs = None - self.comment = node.get('comment') - self.permissions = node.get('permissions') - if node.get('resrefs') is not None: - self.resrefs = node.attrib['resrefs'].split('|') - if node.get('encoding') == 'hex64': - #self.value = KnoraStandoffXml( - # '\n' + \ - # base64.b64decode("".join(node.itertext())).decode() + '') - self.value = '\n' + \ - base64.b64decode("".join(node.itertext())).decode() + '' - else: - if type == 'list': - self.value = listname + ':' + "".join(node.itertext()) - else: - self.value = "".join(node.itertext()) - while True: - event, subnode = next(context) - if event == 'start': - raise MyError( - 'Unexpected start tag: "{}" value-tags may contain no other tags!'.format(subnode.tag)) - else: - if subnode.tag == type: - break - else: - raise MyError('Unexpected end tag: "{}": expected!'.format(subnode.tag, type)) - - def print(self) -> None: - """ - Print value to stdout for debugging... - - :return: None - """ - print(' Value: ' + self.value) - if self.comment: - print(' Comment:' + self.comment) - if self.resrefs is not None: - for i in self.resrefs: - print(' resref: ' + i) - - -class KnoraProperty: - """ - A class representing a knora property class - - A typical property node has the form: - - :: - - … - - - The option "name" is required an indicates the name of the knora property. - """ - name: str - type: str - values: List[KnoraValue] - - def __init__(self, context: etree.iterparse, node: Tuple, type): - """ - Constructor to parse a property class from XML DOM - - :param context: Context for DOM node traversal - :param node: The DOM node to be processed (representing a property class) - :param type: The Value type ('text','color','date','decimal','geometry','geoname','list', etc.) - """ - - self.name = node.attrib['name'] # safe the property nam - listname = node.attrib.get('list') # safe the list name if given (only for lists) - self.type = type - self.values = [] - - # - # Now we start procssing tbe subnodes which should be value nodes - # - while True: - event, subnode = next(context) - if event == 'start': - if subnode.tag == type: # the subnode must correspond to the expected value type - self.values.append(KnoraValue(context, subnode, type, listname)) - else: - raise MyError('Unexpected start tag: "{}" may contain only tags!'.format(subnode.tag)) - else: - if subnode.tag == 'text-prop' or subnode.tag == 'color-prop' or \ - subnode.tag == 'date-prop' or subnode.tag == 'decimal-prop' or \ - subnode.tag == 'geometry-prop' or subnode.tag == 'geoname-prop' or \ - subnode.tag == 'list-prop' or subnode.tag == 'iconclass-prop' or \ - subnode.tag == 'integer-prop' or subnode.tag == 'interval-prop' or \ - subnode.tag == 'period-prop' or subnode.tag == 'resptr-prop' or \ - subnode.tag == 'resptr-prop' or subnode.tag == 'time-prop' or \ - subnode.tag == 'uri-prop' or subnode.tag == 'boolean-prop': - break - else: - raise MyError('Unknown endtag for property: "{}"!'.format(subnode.tag)) - - def print(self) -> None: - """ - Print property class to stdout for debugging... - - :return: None - """ - print(' Property: {} Type: {}'.format(self.name, self.type)) - for value in self.values: - value.print() - - -class KnoraResource: - """ - A class representing a resource from the XML DOM. - - A typical resource node looks like follows: - - :: - - - - The options ar as follows: - - label : (required) - The knora label for the resource - - restype : (required) - The resource type as defind in th knora project specific ontology - - unique_id : (required) - An arbitrary unique id that ist used to refrencee this this resource from another one - - permissions : (optional) - The reference ID of a permission set - - """ - unique_id: str - label: str - restype: str - permissions: str - image: str - properties: List[KnoraProperty] - - def __init__(self, context: etree.iterparse, node: Tuple) -> None: - """ - Constructor that parses a resource node from the XML DOM - - :param context: Context for DOM node traversal - :param node: The DOM node to be processed (representing a resource) - """ - self.unique_id = node.attrib['unique_id'] # safe the unique id - self.label = node.attrib['label'] - self.restype = node.attrib['restype'] - self.permissions = node.attrib['permissions'] - self.image = None - self.properties = [] - while True: - # - # start processing the sub nodes - # - event, subnode = next(context) - if event == 'start': - if subnode.tag == 'image': - self.image = node.text - elif subnode.tag == 'text-prop': - self.properties.append(KnoraProperty(context, subnode, 'text')) - elif subnode.tag == 'color-prop': - self.properties.append(KnoraProperty(context, subnode, 'color')) - elif subnode.tag == 'date-prop': - self.properties.append(KnoraProperty(context, subnode, 'date')) - elif subnode.tag == 'decimal-prop': - self.properties.append(KnoraProperty(context, subnode, 'decimal')) - elif subnode.tag == 'geometry-prop': - self.properties.append(KnoraProperty(context, subnode, 'geometry')) - elif subnode.tag == 'geoname-prop': - self.properties.append(KnoraProperty(context, subnode, 'geoname')) - elif subnode.tag == 'list-prop': - self.properties.append(KnoraProperty(context, subnode, 'list')) - elif subnode.tag == 'iconclass-prop': - self.properties.append(KnoraProperty(context, subnode, 'iconclass')) - elif subnode.tag == 'integer-prop': - self.properties.append(KnoraProperty(context, subnode, 'integer')) - elif subnode.tag == 'interval-prop': - self.properties.append(KnoraProperty(context, subnode, 'interval')) - elif subnode.tag == 'period-prop': - self.properties.append(KnoraProperty(context, subnode, 'period')) - elif subnode.tag == 'resptr-prop': - self.properties.append(KnoraProperty(context, subnode, 'resptr')) - elif subnode.tag == 'time-prop': - self.properties.append(KnoraProperty(context, subnode, 'time')) - elif subnode.tag == 'uri-prop': - self.properties.append(KnoraProperty(context, subnode, 'uri')) - elif subnode.tag == 'boolean-prop': - self.properties.append(KnoraProperty(context, subnode, 'boolean')) - else: - raise MyError('Unexpected start tag: "{}" may contain only or tags!'.format(subnode.tag)) - else: - if subnode.tag == 'resource': - break - elif subnode.tag == 'image': - self.image = "".join(subnode.itertext()) - else: - raise MyError('Unexpected end tag: "{}" expected!'.format(subnode.tag)) - - def print(self): - """ - Print Resource to stdout for debugging... - - :return: None - """ - print('Resource: id={} restype: {} label: {}'.format(self.unique_id, self.restype, self.label)) - if self.image is not None: - print(' Image: ' + self.image) - for property in self.properties: - property.print() - - def get_resptrs(self) -> List[str]: - """ - Return a list of all reesource id's that a referenced by this rsource - :return: List of resources identified by their unique id's - """ - resptrs: List[str] = [] - for property in self.properties: - if property.type == 'resptr': - for value in property.values: - resptrs.append(value.value) - elif property.type == 'text': - for value in property.values: - if value.resrefs is not None: - resptrs.extend(value.resrefs) - return resptrs - - def get_propvals(self, - resiri_lookup: StrDict, - permissions_lookup: StrDict) -> Dict[str, VarStrObj]: - """ - A function which retrieves... - - :param resiri_lookup: Is used to solve internal unique_id's of resourcs to real IRI's - :param permissions_lookup: Is usd to resolve thee permission ID's to permission sets - :return: A dict of values with the property name as key and a single value. This dict represents - the JSON structure that Knora.create_resource() expects. - """ - propdata = {} - exp = re.compile(r'IRI:[^:]*:IRI') # regepx to parse the IRI's in RichText's - for property in self.properties: - vals: List[StrObj] = [] # == List[Union[str,StrDict] - for value in property.values: - v: str - if property.type == 'resptr': # we have a resptr, therefore simple lookup or IRI - iri = resiri_lookup.get(value.value) - if iri is not None: - v = iri - else: - v = value.value # if we do not find the unique_id, we assume it's a valid knora IRI - elif property.type == 'text': # we have a text which might have embedded references to other resources - if isinstance(value.value, KnoraStandoffXml): - irirefs = value.value.findall() # The IRI's must be embedded as "...IRI:unique_id:IRI..." - for iriref in irirefs: - resid = iriref.split(':')[1] - iri = resiri_lookup.get(resid) - value.value.replace(iriref, iri) - #tmpstr: str = value.value - #for iriref in irirefs: - # resid = iriref.split(':')[1] - # iri = resiri_lookup.get(resid) - # tmpstr.replace(iriref, iri) - #v = tmpstr - v = value.value - else: - v = value.value - - if value.comment is None and value.permissions is None: - # no comment or prmissions - vals.append(v) - else: - # we have comment or permissions - tmp = {'value': v} - if value.comment is not None: - tmp['comment'] = value.comment - if value.permissions is not None: - tmp['permissions'] = permissions_lookup.get(value.permissions) - vals.append(tmp) - propdata[property.name] = vals if len(vals) > 1 else vals[0] # append a Union[StrObj,List[StrObj]] - return propdata - -class Allow: - """ - Class representing a single right in a permission set definition - """ - group: str - permission: str - - def __init__(self, context: etree.iterparse, node: Tuple) -> None: - """ - Constructor which parses the XML DOM allow element - - :param context: Context for DOM node traversal - :param node: The DOM node to be processed (representing an single right in a permission set) - """ - self.group = node.attrib['group'] - self.permission = "".join(node.itertext()) - # UnknownUser | KnownUser | ProjectMember | Creator | ProjectAdmin | SystemAdmin - - -class Permission: - """ - A class representing a permission set - """ - id: str - allows: List[Allow] - - def __init__(self, context: etree.iterparse, node: Tuple) -> None: - """ - Constructor which parses a XML DOM permissions element represrenting an named permission set - - :param context: Context for DOM node traversal - :param node: The DOM node to be processed (representing an a permission set) - """ - self.allows = [] - self.id = node.attrib['id'] - while True: - event, subnode = next(context) - if event == 'start': - if subnode.tag == 'allow': - self.allows.append(Allow(context, subnode)) - else: - raise MyError ('Unexpected tag: "{}" expected!'.format(subnode.tag)) - else: - if subnode.tag == 'allow': - pass - elif subnode.tag == 'resource': - break - elif subnode.tag == 'permissions': - break - else: - raise MyError('Unexpected end tag: "{}" expected!'.format(subnode.tag)) - - def __str__(self): - allowstrs: List[str] = [] - for allow in self.allows: - allowstrs.append("{} {}".format(allow.permission, allow.group)) - return '|'.join(allowstrs) - - -def create_permission(con: Knora, permission: Permission) -> str: - """ - This function processes a Permission ans returns a Knora compatible permission string and - transforming/resolving all groupnames using the knora project information - - :param con: Knora instance - :param permission: Permission instance - :return: Knora compatible permission string with resolved group names - """ - allowstrs: List[str] = [] - for allow in permission.allows: - tmp = allow.group.split(':') - if len(tmp) > 1: - project_name = tmp[0] - group_name = tmp[1] - group_iri = con.get_group_by_pshortname_and_gname(project_name, group_name) - else: - group_iri= 'knora-admin:' + tmp[0] - allowstrs.append("{} {}".format(allow.permission, group_iri)) - return '|'.join(allowstrs) - -def do_sortorder(resources: List[KnoraResource]) -> List[KnoraResource]: - """ - Sort the list of resources such that resources that reference other resources are - added after the referenced resources. It will fail with an error if there are circular - references. - - :param resources: List of resources before sorting - :return: Sorted list of resources - """ - # - # here we sort the resources according to outgoing resptrs - # - ok_resources: [KnoraResource] = [] - notok_resources: [KnoraResource] = [] - ok_resids : [str] = [] - cnt = 0 - notok_len = 9999999 - while len(resources) > 0 and cnt < 10000: - for resource in resources: - resptrs = resource.get_resptrs() - if len(resptrs) == 0: - ok_resources.append(resource) - ok_resids.append(resource.unique_id) - else: - ok = True - for resptr in resptrs: - if resptr in ok_resids: - pass - else: - ok = False; - if ok: - ok_resources.append(resource) - ok_resids.append(resource.unique_id) - else: - notok_resources.append(resource) - resources = notok_resources - if not len(notok_resources) < notok_len: - print('Cannot resolve resptr dependencies. Giving up....') - print(len(notok_resources)) - for r in notok_resources: - print('Resource {} has unresolvable resptrs to: '.format(r.unique_id), end= ' ') - for x in r.get_resptrs(): - print(x, end=' ') - print('') - print('=============') - exit(5) - notok_len = len(notok_resources) - notok_resources = [] - cnt += 1 - print('{}. Ordering pass Finished!'.format(cnt)) - print('Remaining: {}'.format(len(resources))) - return ok_resources - -def program(args) -> None: - """ - This is the main program that starts everyting - - :param args: - :return: - """ - - # - # first we read the command line options - # - parser = argparse.ArgumentParser() - parser.add_argument("inproject", help="Shortname of project the data should be added to") - parser.add_argument("-s", "--server", type=str, default="http://0.0.0.0:3333", help="URL of the Knora server") - parser.add_argument("-S", "--sipi", type=str, default="http://0.0.0.0:1024", help="URL of SIPI server") - parser.add_argument("-u", "--user", type=str, default="root@example.com", help="Username for Knora") - parser.add_argument("-p", "--password", type=str, default="test", help="The password for login") - parser.add_argument("-F", "--folder", default="-", help="Input folder.") - parser.add_argument("-i", "--infile", default="-", help="Input file.") - parser.add_argument("-a", "--assets", default="-", help="Assets folder.") - parser.add_argument("-I", "--images", default="-", help="images folder.") - parser.add_argument("-V", "--validate", action='store_true', help="Do only validation of JSON, no upload of the ontology") - args = parser.parse_args(args) - - current_dir = os.path.dirname(os.path.realpath(__file__)) - - # - # prepare (create) local directories to store all information - # - if args.folder == '-': - folder = args.inproject + ".dir" - else: - folder = args.folder - - if args.assets == '-': - assets_path = os.path.join(folder, 'assets') - else: - assets_path = args.assets; - - if args.images == '-': - images_path = os.path.join(folder, 'images') - else: - images_path = args.images - - if args.infile == '-': - infile_path = os.path.join(folder, args.inproject) + '.xml' - else: - infile_path = args.infile - - xmlschema_doc = etree.parse(os.path.join(current_dir, 'knora-data-schema.xsd')) - xmlschema = etree.XMLSchema(xmlschema_doc) - doc = etree.parse(infile_path) - xmlschema.assertValid(doc) - - del xmlschema - del doc - del xmlschema_doc - - print("The imput data file is syntactically correct and passed validation!") - - if args.validate: - exit(0) - - # - # read the XML file containing the data, including project shortcode - # - context: etree.iterparse = etree.iterparse(infile_path, events=("start", "end")) - resources: List[KnoraResource] = [] - permissions: Dict[str,Permission] = {} - while True: - event, node = next(context) - if event == 'start': - if node.tag == 'knora': - ontology = node.attrib['ontology'] - shortcode = node.attrib['shortcode'] - elif event == 'start' and node.tag == 'resource': - resources.append(KnoraResource(context, node)) - elif event == 'start' and node.tag == 'permissions': - permission = Permission(context, node) - permissions[permission.id] = permission - elif event == 'end': - if node.tag == 'knora': - break; - - context = None # delete XML tree tto save memory - - # - # sort the resources so that resources which do not likt to others come first - # - resources = do_sortorder(resources) - - # - # connect to Knora - # - con = Knora(args.server) - con.login(args.user, args.password) - - sipi = Sipi(args.sipi, con.get_token()) - - graph = con.get_ontology_graph(shortcode, ontology) - schema = con.create_schema(shortcode, ontology) - - permissions_lookup: StrDict = {} - for p in permissions.items(): - permissions_lookup[p[0]] = create_permission(con, p[1]) - - resiri_lookup: StrDict = {} - - # cnt: int = 0 - - for resource in resources: - if resource.image is not None: - print('Uploading ' + resource.image + '...') - imgres = sipi.upload_image(resource.image) - print('Upload done: ' + imgres['uploadedFiles'][0]['internalFilename']) - fileref = imgres['uploadedFiles'][0]['internalFilename'] - print('Uploading data...') - resinfo = con.create_resource(schema=schema, - res_class=resource.restype, - label=resource.label, - values=resource.get_propvals(resiri_lookup, permissions_lookup), - permissions=permissions_lookup.get(resource.permissions), - stillimage=fileref) - else: - resinfo = con.create_resource(schema=schema, - res_class=resource.restype, - label=resource.label, - values=resource.get_propvals(resiri_lookup, permissions_lookup), - permissions=permissions_lookup.get(resource.permissions)) - resiri_lookup[resource.unique_id] = resinfo['iri'] - - -def main(): - program(sys.argv[1:]) - - -if __name__ == '__main__': - program(sys.argv[1:]) diff --git a/mkdocs.yml b/mkdocs.yml index 585cc66e5..f29d26ec4 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -1,10 +1,10 @@ -site_name: Knora-Py Documentation +site_name: dsp-tools Documentation nav: - - Introduction: index.md - - dsp-tools: dsp-tools.md + - dsp-tools: index.md - JSON data model format: dsp-tools-create.md - Bulk data import: dsp-tools-xmlupload.md + - Excel file processing: dsp-tools-excel.md theme: name: material diff --git a/requirements.txt b/requirements.txt index 41f6b7b41..6f242c8b0 100644 --- a/requirements.txt +++ b/requirements.txt @@ -10,4 +10,5 @@ validators requests jsonschema rfc3987 +openpyxl pystrict diff --git a/setup.py b/setup.py index b26f37722..98c7e6cf3 100644 --- a/setup.py +++ b/setup.py @@ -5,7 +5,7 @@ setuptools.setup( name='dsp-tools', - version='0.9.15', + version='1.0.0', description='A Python library and tools for the DaSCH Service Platform', long_description=long_description, long_description_content_type="text/markdown", @@ -29,7 +29,8 @@ 'jsonschema', 'click', 'rfc3987', - 'pystrict' + 'pystrict', + 'openpyxl' ], entry_points={ 'console_scripts': [ diff --git a/test/BUILD b/test/BUILD.bazel similarity index 74% rename from test/BUILD rename to test/BUILD.bazel index 04d56b23f..c241c6d78 100644 --- a/test/BUILD +++ b/test/BUILD.bazel @@ -4,6 +4,8 @@ load("@rules_python//python:defs.bzl", "py_binary", "py_library", "py_test") # make the dependencies from requirements.txt available load("@knora_py_deps//:requirements.bzl", "requirement") + + py_test( name = "test_connection", srcs = ["test_connection.py"], @@ -103,3 +105,37 @@ py_test( ], imports = [".", "../knora"], ) + +py_test( + name = "test_resource", + srcs = ["test_resource.py"], + deps = [ + "//knora/dsplib/models:connection", + "//knora/dsplib/models:resource", + "//knora/dsplib/models:group", + "//knora/dsplib/models:value", + "//knora/dsplib/models:permission", + "//knora/dsplib/models:sipi", + ], + data = [ + "//testdata:testdata", + "//testdata/bitstreams:bitstream" + ], + imports = [".", "../knora"], +) + +py_test( + name = "test_tools", + srcs = ["test_tools.py"], + deps = [ + "//knora/dsplib/utils:onto_get", + "//knora/dsplib/utils:onto_validate", + "//knora/dsplib/utils:onto_create_ontology", + "//knora/dsplib/utils:xml_upload", + ], + data = [ + "//testdata:testdata", + "//testdata/bitstreams:bitstream" + ], + imports = [".", "../knora"], +) diff --git a/test/lists.json b/test/lists.json deleted file mode 100644 index 2a42deb95..000000000 --- a/test/lists.json +++ /dev/null @@ -1,27 +0,0 @@ -{ - "options": { - "id": "http://rdfh.ch/lists/00FE/BMwIHgIPTDaYfB8jAwRrPg", - "nodes": [ - { - "opt1": { - "id": "http://rdfh.ch/lists/00FE/jNX7KxjTRNy1YY_QeKmhHg" - } - }, - { - "opt2": { - "id": "http://rdfh.ch/lists/00FE/Un_wPfKVTtKvmFMM5PwAwQ" - } - }, - { - "opt3": { - "id": "http://rdfh.ch/lists/00FE/VQ0Uh2qaQ2e4x0PoLNWrnQ" - } - }, - { - "opt4": { - "id": "http://rdfh.ch/lists/00FE/UfSBtwVuTEiuzYliMJ5KOw" - } - } - ] - } -} \ No newline at end of file diff --git a/test/test-onto.json b/test/test-onto.json deleted file mode 100644 index c5482f905..000000000 --- a/test/test-onto.json +++ /dev/null @@ -1,217 +0,0 @@ -{ - "prefixes": { - "foaf": "http://xmlns.com/foaf/0.1/", - "dcterms": "http://purl.org/dc/terms/" - }, - "project": { - "shortcode": "00FE", - "shortname": "knora-py-test", - "longname": "Test-ontology for knora-py", - "descriptions": { - "en": "A ontology for testing knora-py" - }, - "keywords": ["test", "knora-py"], - "lists": [ - { - "name": "options", - "labels": { - "en": "Options" - }, - "nodes": [ - { - "name": "opt1", - "labels": { - "en": "Opt 1" - } - }, - { - "name": "opt2", - "labels": { - "en": "Opt 2" - } - }, - { - "name": "opt3", - "labels": { - "en": "Opt 3" - } - }, - { - "name": "opt4", - "labels": { - "en": "Opt 4" - } - } - ] - } - ], - "groups": [ - { - "name": "MlsEditors", - "description": "MLS editorial team", - "selfjoin": false - } - ], - "users": [ - { - "username": "testuser", - "email": "testuser@test.org", - "givenName": "test", - "familyName": "user", - "password": "test", - "lang": "en", - "groups": ["ProjectAdmin", ":MlsEditors"] - } - ], - "ontology": { - "name": "kpt", - "label": "Test ontology for knora-py", - "resources": [ - { - "name": "MyObject", - "super": "Resource", - "labels": { - "en": "Object type 1" - }, - "properties": [ - { - "name": "mySimpleText", - "object": "TextValue", - "labels": { - "en": "Text-Property" - }, - "gui_element": "SimpleText", - "gui_attributes": ["size=64", "maxlength=128"], - "cardinality": "1-n" - }, - { - "name": "myRichText", - "object": "TextValue", - "labels": { - "en": "Richtext value" - }, - "gui_element": "Richtext", - "cardinality": "0-1" - }, - { - "name": "myColor", - "object": "ColorValue", - "labels": { - "en": "Color value" - }, - "gui_element": "Colorpicker", - "cardinality": "0-1" - }, - { - "name": "myDate", - "object": "DateValue", - "labels": { - "en": "Date value" - }, - "gui_element": "Date", - "cardinality": "1-n" - }, - { - "name": "myDecimal", - "object": "DecimalValue", - "labels": { - "en": "Decimal value" - }, - "gui_element": "SimpleText", - "gui_attributes": ["size=16", "maxlength=16"], - "cardinality": "0-1" - }, - { - "name": "myGeoname", - "object": "GeonameValue", - "labels": { - "en": "Geolocation" - }, - "gui_element": "Geonames", - "cardinality": "0-1" - }, - { - "name": "myList", - "object": "ListValue", - "labels": { - "en": "List value" - }, - "gui_element": "Pulldown", - "gui_attributes": ["hlist=options"], - "cardinality": "0-1" - }, - { - "name": "myInteger", - "object": "IntValue", - "labels": { - "en": "Integer value" - }, - "gui_element": "Spinbox", - "gui_attributes": ["min=0", "max=9"], - "cardinality": "0-1" - }, - { - "name": "myInterval", - "object": "IntervalValue", - "labels": { - "en": "Interval value" - }, - "gui_element": "SimpleText", - "gui_attributes": ["size=32", "maxlength=32"], - "cardinality": "0-1" - }, - { - "name": "myBoolean", - "object": "BooleanValue", - "labels": { - "en": "Boolean value" - }, - "gui_element": "Checkbox", - "cardinality": "0-1" - } - ] - }, - { - "name": "MyImage", - "super": "StillImageRepresentation", - "labels": { - "en": "Object type 2 (with image and link)" - }, - "properties": [ - { - "name": "myTitle", - "object": "TextValue", - "labels": { - "en": "Title" - }, - "gui_element": "SimpleText", - "gui_attributes": ["size=32", "maxlength=32"], - "cardinality": "1" - }, - { - "name": "myDescription", - "object": "TextValue", - "labels": { - "en": "Description", - "de": "Beschreibung" - }, - "gui_element": "Richtext", - "cardinality": "0-n" - }, - { - "name": "myLink", - "super": ["hasLinkTo"], - "object": ":MyObject", - "labels": { - "en": "Link to" - }, - "gui_element": "Searchbox", - "gui_attributes": ["numprops=1"], - "cardinality": "0-n" - } - ] - } - ] - } - } -} diff --git a/test/test.tif b/test/test.tif deleted file mode 100644 index 6ffeb6420..000000000 Binary files a/test/test.tif and /dev/null differ diff --git a/test/test_resource.py b/test/test_resource.py new file mode 100644 index 000000000..bbd94134e --- /dev/null +++ b/test/test_resource.py @@ -0,0 +1,78 @@ +import unittest + +from dsplib.models.connection import Connection +from dsplib.models.resource import ResourceInstanceFactory +from dsplib.models.value import BooleanValue, ColorValue, DateValue, DecimalValue, IntValue, IntervalValue, TextValue, \ + UriValue, KnoraStandoffXml, make_value +from dsplib.models.permission import PermissionValue, Permissions, PermissionsIterator +from dsplib.models.sipi import Sipi + +from pprint import pprint + +class TestResource(unittest.TestCase): + + def test_Resource_create(self): + # + # Connect to Knora + # + con = Connection('http://0.0.0.0:3333') + con.login('root@example.com', 'test') + + # + # Make class factory for project 'anything. The factory creates classes that implement the CRUD methods + # for the given resource classes, that is to create, read, update and delete instances (=resources) of the given classesd + # + factory = ResourceInstanceFactory(con, 'anything') + resclassnames = factory.get_resclass_names() + + # + # Get an python class of a BlueThing resource class + # + BlueThing = factory.get_resclass('anything:BlueThing') + + an_old_thing = BlueThing(con=con, iri="http://rdfh.ch/0001/H6gBWUuJSuuO-CilHV8kQw").read() + + a_blue_thing = BlueThing(con=con, + label='BlueThing', + values={ + 'anything:hasBoolean': True, + 'anything:hasColor': ['#ff0033', '#0077FF'], + 'anything:hasDate': make_value(value='1833', comment='not verified!'), + 'anything:hasDecimal': 3.14159, + 'anything:hasInteger': "42", + 'anything:hasTimeStamp': "2004-04-12T13:20:00Z", + 'anything:hasInterval': [make_value(value="0.0:3.0", comment="first interval"), + make_value(value="3.5:3.7", comment="second interval")], + 'anything:hasRichtext': KnoraStandoffXml("This is bold text."), + 'anything:hasText': "Dies ist ein einfacher Text", + 'anything:hasUri': 'http://gaga.com:65500/gugus' + }).create() + + + new_blue_thing = a_blue_thing.read() + self.assertEqual(a_blue_thing.label, "BlueThing") + self.assertEqual(a_blue_thing.value("anything:hasColor"), ['#ff0033', '#0077FF']) + self.assertEqual(a_blue_thing.value("anything:hasInteger"), 42) + self.assertEqual(a_blue_thing.value("anything:hasBoolean"), True) + self.assertEqual(a_blue_thing.value("anything:hasDecimal"), 3.14159) + self.assertEqual(a_blue_thing.value("anything:hasText"), "Dies ist ein einfacher Text") + + ThingPicture = factory.get_resclass('anything:ThingPicture') + sipi = Sipi('http://0.0.0.0:1024', con.get_token()) + img = sipi.upload_bitstream('testdata/bitstreams/TEMP11.TIF') + fileref = img['uploadedFiles'][0]['internalFilename'] + resperm = Permissions({PermissionValue.M: ["knora-admin:UnknownUser", "knora-admin:KnownUser"], + PermissionValue.CR: ["knora-admin:Creator", "knora-admin:ProjectAdmin"]}) + a_thing_picture = ThingPicture( + con=con, + label='ThingPicture', + bitstream=fileref, + permissions=resperm, + values={ + 'anything:hasPictureTitle': make_value(value="A Thing Picture named Lena", permissions=resperm) + } + ).create() + + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_tools.py b/test/test_tools.py new file mode 100644 index 000000000..4f9bdd9de --- /dev/null +++ b/test/test_tools.py @@ -0,0 +1,57 @@ +import unittest +import json + +from dsplib.utils.onto_get import get_ontology +from dsplib.utils.onto_get import get_ontology +from dsplib.utils.onto_validate import validate_ontology +from dsplib.utils.onto_create_ontology import create_ontology +from knora.dsplib.utils.xml_upload import xml_upload + + +class TestTools(unittest.TestCase): + + def test_get(self): + + with open('testdata/anything.json') as f: + jsonstr = f.read() + refobj = json.loads(jsonstr) + + get_ontology(projident="anything", + outfile="_anything.json", + server="http://0.0.0.0:3333", + user="root@example.com", + password="test", + verbose=True) + + with open('_anything.json') as f: + jsonstr = f.read() + jsonobj = json.loads(jsonstr) + + self.assertEqual(refobj["project"]["shortcode"], jsonobj["project"]["shortcode"]) + + def test_validate_onto(self): + validate_ontology('testdata/test-onto.json') + + def test_create_onto(self): + create_ontology(input_file='testdata/test-onto.json', + lists_file='lists-out.json', + server="http://0.0.0.0:3333", + user="root@example.com", + password="test", + verbose=True, + dump=True) + + def test_xmlupload(self): + xml_upload(input_file="testdata/test-data.xml", + server="http://0.0.0.0:3333", + user="root@example.com", + password="test", + imgdir="testdata/bitmaps", + sipi="http://0.0.0.0:1024", + verbose=True, + validate=True) + + + +if __name__ == '__main__': + unittest.main() diff --git a/testdata/BUILD.bazel b/testdata/BUILD.bazel new file mode 100644 index 000000000..75998a19a --- /dev/null +++ b/testdata/BUILD.bazel @@ -0,0 +1,17 @@ +# make the python rules available +#load("@rules_python//python:defs.bzl", "py_binary", "py_library") + +# make the dependencies from requirements.txt available +#load("@knora_py_deps//:requirements.bzl", "requirement") + +filegroup( + name = "testdata", + visibility = ["//visibility:public"], + srcs = [ + "anything.json", + "list-as-excel.xlsx", + "test-data.xml", + "test-onto.json", + ], +) + diff --git a/testdata/anything.json b/testdata/anything.json new file mode 100644 index 000000000..86adb721f --- /dev/null +++ b/testdata/anything.json @@ -0,0 +1,1005 @@ +{ + "prefixes": { + "anything": "http://0.0.0.0:3333/ontology/0001/anything/v2", + "minimal": "http://0.0.0.0:3333/ontology/0001/minimal/v2", + "something": "http://0.0.0.0:3333/ontology/0001/something/v2" + }, + "project": { + "shortcode": "0001", + "shortname": "anything", + "longname": "Anything Project", + "descriptions": "Anything Project", + "keywords": [ + "things", + "arbitrary test data" + ], + "lists": [ + { + "name": null, + "labels": { + "en": "Tree list root" + }, + "nodes": [ + { + "name": "Other Tree list node 01", + "labels": { + "en": "Other Tree list node 01" + } + }, + { + "name": "Other Tree list node 02", + "labels": { + "en": "Other Tree list node 02" + } + }, + { + "name": "Other Tree list node 03", + "labels": { + "en": "Other Tree list node 03" + }, + "nodes": [ + { + "name": "Other Tree list node 10", + "labels": { + "en": "Other Tree list node 10" + } + }, + { + "name": "Other Tree list node 11", + "labels": { + "en": "Other Tree list node 11" + } + } + ] + } + ] + }, + { + "name": "notUsedList", + "labels": { + "de": "unbenutzte Liste", + "en": "a list that is not used" + }, + "comment": { + "en": "a list that is not in used in ontology or data" + }, + "nodes": [ + { + "name": "node 1", + "labels": { + "en": "node 1" + }, + "nodes": [ + { + "name": "child of node 1", + "labels": { + "en": "child of node 1" + } + }, + { + "name": "List012", + "labels": { + "en": "List012" + } + }, + { + "name": "List013", + "labels": { + "en": "List013" + } + }, + { + "name": "List014", + "labels": { + "en": "List014" + } + }, + { + "name": "List015", + "labels": { + "en": "List015" + } + } + ] + }, + { + "name": "node 2", + "labels": { + "en": "node 2" + } + }, + { + "name": "node 3", + "labels": { + "en": "node 3" + }, + "nodes": [ + { + "name": "child of node 3", + "labels": { + "en": "child of node 3" + } + } + ] + } + ] + }, + { + "name": "treelistroot", + "labels": { + "de": "Listenwurzel", + "en": "Tree list root" + }, + "comment": { + "en": "Anything Tree List" + }, + "nodes": [ + { + "name": "Tree list node 01", + "labels": { + "en": "Tree list node 01" + } + }, + { + "name": "Tree list node 02", + "labels": { + "de": "Baumlistenknoten 02", + "en": "Tree list node 02" + } + }, + { + "name": "Tree list node 03", + "labels": { + "en": "Tree list node 03" + }, + "nodes": [ + { + "name": "Tree list node 10", + "labels": { + "en": "Tree list node 10" + } + }, + { + "name": "Tree list node 11", + "labels": { + "en": "Tree list node 11" + } + } + ] + } + ] + } + ], + "ontologies": [ + { + "name": "anything", + "label": "The anything ontology", + "properties": [ + { + "name": "hasBlueThing", + "super": [ + ":hasOtherThing" + ], + "object": ":BlueThing", + "labels": "A blue thing", + "gui_element": "Searchbox" + }, + { + "name": "hasBlueThingValue", + "super": [ + ":hasOtherThingValue" + ], + "object": "LinkValue", + "labels": "A blue thing" + }, + { + "name": "hasBoolean", + "super": [ + "hasValue" + ], + "object": "BooleanValue", + "labels": "Boolean value", + "gui_element": "Checkbox" + }, + { + "name": "hasColor", + "super": [ + "hasValue" + ], + "object": "ColorValue", + "labels": "Color", + "gui_element": "Colorpicker" + }, + { + "name": "hasDate", + "super": [ + "hasValue" + ], + "object": "DateValue", + "labels": "Date", + "gui_element": "Date" + }, + { + "name": "hasDecimal", + "super": [ + "hasValue" + ], + "object": "DecimalValue", + "labels": "Decimal number", + "gui_element": "SimpleText", + "gui_attributes": { + "maxlength": "255", + "size": 80 + } + }, + { + "name": "hasDocumentTitle", + "super": [ + "hasValue" + ], + "object": "TextValue", + "labels": "document title", + "gui_element": "SimpleText", + "gui_attributes": { + "maxlength": "255", + "size": 80 + } + }, + { + "name": "hasGeometry", + "super": [ + "hasValue" + ], + "object": "GeomValue", + "labels": "Geometry", + "gui_element": "Geometry" + }, + { + "name": "hasGeoname", + "super": [ + "hasValue" + ], + "object": "GeonameValue", + "labels": "Geoname", + "gui_element": "Geonames" + }, + { + "name": "hasInteger", + "super": [ + "hasValue" + ], + "object": "IntValue", + "labels": "Integer", + "gui_element": "Spinbox", + "gui_attributes": { + "max": -1.0, + "min": 0.0 + } + }, + { + "name": "hasInterval", + "super": [ + "hasValue" + ], + "object": "IntervalValue", + "labels": "Time interval", + "gui_element": "Interval" + }, + { + "name": "hasListItem", + "super": [ + "hasValue" + ], + "object": "ListValue", + "labels": "List element", + "gui_element": "List", + "gui_attributes": { + "hlist": "treelistroot" + } + }, + { + "name": "hasOtherListItem", + "super": [ + "hasValue" + ], + "object": "ListValue", + "labels": "Other list element", + "gui_element": "List", + "gui_attributes": { + "hlist": null + } + }, + { + "name": "hasOtherThing", + "super": [ + "hasLinkTo" + ], + "object": ":Thing", + "labels": "Another thing", + "gui_element": "Searchbox" + }, + { + "name": "hasPictureTitle", + "super": [ + "hasValue" + ], + "object": "TextValue", + "labels": "Title", + "gui_element": "SimpleText", + "gui_attributes": { + "maxlength": "255", + "size": 80 + } + }, + { + "name": "hasRichtext", + "super": [ + "hasValue" + ], + "object": "TextValue", + "labels": "Text", + "gui_element": "Richtext" + }, + { + "name": "hasText", + "super": [ + "hasValue" + ], + "object": "TextValue", + "labels": "Text", + "gui_element": "SimpleText", + "gui_attributes": { + "maxlength": "255", + "size": 80 + } + }, + { + "name": "hasThingDocument", + "super": [ + "hasRepresentation" + ], + "object": ":ThingDocument", + "labels": "document about a thing", + "gui_element": "Searchbox" + }, + { + "name": "hasThingDocumentValue", + "super": [ + "hasRepresentationValue" + ], + "object": "LinkValue", + "labels": "document about a thing", + "gui_element": "Searchbox" + }, + { + "name": "hasThingPicture", + "super": [ + "hasRepresentation" + ], + "object": ":ThingPicture", + "labels": "Picture of a thing", + "gui_element": "Searchbox" + }, + { + "name": "hasThingPictureValue", + "super": [ + "hasRepresentationValue" + ], + "object": "LinkValue", + "labels": "Picture of a thing", + "gui_element": "Searchbox" + }, + { + "name": "hasTimeStamp", + "super": [ + "hasValue" + ], + "object": "TimeValue", + "labels": "Timestamp", + "gui_element": "TimeStamp" + }, + { + "name": "hasUri", + "super": [ + "hasValue" + ], + "object": "UriValue", + "labels": "URI", + "gui_element": "SimpleText", + "gui_attributes": { + "maxlength": "255", + "size": 80 + } + }, + { + "name": "isPartOfOtherThing", + "super": [ + "isPartOf" + ], + "object": ":Thing", + "labels": "is part of", + "gui_element": "Searchbox" + }, + { + "name": "isPartOfOtherThingValue", + "super": [ + "isPartOfValue" + ], + "object": "LinkValue", + "labels": "is part of", + "gui_element": "Searchbox" + }, + { + "name": "thingHasRegion", + "super": [ + "hasLinkTo" + ], + "object": "Region", + "labels": "has region", + "gui_element": "Searchbox" + } + ], + "resources": [ + { + "name": "BlueThing", + "labels": "Blue thing", + "comments": "Diese Resource-Klasse beschreibt ein blaues Ding", + "super": ":Thing", + "cardinalities": [ + { + "propname": ":hasListItem", + "cardinality": "0-n", + "gui_order": 0 + }, + { + "propname": ":hasOtherListItem", + "cardinality": "0-n", + "gui_order": 0 + }, + { + "propname": ":hasRichtext", + "cardinality": "0-n", + "gui_order": 2 + }, + { + "propname": ":hasText", + "cardinality": "0-n", + "gui_order": 2 + }, + { + "propname": ":hasDate", + "cardinality": "0-n", + "gui_order": 3 + }, + { + "propname": ":hasInteger", + "cardinality": "0-n", + "gui_order": 4 + }, + { + "propname": ":hasDecimal", + "cardinality": "0-n", + "gui_order": 5 + }, + { + "propname": ":hasBoolean", + "cardinality": "0-1", + "gui_order": 6 + }, + { + "propname": ":hasUri", + "cardinality": "0-n", + "gui_order": 7 + }, + { + "propname": ":hasInterval", + "cardinality": "0-n", + "gui_order": 9 + }, + { + "propname": ":hasColor", + "cardinality": "0-n", + "gui_order": 10 + }, + { + "propname": ":hasGeometry", + "cardinality": "0-n", + "gui_order": 11 + }, + { + "propname": ":hasGeoname", + "cardinality": "0-n", + "gui_order": 12 + }, + { + "propname": ":hasThingDocument", + "cardinality": "0-n", + "gui_order": 13 + }, + { + "propname": ":hasThingDocumentValue", + "cardinality": "0-n", + "gui_order": 13 + }, + { + "propname": ":hasThingPicture", + "cardinality": "0-n", + "gui_order": 13 + }, + { + "propname": ":hasThingPictureValue", + "cardinality": "0-n", + "gui_order": 13 + }, + { + "propname": ":hasTimeStamp", + "cardinality": "0-n", + "gui_order": 13 + }, + { + "propname": ":isPartOfOtherThing", + "cardinality": "0-n", + "gui_order": 15 + }, + { + "propname": ":isPartOfOtherThingValue", + "cardinality": "0-n", + "gui_order": 15 + }, + { + "propname": ":hasBlueThingValue", + "cardinality": "0-n", + "gui_order": 16 + }, + { + "propname": ":hasBlueThing", + "cardinality": "0-n", + "gui_order": 63 + } + ] + }, + { + "name": "Thing", + "labels": "Thing", + "comments": "'The whole world is full of things, which means there's a real need for someone to go searching for them. And that's exactly what a thing-searcher does.' --Pippi Longstocking", + "super": "Resource", + "cardinalities": [ + { + "propname": ":hasListItem", + "cardinality": "0-n", + "gui_order": 0 + }, + { + "propname": ":hasOtherListItem", + "cardinality": "0-n", + "gui_order": 0 + }, + { + "propname": ":hasOtherThing", + "cardinality": "0-n", + "gui_order": 1 + }, + { + "propname": ":hasRichtext", + "cardinality": "0-n", + "gui_order": 2 + }, + { + "propname": ":hasText", + "cardinality": "0-n", + "gui_order": 2 + }, + { + "propname": ":hasDate", + "cardinality": "0-n", + "gui_order": 3 + }, + { + "propname": ":hasInteger", + "cardinality": "0-n", + "gui_order": 4 + }, + { + "propname": ":hasDecimal", + "cardinality": "0-n", + "gui_order": 5 + }, + { + "propname": ":hasBoolean", + "cardinality": "0-1", + "gui_order": 6 + }, + { + "propname": ":hasUri", + "cardinality": "0-n", + "gui_order": 7 + }, + { + "propname": ":hasInterval", + "cardinality": "0-n", + "gui_order": 9 + }, + { + "propname": ":hasColor", + "cardinality": "0-n", + "gui_order": 10 + }, + { + "propname": ":hasGeometry", + "cardinality": "0-n", + "gui_order": 11 + }, + { + "propname": ":hasGeoname", + "cardinality": "0-n", + "gui_order": 12 + }, + { + "propname": ":hasThingDocument", + "cardinality": "0-n", + "gui_order": 13 + }, + { + "propname": ":hasThingDocumentValue", + "cardinality": "0-n", + "gui_order": 13 + }, + { + "propname": ":hasThingPicture", + "cardinality": "0-n", + "gui_order": 13 + }, + { + "propname": ":hasThingPictureValue", + "cardinality": "0-n", + "gui_order": 13 + }, + { + "propname": ":hasTimeStamp", + "cardinality": "0-n", + "gui_order": 13 + }, + { + "propname": ":isPartOfOtherThing", + "cardinality": "0-n", + "gui_order": 15 + }, + { + "propname": ":isPartOfOtherThingValue", + "cardinality": "0-n", + "gui_order": 15 + } + ] + }, + { + "name": "ThingDocument", + "labels": "Document", + "comments": "A document about a thing", + "super": "DocumentRepresentation", + "cardinalities": [ + { + "propname": ":hasDocumentTitle", + "cardinality": "0-n" + } + ] + }, + { + "name": "ThingPicture", + "labels": "Picture of a thing", + "comments": "Diese Resource-Klasse beschreibt ein Bild eines Dinges", + "super": "StillImageRepresentation", + "cardinalities": [ + { + "propname": ":hasPictureTitle", + "cardinality": "0-n" + } + ] + }, + { + "name": "ThingWithRegion", + "labels": "Thing with region", + "comments": "A thing with a region", + "super": "Resource", + "cardinalities": [ + { + "propname": ":thingHasRegion", + "cardinality": "0-n" + } + ] + }, + { + "name": "ThingWithRepresentation", + "labels": "Thing with representation", + "comments": "A thing with a representation", + "super": "Resource", + "cardinalities": [] + }, + { + "name": "ThingWithSeqnum", + "labels": "Thing with sequence number", + "comments": "Diese Resource-Klasse beschreibt ein Ding mit einer Sequenznummer", + "super": ":Thing", + "cardinalities": [ + { + "propname": ":hasListItem", + "cardinality": "0-n", + "gui_order": 0 + }, + { + "propname": ":hasOtherListItem", + "cardinality": "0-n", + "gui_order": 0 + }, + { + "propname": ":hasOtherThing", + "cardinality": "0-n", + "gui_order": 1 + }, + { + "propname": ":hasRichtext", + "cardinality": "0-n", + "gui_order": 2 + }, + { + "propname": ":hasText", + "cardinality": "0-n", + "gui_order": 2 + }, + { + "propname": ":hasDate", + "cardinality": "0-n", + "gui_order": 3 + }, + { + "propname": ":hasInteger", + "cardinality": "0-n", + "gui_order": 4 + }, + { + "propname": ":hasDecimal", + "cardinality": "0-n", + "gui_order": 5 + }, + { + "propname": ":hasBoolean", + "cardinality": "0-1", + "gui_order": 6 + }, + { + "propname": ":hasUri", + "cardinality": "0-n", + "gui_order": 7 + }, + { + "propname": ":hasInterval", + "cardinality": "0-n", + "gui_order": 9 + }, + { + "propname": ":hasColor", + "cardinality": "0-n", + "gui_order": 10 + }, + { + "propname": ":hasGeometry", + "cardinality": "0-n", + "gui_order": 11 + }, + { + "propname": ":hasGeoname", + "cardinality": "0-n", + "gui_order": 12 + }, + { + "propname": ":hasThingDocument", + "cardinality": "0-n", + "gui_order": 13 + }, + { + "propname": ":hasThingDocumentValue", + "cardinality": "0-n", + "gui_order": 13 + }, + { + "propname": ":hasThingPicture", + "cardinality": "0-n", + "gui_order": 13 + }, + { + "propname": ":hasThingPictureValue", + "cardinality": "0-n", + "gui_order": 13 + }, + { + "propname": ":hasTimeStamp", + "cardinality": "0-n", + "gui_order": 13 + }, + { + "propname": ":isPartOfOtherThing", + "cardinality": "0-n", + "gui_order": 15 + }, + { + "propname": ":isPartOfOtherThingValue", + "cardinality": "0-n", + "gui_order": 15 + } + ] + }, + { + "name": "TrivialThing", + "labels": "Trivial thing", + "comments": "Diese Resource-Klasse beschreibt ein unbedeutendes Ding", + "super": "Resource", + "cardinalities": [] + } + ] + }, + { + "name": "minimal", + "label": "A minimal ontology", + "properties": [ + { + "name": "hasName", + "super": [ + "hasValue" + ], + "object": "TextValue", + "labels": "has name", + "gui_element": "SimpleText", + "gui_attributes": { + "maxlength": "255", + "size": 80 + } + } + ], + "resources": [] + }, + { + "name": "something", + "label": "The something ontology", + "properties": [ + { + "name": "hasOtherSomething", + "super": [ + "anything:hasOtherThing" + ], + "object": ":Something", + "labels": "has other something", + "gui_element": "Searchbox" + }, + { + "name": "hasOtherSomethingValue", + "super": [ + "anything:hasOtherThingValue" + ], + "object": "LinkValue", + "labels": "has other something", + "gui_element": "Searchbox" + } + ], + "resources": [ + { + "name": "Something", + "labels": "Something", + "comments": "A something is a thing.", + "super": "anything:Thing", + "cardinalities": [ + { + "propname": "anything:hasListItem", + "cardinality": "0-n", + "gui_order": 0 + }, + { + "propname": "anything:hasOtherListItem", + "cardinality": "0-n", + "gui_order": 0 + }, + { + "propname": ":hasOtherSomething", + "cardinality": "0-n", + "gui_order": 0 + }, + { + "propname": ":hasOtherSomethingValue", + "cardinality": "0-n", + "gui_order": 0 + }, + { + "propname": "anything:hasRichtext", + "cardinality": "0-n", + "gui_order": 2 + }, + { + "propname": "anything:hasText", + "cardinality": "0-n", + "gui_order": 2 + }, + { + "propname": "anything:hasDate", + "cardinality": "0-n", + "gui_order": 3 + }, + { + "propname": "anything:hasInteger", + "cardinality": "0-n", + "gui_order": 4 + }, + { + "propname": "anything:hasDecimal", + "cardinality": "0-n", + "gui_order": 5 + }, + { + "propname": "anything:hasBoolean", + "cardinality": "0-1", + "gui_order": 6 + }, + { + "propname": "anything:hasUri", + "cardinality": "0-n", + "gui_order": 7 + }, + { + "propname": "anything:hasInterval", + "cardinality": "0-n", + "gui_order": 9 + }, + { + "propname": "anything:hasColor", + "cardinality": "0-n", + "gui_order": 10 + }, + { + "propname": "anything:hasGeometry", + "cardinality": "0-n", + "gui_order": 11 + }, + { + "propname": "anything:hasGeoname", + "cardinality": "0-n", + "gui_order": 12 + }, + { + "propname": "anything:hasThingDocument", + "cardinality": "0-n", + "gui_order": 13 + }, + { + "propname": "anything:hasThingDocumentValue", + "cardinality": "0-n", + "gui_order": 13 + }, + { + "propname": "anything:hasThingPicture", + "cardinality": "0-n", + "gui_order": 13 + }, + { + "propname": "anything:hasThingPictureValue", + "cardinality": "0-n", + "gui_order": 13 + }, + { + "propname": "anything:hasTimeStamp", + "cardinality": "0-n", + "gui_order": 13 + }, + { + "propname": "anything:isPartOfOtherThing", + "cardinality": "0-n", + "gui_order": 15 + }, + { + "propname": "anything:isPartOfOtherThingValue", + "cardinality": "0-n", + "gui_order": 15 + } + ] + } + ] + } + ] + } +} \ No newline at end of file diff --git a/testdata/bitstreams/BUILD.bazel b/testdata/bitstreams/BUILD.bazel new file mode 100644 index 000000000..c2ef74bd4 --- /dev/null +++ b/testdata/bitstreams/BUILD.bazel @@ -0,0 +1,21 @@ +# make the python rules available +#load("@rules_python//python:defs.bzl", "py_binary", "py_library") + +# make the dependencies from requirements.txt available +#load("@knora_py_deps//:requirements.bzl", "requirement") + +filegroup( + name = "bitstream", + visibility = ["//visibility:public"], + srcs = [ + "clara.wav", + "TEMP11.TIF", + "TEMP12.TIF", + "TEMP13.TIF", + "TEMP14.TIF", + "TEMP15.TIF", + "test.csv", + "test.pdf", + "test.zip" + ] +) diff --git a/testdata/bitstreams/TEMP11.TIF b/testdata/bitstreams/TEMP11.TIF new file mode 100644 index 000000000..4a67177c7 Binary files /dev/null and b/testdata/bitstreams/TEMP11.TIF differ diff --git a/testdata/bitstreams/TEMP12.TIF b/testdata/bitstreams/TEMP12.TIF new file mode 100644 index 000000000..3c80d62b3 Binary files /dev/null and b/testdata/bitstreams/TEMP12.TIF differ diff --git a/testdata/bitstreams/TEMP13.TIF b/testdata/bitstreams/TEMP13.TIF new file mode 100644 index 000000000..b5cec3edd Binary files /dev/null and b/testdata/bitstreams/TEMP13.TIF differ diff --git a/testdata/bitstreams/TEMP14.TIF b/testdata/bitstreams/TEMP14.TIF new file mode 100644 index 000000000..f49cbf02c Binary files /dev/null and b/testdata/bitstreams/TEMP14.TIF differ diff --git a/testdata/bitstreams/TEMP15.TIF b/testdata/bitstreams/TEMP15.TIF new file mode 100644 index 000000000..cf31aef66 Binary files /dev/null and b/testdata/bitstreams/TEMP15.TIF differ diff --git a/knora/bitstreams/clara.wav b/testdata/bitstreams/clara.wav similarity index 100% rename from knora/bitstreams/clara.wav rename to testdata/bitstreams/clara.wav diff --git a/testdata/bitstreams/test.csv b/testdata/bitstreams/test.csv new file mode 100644 index 000000000..944a7221f --- /dev/null +++ b/testdata/bitstreams/test.csv @@ -0,0 +1 @@ +Performing arts;;; Performing arts;Music;; Performing arts;Music;Chamber music; Performing arts;Music;Church music; Performing arts;Music;Conducting; Performing arts;Music;Conducting;Choirs Performing arts;Music;Conducting;Orchestras Performing arts;Music;Music history; Performing arts;Music;Musictheory; Performing arts;Music;Musicology; Performing arts;Music;Jazz; Performing arts;Music;Pop/Rock/Blues; Dance;;; Dance;Choreography;; Theatre;;; Theatre;Acting;; Theatre;Directing;; Theatre;Playwriting;; Theatre;Scenography;; Movies/television;;; Movies/television;Animation;; Movies/television;Live action;; Visual arts;;; Visual arts;Fine Arts;; Visual arts;Fine Arts;Drawing; Visual arts;Fine Arts;Painting; Visual arts;Fine Arts;Photography; Visual arts;Applied arts;; Visual arts;Applied arts;Animation; Visual arts;Applied arts;Architecture; Visual arts;Applied arts;Decorative arts; History;;; History;Ancient history;; History;Modern history;; Languages and literature;;; Languages and literature;Linguistics;; Languages and literature;Linguistics;Grammer; Languages and literature;Linguistics;Etymology; Languages and literature;Linguistics;Phonetics; Languages and literature;Linguistics;Semantics; Languages and literature;Literature;; Languages and literature;Literature;Fiction; Languages and literature;Literature;Non-fiction; Languages and literature;Literature;Theory of literature; Philosophy;;; Philosophy;Aesthetics;; Philosophy;Applied philosophy;; Philosophy;Epistemology;; Philosophy;Epistemology;Justification; Philosophy;Epistemology;Reasoning; Philosophy;Metaphysics;; Philosophy;Metaphysics;Determinisn and free will; Philosophy;Metaphysics;Ontology; Philosophy;Metaphysics;Philosophy of mind; Philosophy;Metaphysics;Teleology; \ No newline at end of file diff --git a/testdata/bitstreams/test.pdf b/testdata/bitstreams/test.pdf new file mode 100644 index 000000000..94d947797 Binary files /dev/null and b/testdata/bitstreams/test.pdf differ diff --git a/knora/bitstreams/test.zip b/testdata/bitstreams/test.zip similarity index 100% rename from knora/bitstreams/test.zip rename to testdata/bitstreams/test.zip diff --git a/testdata/list-as-excel.xlsx b/testdata/list-as-excel.xlsx new file mode 100644 index 000000000..7d72c1a08 Binary files /dev/null and b/testdata/list-as-excel.xlsx differ diff --git a/knora/test-data.xml b/testdata/test-data.xml similarity index 99% rename from knora/test-data.xml rename to testdata/test-data.xml index e5dd55355..d5a683304 100644 --- a/knora/test-data.xml +++ b/testdata/test-data.xml @@ -186,6 +186,7 @@
+ diff --git a/knora/test-onto.json b/testdata/test-onto.json similarity index 98% rename from knora/test-onto.json rename to testdata/test-onto.json index 2bcbc9ad9..1d2dd0cea 100644 --- a/knora/test-onto.json +++ b/testdata/test-onto.json @@ -55,6 +55,16 @@ } } ] + }, + { + "name": "fromexcel", + "labels": { + "en": "Fromexcel" + }, + "nodes": { + "file": "testdata/list-as-excel.xlsx", + "worksheet": "Tabelle1" + } } ], "groups": [