├── .gitignore ├── .travis.yml ├── CHANGES.md ├── LICENSE ├── MANIFEST.in ├── README.rst ├── examples ├── README.md ├── asb-ubk-2.ttl ├── asb-ubk-2.xml ├── bk-54.65.ttl ├── bk-54.65.xml ├── ddc21en-003.3.ttl ├── ddc21en-003.3.xml ├── ddc21en-003.5.ttl ├── ddc21en-003.5.xml ├── ddc21en-003.52.ttl ├── ddc21en-003.52.xml ├── ddc21en-003.54.ttl ├── ddc21en-003.54.xml ├── ddc21en-003.56.ttl ├── ddc21en-003.56.xml ├── ddc21en-003.7.ttl ├── ddc21en-003.7.xml ├── ddc21en-003.71.ttl ├── ddc21en-003.71.xml ├── ddc21en-6--98.ttl ├── ddc21en-6--98.xml ├── ddc21en-6--982.ttl ├── ddc21en-6--982.xml ├── ddc21en-6--983.ttl ├── ddc21en-6--983.xml ├── ddc21en-6--9832.ttl ├── ddc21en-6--9832.xml ├── ddc21en-6--98323.ttl ├── ddc21en-6--98323.xml ├── ddc21en-6--98324.ttl ├── ddc21en-6--98324.xml ├── ddc21en-6--9835.ttl ├── ddc21en-6--9835.xml ├── ddc21en-6--9837.ttl ├── ddc21en-6--9837.xml ├── ddc21en-6--9838.ttl ├── ddc21en-6--9838.xml ├── ddc21en-6--98382.ttl ├── ddc21en-6--98382.xml ├── ddc21en-6--983829.ttl ├── ddc21en-6--983829.xml ├── ddc21en-6--9839.ttl ├── ddc21en-6--9839.xml ├── ddc21en-6--984.ttl ├── ddc21en-6--984.xml ├── ddc23de-001.ttl ├── ddc23de-001.xml ├── ddc23no-001.ttl ├── ddc23no-001.xml ├── ddc23no-002.0216.ttl ├── ddc23no-002.0216.xml ├── ddc23no-1--093-099.ttl ├── ddc23no-1--093-099.xml ├── ddc23no-539.60113.ttl ├── ddc23no-539.60113.xml ├── gnd-1020118989.ttl ├── gnd-1020118989.xml ├── humord-c28807.ttl ├── humord-c28807.xml ├── lcgft-gf2011026530.ttl ├── lcgft-gf2011026530.xml ├── lcsh-sh2009007258.ttl ├── lcsh-sh2009007258.xml ├── nalt-1396.ttl ├── nalt-1396.xml ├── noubojur-c000504.ttl ├── noubojur-c000504.xml ├── noubomn-c000011.ttl ├── noubomn-c000011.xml ├── rvk-gnd-mapping.ttl ├── rvk-gnd-mapping.xml ├── rvk.ttl ├── rvk.xml └── skosify.cfg ├── mc2skos ├── __init__.py ├── constants.py ├── element.py ├── error.py ├── jskos-context.json ├── mc2skos.py ├── reader.py ├── record.py ├── util.py ├── vocabularies.py └── vocabularies.yml ├── pytest.ini ├── setup.cfg ├── setup.py └── test ├── test_153.py ├── test_process_examples.py ├── test_process_record.py ├── test_skosify.py └── test_stringify.py /.gitignore: -------------------------------------------------------------------------------- 1 | # Byte-compiled / optimized / DLL files 2 | __pycache__/ 3 | *.py[cod] 4 | 5 | # C extensions 6 | *.so 7 | 8 | # Distribution / packaging 9 | .Python 10 | env/ 11 | bin/ 12 | build/ 13 | develop-eggs/ 14 | dist/ 15 | eggs/ 16 | .eggs/ 17 | lib/ 18 | lib64/ 19 | parts/ 20 | sdist/ 21 | var/ 22 | *.egg-info/ 23 | .installed.cfg 24 | *.egg 25 | 26 | # Installer logs 27 | pip-log.txt 28 | pip-delete-this-directory.txt 29 | 30 | # Unit test / coverage reports 31 | htmlcov/ 32 | .tox/ 33 | .coverage 34 | .cache 35 | nosetests.xml 36 | coverage.xml 37 | 38 | # Translations 39 | *.mo 40 | 41 | # Mr Developer 42 | .mr.developer.cfg 43 | .project 44 | .pydevproject 45 | 46 | # Rope 47 | .ropeproject 48 | 49 | # Django stuff: 50 | *.log 51 | *.pot 52 | 53 | # Sphinx documentation 54 | docs/_build/ 55 | 56 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | language: python 2 | dist: xenial 3 | python: 4 | - '2.7' 5 | - '3.6' 6 | - '3.7' 7 | - '3.8' 8 | 9 | install: 10 | - pip install -U pip setuptools # Fix for https://travis-ci.org/scriptotek/otsrdflib/jobs/152446727 11 | - python setup.py install 12 | - pip install Pygments collective.checkdocs 13 | 14 | script: 15 | - python setup.py test 16 | - python setup.py checkdocs 17 | 18 | after_success: 19 | - bash <(curl -s https://codecov.io/bash) 20 | 21 | deploy: 22 | provider: pypi 23 | user: danmichaelo 24 | password: 25 | secure: fGGL9Ha+JU+l7y/ftfJ/FgyX3c0foblfb8ZBQMmJ0Pl1oDswbXFUIXj8OuOSq2bqTrGgbpre+CAUGh1kAif1yY5icS/Ipu80CRt8IWUJlzqt8Z5qs6H3BjyjGYqxaq/6E5qZocvbBq65kSY8D9yJczSxq8T6EpGha801eULj70I= 26 | on: 27 | tags: true 28 | distributions: sdist bdist_wheel 29 | repo: scriptotek/mc2skos 30 | python: '3.6' 31 | -------------------------------------------------------------------------------- /CHANGES.md: -------------------------------------------------------------------------------- 1 | See for release history. 2 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | This is free and unencumbered software released into the public domain. 2 | 3 | Anyone is free to copy, modify, publish, use, compile, sell, or 4 | distribute this software, either in source code form or as a compiled 5 | binary, for any purpose, commercial or non-commercial, and by any 6 | means. 7 | 8 | In jurisdictions that recognize copyright laws, the author or authors 9 | of this software dedicate any and all copyright interest in the 10 | software to the public domain. We make this dedication for the benefit 11 | of the public at large and to the detriment of our heirs and 12 | successors. We intend this dedication to be an overt act of 13 | relinquishment in perpetuity of all present and future rights to this 14 | software under copyright law. 15 | 16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 17 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 18 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 19 | IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR 20 | OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, 21 | ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 22 | OTHER DEALINGS IN THE SOFTWARE. 23 | 24 | For more information, please refer to -------------------------------------------------------------------------------- /MANIFEST.in: -------------------------------------------------------------------------------- 1 | include mc2skos/jskos-context.json 2 | include mc2skos/vocabularies.yml 3 | -------------------------------------------------------------------------------- /examples/README.md: -------------------------------------------------------------------------------- 1 | The MARCXML files in this directory include examples given in appendix B of 2 | [MARC 21 Classification format specification](https://www.loc.gov/marc/classification/): 3 | 4 | * [class 003](https://www.loc.gov/marc/classification/examples.html#ddc003): `ddc21en-003.*.xml` 5 | * [table 6](https://www.loc.gov/marc/classification/examples.html#ddc6): `ddc21en-6--*.xml` 6 | 7 | Additional sample records have been added to test features not included in the official examples. 8 | 9 | * `ddc23de-*.xml`: German WebDewey 23rd edition 10 | * `ddc23no-*.xml`: Norwegian WebDewey 23rd edition 11 | * `bk-*.xml`: Basisklassifikation (BK) 12 | * `lcsh-*.xml`: [Library of Congress Subject Headings](http://id.loc.gov/) 13 | * `bk-*.xml`: [Basisklassifikation](http://uri.gbv.de) (BK) 14 | * `humord-*.xml: [Humord](http://data.ub.uio.no), `noubomn-*.xml: [Realfagstermer](http://data.ub.uio.no), `usvd-*.xml: [UBO index to Dewey](http://data.ub.uio.no) 15 | * `nalt-*.xml`: [NAL Thesaurus](https://agclass.nal.usda.gov/download.shtml) 16 | * ... 17 | 18 | For each MARCXML file there is a corresponding RDF/Turtle file with triples expected to be included 19 | when converting to SKOS. See `test/test_process_examples.py` for implementation. 20 | -------------------------------------------------------------------------------- /examples/asb-ubk-2.ttl: -------------------------------------------------------------------------------- 1 | @prefix dcterms: . 2 | @prefix owl: . 3 | @prefix rdf: . 4 | @prefix rdfs: . 5 | @prefix skos: . 6 | @prefix xml: . 7 | @prefix xsd: . 8 | 9 | a skos:Concept ; 10 | skos:altLabel "Astronomie / Atlas"@de, 11 | "Astronomie / Aufgabensammlung / Allgemeines"@de, 12 | "Astronomie / Bibliographie / Allgemeines"@de, 13 | "Astronomie / Formelsammlung / Allgemeines"@de, 14 | "Astronomie / Nachschlagewerk / Allgemeines"@de, 15 | "Astronomie / Tabellensammlung / Allgemeines"@de, 16 | "Weltraum / Atlas"@de ; 17 | skos:broader ; 18 | skos:editorialNote "Spezielle Nachschlagewerke und Bibliographien s. Ubk 5 bis Ubm 3"@de ; 19 | skos:inScheme ; 20 | skos:notation "Ubk 2" ; 21 | skos:prefLabel "Nachschlagewerke. Bibliographien"@de ; 22 | skos:scopeNote "Formel- und Tabellensammlungen"@de . 23 | 24 | -------------------------------------------------------------------------------- /examples/asb-ubk-2.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | *****nw###22*****n##4500 5 | 6 | DE-Rt5 7 | ger 8 | 9 | 10 | asb 11 | ger 12 | DE-Rt5 13 | 14 | 15 | Ubk 2 16 | Ubk 17 | Nachschlagewerke. Bibliographien 18 | 19 | 20 | Formel- und Tabellensammlungen 21 | 22 | 23 | Spezielle Nachschlagewerke und Bibliographien s. Ubk 5 bis Ubm 3 24 | 25 | 26 | Astronomie / Atlas 27 | 28 | 29 | Astronomie / Aufgabensammlung / Allgemeines 30 | 31 | 32 | Astronomie / Bibliographie / Allgemeines 33 | 34 | 35 | Astronomie / Formelsammlung / Allgemeines 36 | 37 | 38 | Astronomie / Nachschlagewerk / Allgemeines 39 | 40 | 41 | Astronomie / Tabellensammlung / Allgemeines 42 | 43 | 44 | Weltraum / Atlas 45 | 46 | 47 | 48 | -------------------------------------------------------------------------------- /examples/bk-54.65.ttl: -------------------------------------------------------------------------------- 1 | @prefix dcterms: . 2 | @prefix owl: . 3 | @prefix rdf: . 4 | @prefix rdfs: . 5 | @prefix skos: . 6 | @prefix xml: . 7 | @prefix xsd: . 8 | 9 | a skos:Concept ; 10 | dcterms:created "2004-12-17"^^xsd:date ; 11 | dcterms:identifier "475288998" ; 12 | dcterms:modified "2012-06-29"^^xsd:date ; 13 | skos:altLabel "Datenbankanbindung"@de, 14 | "Skriptsprachen"@de, 15 | "Web engineering"@de, 16 | "Webdesign"@de ; 17 | skos:broader ; 18 | skos:inScheme ; 19 | skos:notation "54.65" ; 20 | skos:prefLabel "Webentwicklung. Webanwendungen"@de ; 21 | skos:scopeNote "Gestaltung von Weboberflächen und Navigationsstrukturen, Entwurf und Programmierung internetbasierter Endnutzerdienste"@de . 22 | 23 | -------------------------------------------------------------------------------- /examples/bk-54.65.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 00515nw aa2200181n 4500 5 | 475288998 6 | DE-601 7 | 20120629220042.0 8 | 041217ananaana 9 | 10 | DE-601 11 | ger 12 | 13 | 14 | bkl 15 | ger 16 | DE-601 17 | 18 | 19 | 54.65 20 | 54 21 | Webentwicklung. Webanwendungen 22 | 23 | 24 | Gestaltung von Weboberflächen und Navigationsstrukturen, Entwurf und Programmierung internetbasierter Endnutzerdienste 25 | 26 | 27 | Webdesign 28 | 29 | 30 | Datenbankanbindung 31 | 32 | 33 | Skriptsprachen 34 | 35 | 36 | Web engineering 37 | 38 | 39 | 40 | -------------------------------------------------------------------------------- /examples/ddc21en-003.3.ttl: -------------------------------------------------------------------------------- 1 | @prefix dcterms: . 2 | @prefix owl: . 3 | @prefix rdf: . 4 | @prefix rdfs: . 5 | @prefix skos: . 6 | @prefix xml: . 7 | @prefix xsd: . 8 | 9 | a skos:Concept ; 10 | skos:editorialNote "0285 vs. 0113"@en, 11 | "For computer modeling and simulation applied to a specific subject, see the subject plus notation 0113 from Table 1, e.g., computer modeling in economics 330.0113"@en ; 12 | skos:historyNote "Computer modeling and simulation"@en ; 13 | skos:inScheme ; 14 | skos:notation "003.3" ; 15 | skos:prefLabel "Computer modeling and simulation"@en ; 16 | skos:scopeNote "Class here data processing and computer science applied to systems, computer implementation of mathematical models of systems, interdisciplinary works on computer modeling and simulation"@en . 17 | 18 | -------------------------------------------------------------------------------- /examples/ddc21en-003.3.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | *****nw###22*****n##4500 5 | 6 | ddc 7 | 21 8 | 9 | 10 | 003.3 11 | Generalities 12 | Systems 13 | Computer modeling and simulation 14 | 15 | 16 | For computer modeling and simulation applied to a specific subject, see the subject plus notation 17 | 1 18 | 0113 19 | from Table 1, e.g., computer modeling in economics 20 | 330.0113 21 | 22 | 23 | m 24 | 003.0285 25 | Generalities 26 | Systems 27 | Miscellany 28 | Auxiliary techniques and procedures; apparatus, equipment, materials 29 | Auxiliary techniques and procedures 30 | Data processing. Computer applications 31 | 32 | 33 | k 34 | 001.42 35 | Generalities 36 | Knowledge 37 | Research; statistical methods 38 | Research methods 39 | computer modeling and simulation 40 | 41 | 42 | k 43 | 004 44 | Generalities 45 | Data processing. Computer science 46 | computer modeling and simulation 47 | 48 | 49 | Class here data processing and computer science applied to systems, computer implementation of mathematical models of systems, interdisciplinary works on computer modeling and simulation 50 | 51 | 52 | 1 53 | 0285 54 | vs. 55 | 1 56 | 0113 57 | Data processing. Computer applications vs. [Computer modeling and simulation] 58 | 59 | 60 | Computer modeling and simulation 61 | 003 62 | 19890306 63 | 20 64 | 65 | 66 | Computer modeling 67 | 68 | 69 | Computer simulation 70 | 71 | 72 | Standard subdivisions are added for either or both topics in heading 73 | 74 | 75 | Add to base number 76 | 003.3 77 | the numbers following 78 | 00 79 | in 80 | 004 81 | 006, 82 | e.g., computer simulation languages 83 | 003.3513 84 | 85 | 86 | 003.3 87 | 003.3 88 | 00 89 | 513 90 | 003.3513 91 | 92 | 93 | 003 94 | 1 95 | 0 96 | 1 97 | 0285 98 | 003.0285 99 | 100 | 101 | 102 | -------------------------------------------------------------------------------- /examples/ddc21en-003.5.ttl: -------------------------------------------------------------------------------- 1 | @prefix dcterms: . 2 | @prefix owl: . 3 | @prefix rdf: . 4 | @prefix rdfs: . 5 | @prefix skos: . 6 | @prefix xml: . 7 | @prefix xsd: . 8 | 9 | a skos:Concept ; 10 | skos:editorialNote "003.5 vs. 629.8"@en, 11 | "Class interdisciplinary works on control of living and nonliving systems in 003.5 or with various specific kinds of systems in 003.7-003.8. Class automatic control of man-made physical systems in 629.8. If in doubt, prefer 003.5."@en, 12 | "For control and stability of systems in a specific subject, see the subject plus notation 0115 from Table 1, e.g., control and stability of systems in general engineering 620.00115"@en ; 13 | skos:historyNote "Cybernetics formerly located in"@en, 14 | "Theory of communication and control"@en ; 15 | skos:inScheme ; 16 | skos:notation "003.5" ; 17 | skos:prefLabel "Theory of communication and control"@en ; 18 | skos:scopeNote "Class here cybernetics, interdisciplinary works on the control and stability of systems"@en, 19 | "In living and nonliving systems"@en, 20 | "Including bionics"@en . 21 | 22 | -------------------------------------------------------------------------------- /examples/ddc21en-003.5.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | *****nw###22*****n##4500 5 | 6 | ddc 7 | 21 8 | 9 | 10 | For control and stability of systems in a specific subject, see the subject plus notation 11 | 1 12 | 0115 13 | from Table 1, e.g., control and stability of systems in general engineering 14 | 620.00115 15 | 16 | 17 | 003.5 18 | Generalities 19 | Systems 20 | Theory of communication and control 21 | 22 | 23 | kh 24 | 515.64 25 | Natural sciences and mathematics 26 | Mathematics 27 | Analysis 28 | Other analytic methods 29 | Calculus of variations 30 | interdisciplinary works on control theory 31 | 32 | 33 | kh 34 | 629.8312 35 | Technology (Applied sciences) 36 | Engineering and allied operations 37 | Other branches of engineering 38 | Automatic control engineering 39 | Closed-loop (Feedback) systems 40 | General principles 41 | Control theory 42 | interdisciplinary works on control theory 43 | 44 | 45 | In living and nonliving systems 46 | 47 | 48 | Including bionics 49 | 50 | 51 | Class here cybernetics, interdisciplinary works on the control and stability of systems 52 | 53 | 54 | 003.5 55 | vs. 56 | 629.8 57 | Theory of communication and control vs. Automatic control engineering 58 | 59 | 60 | Class interdisciplinary works on control of living and nonliving systems in 61 | 003.5 62 | or with various specific kinds of systems in 63 | 003.7 64 | 003.8. 65 | Class automatic control of man-made physical systems in 66 | 629.8. 67 | If in doubt, prefer 68 | 003.5. 69 | 70 | 71 | Theory of communication and control 72 | 003 73 | 19890306 74 | 20 75 | 76 | 77 | Cybernetics 78 | formerly located in 79 | 001.53 80 | 19890306 81 | 20 82 | 83 | 84 | Control theory 85 | 86 | 87 | Control theory 88 | systems 89 | 90 | 91 | Bionics 92 | 93 | 94 | Cybernetics 95 | 96 | 97 | Process control 98 | 99 | 100 | Systems control 101 | 102 | 103 | Systems stability 104 | 105 | 106 | 107 | *****nw###22*****n##4500 108 | 109 | 302.2 110 | Social sciences 111 | Specific topics in sociology and anthropology 112 | Social interaction 113 | Communication 114 | 115 | 116 | kh 117 | 003.5 118 | Generalities 119 | Systems 120 | Theory of communication and control 121 | social aspects of and interdisciplinary works on communication in systems 122 | 123 | 124 | 125 | *****nw###22*****n##4500 126 | 127 | 006.3 128 | Generalities 129 | Special computer methods 130 | Artificial intelligence 131 | 132 | 133 | jg 134 | 003.5 135 | Generalities 136 | Systems 137 | Theory of communication and control 138 | artificial intelligence 139 | 140 | 141 | 142 | -------------------------------------------------------------------------------- /examples/ddc21en-003.52.ttl: -------------------------------------------------------------------------------- 1 | @prefix dcterms: . 2 | @prefix owl: . 3 | @prefix rdf: . 4 | @prefix rdfs: . 5 | @prefix skos: . 6 | @prefix xml: . 7 | @prefix xsd: . 8 | 9 | a skos:Concept ; 10 | skos:historyNote "Perception theory formerly located in"@en ; 11 | skos:inScheme ; 12 | skos:notation "003.52" ; 13 | skos:prefLabel "Perception theory"@en . 14 | 15 | -------------------------------------------------------------------------------- /examples/ddc21en-003.52.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | *****nw###22*****n##4500 5 | 6 | ddc 7 | 21 8 | 9 | 10 | 003.52 11 | Generalities 12 | Systems 13 | Theory of communication and control 14 | Perception theory 15 | 16 | 17 | Perception theory 18 | formerly located in 19 | 001.534 20 | 19890306 21 | 20 22 | 23 | 24 | Perception theory 25 | 26 | 27 | 28 | *****nw###22*****n##4500 29 | 30 | 006.37 31 | Generalities 32 | Special computer methods 33 | Artificial intelligence 34 | Computer vision 35 | 36 | 37 | k 38 | 003.52 39 | Generalities 40 | Systems 41 | Theory of communication and control 42 | Perception theory 43 | computer vision 44 | 45 | 46 | 47 | *****nw###22*****n##4500 48 | 49 | 153.7 50 | Philosophy, paranormal phenomena, psychology 51 | Psychology 52 | Specific topics in psychology 53 | Conscious mental processes and intelligence 54 | Perceptual processes 55 | 56 | 57 | k 58 | 003.52 59 | Generalities 60 | Systems 61 | Theory of communication and control 62 | Perception theory 63 | psychology of human perception 64 | 65 | 66 | 67 | *****nw###22*****n##4500 68 | 69 | 573.87 70 | Natural sciences and mathematics 71 | Life sciences 72 | Life sciences. Biology 73 | Internal biological processes and structures 74 | Specific physiological systems in animals, regional histology and physiology 75 | Nervous and sensory systems 76 | Sense organs 77 | 78 | 79 | k 80 | 003.52 81 | Generalities 82 | Systems 83 | Theory of communication and control 84 | Perception theory 85 | perception in animals 86 | 87 | 88 | 89 | *****nw###22*****n##4500 90 | 91 | 006.4 92 | Generalities 93 | Special computer methods 94 | Computer pattern recognition 95 | 96 | 97 | l 98 | 003.52 99 | Generalities 100 | Systems 101 | Theory of communication and control 102 | Perception theory 103 | computer pattern recognition 104 | 105 | 106 | 107 | -------------------------------------------------------------------------------- /examples/ddc21en-003.54.ttl: -------------------------------------------------------------------------------- 1 | @prefix dcterms: . 2 | @prefix owl: . 3 | @prefix rdf: . 4 | @prefix rdfs: . 5 | @prefix skos: . 6 | @prefix xml: . 7 | @prefix xsd: . 8 | 9 | a skos:Concept ; 10 | skos:editorialNote "Class information theory in communications engineering in 621.3822, without using notation 01154 from Table 1"@en, 11 | "Class information theory in communications engineering of a specific kind of communications with the kind, without using notation 01154 from Table 1, e.g., radio 621.384; class information theory in any other specific subject with the subject, plus notation 01154 from Table 1, e.g., information theory in economics 330.01154"@en ; 12 | skos:historyNote "Coding theory formerly located in"@en, 13 | "Information theory formerly located in"@en ; 14 | skos:inScheme ; 15 | skos:notation "003.54" ; 16 | skos:prefLabel "Information theory"@en ; 17 | skos:scopeNote "Class here coding theory"@en, 18 | "Theory concerning measurement of quantities of information; accuracy in transmission of messages subject to noise (unwanted, usually random, signals), distortion, and transmission failure; and methods of coding for efficient, accurate transmission"@en . 19 | 20 | -------------------------------------------------------------------------------- /examples/ddc21en-003.54.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | *****nw###22*****n##4500 5 | 6 | ddc 7 | 21 8 | 9 | 10 | 003.54 11 | Generalities 12 | Systems 13 | Theory of communication and control 14 | Information theory 15 | 16 | 17 | Class information theory in communications engineering in 18 | 621.3822, 19 | without using notation 20 | 1 21 | 01154 22 | from Table 1 23 | 24 | 25 | Class information theory in communications engineering of a specific kind of communications with the kind, without using notation 26 | 1 27 | 01154 28 | from Table 1, e.g., radio 29 | 621.384; 30 | class information theory in any other specific subject with the subject, plus notation 31 | 1 32 | 01154 33 | from Table 1, e.g., information theory in economics 34 | 330.01154 35 | 36 | 37 | l 38 | 020 39 | Generalities 40 | Library and information sciences 41 | information theory 42 | 43 | 44 | l 45 | 302.2 46 | Social sciences 47 | Specific topics in sociology and anthropology 48 | Social interaction 49 | Communication 50 | information theory 51 | 52 | 53 | l 54 | 621.3822 55 | Technology (Applied sciences) 56 | Engineering and allied operations 57 | Applied physics 58 | Electrical engineering; lighting; superconductivity; magnetic engineering; applied optics; paraphotic technology; electronics; communications engineering; computers 59 | Electronics, communications engineering 60 | Communications engineering 61 | Signal processing 62 | interdisciplinary works on information theory 63 | 64 | 65 | Theory concerning measurement of quantities of information; accuracy in transmission of messages subject to noise (unwanted, usually random, signals), distortion, and transmission failure; and methods of coding for efficient, accurate transmission 66 | 67 | 68 | Class here coding theory 69 | 70 | 71 | Information theory 72 | formerly located in 73 | 001.539 74 | 19890306 75 | 20 76 | 77 | 78 | Coding theory 79 | formerly located in 80 | 519.4 81 | 19890306 82 | 20 83 | 84 | 85 | Coding theory 86 | 87 | 88 | Information theory 89 | 90 | 91 | Signal theory 92 | 93 | 94 | Signal theory 95 | systems 96 | 97 | 98 | 1 99 | 011 100 | 1 101 | 011 102 | 003 103 | 54 104 | 1 105 | 01154 106 | 107 | 108 | 330 109 | 1 110 | 0 111 | 1 112 | 011 113 | 330.01154 114 | 115 | 116 | 330.011 117 | 1 118 | 011 119 | 003 120 | 54 121 | 330.01154 122 | 123 | 124 | 125 | -------------------------------------------------------------------------------- /examples/ddc21en-003.56.ttl: -------------------------------------------------------------------------------- 1 | @prefix dcterms: . 2 | @prefix owl: . 3 | @prefix rdf: . 4 | @prefix rdfs: . 5 | @prefix skos: . 6 | @prefix xml: . 7 | @prefix xsd: . 8 | 9 | a skos:Concept ; 10 | skos:historyNote "Decision theory"@en ; 11 | skos:inScheme ; 12 | skos:notation "003.56" ; 13 | skos:prefLabel "Decision theory"@en . 14 | 15 | -------------------------------------------------------------------------------- /examples/ddc21en-003.56.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | *****nw###22*****n##4500 5 | 6 | ddc 7 | 21 8 | 9 | 10 | 003.56 11 | Generalities 12 | Systems 13 | Theory of communication and control 14 | Decision theory 15 | 16 | 17 | Decision theory 18 | 003 19 | 19890306 20 | 20 21 | 22 | 23 | Decision theory 24 | 25 | 26 | 27 | *****nw###22*****n##4500 28 | 29 | 153.83 30 | Philosophy, paranormal phenomena, psychology 31 | Psychology 32 | Specific topics in psychology 33 | Conscious mental processes and intelligence 34 | Will (Volition) 35 | Choice and decision 36 | 37 | 38 | 39 | *****nw###22*****n##4500 40 | 41 | 511.65 42 | Natural sciences and mathematics 43 | Mathematics 44 | General principles of mathematics 45 | Combinatorial analysis 46 | Choice 47 | 48 | 49 | l 50 | 003.56 51 | Generalities 52 | Systems 53 | Theory of communication and control 54 | Decision theory 55 | decision theory in combinatorial analysis 56 | 57 | 58 | 59 | *****nw###22*****n##4500 60 | 61 | 658.40301 62 | Technology (Applied sciences) 63 | Management and auxiliary services 64 | General management 65 | Executive management 66 | Specific executive management activities 67 | Decision making and information management 68 | Philosophy and theory of decision making 69 | 70 | 71 | l 72 | 003.56 73 | Generalities 74 | Systems 75 | Theory of communication and control 76 | Decision theory 77 | decision theory in management 78 | 79 | 80 | 81 | -------------------------------------------------------------------------------- /examples/ddc21en-003.7.ttl: -------------------------------------------------------------------------------- 1 | @prefix dcterms: . 2 | @prefix owl: . 3 | @prefix rdf: . 4 | @prefix rdfs: . 5 | @prefix skos: . 6 | @prefix xml: . 7 | @prefix xsd: . 8 | 9 | a skos:Concept ; 10 | skos:editorialNote "003.7"@en, 11 | "Many kinds of systems are defined in terms of the equations used to model them, e.g., distributed-parameter systems are defined as systems governed by partial differential equations. Other equations may be used to model the behavior of the same real-world system. Class a work about a specific kind of system according to the way the work describes the system, e.g., a work that discusses applying the mathematics of stochastic (random) processes to systems 003.76."@en ; 12 | skos:historyNote "Kinds of systems"@en, 13 | "Self-organizing systems formerly located in"@en ; 14 | skos:inScheme ; 15 | skos:notation "003.7" ; 16 | skos:prefLabel "Kinds of systems"@en ; 17 | skos:scopeNote "Including deterministic, hierarchical, lumped-parameter, self-organizing, small-scale systems"@en . 18 | 19 | -------------------------------------------------------------------------------- /examples/ddc21en-003.7.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | *****nw###22*****n##4500 5 | 6 | ddc 7 | 21 8 | 9 | 10 | 003.7 11 | Generalities 12 | Systems 13 | Kinds of systems 14 | 15 | 16 | Including deterministic, hierarchical, lumped-parameter, self-organizing, small-scale systems 17 | 18 | 19 | 003.7 20 | Kinds of systems 21 | 22 | 23 | Many kinds of systems are defined in terms of the equations used to model them, e.g., distributed-parameter systems are defined as systems governed by partial differential equations. Other equations may be used to model the behavior of the same real-world system. Class a work about a specific kind of system according to the way the work describes the system, e.g., a work that discusses applying the mathematics of stochastic (random) processes to systems 24 | 003.76. 25 | 26 | 27 | Kinds of systems 28 | 003 29 | 19890306 30 | 20 31 | 32 | 33 | Self-organizing systems 34 | formerly located in 35 | 001.533 36 | 19890306 37 | 20 38 | 39 | 40 | Systems 41 | 42 | 43 | Deterministic systems 44 | 45 | 46 | Hierarchical systems 47 | 48 | 49 | Lumped-parameter systems 50 | 51 | 52 | Self-organizing systems 53 | 54 | 55 | Small-scale systems 56 | 57 | 58 | 59 | *****nw###22*****n##4500 60 | 61 | 003.8 62 | Generalities 63 | Systems 64 | Systems distinguished in relation to time 65 | 66 | 67 | jg 68 | 003.7 69 | Generalities 70 | Systems 71 | Kinds of systems 72 | systems distinguished in relation to time 73 | 74 | 75 | 76 | -------------------------------------------------------------------------------- /examples/ddc21en-003.71.ttl: -------------------------------------------------------------------------------- 1 | @prefix dcterms: . 2 | @prefix owl: . 3 | @prefix rdf: . 4 | @prefix rdfs: . 5 | @prefix skos: . 6 | @prefix xml: . 7 | @prefix xsd: . 8 | 9 | a skos:Concept ; 10 | skos:historyNote "Large-scale systems"@en ; 11 | skos:inScheme ; 12 | skos:notation "003.71" ; 13 | skos:prefLabel "Large-scale systems"@en ; 14 | skos:scopeNote "Limited to works emphasizing that the systems are large"@en . 15 | 16 | -------------------------------------------------------------------------------- /examples/ddc21en-003.71.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | *****nw###22*****n##4500 5 | 6 | ddc 7 | 21 8 | 9 | 10 | 003.71 11 | Generalities 12 | Systems 13 | Kinds of systems 14 | Large-scale systems 15 | 16 | 17 | Limited to works emphasizing that the systems are large 18 | 19 | 20 | Large-scale systems 21 | 003 22 | 19890306 23 | 20 24 | 25 | 26 | Large-scale systems 27 | 28 | 29 | 30 | -------------------------------------------------------------------------------- /examples/ddc21en-6--98.ttl: -------------------------------------------------------------------------------- 1 | @prefix dcterms: . 2 | @prefix owl: . 3 | @prefix rdf: . 4 | @prefix rdfs: . 5 | @prefix skos: . 6 | @prefix xml: . 7 | @prefix xsd: . 8 | 9 | a skos:Concept ; 10 | skos:inScheme , 11 | ; 12 | skos:notation "T6--98" ; 13 | skos:prefLabel "South American native languages"@en ; 14 | skos:scopeNote "Including Araucanian, Cahuapanan, Mataco-Guaicuru, Tacanan, Uru-Chipaya, Witotoan, Yanomam languages; Hixkaryana, Warao, Yaruro"@en . 15 | 16 | -------------------------------------------------------------------------------- /examples/ddc21en-6--982.ttl: -------------------------------------------------------------------------------- 1 | @prefix dcterms: . 2 | @prefix owl: . 3 | @prefix rdf: . 4 | @prefix rdfs: . 5 | @prefix skos: . 6 | @prefix xml: . 7 | @prefix xsd: . 8 | 9 | a skos:Concept ; 10 | skos:inScheme , 11 | ; 12 | skos:notation "T6--982" ; 13 | skos:prefLabel "Chibchan and Paezan languages"@en . 14 | 15 | -------------------------------------------------------------------------------- /examples/ddc21en-6--982.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | *****nw###22*****n##4500 5 | 6 | ddc 7 | 21 8 | 9 | 10 | 6 11 | 982 12 | Languages 13 | Other languages 14 | South American native languages 15 | Chibchan and Paezan languages 16 | 17 | 18 | j 19 | 6 20 | 978 21 | Languages 22 | Other languages 23 | North American native languages 24 | Chibchan languages of North America, Misumalpan languages 25 | comprehensive works on Chibchan language 26 | 27 | 28 | Cayapa language 29 | 30 | 31 | Chachi language 32 | 33 | 34 | Chibchan languages 35 | 36 | 37 | Coconuco language 38 | 39 | 40 | Cuna language 41 | 42 | 43 | Guambiano language 44 | 45 | 46 | Kuna language 47 | 48 | 49 | Moguex language 50 | 51 | 52 | Paez language 53 | 54 | 55 | Paezan languages 56 | 57 | 58 | 59 | *****nw###22*****n##4500 60 | 61 | 6 62 | 978 63 | Languages 64 | Other languages 65 | North American native languages 66 | Chibchan languages of North American, Misumalpan languages 67 | 68 | 69 | jh 70 | 6 71 | 982 72 | Languages 73 | Other languages 74 | South American native languages 75 | Chibchan and Paezan languages 76 | Chibchan languages of North American 77 | 78 | 79 | 80 | *****nw###22*****n##4500 81 | 82 | 6 83 | 98 84 | Languages 85 | Other languages 86 | South American native languages 87 | 88 | 89 | j 90 | 6 91 | 982 92 | Languages 93 | Other languages 94 | South American native languages 95 | Chibchan and Paezan languages 96 | Yanomam languages, Warao 97 | 98 | 99 | 100 | -------------------------------------------------------------------------------- /examples/ddc21en-6--983.ttl: -------------------------------------------------------------------------------- 1 | @prefix dcterms: . 2 | @prefix owl: . 3 | @prefix rdf: . 4 | @prefix rdfs: . 5 | @prefix skos: . 6 | @prefix xml: . 7 | @prefix xsd: . 8 | 9 | a skos:Concept ; 10 | skos:historyNote "Use of this number for Yaruro discontinued; class in 98"@en ; 11 | skos:inScheme , 12 | ; 13 | skos:notation "T6--983" ; 14 | skos:prefLabel "Quechuan (Kechuan), Aymaran, Tucanoan, Tupí, Arawakan languages"@en ; 15 | skos:scopeNote "Former heading: Andean-Equatorial languages"@en . 16 | 17 | -------------------------------------------------------------------------------- /examples/ddc21en-6--983.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | *****nw###22*****n##4500 5 | 6 | ddc 7 | 21 8 | 9 | 10 | 6 11 | 983 12 | Languages 13 | Other languages 14 | South American native languages 15 | Quechuan (Kechuan), Aymaran, Tucanoan, Tupí, Arawakan languages 16 | 17 | 18 | Former heading: Andean-Equatorial languages 19 | 20 | 21 | Use of this number for 22 | Yaruro 23 | discontinued; class in 24 | 6 25 | 98 26 | 19960930 27 | 21 28 | 29 | 30 | 6 31 | 98 32 | Languages 33 | Other Languages 34 | South American native languages 35 | 36 | 37 | anaa 38 | 6 39 | 983 40 | Languages 41 | Other languages 42 | South American native languages 43 | Quechuan (Kechuan), Aymaran, Tucanoan, Tupí, Arawakan languages 44 | Yaruro 45 | 46 | 47 | 48 | -------------------------------------------------------------------------------- /examples/ddc21en-6--9832.ttl: -------------------------------------------------------------------------------- 1 | @prefix dcterms: . 2 | @prefix owl: . 3 | @prefix rdf: . 4 | @prefix rdfs: . 5 | @prefix skos: . 6 | @prefix xml: . 7 | @prefix xsd: . 8 | 9 | a skos:Concept ; 10 | skos:inScheme , 11 | ; 12 | skos:notation "T6--9832" ; 13 | skos:prefLabel "Quechuan (Kechuan) and Aymaran languages"@en ; 14 | skos:scopeNote "Former heading: Andean languages"@en . 15 | 16 | -------------------------------------------------------------------------------- /examples/ddc21en-6--9832.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | *****nw###22*****n##4500 5 | 6 | ddc 7 | 21 8 | 9 | 10 | 6 11 | 9832 12 | Languages 13 | Other languages 14 | South American native languages 15 | Quechuan (Kechuan), Aymaran, Tucanoan, Tupí, Arawakan languages 16 | Quechuan (Kechuan) and Aymaran languages 17 | 18 | 19 | Former heading: Andean languages 20 | 21 | 22 | Andean languages 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /examples/ddc21en-6--98323.ttl: -------------------------------------------------------------------------------- 1 | @prefix dcterms: . 2 | @prefix owl: . 3 | @prefix rdf: . 4 | @prefix rdfs: . 5 | @prefix skos: . 6 | @prefix xml: . 7 | @prefix xsd: . 8 | 9 | a skos:Concept ; 10 | skos:historyNote "Aymaran languages relocated to 98324"@en ; 11 | skos:inScheme , 12 | ; 13 | skos:notation "T6--98323" ; 14 | skos:prefLabel "Quechuan (Kechuan) languages. Quechua (Kechua)"@en . 15 | 16 | -------------------------------------------------------------------------------- /examples/ddc21en-6--98323.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | *****nw###22*****n##4500 5 | 6 | ddc 7 | 21 8 | 9 | 10 | 6 11 | 98323 12 | Languages 13 | Other languages 14 | South American native languages 15 | Quechuan (Kechuan), Aymaran, Tucanoan, Tupí, Arawakan languages 16 | Quechuan (Kechuan) and Aymaran languages 17 | Quechuan (Kechuan) languages. Quechua (Kechua) 18 | 19 | 20 | Aymaran languages 21 | relocated to 22 | 6 23 | 98324 24 | 19960930 25 | 21 26 | 27 | 28 | Kechua language 29 | 30 | 31 | Kechuan languages 32 | 33 | 34 | Quechua language 35 | 36 | 37 | Quechuan languages 38 | 39 | 40 | 41 | -------------------------------------------------------------------------------- /examples/ddc21en-6--98324.ttl: -------------------------------------------------------------------------------- 1 | @prefix dcterms: . 2 | @prefix owl: . 3 | @prefix rdf: . 4 | @prefix rdfs: . 5 | @prefix skos: . 6 | @prefix xml: . 7 | @prefix xsd: . 8 | 9 | a skos:Concept ; 10 | skos:historyNote "Aymaran languages formerly 98323"@en ; 11 | skos:inScheme , 12 | ; 13 | skos:notation "T6--98324" ; 14 | skos:prefLabel "Aymaran languages. Aymara"@en . 15 | 16 | -------------------------------------------------------------------------------- /examples/ddc21en-6--98324.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | *****nw###22*****n##4500 5 | 6 | ddc 7 | 21 8 | 9 | 10 | 6 11 | 98324 12 | Languages 13 | Other languages 14 | South American native languages 15 | Quechuan (Kechuan), Aymaran, Tucanoan, Tupí, Arawakan languages 16 | Quechuan (Kechuan) and Aymaran languages 17 | Aymaran languages. Aymara 18 | 19 | 20 | 6 21 | 98323 22 | Languages 23 | Other languages 24 | South American native languages 25 | Quechuan (Kechuan), Aymaran, Tucanoan, Tupí, Arawakan languages 26 | Quechuan (Kechuan) and Aymaran languages 27 | Quechuan (Kechuan) languages. Quechua (Kechua) 28 | Aymaran languages. Aymara 29 | 30 | 31 | Aymaran languages 32 | formerly 33 | 6 34 | 98323 35 | 19960930 36 | 21 37 | 38 | 39 | Aymara language 40 | 41 | 42 | Aymaran languages 43 | 44 | 45 | 46 | -------------------------------------------------------------------------------- /examples/ddc21en-6--9835.ttl: -------------------------------------------------------------------------------- 1 | @prefix dcterms: . 2 | @prefix owl: . 3 | @prefix rdf: . 4 | @prefix rdfs: . 5 | @prefix skos: . 6 | @prefix xml: . 7 | @prefix xsd: . 8 | 9 | a skos:Concept ; 10 | skos:historyNote "expanded from"@en ; 11 | skos:inScheme , 12 | ; 13 | skos:notation "T6--9835" ; 14 | skos:prefLabel "Tucanoan languages"@en ; 15 | skos:scopeNote "Including Tucano"@en . 16 | 17 | -------------------------------------------------------------------------------- /examples/ddc21en-6--9835.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | *****nw###22*****n##4500 5 | 6 | ddc 7 | 21 8 | 9 | 10 | 6 11 | 9835 12 | Languages 13 | Other languages 14 | South American native languages 15 | Quechuan (Kechuan), Aymaran, Tucanoan, Tupí, Arawakan languages 16 | Tucanoan languages 17 | 18 | 19 | Including Tucano 20 | 21 | 22 | expanded from 23 | 6 24 | 983 25 | 19960930 26 | 21 27 | 28 | 29 | Tucano language 30 | 31 | 32 | Tucanoan languages 33 | 34 | 35 | Tukano language 36 | 37 | 38 | Tukanoan languages 39 | 40 | 41 | Yahuna language 42 | 43 | 44 | 45 | -------------------------------------------------------------------------------- /examples/ddc21en-6--9837.ttl: -------------------------------------------------------------------------------- 1 | @prefix dcterms: . 2 | @prefix owl: . 3 | @prefix rdf: . 4 | @prefix rdfs: . 5 | @prefix skos: . 6 | @prefix xml: . 7 | @prefix xsd: . 8 | 9 | a skos:Concept ; 10 | skos:historyNote "expanded from"@en ; 11 | skos:inScheme , 12 | ; 13 | skos:notation "T6--9837" ; 14 | skos:prefLabel "Jivaroan languages"@en . 15 | 16 | -------------------------------------------------------------------------------- /examples/ddc21en-6--9837.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | *****nw###22*****n##4500 5 | 6 | ddc 7 | 21 8 | 9 | 10 | 6 11 | 9837 12 | Languages 13 | Other languages 14 | South American native languages 15 | Quechuan (Kechuan), Aymaran, Tucanoan, Tupí, Arawakan languages 16 | Jivaroan languages 17 | 18 | 19 | expanded from 20 | 6 21 | 983 22 | 19960930 23 | 21 24 | 25 | 26 | Jivaran languages 27 | 28 | 29 | Jivaroan languages 30 | 31 | 32 | 33 | *****nw###22*****n##4500 34 | 35 | 6 36 | 98 37 | Languages 38 | Other languages 39 | South American native languages 40 | 41 | 42 | j 43 | 6 44 | 9837 45 | Languages 46 | Other languages 47 | South American native languages 48 | Quechuan (Kechuan), Aymaran, Tucanoan, Tupí, Arawakan languages 49 | Jivaroan languages 50 | Yaruro 51 | 52 | 53 | 54 | *****nw###22*****n##4500 55 | 56 | 6 57 | 98372 58 | Languages 59 | Other languages 60 | South American native languages 61 | Quechuan (Kechuan), Aymaran, Tucanoan, Tupí, Arawakan languages 62 | Jivaroan languages 63 | Jivaro proper. Shuar 64 | 65 | 66 | jh 67 | 6 68 | 9837 69 | Languages 70 | Other languages 71 | South American native languages 72 | Quechuan (Kechuan), Aymaran, Tucanoan, Tupí, Arawakan languages 73 | Jivaroan languages 74 | Jivaro proper 75 | 76 | 77 | 78 | -------------------------------------------------------------------------------- /examples/ddc21en-6--9838.ttl: -------------------------------------------------------------------------------- 1 | @prefix dcterms: . 2 | @prefix owl: . 3 | @prefix rdf: . 4 | @prefix rdfs: . 5 | @prefix skos: . 6 | @prefix xml: . 7 | @prefix xsd: . 8 | 9 | a skos:Concept ; 10 | skos:historyNote "expanded from"@en ; 11 | skos:inScheme , 12 | ; 13 | skos:notation "T6--9838" ; 14 | skos:prefLabel "Tupí languages"@en ; 15 | skos:scopeNote "Including Munduruku, Sirionó; Oyampi"@en . 16 | 17 | -------------------------------------------------------------------------------- /examples/ddc21en-6--9838.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | *****nw###22*****n##4500 5 | 6 | ddc 7 | 21 8 | 9 | 10 | 6 11 | 9838 12 | Languages 13 | Other languages 14 | South American native languages 15 | Quechuan (Kechuan), Aymaran, Tucanoan, Tupí, Arawakan languages 16 | Tupí languages 17 | 18 | 19 | Including Munduruku, Sirionó; Oyampi 20 | 21 | 22 | expanded from 23 | 6 24 | 983 25 | 19960930 26 | 21 27 | 28 | 29 | Cocama language 30 | 31 | 32 | Mundurucu language 33 | 34 | 35 | Munduruku language 36 | 37 | 38 | Oyampi language 39 | 40 | 41 | Sirionó language 42 | 43 | 44 | Tupí languages 45 | 46 | 47 | Tupian languages 48 | 49 | 50 | Wayampi language 51 | 52 | 53 | Wayãpi language 54 | 55 | 56 | 57 | -------------------------------------------------------------------------------- /examples/ddc21en-6--98382.ttl: -------------------------------------------------------------------------------- 1 | @prefix dcterms: . 2 | @prefix owl: . 3 | @prefix rdf: . 4 | @prefix rdfs: . 5 | @prefix skos: . 6 | @prefix xml: . 7 | @prefix xsd: . 8 | 9 | a skos:Concept ; 10 | skos:historyNote "expanded from"@en ; 11 | skos:inScheme , 12 | ; 13 | skos:notation "T6--98382" ; 14 | skos:prefLabel "Narrow Tupí group. Guaraní"@en . 15 | 16 | -------------------------------------------------------------------------------- /examples/ddc21en-6--98382.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | *****nw###22*****n##4500 5 | 6 | ddc 7 | 21 8 | 9 | 10 | 6 11 | 98382 12 | Languages 13 | Other languages 14 | South American native languages 15 | Quechuan (Kechuan), Aymaran, Tucanoan, Tupí, Arawakan languages 16 | Tupí languages 17 | Narrow Tupí group. Guaraní 18 | 19 | 20 | expanded from 21 | 6 22 | 983 23 | 19960930 24 | 21 25 | 26 | 27 | Chiriguano language 28 | 29 | 30 | Guaraní language 31 | 32 | 33 | 34 | -------------------------------------------------------------------------------- /examples/ddc21en-6--983829.ttl: -------------------------------------------------------------------------------- 1 | @prefix dcterms: . 2 | @prefix owl: . 3 | @prefix rdf: . 4 | @prefix rdfs: . 5 | @prefix skos: . 6 | @prefix xml: . 7 | @prefix xsd: . 8 | 9 | a skos:Concept ; 10 | skos:historyNote "expanded from"@en ; 11 | skos:inScheme , 12 | ; 13 | skos:notation "T6--983829" ; 14 | skos:prefLabel "Tupí (Nhengatu)"@en . 15 | 16 | -------------------------------------------------------------------------------- /examples/ddc21en-6--983829.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | *****nw###22*****n##4500 5 | 6 | ddc 7 | 21 8 | 9 | 10 | 6 11 | 983829 12 | Languages 13 | Other languages 14 | South American native languages 15 | Quechuan (Kechuan), Aymaran, Tucanoan, Tupí, Arawakan languages 16 | Tupí languages 17 | Narrow Tupí group. Guaraní 18 | Tupí (Nhengatu) 19 | 20 | 21 | expanded from 22 | 6 23 | 983 24 | 19960930 25 | 21 26 | 27 | 28 | Neengatu language 29 | 30 | 31 | Nheengatu language 32 | 33 | 34 | Nhengatu language 35 | 36 | 37 | Tupí language 38 | 39 | 40 | 41 | -------------------------------------------------------------------------------- /examples/ddc21en-6--9839.ttl: -------------------------------------------------------------------------------- 1 | @prefix dcterms: . 2 | @prefix owl: . 3 | @prefix rdf: . 4 | @prefix rdfs: . 5 | @prefix skos: . 6 | @prefix xml: . 7 | @prefix xsd: . 8 | 9 | a skos:Concept ; 10 | skos:historyNote "expanded from"@en ; 11 | skos:inScheme , 12 | ; 13 | skos:notation "T6--9839" ; 14 | skos:prefLabel "Arawakan languages"@en . 15 | 16 | -------------------------------------------------------------------------------- /examples/ddc21en-6--9839.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | *****nw###22*****n##4500 5 | 6 | ddc 7 | 21 8 | 9 | 10 | 6 11 | 9839 12 | Languages 13 | Other languages 14 | South American native languages 15 | Quechuan (Kechuan), Aymaran, Tucanoan, Tupí, Arawakan languages 16 | Arawakan languages 17 | 18 | 19 | j 20 | 6 21 | 979 22 | Languages 23 | Other languages 24 | North American native languages 25 | Other North American languages 26 | comprehensive works on Arawakan languages 27 | 28 | 29 | expanded from 30 | 6 31 | 983 32 | 19960930 33 | 21 34 | 35 | 36 | Arawak language 37 | 38 | 39 | Arawakan languages 40 | 41 | 42 | Arawakan languages—South America 43 | 44 | 45 | Asheninca Campa language 46 | 47 | 48 | Campa language 49 | 50 | 51 | Goajiro language 52 | 53 | 54 | Guajiro language 55 | 56 | 57 | Maipuran languages 58 | 59 | 60 | Mapura language 61 | 62 | 63 | 64 | *****nw###22*****n##4500 65 | 66 | 6 67 | 979 68 | Languages 69 | Other languages 70 | North American native languages 71 | Other North American languages 72 | 73 | 74 | k 75 | 6 76 | 9839 77 | Languages 78 | Other languages 79 | South American native languages 80 | Quechuan (Kechuan), Aymaran, Tucanoan, Tupí, Arawakan languages 81 | Arawakan languages 82 | Arawakan languages of Central America and West Indies 83 | 84 | 85 | 86 | -------------------------------------------------------------------------------- /examples/ddc21en-6--984.ttl: -------------------------------------------------------------------------------- 1 | @prefix dcterms: . 2 | @prefix owl: . 3 | @prefix rdf: . 4 | @prefix rdfs: . 5 | @prefix skos: . 6 | @prefix xml: . 7 | @prefix xsd: . 8 | 9 | a skos:Concept ; 10 | skos:inScheme , 11 | ; 12 | skos:notation "T6--984" ; 13 | skos:prefLabel "Carib, Macro-Gê, Nambiquaran, Panoan languages"@en . 14 | 15 | -------------------------------------------------------------------------------- /examples/ddc21en-6--984.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | *****nw###22*****n##4500 5 | 6 | ddc 7 | 21 8 | 9 | 10 | 6 11 | 984 12 | Languages 13 | Other languages 14 | South American native languages 15 | Carib, Macro-Gê, Nambiquaran, Panoan languages 16 | 17 | 18 | Akwe-Shavante language 19 | 20 | 21 | Canella language 22 | 23 | 24 | Caraja language 25 | 26 | 27 | Carajó language 28 | 29 | 30 | Carib language 31 | 32 | 33 | Cariban languages 34 | 35 | 36 | Cashinawa language 37 | 38 | 39 | Catuquina language (Panoan) 40 | 41 | 42 | Cayapó language 43 | 44 | 45 | Gê language 46 | 47 | 48 | Gê-Pano-Carib languages 49 | 50 | 51 | Kayapó language 52 | 53 | 54 | Macro-Gê languages 55 | 56 | 57 | Nambicuara language 58 | 59 | 60 | Nambikuara language 61 | 62 | 63 | Nambiquaran languages 64 | 65 | 66 | Panoan languages 67 | 68 | 69 | Pemón language 70 | 71 | 72 | Xavante language 73 | 74 | 75 | 76 | *****nw###22*****n##4500 77 | 78 | 6 79 | 98 80 | Languages 81 | Other languages 82 | South American native languages 83 | 84 | 85 | j 86 | 6 87 | 984 88 | Languages 89 | Other languages 90 | South American native languages 91 | Carib, Macro-Gê, Nambiquaran, Panoan languages 92 | Hixkaryana, Mataco-Guaicuru, Tacanan, Witotoan languages 93 | 94 | 95 | 96 | -------------------------------------------------------------------------------- /examples/ddc23de-001.ttl: -------------------------------------------------------------------------------- 1 | @prefix dcterms: . 2 | @prefix ns1: . 3 | @prefix owl: . 4 | @prefix rdf: . 5 | @prefix rdfs: . 6 | @prefix skos: . 7 | @prefix xml: . 8 | @prefix xsd: . 9 | 10 | a skos:Concept ; 11 | ns1:classHere "Diskussion von ideen aus vielen gebieten, fächerübergreifender ansatz zum wissensbegriff"@de ; 12 | ns1:including "Fächerübergreifende werke über berater"@de ; 13 | dcterms:created "2000-02-02"^^xsd:date ; 14 | dcterms:identifier "e957a697-9369-3496-85af-bd067229b32d" ; 15 | dcterms:modified "2011-07-28"^^xsd:date ; 16 | skos:broader ; 17 | skos:editorialNote "Für Berater oder für den Einsatz von Beratern in einem bestimmten Thema siehe das Thema, z.B. Bibliotheksberater, technische Berater, Einsatz von Beratern im Management"@de, 18 | "Klassifiziere Epistemologie in 121"@de, 19 | "Klassifiziere eine Zusammenstellung von Wissen in einer bestimmten Form bei der Form, z.B. Enzyklopädien"@de, 20 | "Siehe Praxishilfe bei 500 vs. 001"@de ; 21 | skos:inScheme ; 22 | skos:notation "001" ; 23 | skos:prefLabel "Wissen"@de ; 24 | skos:scopeNote "Darstellung und kritische Bewertung intellektueller, geistiger Aktivität im Allgemeinen"@de, 25 | "Einschließlich: fächerübergreifende Werke über Berater"@de, 26 | "Hier auch: Diskussion von Ideen aus vielen Gebieten, fächerübergreifender Ansatz zum Wissensbegriff"@de . 27 | 28 | -------------------------------------------------------------------------------- /examples/ddc23de-001.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 00000nw a2200000n 4500 5 | e957a697-9369-3496-85af-bd067229b32d 6 | DE-101 7 | 20110728111208.0 8 | 000202aaaabaaa 9 | 10 | ocd00116591 11 | 12 | 13 | OCoLC-D 14 | ger 15 | DE-101 16 | DE-101 17 | 18 | 19 | ddc 20 | 23de 21 | ger 22 | 23 | 24 | 001 25 | 00 26 | Wissen 27 | ess=en 28 | ess=eh 29 | 30 | 31 | Darstellung und kritische Bewertung intellektueller, geistiger Aktivität im Allgemeinen 32 | ess=nsc 33 | 34 | 35 | Einschließlich: 36 | fächerübergreifende Werke über Berater 37 | ess=nin 38 | 39 | 40 | Hier auch: 41 | Diskussion von Ideen aus vielen Gebieten, fächerübergreifender Ansatz zum Wissensbegriff 42 | ess=nch 43 | 44 | 45 | Klassifiziere 46 | Epistemologie 47 | in 48 | 121 49 | ess=nce 50 | 51 | 52 | Klassifiziere 53 | eine Zusammenstellung von Wissen in einer bestimmten Form 54 | bei der Form, z.B. 55 | Enzyklopädien 56 | 030 57 | ess=ncw 58 | 59 | 60 | Für 61 | Berater oder für den Einsatz von Beratern in einem bestimmten Thema 62 | siehe das Thema, z.B. 63 | Bibliotheksberater 64 | 023.2 65 | , technische Berater 66 | 620 67 | , Einsatz von Beratern im Management 68 | 658.46 69 | ess=nsw 70 | 71 | 72 | Siehe Praxishilfe bei 73 | 500 74 | vs. 75 | 001 76 | ess=nsm 77 | 78 | 79 | Berater 80 | ddcri 81 | ps=PE 82 | 83 | 84 | Gutachter 85 | ddcri 86 | ps=PE 87 | 88 | 89 | Experten 90 | ddcri 91 | ps=PE 92 | 93 | 94 | Fächerübergreifender Ansatz zum Wissensbegriff 95 | ddcri 96 | ps=PE 97 | 98 | 99 | Wissen 100 | ddcri 101 | ps=PE 102 | 103 | 104 | Wissensbegriff 105 | ddcri 106 | ps=PE 107 | 108 | 109 | Wissenschaften (Wissensbegriff) 110 | ddcri 111 | ps=PE 112 | 113 | 114 | -------------------------------------------------------------------------------- /examples/ddc23no-001.ttl: -------------------------------------------------------------------------------- 1 | @prefix dcterms: . 2 | @prefix ns1: . 3 | @prefix owl: . 4 | @prefix rdf: . 5 | @prefix rdfs: . 6 | @prefix skos: . 7 | @prefix xml: . 8 | @prefix xsd: . 9 | 10 | a skos:Concept ; 11 | ns1:classHere "Idéer fra flere områder"@nb, 12 | "Tverrfaglig tilnærming til kunnskap"@nb ; 13 | ns1:including "Tverrfaglige verker om spesialister"@nb ; 14 | dcterms:created "2009-12-03"^^xsd:date ; 15 | dcterms:identifier "ocd00116591" ; 16 | dcterms:modified "2015-09-29"^^xsd:date ; 17 | skos:broader ; 18 | skos:editorialNote "Klassifiser en samling av kunnskap i en bestemt form med formen, f.eks. leksika"@nb, 19 | "Klassifiser erkjennelsesteori (epistemologi) i 121"@nb, 20 | "Se manualen: 500 vs. 001"@nb, 21 | "Spesialister eller bruken av spesialister innen et bestemt emne, se emnet, f.eks. spesialister innen lungemedisin, bruken av spesialister innen ingeniørfag, bruken av konsulenter innen ledelse"@nb ; 22 | skos:inScheme ; 23 | skos:notation "001" ; 24 | skos:prefLabel "Kunnskap"@nb ; 25 | skos:scopeNote "Beskrivelse og kritisk vurdering av intellektuell virksomhet i alminnelighet"@nb, 26 | "Her: Idéer fra flere områder; tverrfaglig tilnærming til kunnskap"@nb, 27 | "Inkluderer: Tverrfaglige verker om spesialister"@nb . 28 | 29 | -------------------------------------------------------------------------------- /examples/ddc23no-001.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 00000nw a2200000n 4500 5 | ocd00116591 6 | OCoLC-D 7 | 20150929121529.8 8 | 091203aaaaaaaa 9 | 10 | OCLCD 11 | nob 12 | OCLCD 13 | 14 | 15 | ddc 16 | 23no 17 | nob 18 | 19 | 20 | 001 21 | 00 22 | Kunnskap 23 | ess=en 24 | ess=eh 25 | 26 | 27 | Beskrivelse og kritisk vurdering av intellektuell virksomhet i alminnelighet 28 | ess=nsc 29 | 30 | 31 | Inkluderer: 32 | Tverrfaglige verker om spesialister 33 | ess=nin 34 | 35 | 36 | Her: 37 | Idéer fra flere områder 38 | ; 39 | tverrfaglig tilnærming til kunnskap 40 | ess=nch 41 | 42 | 43 | Klassifiser 44 | erkjennelsesteori (epistemologi) 45 | i 46 | 121 47 | ess=nce 48 | 49 | 50 | Klassifiser 51 | en samling av kunnskap i en bestemt form 52 | med formen, f.eks. 53 | leksika 54 | 030 55 | ess=ncw 56 | 57 | 58 | Spesialister eller bruken av spesialister innen et bestemt emne 59 | , se emnet, f.eks. 60 | spesialister innen lungemedisin 61 | 616.24 62 | , 63 | bruken av spesialister innen ingeniørfag 64 | 620 65 | , 66 | bruken av konsulenter innen ledelse 67 | 658.46 68 | ess=nsw 69 | 70 | 71 | Se manualen: 72 | 500 73 | vs. 74 | 001 75 | ess= 76 | 77 | 78 | Konsulenter (spesialister) 79 | (OCoLC-D)ccd9b76f-6c64-4713-8bd9-4c22c3f2409b 80 | ddcri 81 | ps=PE 82 | 83 | 84 | Spesialister 85 | (OCoLC-D)ba923cf2-65e0-4b97-a5b7-fa1ccab20532 86 | ddcri 87 | ps=PE 88 | 89 | 90 | Eksperter 91 | (OCoLC-D)91533959-14dc-481e-baaf-b863a62d2078 92 | ddcri 93 | ps=PE 94 | 95 | 96 | Tverrfaglig tilnærming til kunnskap 97 | (OCoLC-D)1d367be7-5817-42fb-9776-dfe9d46ceb16 98 | ddcri 99 | ps=PE 100 | 101 | 102 | Kunnskap 103 | (OCoLC-D)0d247098-13a8-45b2-8033-f3b398343a72 104 | ddcri 105 | ps=PE 106 | 107 | 108 | Vitenskap (kunnskap) 109 | (OCoLC-D)6df2bf4e-1deb-4f4f-b28a-dba4f634ffc0 110 | ddcri 111 | ps=PE 112 | 113 | 114 | -------------------------------------------------------------------------------- /examples/ddc23no-002.0216.ttl: -------------------------------------------------------------------------------- 1 | @prefix dcterms: . 2 | @prefix owl: . 3 | @prefix rdf: . 4 | @prefix rdfs: . 5 | @prefix skos: . 6 | @prefix xml: . 7 | @prefix xsd: . 8 | 9 | a skos:Concept ; 10 | dcterms:created "2009-12-03"^^xsd:date ; 11 | dcterms:identifier "ocd00116663" ; 12 | dcterms:modified "2017-01-25"^^xsd:date ; 13 | owl:deprecated true ; 14 | skos:broader ; 15 | skos:editorialNote "Brukes ikke; klassifiser i 010"@nb ; 16 | skos:inScheme ; 17 | skos:notation "002.0216" ; 18 | skos:prefLabel "Lister, fortegnelser, kataloger"@nb . 19 | 20 | -------------------------------------------------------------------------------- /examples/ddc23no-002.0216.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 00000nw a2200000n 4500 5 | ocd00116663 6 | OCoLC-D 7 | 20170125122349.0 8 | 091203aadaaaba 9 | 10 | OCLCD 11 | nob 12 | OCLCD 13 | 14 | 15 | ddc 16 | 23no 17 | nob 18 | 19 | 20 | 002.0216 21 | 002 22 | Lister, fortegnelser, kataloger 23 | ess=en 24 | ess=eh 25 | 26 | 27 | 002 28 | 1 29 | 0216 30 | 002.0216 31 | ess=hn 32 | 33 | 34 | Brukes ikke; klassifiser i 35 | 010 36 | ess=nsx 37 | 38 | 39 | 40 | -------------------------------------------------------------------------------- /examples/ddc23no-1--093-099.ttl: -------------------------------------------------------------------------------- 1 | @prefix dcterms: . 2 | @prefix owl: . 3 | @prefix rdf: . 4 | @prefix rdfs: . 5 | @prefix skos: . 6 | @prefix xml: . 7 | @prefix xsd: . 8 | 9 | a skos:Concept ; 10 | dcterms:created "2009-12-03"^^xsd:date ; 11 | dcterms:identifier "ocd00119742" ; 12 | dcterms:modified "2015-08-24"^^xsd:date ; 13 | skos:broader ; 14 | skos:editorialNote "(Tillatt løsning: Historiske perioder fra 930-990 kan tilføyes et siffer for alle områder, unntatt Nord-Amerika og Sør-Amerika som får, f.eks. borgerkrigen i USA, Brasil under keiserdømmet, Nord-Amerika på 1900-tallet. Dersom denne tillatte løsningen brukes, skal ikke 090 fra den spesielle hjelpetabellen over brukes. Et ekstra siffer 0 tilføyes numrene fra den spesielle hjelpetabellen ovenfor, f.eks. statistikk som gjelder Brasil)"@nb, 15 | "Se manualen: 0922 vs. 093-099"@nb, 16 | "Se manualen: 0940902 vs. 0902"@nb ; 17 | skos:inScheme , 18 | ; 19 | skos:notation "T1--093-099" ; 20 | skos:prefLabel "Bestemte verdensdeler, stater, lokalområder; himmellegemer utenfor jorda"@nb ; 21 | skos:scopeNote "Historie og beskrivelse etter sted, etter bestemte hendelser innen emnet"@nb, 22 | "Vær oppmerksom på at inndelingene i den spesielle hjelpetabellen under ikke er generell forminndeling"@nb . 23 | 24 | -------------------------------------------------------------------------------- /examples/ddc23no-539.60113.ttl: -------------------------------------------------------------------------------- 1 | @prefix dcterms: . 2 | @prefix owl: . 3 | @prefix rdf: . 4 | @prefix rdfs: . 5 | @prefix skos: . 6 | @prefix xml: . 7 | @prefix xsd: . 8 | 9 | a skos:Concept ; 10 | dcterms:created "2018-02-08"^^xsd:date ; 11 | dcterms:identifier "2cf125c9-d3e9-42d9-802d-542116221196" ; 12 | dcterms:modified "2018-02-08"^^xsd:date ; 13 | skos:broader ; 14 | skos:inScheme ; 15 | skos:notation "539.60113" ; 16 | skos:prefLabel "Molekylærfysikk--datamaskinsimulering"@nb . 17 | 18 | -------------------------------------------------------------------------------- /examples/ddc23no-539.60113.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 00000nw a2200000n 4500 4 | 2cf125c9-d3e9-42d9-802d-542116221196 5 | OCoLC-D 6 | 20180208154625.0 7 | 180208aaaaacbb 8 | 9 | OCLCD 10 | nob 11 | OCLCD 12 | 13 | 14 | ddc 15 | 23no 16 | nob 17 | 18 | 19 | 539.60113 20 | 539.6 21 | 22 | 23 | 539.6011 24 | 1 25 | 011 26 | 003 27 | 3 28 | 539.60113 29 | ess= 30 | 31 | 32 | 539.6 33 | 1 34 | 011 35 | 539.6011 36 | ess= 37 | 38 | 39 | WebDewey Number Building Engine-1 40 | 20180206 41 | ess= 42 | 43 | 44 | 539/.60113 45 | ess= 46 | 47 | 48 | update=silent 49 | 50 | 51 | Molekylærfysikk 52 | datamaskinsimulering 53 | (OCoLC-D)c6ef2e7b-140e-4c22-ab24-c8724e334102 54 | ddcri 55 | ps=EO 56 | ess=isCaption 57 | 58 | 59 | -------------------------------------------------------------------------------- /examples/gnd-1020118989.ttl: -------------------------------------------------------------------------------- 1 | @prefix dcterms: . 2 | @prefix owl: . 3 | @prefix rdf: . 4 | @prefix rdfs: . 5 | @prefix skos: . 6 | @prefix xml: . 7 | @prefix xsd: . 8 | 9 | a skos:Concept ; 10 | dcterms:created "2012-02-24"^^xsd:date ; 11 | dcterms:identifier "1020118989" ; 12 | dcterms:modified "2017-08-14"^^xsd:date ; 13 | skos:altLabel "Schneider, B. (1971-)"@de ; 14 | skos:exactMatch , 15 | , 16 | , 17 | , 18 | ; 19 | skos:inScheme ; 20 | skos:note "Diss. Bremen 2002"@de ; 21 | skos:prefLabel "Schneider, Birgit (1971-)"@de ; 22 | skos:related , 23 | , 24 | , 25 | , 26 | . 27 | 28 | -------------------------------------------------------------------------------- /examples/gnd-1020118989.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 00000nz a2200000oc 4500 4 | 1020118989 5 | DE-101 6 | 20170814095021.0 7 | 120224n||aznnnaabn | aaa |c 8 | 9 | http://d-nb.info/gnd/1020118989 10 | uri 11 | 12 | 13 | 0000-0001-9142-1457 14 | orcid 15 | 16 | 17 | C-2215-2017 18 | rid 19 | 20 | 21 | 24167396300 22 | scopus 23 | 24 | 25 | 267074138 26 | viaf 27 | 28 | 29 | nb2003041477 30 | lccn 31 | 32 | 33 | 0000 0001 1441 8676 34 | isni 35 | 36 | 37 | Q865334 38 | wikidata 39 | 40 | 41 | (DE-101)1020118989 42 | 43 | 44 | (DE-588)1020118989 45 | 46 | 47 | (DE-588a)1020118989 48 | v:zg 49 | 50 | 51 | DE-8 52 | r:DE-601 53 | ger 54 | 0008 55 | 56 | 57 | gnd3 58 | 59 | 60 | XA-DE 61 | 62 | 63 | p 64 | gndgen 65 | 66 | 67 | piz 68 | gndspec 69 | 70 | 71 | g 72 | f 73 | 74 | 75 | Schneider, Birgit 76 | 1971- 77 | 78 | 79 | 2 80 | iso5218 81 | 82 | 83 | Schneider, B. 84 | 1971- 85 | 86 | 87 | (DE-101)956081045 88 | (DE-588)2176115-2 89 | http://d-nb.info/gnd/2176115-2 90 | Christian-Albrechts-Universität zu Kiel 91 | Institut für Geowissenschaften 92 | affi 93 | http://d-nb.info/standards/elementset/gnd#affiliation 94 | r 95 | Affiliation 96 | Affiliation 97 | 98 | 99 | 1971- 100 | datl 101 | http://d-nb.info/standards/elementset/gnd#dateOfBirth 102 | r 103 | Lebensdaten 104 | 105 | 106 | (DE-101)977054926 107 | (DE-588)4874356-2 108 | http://d-nb.info/gnd/4874356-2 109 | Geologin 110 | berc 111 | http://d-nb.info/standards/elementset/gnd#professionOrOccupation 112 | r 113 | Charakteristischer Beruf 114 | 115 | 116 | (DE-101)041602196 117 | (DE-588)4160219-5 118 | http://d-nb.info/gnd/4160219-5 119 | Hochschullehrerin 120 | beru 121 | http://d-nb.info/standards/elementset/gnd#professionOrOccupation 122 | r 123 | Beruf 124 | 125 | 126 | Prof. Dr. 127 | akad 128 | http://d-nb.info/standards/elementset/gnd#academicDegree 129 | r 130 | Akademischer Grad 131 | 132 | 133 | (DE-101)040056570 134 | (DE-588)4005657-0 135 | http://d-nb.info/gnd/4005657-0 136 | Bergisch Gladbach 137 | ortg 138 | http://d-nb.info/standards/elementset/gnd#placeOfBirth 139 | r 140 | Geburtsort 141 | 142 | 143 | (DE-101)040304817 144 | (DE-588)4030481-4 145 | http://d-nb.info/gnd/4030481-4 146 | Kiel 147 | ortw 148 | http://d-nb.info/standards/elementset/gnd#placeOfActivity 149 | r 150 | Wirkungsort 151 | 152 | 153 | Diss. Bremen 2002 154 | 155 | 156 | pnd 157 | a 158 | Schneider, Birgit 159 | (DE-588a)1020118989 160 | 161 | 162 | -------------------------------------------------------------------------------- /examples/humord-c28807.ttl: -------------------------------------------------------------------------------- 1 | @prefix dcterms: . 2 | @prefix owl: . 3 | @prefix rdf: . 4 | @prefix rdfs: . 5 | @prefix skos: . 6 | @prefix xml: . 7 | @prefix xsd: . 8 | 9 | a skos:Concept ; 10 | dcterms:created "2016-12-09"^^xsd:date ; 11 | dcterms:identifier "HUME28807" ; 12 | dcterms:modified "2016-12-09"^^xsd:date ; 13 | skos:broader ; 14 | skos:exactMatch ; 15 | skos:inScheme ; 16 | skos:note "Lukket bemerkning: ubo16"@nb ; 17 | skos:prefLabel "Undervannsgeologi"@nb . 18 | 19 | -------------------------------------------------------------------------------- /examples/humord-c28807.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 00000nz a2200000n 4500 4 | HUME28807 5 | No-TrBIB 6 | 20161209000000.0 7 | 161209|||anz|nbabn |a|ana|||| d 8 | 9 | http://data.ub.uio.no/humord/c28807 10 | uri 11 | 12 | 13 | No-TrBIB 14 | nob 15 | humord 16 | 17 | 18 | 584.92 19 | 23no 20 | =EQ 21 | 22 | 23 | Undervannsgeologi 24 | rank=preferred 25 | language=nb 26 | 27 | 28 | Geologi 29 | g 30 | (No-TrBIB)HUME08282 31 | 32 | 33 | Lukket bemerkning: ubo16 34 | 35 | 36 | -------------------------------------------------------------------------------- /examples/lcgft-gf2011026530.ttl: -------------------------------------------------------------------------------- 1 | @prefix dcterms: . 2 | @prefix owl: . 3 | @prefix rdf: . 4 | @prefix rdfs: . 5 | @prefix skos: . 6 | @prefix xml: . 7 | @prefix xsd: . 8 | 9 | a skos:Concept ; 10 | dcterms:created "2011-05-07"^^xsd:date ; 11 | dcterms:identifier "gf2011026530" ; 12 | dcterms:modified "2018-02-20"^^xsd:date ; 13 | skos:altLabel "Images, Remote-sensing"@en, 14 | "Multispectral scanning images"@en, 15 | "SLAR images"@en, 16 | "Satellite images"@en, 17 | "Side-looking airborne radar images"@en ; 18 | skos:inScheme ; 19 | skos:note "Images of planetary surfaces created by means of reflected or emitted electromagnetic energy."@en, 20 | "Source: AACR2, 1988 rev.:"@en, 21 | "Source: Cartographic materials: A Manual of interpretation for AACR2, 1982:"@en, 22 | "Source: Conversation with M.L. Larsgaard, Map & Imagery Lab, Library, Univ. of Calif., Santa Barbara, May 20, 1994"@en, 23 | "Source: Environmental Research Institute of Michigan. Remote sensing image of Michigan, 1985."@en, 24 | "Source: Introduction to remote sensing, c2007:"@en, 25 | "Source: Map Online Users Group Newsletter:"@en, 26 | "Source: Satellite images of Australia, c1982."@en ; 27 | skos:prefLabel "Remote-sensing images"@en . 28 | 29 | -------------------------------------------------------------------------------- /examples/lcgft-gf2011026530.xml: -------------------------------------------------------------------------------- 1 | 2 | 01597cz a2200313n 4500 3 | gf2011026530 4 | DLC 5 | 20180220154626.4 6 | 110507|| anznnbabn |a ana 7 | 8 | gf2011026530 9 | sh2009025023 10 | 11 | 12 | DLC 13 | eng 14 | DLC 15 | lcgft 16 | DLC 17 | 18 | 19 | Remote-sensing images 20 | 21 | 22 | Images, Remote-sensing 23 | 24 | 25 | Multispectral scanning images 26 | 27 | 28 | Satellite images 29 | 30 | 31 | Side-looking airborne radar images 32 | 33 | 34 | SLAR images 35 | 36 | 37 | g 38 | Cartographic materials 39 | 40 | 41 | g 42 | Informational works 43 | 44 | 45 | g 46 | Visual works 47 | 48 | 49 | AACR2, 1988 rev.: 50 | pp. 108-116. 51 | 52 | 53 | Cartographic materials: A Manual of interpretation for AACR2, 1982: 54 | p. 90 (aerial remote-sensing image; multispectral scanning image; Sidelooking airborne radar (SLAR)) 55 | 56 | 57 | Conversation with M.L. Larsgaard, Map & Imagery Lab, Library, Univ. of Calif., Santa Barbara, May 20, 1994 58 | (Remote-sensing images) 59 | 60 | 61 | Satellite images of Australia, c1982. 62 | 63 | 64 | Map Online Users Group Newsletter: 65 | no. 17, p. 6 (type of material subdivision ... Remote-sensing imagery) 66 | 67 | 68 | Environmental Research Institute of Michigan. Remote sensing image of Michigan, 1985. 69 | 70 | 71 | Introduction to remote sensing, c2007: 72 | introd. (remote sensing: observation of the Earth's land and water surfaces by means of reflected or emitted electromagnetic energy) 73 | 74 | 75 | Glossary of the mapping sciences, 1994 76 | 77 | 78 | Images of planetary surfaces created by means of reflected or emitted electromagnetic energy. 79 | 80 | 81 | -------------------------------------------------------------------------------- /examples/lcsh-sh2009007258.ttl: -------------------------------------------------------------------------------- 1 | @prefix dcterms: . 2 | @prefix owl: . 3 | @prefix rdf: . 4 | @prefix rdfs: . 5 | @prefix skos: . 6 | @prefix xml: . 7 | @prefix xsd: . 8 | 9 | a skos:Concept ; 10 | dcterms:created "2009-09-03"^^xsd:date ; 11 | dcterms:identifier "sh2009007258" ; 12 | dcterms:modified "2009-09-03"^^xsd:date ; 13 | skos:altLabel "Valley Forge State Park (Pa.)"@en ; 14 | skos:inScheme ; 15 | skos:note "Source: GNIS, July 27, 2009"@en, 16 | "Source: Wikipedia, July 27, 2009"@en, 17 | "Source: Work cat.: Sloto, R.A. Hydrogeology and ground-water quality of Valley Forge National Historical Park, Montgomery County, Pennsylvania, 1996."@en ; 18 | skos:prefLabel "Valley Forge National Historical Park (Pa.)"@en . 19 | 20 | -------------------------------------------------------------------------------- /examples/lcsh-sh2009007258.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 01293nz a2200193n 4500 4 | sh2009007258 5 | DLC 6 | 20090903084342.0 7 | 090903|| anannbabn |a ana c 8 | 9 | sh2009007258 10 | 11 | 12 | WaU 13 | eng 14 | DLC 15 | 16 | 17 | Valley Forge National Historical Park (Pa.) 18 | 19 | 20 | Valley Forge State Park (Pa.) 21 | 22 | 23 | g 24 | Historic sites 25 | Pennsylvania 26 | 27 | 28 | g 29 | National parks and reserves 30 | Pennsylvania 31 | 32 | 33 | Work cat.: Sloto, R.A. Hydrogeology and ground-water quality of Valley Forge National Historical Park, Montgomery County, Pennsylvania, 1996. 34 | 35 | 36 | Wikipedia, July 27, 2009 37 | (Valley Forge National Historical Park is the site where the Continental Army spent the winter of 1777-1778 near Valley Forge, Pa., during the American Revolutionary War. Originally Valley Forge State Park, it became a national park in 1976; Valley Forge was established as the first state park of Pa. in 1893 by the Valley Forge Park Commission; in 1976, Pennsylvania gave the park as a gift to the nation for the Bicentennial) 38 | 39 | 40 | GNIS, July 27, 2009 41 | (Valley Forge National Historical Park, park, variant name: Valley Forge State Park, Montgomery Co., Pa., 40°06ʹ00ʺN 075°26ʹ42ʺW) 42 | 43 | 44 | Pennsylvania 45 | Valley Forge National Historical Park 46 | 47 | 48 | -------------------------------------------------------------------------------- /examples/nalt-1396.ttl: -------------------------------------------------------------------------------- 1 | @prefix dcterms: . 2 | @prefix owl: . 3 | @prefix rdf: . 4 | @prefix rdfs: . 5 | @prefix skos: . 6 | @prefix xml: . 7 | @prefix xsd: . 8 | 9 | a skos:Concept ; 10 | dcterms:created "2016-12-08"^^xsd:date ; 11 | dcterms:identifier "nalt00001396" ; 12 | dcterms:modified "2016-12-08"^^xsd:date ; 13 | skos:altLabel "2-oxoisocaproate dehydrogenase"@en, 14 | "2-oxoisovalerate (lipoate) dehydrogenase"@en, 15 | "2-oxoisovalerate dehydrogenase (lipoamide)"@en, 16 | "EC 1.2.4.3"@en, 17 | "EC 1.2.4.4"@en, 18 | "branched chain keto acid dehydrogenase"@en, 19 | "branched chain oxo-acid dehydrogenase"@en, 20 | "branched-chain-ketoacid dehydrogenase"@en ; 21 | skos:inScheme ; 22 | skos:note "A ketone oxidoreductase that catalyzes the overall conversion of alpha-keto acids to acyl-CoA and CO2. The enzyme requires thiamine diphosphate as a cofactor. Defects in genes that code for subunits of the enzyme are a cause of maple syrup urine disease. The enzyme was formerly classified as EC 1.2.4.3."@en ; 23 | skos:prefLabel "3-methyl-2-oxobutanoate dehydrogenase (lipoamide)"@en . 24 | 25 | -------------------------------------------------------------------------------- /examples/nalt-1396.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 01265nz a2200289n 4500 4 | 142 5 | DNAL 6 | 20161208094604.0 7 | 161208 neazdnnbabn a ana 8 | 9 | nalt00001396 10 | DNAL 11 | 12 | 13 | (DNAL) nalt00001396 14 | 15 | 16 | DNAL 17 | DNAL 18 | 19 | 20 | S Biological Sciences 21 | 22 | 23 | W Physical and Chemical Sciences 24 | 25 | 26 | 3-methyl-2-oxobutanoate dehydrogenase (lipoamide) 27 | 28 | 29 | 2-oxoisocaproate dehydrogenase 30 | 31 | 32 | 2-oxoisovalerate (lipoate) dehydrogenase 33 | 34 | 35 | 2-oxoisovalerate dehydrogenase (lipoamide) 36 | 37 | 38 | branched-chain-ketoacid dehydrogenase 39 | 40 | 41 | branched chain keto acid dehydrogenase 42 | 43 | 44 | branched chain oxo-acid dehydrogenase 45 | 46 | 47 | EC 1.2.4.3 48 | 49 | 50 | EC 1.2.4.4 51 | 52 | 53 | aldehyde oxidoreductases 54 | g 55 | 56 | 57 | maple syrup urine disease 58 | 59 | 60 | A ketone oxidoreductase that catalyzes the overall conversion of alpha-keto acids to acyl-CoA and CO2. The enzyme requires thiamine diphosphate as a cofactor. Defects in genes that code for subunits of the enzyme are a cause of maple syrup urine disease. The enzyme was formerly classified as EC 1.2.4.3. 61 | 62 | 63 | 3-metil-2-oxobutanoato deshidrogenasa (lipoamida) 64 | tesa00001396 65 | TESA 66 | 67 | 68 | -------------------------------------------------------------------------------- /examples/noubojur-c000504.ttl: -------------------------------------------------------------------------------- 1 | @prefix dcterms: . 2 | @prefix owl: . 3 | @prefix rdf: . 4 | @prefix rdfs: . 5 | @prefix skos: . 6 | @prefix xml: . 7 | @prefix xsd: . 8 | 9 | a skos:Concept ; 10 | dcterms:created "2015-03-10"^^xsd:date ; 11 | dcterms:identifier "UJUR504" ; 12 | dcterms:modified "2015-03-10"^^xsd:date ; 13 | skos:editorialNote "(bruk også 762.1)"@nb ; 14 | skos:exactMatch ; 15 | skos:inScheme ; 16 | skos:prefLabel "årsregnskapslover - kommentarer"@nb . 17 | 18 | -------------------------------------------------------------------------------- /examples/noubojur-c000504.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 00000nz a2200000n 4500 4 | UJUR504 5 | NoOU 6 | 20150310100734.0 7 | 150310|||anz|naabn |a|ana|||| d 8 | 9 | NoOU 10 | nob 11 | noubojur 12 | 13 | 14 | L 773.7 15 | utklklass 16 | 17 | 18 | årsregnskapslover - kommentarer 19 | 20 | 21 | (bruk også 762.1) 22 | 23 | 24 | -------------------------------------------------------------------------------- /examples/noubomn-c000011.ttl: -------------------------------------------------------------------------------- 1 | @prefix dcterms: . 2 | @prefix owl: . 3 | @prefix rdf: . 4 | @prefix rdfs: . 5 | @prefix skos: . 6 | @prefix xml: . 7 | @prefix xsd: . 8 | 9 | a skos:Concept ; 10 | dcterms:created "2014-08-25"^^xsd:date ; 11 | dcterms:identifier "REAL000011" ; 12 | dcterms:modified "2016-06-23"^^xsd:date ; 13 | owl:deprecated true ; 14 | skos:closeMatch ; 15 | skos:exactMatch , 16 | , 17 | ; 18 | skos:inScheme ; 19 | skos:prefLabel "Mugg"@nb . 20 | 21 | -------------------------------------------------------------------------------- /examples/noubomn-c000011.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 00000xz a2200000n 4500 4 | REAL000011 5 | NoOU 6 | 20160623145459.0 7 | 140825|||anz|nbabn |a|ana|||| d 8 | 9 | http://data.ub.uio.no/realfagstermer/c000011 10 | uri 11 | 12 | 13 | NoOU 14 | nob 15 | noubomn 16 | 17 | 18 | Mugg 19 | 20 | 21 | Muggsopp 22 | =EQ 23 | (No-TrBIB)HUME08221 24 | humord 25 | 26 | 27 | http://www.w3.org/2004/02/skos/core#exactMatch 28 | http://www.wikidata.org/entity/Q159341 29 | http://dbpedia.org/page/Mold 30 | 31 | 32 | Molds (Fungi) 33 | sh85086566 34 | 35 | 36 | -------------------------------------------------------------------------------- /examples/rvk-gnd-mapping.ttl: -------------------------------------------------------------------------------- 1 | @prefix dcterms: . 2 | @prefix owl: . 3 | @prefix rdf: . 4 | @prefix rdfs: . 5 | @prefix skos: . 6 | @prefix xml: . 7 | @prefix xsd: . 8 | 9 | a skos:Concept ; 10 | dcterms:created "2012-07-05"^^xsd:date ; 11 | dcterms:identifier "3:" ; 12 | dcterms:modified "2018-03-16"^^xsd:date ; 13 | skos:altLabel "Bibliografie"@de, 14 | "Zeitschrift"@de ; 15 | skos:broader ; 16 | skos:closeMatch , 17 | ; 18 | skos:editorialNote "Erläuterungen zur Notationsvergabe s. RVK-Online - Nutzunghinweise"@de ; 19 | skos:inScheme ; 20 | skos:notation "AA 09900" ; 21 | skos:prefLabel "Bibliographische Zeitschriften"@de . 22 | 23 | -------------------------------------------------------------------------------- /examples/rvk-gnd-mapping.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | nw a22 o 4500 8 | 3: 9 | DE-625 10 | 201803160839.2 11 | 120705an|aznnaabbn | anc |c 12 | 13 | DE-625 14 | ger 15 | DE-625 16 | DE-625 17 | 18 | 19 | rvk 20 | 21 | 22 | AA 09900 23 | Bibliographische Zeitschriften 24 | A 25 | Allgemeines 26 | AA 27 | Bibliographien der Bibliographien, Universalbibliographien, Bibliothekskataloge, Nationalbibliographien 28 | 29 | 30 | Erläuterungen zur Notationsvergabe s. RVK-Online - Nutzunghinweise 31 | 32 | 33 | (DE-588)4006432-3 34 | Bibliografie 35 | gnd 36 | 37 | 38 | (DE-588)4067488-5 39 | Zeitschrift 40 | gnd 41 | 42 | 43 | 44 | -------------------------------------------------------------------------------- /examples/rvk.ttl: -------------------------------------------------------------------------------- 1 | @prefix dcterms: . 2 | @prefix mads: . 3 | @prefix owl: . 4 | @prefix rdf: . 5 | @prefix rdfs: . 6 | @prefix skos: . 7 | @prefix wd: . 8 | @prefix xml: . 9 | @prefix xsd: . 10 | 11 | a skos:Concept ; 12 | dcterms:created "2012-07-05"^^xsd:date ; 13 | dcterms:identifier "1:" ; 14 | dcterms:modified "2017-09-12"^^xsd:date ; 15 | skos:notation "A" ; 16 | skos:prefLabel "Allgemeines"@de ; 17 | skos:topConceptOf . 18 | 19 | a skos:Concept ; 20 | dcterms:created "2012-07-05"^^xsd:date ; 21 | dcterms:identifier "2:" ; 22 | dcterms:modified "2017-09-12"^^xsd:date ; 23 | skos:broader ; 24 | skos:inScheme ; 25 | skos:notation "AA" ; 26 | skos:prefLabel "Bibliographien der Bibliographien, Universalbibliographien, Bibliothekskataloge, Nationalbibliographien"@de . 27 | 28 | a skos:Concept ; 29 | dcterms:created "2012-07-05"^^xsd:date ; 30 | dcterms:identifier "3:" ; 31 | dcterms:modified "2017-09-12"^^xsd:date ; 32 | skos:broader ; 33 | skos:editorialNote "Erläuterungen zur Notationsvergabe s. RVK-Online - Nutzunghinweise"@de ; 34 | skos:inScheme ; 35 | skos:notation "AA 09900" ; 36 | skos:prefLabel "Bibliographische Zeitschriften"@de . 37 | -------------------------------------------------------------------------------- /examples/rvk.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | nw a22 o 4500 5 | 1: 6 | DE-625 7 | 201709121656.1 8 | 120705an|aznnaabbn | anc |c 9 | 10 | DE-625 11 | ger 12 | DE-625 13 | DE-625 14 | 15 | 16 | rvk 17 | 18 | 19 | A 20 | Allgemeines 21 | 22 | 23 | 24 | nw a22 o 4500 25 | 2: 26 | DE-625 27 | 201709121656.1 28 | 120705an|aznnaabbn | anc |c 29 | 30 | DE-625 31 | ger 32 | DE-625 33 | DE-625 34 | 35 | 36 | rvk 37 | 38 | 39 | AA 40 | Bibliographien der Bibliographien, Universalbibliographien, Bibliothekskataloge, Nationalbibliographien 41 | A 42 | Allgemeines 43 | 44 | 45 | 46 | nw a22 o 4500 47 | 3: 48 | DE-625 49 | 201709121656.1 50 | 120705an|aznnaabbn | anc |c 51 | 52 | DE-625 53 | ger 54 | DE-625 55 | DE-625 56 | 57 | 58 | rvk 59 | 60 | 61 | AA 09900 62 | Bibliographische Zeitschriften 63 | A 64 | Allgemeines 65 | AA 66 | Bibliographien der Bibliographien, Universalbibliographien, Bibliothekskataloge, Nationalbibliographien 67 | 68 | 69 | Erläuterungen zur Notationsvergabe s. RVK-Online - Nutzunghinweise 70 | 71 | 72 | (DE-588)4006432-3 73 | Bibliografie 74 | gnd 75 | 76 | 77 | (DE-588)4067488-5 78 | Zeitschrift 79 | gnd 80 | 81 | 82 | 83 | -------------------------------------------------------------------------------- /examples/skosify.cfg: -------------------------------------------------------------------------------- 1 | [options] 2 | narrower=True 3 | transitive=True 4 | 5 | [namespaces] 6 | 7 | [types] 8 | 9 | [literals] 10 | 11 | [relations] 12 | -------------------------------------------------------------------------------- /mc2skos/__init__.py: -------------------------------------------------------------------------------- 1 | __version__ = '0.12.0' # Use bumpversion to update 2 | -------------------------------------------------------------------------------- /mc2skos/constants.py: -------------------------------------------------------------------------------- 1 | # encoding=utf8 2 | 3 | 4 | class Constants(object): 5 | SCHEDULE_RECORD = 'schedule_record' 6 | TABLE_RECORD = 'table_record' 7 | INTERNAL_SUMMARY_OF_SCHEDULE_NUMBER = 'internal_summary_of_schedule_number' 8 | EXTERNAL_SUMMARY = 'external_summary' 9 | INTERNAL_SUMMARY_OF_TABLE_NUMBER = 'internal_summary_of_table_number' 10 | MANUAL_NOTE_RECORD = 'manual_note_record' 11 | 12 | UNKNOWN = 'unknown' 13 | 14 | SINGLE_NUMBER = 'single_number' 15 | NUMBER_SPAN = 'number_span' 16 | SUMMARY_NUMBER_SPAN = 'summary_number_span' 17 | 18 | COMPLEX_SEE_REFERENCE = 'nce' 19 | COMPLEX_SEE_ALSO_REFERENCE = 'nsa' 20 | DEFINITION = 'ndf' 21 | SCOPE_NOTE = 'scope_note' 22 | APPLICATION_INSTRUCTION_NOTE = 'application_instruction_note' 23 | HISTORY_NOTE = 'history_note' 24 | AUXILIARY_INSTRUCTION_NOTE = 'auxiliary_instruction_note' 25 | -------------------------------------------------------------------------------- /mc2skos/element.py: -------------------------------------------------------------------------------- 1 | # encoding=utf8 2 | 3 | from functools import reduce 4 | from lxml import etree 5 | import re 6 | 7 | 8 | class Element(object): 9 | 10 | nsmap = { 11 | 'mx': 'http://www.loc.gov/MARC21/slim', 12 | 'marc': 'http://www.loc.gov/MARC21/slim', 13 | } 14 | 15 | def __init__(self, data): 16 | if isinstance(data, etree._Element): 17 | self.node = data 18 | else: 19 | self.node = etree.fromstring(data) 20 | 21 | def get(self, name): 22 | return self.node.get(name) 23 | 24 | def all(self, xpath): 25 | # Yields all nodes matching the xpath 26 | for res in self.node.xpath(xpath, namespaces=self.nsmap): 27 | yield Element(res) 28 | 29 | def first(self, xpath): 30 | # Returns first node or None 31 | for res in self.all(xpath): 32 | return res 33 | 34 | def text(self, xpath=None, all=False): 35 | # xpath: the xpath 36 | # all: True to return an array with the text content for all matching elements. 37 | # False to return a string with the text content of the first matching element, or None. 38 | # Returns text content of first node or None 39 | 40 | def flatten_text(node): 41 | # Captions can include Processing Instruction tags, like in this example 42 | # (linebreaks added): 43 | # 44 | # 46 | # L 47 | # p 48 | # 49 | # -rom 50 | # 51 | # 52 | # The code below just strips away the PI tags, giving "Lp-rom" for this example. 53 | children = node.getchildren() 54 | if len(children) != 0: 55 | value = '' 56 | for child in children: 57 | if child.tail is not None: 58 | value += child.tail 59 | else: 60 | value = node.text 61 | return value 62 | 63 | if xpath is None: 64 | return flatten_text(self.node) 65 | if all: 66 | return [flatten_text(res.node) for res in self.all(xpath) if res.node.text is not None] 67 | for res in self.all(xpath): 68 | return flatten_text(res.node) # return text of first element 69 | 70 | def get_ess_codes(self): 71 | return [x[4:] for x in self.node.xpath('mx:subfield[@code="9"]/text()', namespaces=self.nsmap) if x.find('ess=') == 0] 72 | 73 | def reduce(self, fn, subfields=['a', 'c', 'i', 't', 'x'], initializer=''): 74 | codes = ['@code="%s"' % code for code in subfields] 75 | return reduce(fn, self.all('mx:subfield[%s]' % ' or '.join(codes)), initializer) 76 | 77 | def stringify(self, subfields=['a', 'c', 'i', 't', 'x']): 78 | def inner(label, subfield): 79 | code = subfield.get('code') 80 | value = subfield.text() 81 | if value is None: 82 | return label 83 | 84 | # Check if we need to add a separator 85 | if code == 'c': 86 | # Treat $c as the end of a number span, which is correct for the 6XX fields 87 | # in MARC21 Classification. In Marc21 Authority, $c generally seems to be 88 | # undefined, but we might add some checks here if there are some $c subfields 89 | # that need to be treated differently. 90 | value = '-' + value 91 | 92 | elif len(label) != 0 and not re.match(r'[.\?#@+,<>%~`!$^&\(\):;\]]', value[0]): 93 | # Unless the subfield starts with a punctuation character, we will add a space. 94 | value = ' ' + value 95 | 96 | return label + value 97 | 98 | return self.reduce(inner, subfields) 99 | -------------------------------------------------------------------------------- /mc2skos/error.py: -------------------------------------------------------------------------------- 1 | 2 | 3 | class InvalidRecordError(RuntimeError): 4 | 5 | def __init__(self, msg, control_number=None): 6 | super(InvalidRecordError, self).__init__(msg) 7 | self.control_number = control_number 8 | 9 | 10 | class UnknownSchemeError(InvalidRecordError): 11 | 12 | def __init__(self, code=None, **kwargs): 13 | if code is None: 14 | msg = 'Could not find classification scheme or subject vocabulary code.' 15 | else: 16 | msg = 'Cannot generate URIs for unknown classification scheme or subject vocabulary "%s".' % code 17 | super(UnknownSchemeError, self).__init__(msg) 18 | self.code = code 19 | self.control_number = kwargs.get('control_number') 20 | -------------------------------------------------------------------------------- /mc2skos/jskos-context.json: -------------------------------------------------------------------------------- 1 | { 2 | "dct": "http://purl.org/dc/terms/", 3 | "foaf": "http://xmlns.com/foaf/0.1/", 4 | "rdfs": "http://www.w3.org/2000/01/rdf-schema#", 5 | "void": "http://rdfs.org/ns/void#", 6 | "xsd": "http://www.w3.org/2001/XMLSchema#", 7 | "xskos": "http://rdf-vocabulary.ddialliance.org/xkos#", 8 | 9 | "uri": "@id", 10 | "type": { 11 | "@id": "http://www.w3.org/1999/02/22-rdf-syntax-ns#type", 12 | "@type": "@id", 13 | "@container": "@set" 14 | }, 15 | "created": { 16 | "@id": "dct:created", 17 | "@type": "xsd:date" 18 | }, 19 | "issued": { 20 | "@id": "dct:issued", 21 | "@type": "xsd:date" 22 | }, 23 | "modified": { 24 | "@id": "dct:modified", 25 | "@type": "xsd:date" 26 | }, 27 | "creator": { 28 | "@id": "dct:creator", 29 | "@container": "@set" 30 | }, 31 | "contributor": { 32 | "@id": "dct:contributor", 33 | "@container": "@set" 34 | }, 35 | "publisher": { 36 | "@id": "dct:publisher", 37 | "@container": "@set" 38 | }, 39 | "partOf": { 40 | "@id": "dct:isPartOf", 41 | "@container": "@set" 42 | }, 43 | 44 | "url": { 45 | "@id": "foaf:page", 46 | "@type": "@id" 47 | }, 48 | "identifier": { 49 | "@id": "dct:identifier", 50 | "@container": "@set" 51 | }, 52 | "notation": { 53 | "@id": "http://www.w3.org/2004/02/skos/core#notation", 54 | "@container": "@set" 55 | }, 56 | "prefLabel": { 57 | "@id": "http://www.w3.org/2004/02/skos/core#prefLabel", 58 | "@container": "@language" 59 | }, 60 | "altLabel": { 61 | "@id": "http://www.w3.org/2004/02/skos/core#altLabel", 62 | "@container": "@language" 63 | }, 64 | "hiddenLabel": { 65 | "@id": "http://www.w3.org/2004/02/skos/core#hiddenLabel", 66 | "@container": "@language" 67 | }, 68 | "scopeNote": { 69 | "@id": "http://www.w3.org/2004/02/skos/core#scopeNote", 70 | "@container": "@language" 71 | }, 72 | "definition": { 73 | "@id": "http://www.w3.org/2004/02/skos/core#definition", 74 | "@container": "@language" 75 | }, 76 | "example": { 77 | "@id": "http://www.w3.org/2004/02/skos/core#example", 78 | "@container": "@language" 79 | }, 80 | "historyNote": { 81 | "@id": "http://www.w3.org/2004/02/skos/core#historyNote", 82 | "@container": "@language" 83 | }, 84 | "editorialNote": { 85 | "@id": "http://www.w3.org/2004/02/skos/core#editorialNote", 86 | "@container": "@language" 87 | }, 88 | "changeNote": { 89 | "@id": "http://www.w3.org/2004/02/skos/core#changeNote", 90 | "@container": "@language" 91 | }, 92 | "subject": { 93 | "@id": "http://purl.org/dc/terms/subject", 94 | "@container": "@set" 95 | }, 96 | "subjectOf": { 97 | "@reverse": "http://purl.org/dc/terms/subject", 98 | "@container": "@set" 99 | }, 100 | "depiction": { 101 | "@id": "foaf:depiction", 102 | "@type": "@id", 103 | "@container": "@set" 104 | }, 105 | 106 | "narrower": { 107 | "@id": "http://www.w3.org/2004/02/skos/core#narrower", 108 | "@container": "@set" 109 | }, 110 | "broader": { 111 | "@id": "http://www.w3.org/2004/02/skos/core#broader", 112 | "@container": "@set" 113 | }, 114 | "related": { 115 | "@id": "http://www.w3.org/2004/02/skos/core#related", 116 | "@container": "@set" 117 | }, 118 | "previous": { 119 | "@id": "http://www.w3.org/2004/02/skos/core#previous", 120 | "@container": "@set" 121 | }, 122 | "next": { 123 | "@id": "http://www.w3.org/2004/02/skos/core#next", 124 | "@container": "@set" 125 | }, 126 | 127 | "startDate": "schema:startDate", 128 | "endDate": "schema:endDate", 129 | "relatedDate": "rdfs:seeAlso", 130 | "location": "http://schema.org/location", 131 | "ancestors": { 132 | "@id": "http://www.w3.org/2004/02/skos/core#broaderTransitive", 133 | "@container": "@set" 134 | }, 135 | "inScheme": { 136 | "@id": "http://www.w3.org/2004/02/skos/core#inScheme", 137 | "@container": "@set" 138 | }, 139 | "topConceptOf": { 140 | "@id": "http://www.w3.org/2004/02/skos/core#topConceptOf", 141 | "@container": "@set" 142 | }, 143 | 144 | "topConcepts": { 145 | "@id": "http://www.w3.org/2004/02/skos/core#hasTopConcept", 146 | "@container": "@set" 147 | }, 148 | "versionOf": { 149 | "@id": "dct:isVersionOf", 150 | "@container": "@set" 151 | }, 152 | "extent": "dct:extent", 153 | "languages": { 154 | "@id": "dct:language", 155 | "@container": "@set" 156 | }, 157 | "license": { 158 | "@id": "dct:license", 159 | "@container": "@set" 160 | }, 161 | 162 | "fromScheme": "void:subjectsTarget", 163 | "toScheme": "void:objectsTarget", 164 | 165 | "memberList": { 166 | "@id": "http://www.loc.gov/mads/rdf/v1#componentList", 167 | "@container": "@list" 168 | }, 169 | "memberSet": { 170 | "@id": "rdfs:member", 171 | "@container": "@list" 172 | }, 173 | "memberChoice": { 174 | "@id": "rdfs:member", 175 | "@container": "@list" 176 | } 177 | } 178 | -------------------------------------------------------------------------------- /mc2skos/reader.py: -------------------------------------------------------------------------------- 1 | # encoding=utf8 2 | import logging 3 | import time 4 | from lxml import etree 5 | 6 | logger = logging.getLogger(__name__) 7 | 8 | 9 | class MarcFileReader: 10 | """Read records from a MARC XML file.""" 11 | 12 | def __init__(self, name): 13 | self.name = name 14 | 15 | def records(self): 16 | logger.info('Parsing: %s', self.name) 17 | n = 0 18 | t0 = time.time() 19 | record_tag = '{http://www.loc.gov/MARC21/slim}record' 20 | for _, record in etree.iterparse(self.name, tag=record_tag): 21 | yield record 22 | record.clear() 23 | n += 1 24 | if n % 500 == 0: 25 | logger.info('Read %d records (%.f recs/sec)', n, (float(n) / (time.time() - t0))) 26 | -------------------------------------------------------------------------------- /mc2skos/util.py: -------------------------------------------------------------------------------- 1 | def is_uri(value): 2 | return value.startswith('http://') or value.startswith('https://') 3 | 4 | 5 | def is_str(obj): 6 | try: 7 | return isinstance(obj, basestring) # Python 2.x 8 | except NameError: 9 | return isinstance(obj, str) # Python 3.x 10 | -------------------------------------------------------------------------------- /mc2skos/vocabularies.py: -------------------------------------------------------------------------------- 1 | from future.utils import python_2_unicode_compatible 2 | import re 3 | import yaml 4 | from .error import UnknownSchemeError 5 | from .record import AuthorityRecord, ClassificationRecord 6 | from .util import is_str 7 | 8 | 9 | @python_2_unicode_compatible 10 | class Vocabularies(object): 11 | 12 | def __init__(self): 13 | self.entries = {} 14 | self.default_scheme = None 15 | 16 | def __iter__(self): 17 | for val in self.entries.values(): 18 | yield val 19 | 20 | def set_default_scheme(self, generic=None, concept=None, scheme=None, whitespace=None): 21 | # Set URI templates manually. This will override values in vocabulary.yml. 22 | if generic is None and concept is None and scheme is None: 23 | self.default_scheme = None 24 | return 25 | 26 | options = { 27 | 'base_uri': generic, 28 | 'concept': concept, 29 | 'scheme': scheme, 30 | 'whitespace': whitespace, 31 | } 32 | if scheme in self.entries: 33 | self.default_scheme = self.entries[scheme] 34 | else: 35 | self.default_scheme = ConceptScheme(options=options) 36 | 37 | def load_yaml(self, file): 38 | data = yaml.safe_load(file) 39 | for concept_type_key, vocabs in data.items(): 40 | concept_type = { 41 | 'classification_schemes': ClassificationRecord, 42 | 'subject_schemes': AuthorityRecord, 43 | }.get(concept_type_key) 44 | for scheme_code, options in vocabs.items(): 45 | if is_str(options): 46 | options = {'base_uri': options} 47 | self.entries[scheme_code] = ConceptScheme(concept_type, scheme_code, options=options) 48 | 49 | def get(self, scheme_code, edition=None): 50 | if scheme_code == 'n': 51 | raise UnknownSchemeError() 52 | if scheme_code not in self.entries: 53 | raise UnknownSchemeError(scheme_code) 54 | scheme = self.entries[scheme_code] 55 | if edition is not None: 56 | key = '%s-%s' % (scheme_code, edition) 57 | if key not in self.entries: 58 | self.entries[key] = scheme.with_edition(edition) 59 | return self.entries[key] 60 | return scheme 61 | 62 | def get_from_record(self, record): 63 | 64 | if self.default_scheme is not None: 65 | return self.default_scheme 66 | 67 | if isinstance(record, AuthorityRecord): 68 | field_008 = record.record.text('mx:controlfield[@tag="008"]') 69 | if field_008: 70 | code = field_008[11] 71 | if code == 'z': 72 | code = record.record.text('mx:datafield[@tag="040"]/mx:subfield[@code="f"]') 73 | 74 | if code: 75 | return self.get(code) 76 | 77 | if isinstance(record, ClassificationRecord): 78 | code = record.record.text('mx:datafield[@tag="084"]/mx:subfield[@code="a"]') 79 | edition = record.record.text('mx:datafield[@tag="084"]/mx:subfield[@code="c"]') 80 | if code: 81 | return self.get(code, edition=edition) 82 | 83 | raise UnknownSchemeError() 84 | 85 | 86 | @python_2_unicode_compatible 87 | class ConceptScheme(object): 88 | 89 | def __init__(self, concept_type=None, code=None, edition=None, options=None): 90 | options = options or {} 91 | self.type = concept_type 92 | self.code = code # Can be None if URI template is specified in options 93 | self.edition = edition 94 | self.options = options 95 | self.edition_numeric = re.sub('[^0-9]', '', edition or '') 96 | 97 | self.uri_templates = { 98 | 'concept': options.get('concept') or options.get('base_uri'), 99 | 'scheme': options.get('scheme') or options.get('base_uri'), 100 | } 101 | 102 | self.whitespace = options.get('whitespace') or '-' 103 | 104 | def with_edition(self, edition): 105 | # Get a specific edition of this scheme 106 | return ConceptScheme(self.type, self.code, edition, self.options) 107 | 108 | def __repr__(self): 109 | if self.edition is not None: 110 | return u'%s (%s ed.)' % (self.code, self.edition) 111 | return u'%s' % (self.code) 112 | 113 | def uri(self, uri_type, **kwargs): 114 | if uri_type not in self.uri_templates: 115 | raise ValueError('Unknown URI type: %s' % uri_type) 116 | 117 | uri_template = self.uri_templates[uri_type] 118 | if uri_template is None: 119 | raise UnknownSchemeError( 120 | self.code, 121 | message='No URI template found for URIs of type "%s" in vocabulary "%s"' % (uri_type, self.code) 122 | ) 123 | 124 | kwargs['edition'] = self.edition_numeric 125 | if uri_type == 'scheme': 126 | kwargs['control_number'] = '' 127 | 128 | if kwargs.get('control_number') is not None: 129 | # Remove organization prefix in parenthesis: 130 | kwargs['control_number'] = re.sub(r'^\(.+\)(.+)$', '\\1', kwargs['control_number']) 131 | 132 | # Process field[start:end] 133 | 134 | def process_formatter(matches): 135 | start = int(matches.group('start')) if matches.group('start') else None 136 | end = int(matches.group('end')) if matches.group('end') else None 137 | value = kwargs[matches.group('param')][start:end] 138 | if len(value) == 0: 139 | # Empty string can be used for the scheme URI. 140 | # Trying to convert this to decimal or float will fail! 141 | formatter_str = '{0}' 142 | else: 143 | formatter_str = '{0' + matches.group('formatter') + '}' if matches.group('formatter') else '{0}' 144 | if 'd' in formatter_str: 145 | value = int(value) 146 | elif 'f' in formatter_str: 147 | value = float(value) 148 | 149 | return formatter_str.format(value) 150 | 151 | uri_template = re.sub( 152 | r'\{(?P[a-z_]+)(?:\[(?P\d+)?:(?P\d+)?\])?(?P[:!][^\}]+)?\}', 153 | process_formatter, 154 | uri_template 155 | ) 156 | 157 | uri = uri_template.format(**kwargs) 158 | 159 | # replace whitespaces in URI 160 | return uri.replace(' ', self.whitespace) 161 | -------------------------------------------------------------------------------- /mc2skos/vocabularies.yml: -------------------------------------------------------------------------------- 1 | --- 2 | classification_schemes: 3 | asb: http://uri.gbv.de/terminology/asb/{object} 4 | bkl: http://uri.gbv.de/terminology/bk/{object} 5 | ddc: http://dewey.info/{collection}/{object}/e{edition}/ 6 | rvk: 7 | concept: http://rvk.uni-regensburg.de/nt/{object} 8 | scheme: http://rvk.uni-regensburg.de/nt/ 9 | whitespace: _ 10 | utklklass: 11 | concept: http://data.ub.uio.no/lklass/L{object[2:]} 12 | scheme: http://data.ub.uio.no/lklass/ 13 | subject_schemes: 14 | a: 15 | concept: http://id.loc.gov/authorities/subjects/{control_number} 16 | scheme: http://id.loc.gov/authorities/subjects 17 | d: http://lod.nal.usda.gov/nalt/{control_number[4:]:d} 18 | usvd: 19 | concept: http://data.ub.uio.no/usvd/c{control_number[4:]} 20 | scheme: http://data.ub.uio.no/usvd/ 21 | humord: 22 | concept: http://data.ub.uio.no/humord/c{control_number[4:]} 23 | scheme: http://data.ub.uio.no/humord/ 24 | noubojur: 25 | concept: http://data.ub.uio.no/lskjema/c{control_number[4:]:06d} 26 | scheme: http://data.ub.uio.no/lskjema/ 27 | noubomn: 28 | concept: http://data.ub.uio.no/realfagstermer/c{control_number[4:]} 29 | scheme: http://data.ub.uio.no/realfagstermer/ 30 | noubomr: 31 | concept: http://data.ub.uio.no/mrtermer/c{control_number[3:]} 32 | scheme: http://data.ub.uio.no/mrtermer/ 33 | gnd: 34 | concept: http://d-nb.info/gnd/{control_number} 35 | scheme: http://d-nb.info/gnd/ 36 | lccn: 37 | concept: http://id.loc.gov/authorities/names/{control_number} 38 | scheme: http://id.loc.gov/authorities/names/ 39 | lcgft: 40 | concept: http://id.loc.gov/authorities/genreForms/{control_number} 41 | scheme: http://id.loc.gov/authorities/genreForms 42 | ddcri: 43 | scheme: http://id.loc.gov/vocabulary/subjectSchemes/ddcri 44 | TESA: 45 | scheme: http://lod.nal.usda.gov/nalt/ 46 | viaf: 47 | concept: http://viaf.org/viaf/{control_number} 48 | wikidata: 49 | concept: http://www.wikidata.org/entity/{control_number} 50 | isni: 51 | concept: http://isni.org/{control_number} 52 | whitespace: '' # Remove whitespace in URIs 53 | orcid: 54 | concept: https://orcid.org/{control_number} 55 | -------------------------------------------------------------------------------- /pytest.ini: -------------------------------------------------------------------------------- 1 | # We need to keep this in `pytest.ini` instead of `setup.cfg` 2 | # because `pep8maxlinelength` is affected by 3 | # https://github.com/pytest-dev/pytest/issues/567 4 | 5 | [pytest] 6 | addopts = 7 | --verbose 8 | --pep8 9 | --cov=mc2skos 10 | --cov-report xml 11 | --cov-report term-missing 12 | pep8maxlinelength = 140 13 | pep8ignore = 14 | test/*.py E501 # Allow long lines in tests 15 | -------------------------------------------------------------------------------- /setup.cfg: -------------------------------------------------------------------------------- 1 | [bumpversion] 2 | current_version = 0.12.0 3 | commit = True 4 | tag = True 5 | 6 | [aliases] 7 | test = pytest 8 | 9 | [bumpversion:file:setup.py] 10 | 11 | [bumpversion:file:mc2skos/__init__.py] 12 | 13 | [bdist_wheel] 14 | universal = 1 15 | -------------------------------------------------------------------------------- /setup.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | # encoding=utf-8 3 | from __future__ import print_function 4 | import os 5 | import sys 6 | 7 | try: 8 | from setuptools import setup 9 | except ImportError: 10 | print("This package requires 'setuptools' to be installed.") 11 | sys.exit(1) 12 | 13 | here = os.path.abspath(os.path.dirname(__file__)) 14 | README = open(os.path.join(here, 'README.rst')).read() 15 | 16 | setup(name='mc2skos', 17 | version='0.12.0', # Use bumpversion to update 18 | description='Convert Marc21 Classification records in MARC/XML to SKOS/RDF ', 19 | long_description=README, 20 | classifiers=[ 21 | 'Programming Language :: Python', 22 | 'Programming Language :: Python :: 2.7', 23 | 'Programming Language :: Python :: 3.6', 24 | 'Programming Language :: Python :: 3.7', 25 | 'Programming Language :: Python :: 3.8', 26 | ], 27 | keywords='marc rdf skos', 28 | author='Dan Michael O. Heggø', 29 | author_email='danmichaelo@gmail.com', 30 | url='https://github.com/scriptotek/mc2skos', 31 | license='MIT', 32 | install_requires=['rdflib[sparql]', 33 | 'rdflib-jsonld', 34 | 'lxml', 35 | 'otsrdflib>=0.5.0,<0.6.0', 36 | 'iso-639', 37 | 'pyyaml', 38 | 'future', 39 | 'skosify>=2.0.1' 40 | ], 41 | setup_requires=['rdflib', 'pytest-runner>=2.9'], 42 | tests_require=['pytest', 'pytest-pep8', 'pytest-cov'], 43 | packages=['mc2skos'], 44 | entry_points={'console_scripts': ['mc2skos=mc2skos.mc2skos:main']}, 45 | package_data={ 46 | 'mc2skos': ['jskos-context.json', 'vocabularies.yml'] 47 | }, 48 | include_package_data=True 49 | ) 50 | -------------------------------------------------------------------------------- /test/test_153.py: -------------------------------------------------------------------------------- 1 | # encoding=utf-8 2 | import unittest 3 | import pytest 4 | from lxml import etree 5 | from mc2skos.mc2skos import ClassificationRecord, Element 6 | 7 | 8 | class TestParse153(unittest.TestCase): 9 | 10 | def testSimpleClass(self): 11 | element = Element(''' 12 | 13 | 003.5 14 | 003 15 | Generalities 16 | Systems 17 | Theory of communication and control 18 | 19 | ''') 20 | 21 | table, notation, is_top_concept, parent_notation, caption = ClassificationRecord.parse_153(element) 22 | 23 | assert notation == '003.5' 24 | assert parent_notation == '003' 25 | assert is_top_concept is False 26 | assert caption == 'Theory of communication and control' 27 | 28 | def testTableAddTableEntry(self): 29 | element = Element(''' 30 | 31 | 3B 32 | 81 33 | 89 34 | 1 35 | 02 36 | 3B 37 | 81 38 | 89 39 | Anekdoter, epigrammer, graffiti, vitser, vittigheter, sitater, gåter, tungekrøllere 40 | ess=ren 41 | ess=reh 42 | 43 | 44 | ''') 45 | 46 | table, notation, is_top_concept, parent_notation, caption = ClassificationRecord.parse_153(element) 47 | 48 | assert table == '3B' 49 | assert notation == '3B--81-89:02' 50 | assert is_top_concept is False 51 | assert parent_notation == '3B--81-89' 52 | assert caption == u'Anekdoter, epigrammer, graffiti, vitser, vittigheter, sitater, gåter, tungekrøllere' 53 | 54 | def testAddTableEntry(self): 55 | element = Element(''' 56 | 57 | 820.1 58 | 828 59 | 4 60 | 1 61 | 820 62 | Early period to 1858 63 | ess=reb 64 | ess=rhb 65 | 66 | ''') 67 | 68 | table, notation, is_top_concept, parent_notation, caption = ClassificationRecord.parse_153(element) 69 | 70 | assert table is None 71 | assert notation == '820.1-828:4;1' 72 | assert is_top_concept is False 73 | assert parent_notation == '820' 74 | assert caption == u'Early period to 1858' 75 | 76 | def testTableEntryOldStyle(self): 77 | element = Element(''' 78 | 79 | 6 80 | 9839 81 | Languages 82 | Other languages 83 | South American native languages 84 | Quechuan (Kechuan), Aymaran, Tucanoan, Tupí, Arawakan languages 85 | Arawakan languages 86 | 87 | ''') 88 | 89 | table, notation, is_top_concept, parent_notation, caption = ClassificationRecord.parse_153(element) 90 | 91 | assert table == '6' 92 | assert notation == '6--9839' 93 | assert is_top_concept is False 94 | assert parent_notation is None 95 | assert caption == u'Arawakan languages' 96 | 97 | def testComplexTableEntryWithUndocumentStuff(self): 98 | # Test that none of the extra stuff (after $f) leaks into the notation 99 | element = Element(''' 100 | 101 | 1 102 | 0926 103 | 1 104 | 0923 105 | 0928 106 | Samlingsbiografier om personer inndelt etter diverse sosiale kjennetegn 107 | [tidligere 108 | 1 109 | 0922 110 | , 111 | 1 112 | 0923 113 | ] 114 | ess=ten 115 | ess=eh 116 | ess=nrl 117 | 118 | ''') 119 | 120 | table, notation, is_top_concept, parent_notation, caption = ClassificationRecord.parse_153(element) 121 | 122 | assert table == '1' 123 | assert notation == '1--0926' 124 | assert is_top_concept is False 125 | assert parent_notation == '1--0923-0928' 126 | assert caption == u'Samlingsbiografier om personer inndelt etter diverse sosiale kjennetegn' 127 | 128 | def testStandardSubdivisionInfo(self): 129 | element = Element(''' 130 | 131 | 973 132 | ess=si1 133 | 134 | ''') 135 | 136 | table, notation, is_top_concept, parent_notation, caption = ClassificationRecord.parse_153(element) 137 | 138 | assert table is None 139 | assert notation == '973' 140 | assert caption is None 141 | 142 | def testSynthesizedNumber(self): 143 | element = Element(''' 144 | 145 | 001.4092 146 | 001.4 147 | ess=ien 148 | 149 | ''') 150 | 151 | table, notation, is_top_concept, parent_notation, caption = ClassificationRecord.parse_153(element) 152 | 153 | assert table is None 154 | assert is_top_concept is False 155 | assert notation == '001.4092' 156 | assert parent_notation == '001.4' 157 | assert caption is None 158 | 159 | def testExtraSubfields(self): 160 | element = Element(''' 161 | 162 | 332.0240081 163 | 332.0240088 164 | 332.024001 165 | 332.024009 166 | Miscellaneous specific kinds of persons 167 | [formerly 168 | 332.02404 169 | 332.0249 170 | ] 171 | ess=en 172 | ess=eh 173 | ess=nrl 174 | 175 | ''') 176 | 177 | table, notation, is_top_concept, parent_notation, caption = ClassificationRecord.parse_153(element) 178 | 179 | assert table is None 180 | assert is_top_concept is False 181 | assert notation == '332.0240081-332.0240088' 182 | assert parent_notation == '332.024001-332.024009' 183 | assert caption == 'Miscellaneous specific kinds of persons' 184 | 185 | 186 | if __name__ == '__main__': 187 | unittest.main() 188 | -------------------------------------------------------------------------------- /test/test_process_examples.py: -------------------------------------------------------------------------------- 1 | # encoding=utf-8 2 | import unittest 3 | import pytest 4 | import os 5 | import sys 6 | import glob 7 | import re 8 | from lxml import etree 9 | from mc2skos.reader import MarcFileReader 10 | from mc2skos.mc2skos import process_records 11 | from mc2skos.vocabularies import Vocabularies 12 | from rdflib.namespace import RDF, SKOS, OWL, DCTERMS, Namespace 13 | from rdflib import URIRef, Literal, Graph 14 | 15 | 16 | with open('mc2skos/vocabularies.yml') as fp: 17 | vocabularies = Vocabularies() 18 | vocabularies.load_yaml(fp) 19 | 20 | 21 | def examples(pattern): 22 | pattern = '^(examples/%s)\.xml$' % (pattern) 23 | files = glob.glob('examples/*.xml') 24 | files = filter(lambda x: re.match(pattern, x), files) 25 | 26 | return [(MarcFileReader(f), re.match(pattern, f)) for f in files] 27 | 28 | 29 | def check_processing(marc, expect, **kwargs): 30 | kwargs['vocabularies'] = vocabularies 31 | graph = process_records(marc.records(), **kwargs) 32 | filename = re.sub('xml$', 'ttl', marc.name) 33 | 34 | graph.namespace_manager.bind('skos', SKOS) 35 | graph.namespace_manager.bind('owl', OWL) 36 | graph.namespace_manager.bind('dcterms', DCTERMS) 37 | 38 | if os.path.isfile(filename): 39 | expect.parse(filename, format='turtle') 40 | elif len(graph) > 0: 41 | graph.serialize(destination=filename, format='turtle') 42 | 43 | # graph.serialize(destination=sys.stdout, format='turtle') 44 | 45 | for triple in expect: 46 | assert triple in graph 47 | 48 | 49 | @pytest.mark.parametrize('marc,match', 50 | examples('ddc(?P\d{2})(?P[a-z]+)-' 51 | '(?P((?P\d+)--)?[\d.]+-?[\d.]*)')) 52 | def test_ddc_example(marc, match): 53 | edition = match.group('edition') 54 | notation = match.group('notation') 55 | table = match.group('table') 56 | 57 | expect = Graph() 58 | uri = URIRef(u'http://dewey.info/class/' + notation + '/e' + edition + '/') 59 | expect.add((uri, RDF.type, SKOS.Concept)) 60 | if table: 61 | notation = "T" + notation 62 | expect.add((uri, SKOS.notation, Literal(notation))) 63 | 64 | check_processing(marc, expect, include_webdewey=True) 65 | 66 | 67 | @pytest.mark.parametrize('marc,match', 68 | examples('(?Pbk|asb)-(?P[0-9.]+)')) 69 | def test_bk_asb_example(marc, match): 70 | scheme = match.group('scheme') 71 | notation = match.group('notation') 72 | 73 | expect = Graph() 74 | uri = URIRef(u'http://uri.gbv.de/terminology/{}/{}'.format(scheme, notation)) 75 | expect.add((uri, RDF.type, SKOS.Concept)) 76 | 77 | check_processing(marc, expect, include_altlabels=True) 78 | 79 | 80 | @pytest.mark.parametrize('marc,match', examples('rvk(-.*)?')) 81 | def test_rvk_example(marc, match): 82 | 83 | options = { 84 | 'include_altlabels': True, 85 | } 86 | 87 | check_processing(marc, Graph(), **options) 88 | 89 | authority_vocabularies = { 90 | 'lcgft': 'http://id.loc.gov/authorities/genreForms/', 91 | 'lcsh': 'http://id.loc.gov/authorities/subjects/', 92 | 'noubomn': 'http://data.ub.uio.no/realfagstermer/', 93 | 'noubojur': 'http://data.ub.uio.no/lskjema/', 94 | 'humord': 'http://data.ub.uio.no/humord/', 95 | 'nalt': 'http://lod.nal.usda.gov/nalt/', 96 | 'gnd': 'http://d-nb.info/gnd/', 97 | } 98 | 99 | 100 | @pytest.mark.parametrize('marc,match', 101 | examples('(?P' + '|'.join(authority_vocabularies.keys()) + ')-(?P.+)')) 102 | def test_authority_example(marc, match): 103 | vocabulary = match.group('vocabulary') 104 | control_number = match.group('control_number') 105 | 106 | uri_base = authority_vocabularies[vocabulary] 107 | 108 | expect = Graph() 109 | uri = URIRef(uri_base + control_number) 110 | expect.add((uri, RDF.type, SKOS.Concept)) 111 | 112 | if vocabulary == 'gnd': 113 | # For GND, we need to specify --scheme gnd 114 | # See: https://github.com/scriptotek/mc2skos/issues/56 115 | vocabularies.set_default_scheme(scheme='gnd') 116 | 117 | check_processing(marc, expect, include_altlabels=True) 118 | vocabularies.set_default_scheme() 119 | 120 | if __name__ == '__main__': 121 | unittest.main() 122 | -------------------------------------------------------------------------------- /test/test_skosify.py: -------------------------------------------------------------------------------- 1 | # encoding=utf-8 2 | import unittest 3 | import pytest 4 | from rdflib import Graph, URIRef, Namespace 5 | from rdflib.namespace import SKOS 6 | 7 | from mc2skos.mc2skos import process_records 8 | from mc2skos.reader import MarcFileReader 9 | from mc2skos.vocabularies import Vocabularies 10 | 11 | BK = Namespace('http://uri.gbv.de/terminology/bk/') 12 | 13 | 14 | with open('mc2skos/vocabularies.yml') as fp: 15 | vocabularies = Vocabularies() 16 | vocabularies.load_yaml(fp) 17 | 18 | 19 | def test_skosify(): 20 | marc = MarcFileReader('examples/bk-54.65.xml') 21 | rdf = process_records(marc.records(), expand=True, vocabularies=vocabularies) 22 | 23 | assert (BK['54'], SKOS.narrower, BK['54.65']) in rdf 24 | -------------------------------------------------------------------------------- /test/test_stringify.py: -------------------------------------------------------------------------------- 1 | # encoding=utf-8 2 | import unittest 3 | import pytest 4 | from lxml import etree 5 | from mc2skos.mc2skos import Element 6 | 7 | 8 | class TestStringify(unittest.TestCase): 9 | 10 | def setUp(self): 11 | pass 12 | 13 | def testSeeNote(self): 14 | elem = Element(etree.fromstring(u""" 15 | 16 | Vitenskap og lærdom 17 | , se 18 | 001.2 19 | ess=nse 20 | 21 | """)) 22 | assert elem.stringify() == u'Vitenskap og lærdom, se 001.2' 23 | 24 | def testSeeAlsoNote(self): 25 | elem = Element(etree.fromstring(u""" 26 | 27 | Se også 28 | 900 29 | for en 30 | bred beskrivelse av situasjon og vilkår for intellektuell virksomhet 31 | ess=nsa 32 | 33 | """)) 34 | assert elem.stringify() == u'Se også 900 for en bred beskrivelse av situasjon og vilkår for intellektuell virksomhet' 35 | 36 | def testNoteWithClassNumberRange(self): 37 | elem = Element(etree.fromstring(u""" 38 | 39 | Klassifiser 40 | andre bestemte internasjonale språk 41 | med språket i 42 | 420 43 | 490 44 | , f.eks. 45 | latin som et diplomatspråk 46 | 470 47 | , 48 | swahili som et lingua franca 49 | 496.392 50 | ess=ncw 51 | 52 | """)) 53 | assert elem.stringify() == u'Klassifiser andre bestemte internasjonale språk med språket i 420-490, f.eks. latin som et diplomatspråk, swahili som et lingua franca' 54 | 55 | def testComplexNote(self): 56 | elem = Element(etree.fromstring(u""" 57 | 58 | Inkluderer: 59 | Case-studier 60 | [tidligere 61 | 001.432 62 | ]; 63 | utvalgsteknikker 64 | ; 65 | rundspørringer 66 | , 67 | spørreskjemaer 68 | , 69 | feltarbeid 70 | , 71 | deltakende observasjon 72 | , 73 | intervjuer 74 | ess=nin 75 | 76 | """)) 77 | assert elem.stringify() == u'Inkluderer: Case-studier [tidligere 001.432]; utvalgsteknikker; rundspørringer, spørreskjemaer, feltarbeid, deltakende observasjon, intervjuer' 78 | 79 | 80 | if __name__ == '__main__': 81 | unittest.main() 82 | --------------------------------------------------------------------------------