ddigraph 0.4.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- ddigraph-0.4.0/.gitignore +217 -0
- ddigraph-0.4.0/CONTRIBUTING.md +65 -0
- ddigraph-0.4.0/LICENSE +21 -0
- ddigraph-0.4.0/NOTICE +2 -0
- ddigraph-0.4.0/PKG-INFO +256 -0
- ddigraph-0.4.0/README.md +160 -0
- ddigraph-0.4.0/pyproject.toml +262 -0
- ddigraph-0.4.0/schemas/README.md +59 -0
- ddigraph-0.4.0/schemas/__init__.py +0 -0
- ddigraph-0.4.0/schemas/ddi/v3_1/XHTML/xhtml-attribs-1.xsd +82 -0
- ddigraph-0.4.0/schemas/ddi/v3_1/XHTML/xhtml-bdo-1.xsd +85 -0
- ddigraph-0.4.0/schemas/ddi/v3_1/XHTML/xhtml-blkphras-1.xsd +206 -0
- ddigraph-0.4.0/schemas/ddi/v3_1/XHTML/xhtml-blkpres-1.xsd +42 -0
- ddigraph-0.4.0/schemas/ddi/v3_1/XHTML/xhtml-blkstruct-1.xsd +57 -0
- ddigraph-0.4.0/schemas/ddi/v3_1/XHTML/xhtml-charent-1.xsd +41 -0
- ddigraph-0.4.0/schemas/ddi/v3_1/XHTML/xhtml-datatypes-1.xsd +147 -0
- ddigraph-0.4.0/schemas/ddi/v3_1/XHTML/xhtml-framework-1.xsd +74 -0
- ddigraph-0.4.0/schemas/ddi/v3_1/XHTML/xhtml-hypertext-1.xsd +51 -0
- ddigraph-0.4.0/schemas/ddi/v3_1/XHTML/xhtml-inlphras-1.xsd +220 -0
- ddigraph-0.4.0/schemas/ddi/v3_1/XHTML/xhtml-inlpres-1.xsd +56 -0
- ddigraph-0.4.0/schemas/ddi/v3_1/XHTML/xhtml-inlstruct-1.xsd +60 -0
- ddigraph-0.4.0/schemas/ddi/v3_1/XHTML/xhtml-inlstyle-1.xsd +27 -0
- ddigraph-0.4.0/schemas/ddi/v3_1/XHTML/xhtml-lat1.ent +121 -0
- ddigraph-0.4.0/schemas/ddi/v3_1/XHTML/xhtml-list-1.xsd +128 -0
- ddigraph-0.4.0/schemas/ddi/v3_1/XHTML/xhtml-notations-1.xsd +105 -0
- ddigraph-0.4.0/schemas/ddi/v3_1/XHTML/xhtml-pres-1.xsd +53 -0
- ddigraph-0.4.0/schemas/ddi/v3_1/XHTML/xhtml-special.ent +82 -0
- ddigraph-0.4.0/schemas/ddi/v3_1/XHTML/xhtml-symbol.ent +204 -0
- ddigraph-0.4.0/schemas/ddi/v3_1/XHTML/xhtml-table-1.xsd +323 -0
- ddigraph-0.4.0/schemas/ddi/v3_1/XHTML/xhtml-text-1.xsd +70 -0
- ddigraph-0.4.0/schemas/ddi/v3_1/archive.xsd +1797 -0
- ddigraph-0.4.0/schemas/ddi/v3_1/comparative.xsd +570 -0
- ddigraph-0.4.0/schemas/ddi/v3_1/conceptualcomponent.xsd +1517 -0
- ddigraph-0.4.0/schemas/ddi/v3_1/datacollection.xsd +7300 -0
- ddigraph-0.4.0/schemas/ddi/v3_1/dataset.xsd +243 -0
- ddigraph-0.4.0/schemas/ddi/v3_1/dc.xsd +119 -0
- ddigraph-0.4.0/schemas/ddi/v3_1/dcmitype.xsd +53 -0
- ddigraph-0.4.0/schemas/ddi/v3_1/dcterms.xsd +383 -0
- ddigraph-0.4.0/schemas/ddi/v3_1/ddi-xhtml11-model-1.xsd +462 -0
- ddigraph-0.4.0/schemas/ddi/v3_1/ddi-xhtml11-modules-1.xsd +537 -0
- ddigraph-0.4.0/schemas/ddi/v3_1/ddi-xhtml11.xsd +83 -0
- ddigraph-0.4.0/schemas/ddi/v3_1/ddiprofile.xsd +227 -0
- ddigraph-0.4.0/schemas/ddi/v3_1/group.xsd +1403 -0
- ddigraph-0.4.0/schemas/ddi/v3_1/instance_3_1.xsd +406 -0
- ddigraph-0.4.0/schemas/ddi/v3_1/logicalproduct.xsd +3488 -0
- ddigraph-0.4.0/schemas/ddi/v3_1/physicaldataproduct.xsd +813 -0
- ddigraph-0.4.0/schemas/ddi/v3_1/physicaldataproduct_ncube_inline.xsd +221 -0
- ddigraph-0.4.0/schemas/ddi/v3_1/physicaldataproduct_ncube_normal.xsd +237 -0
- ddigraph-0.4.0/schemas/ddi/v3_1/physicaldataproduct_ncube_tabular.xsd +283 -0
- ddigraph-0.4.0/schemas/ddi/v3_1/physicaldataproduct_proprietary.xsd +237 -0
- ddigraph-0.4.0/schemas/ddi/v3_1/physicalinstance.xsd +833 -0
- ddigraph-0.4.0/schemas/ddi/v3_1/reusable.xsd +8337 -0
- ddigraph-0.4.0/schemas/ddi/v3_1/studyunit.xsd +325 -0
- ddigraph-0.4.0/schemas/ddi/v3_1/xml.xsd +76 -0
- ddigraph-0.4.0/schemas/ddi/v3_2/XHTML/xhtml-attribs-1.xsd +82 -0
- ddigraph-0.4.0/schemas/ddi/v3_2/XHTML/xhtml-bdo-1.xsd +85 -0
- ddigraph-0.4.0/schemas/ddi/v3_2/XHTML/xhtml-blkphras-1.xsd +206 -0
- ddigraph-0.4.0/schemas/ddi/v3_2/XHTML/xhtml-blkpres-1.xsd +42 -0
- ddigraph-0.4.0/schemas/ddi/v3_2/XHTML/xhtml-blkstruct-1.xsd +57 -0
- ddigraph-0.4.0/schemas/ddi/v3_2/XHTML/xhtml-charent-1.xsd +41 -0
- ddigraph-0.4.0/schemas/ddi/v3_2/XHTML/xhtml-datatypes-1.xsd +147 -0
- ddigraph-0.4.0/schemas/ddi/v3_2/XHTML/xhtml-framework-1.xsd +74 -0
- ddigraph-0.4.0/schemas/ddi/v3_2/XHTML/xhtml-hypertext-1.xsd +51 -0
- ddigraph-0.4.0/schemas/ddi/v3_2/XHTML/xhtml-inlphras-1.xsd +220 -0
- ddigraph-0.4.0/schemas/ddi/v3_2/XHTML/xhtml-inlpres-1.xsd +56 -0
- ddigraph-0.4.0/schemas/ddi/v3_2/XHTML/xhtml-inlstruct-1.xsd +60 -0
- ddigraph-0.4.0/schemas/ddi/v3_2/XHTML/xhtml-inlstyle-1.xsd +27 -0
- ddigraph-0.4.0/schemas/ddi/v3_2/XHTML/xhtml-lat1.ent +121 -0
- ddigraph-0.4.0/schemas/ddi/v3_2/XHTML/xhtml-list-1.xsd +128 -0
- ddigraph-0.4.0/schemas/ddi/v3_2/XHTML/xhtml-notations-1.xsd +105 -0
- ddigraph-0.4.0/schemas/ddi/v3_2/XHTML/xhtml-pres-1.xsd +53 -0
- ddigraph-0.4.0/schemas/ddi/v3_2/XHTML/xhtml-special.ent +82 -0
- ddigraph-0.4.0/schemas/ddi/v3_2/XHTML/xhtml-symbol.ent +204 -0
- ddigraph-0.4.0/schemas/ddi/v3_2/XHTML/xhtml-table-1.xsd +323 -0
- ddigraph-0.4.0/schemas/ddi/v3_2/XHTML/xhtml-text-1.xsd +70 -0
- ddigraph-0.4.0/schemas/ddi/v3_2/archive.xsd +1797 -0
- ddigraph-0.4.0/schemas/ddi/v3_2/comparative.xsd +570 -0
- ddigraph-0.4.0/schemas/ddi/v3_2/conceptualcomponent.xsd +1517 -0
- ddigraph-0.4.0/schemas/ddi/v3_2/datacollection.xsd +7300 -0
- ddigraph-0.4.0/schemas/ddi/v3_2/dataset.xsd +243 -0
- ddigraph-0.4.0/schemas/ddi/v3_2/dc.xsd +119 -0
- ddigraph-0.4.0/schemas/ddi/v3_2/dcmitype.xsd +53 -0
- ddigraph-0.4.0/schemas/ddi/v3_2/dcterms.xsd +383 -0
- ddigraph-0.4.0/schemas/ddi/v3_2/ddi-xhtml11-model-1.xsd +462 -0
- ddigraph-0.4.0/schemas/ddi/v3_2/ddi-xhtml11-modules-1.xsd +537 -0
- ddigraph-0.4.0/schemas/ddi/v3_2/ddi-xhtml11.xsd +83 -0
- ddigraph-0.4.0/schemas/ddi/v3_2/ddiprofile.xsd +227 -0
- ddigraph-0.4.0/schemas/ddi/v3_2/group.xsd +1403 -0
- ddigraph-0.4.0/schemas/ddi/v3_2/instance_3_2.xsd +406 -0
- ddigraph-0.4.0/schemas/ddi/v3_2/logicalproduct.xsd +3488 -0
- ddigraph-0.4.0/schemas/ddi/v3_2/physicaldataproduct.xsd +813 -0
- ddigraph-0.4.0/schemas/ddi/v3_2/physicaldataproduct_ncube_inline.xsd +221 -0
- ddigraph-0.4.0/schemas/ddi/v3_2/physicaldataproduct_ncube_normal.xsd +237 -0
- ddigraph-0.4.0/schemas/ddi/v3_2/physicaldataproduct_ncube_tabular.xsd +283 -0
- ddigraph-0.4.0/schemas/ddi/v3_2/physicaldataproduct_proprietary.xsd +237 -0
- ddigraph-0.4.0/schemas/ddi/v3_2/physicalinstance.xsd +833 -0
- ddigraph-0.4.0/schemas/ddi/v3_2/reusable.xsd +8337 -0
- ddigraph-0.4.0/schemas/ddi/v3_2/studyunit.xsd +325 -0
- ddigraph-0.4.0/schemas/ddi/v3_2/xml.xsd +76 -0
- ddigraph-0.4.0/schemas/ddi/v3_3/XHTML/xhtml-attribs-1.xsd +82 -0
- ddigraph-0.4.0/schemas/ddi/v3_3/XHTML/xhtml-bdo-1.xsd +85 -0
- ddigraph-0.4.0/schemas/ddi/v3_3/XHTML/xhtml-blkphras-1.xsd +206 -0
- ddigraph-0.4.0/schemas/ddi/v3_3/XHTML/xhtml-blkpres-1.xsd +42 -0
- ddigraph-0.4.0/schemas/ddi/v3_3/XHTML/xhtml-blkstruct-1.xsd +57 -0
- ddigraph-0.4.0/schemas/ddi/v3_3/XHTML/xhtml-charent-1.xsd +41 -0
- ddigraph-0.4.0/schemas/ddi/v3_3/XHTML/xhtml-datatypes-1.xsd +147 -0
- ddigraph-0.4.0/schemas/ddi/v3_3/XHTML/xhtml-framework-1.xsd +74 -0
- ddigraph-0.4.0/schemas/ddi/v3_3/XHTML/xhtml-hypertext-1.xsd +51 -0
- ddigraph-0.4.0/schemas/ddi/v3_3/XHTML/xhtml-inlphras-1.xsd +220 -0
- ddigraph-0.4.0/schemas/ddi/v3_3/XHTML/xhtml-inlpres-1.xsd +56 -0
- ddigraph-0.4.0/schemas/ddi/v3_3/XHTML/xhtml-inlstruct-1.xsd +60 -0
- ddigraph-0.4.0/schemas/ddi/v3_3/XHTML/xhtml-inlstyle-1.xsd +27 -0
- ddigraph-0.4.0/schemas/ddi/v3_3/XHTML/xhtml-lat1.ent +121 -0
- ddigraph-0.4.0/schemas/ddi/v3_3/XHTML/xhtml-list-1.xsd +128 -0
- ddigraph-0.4.0/schemas/ddi/v3_3/XHTML/xhtml-notations-1.xsd +105 -0
- ddigraph-0.4.0/schemas/ddi/v3_3/XHTML/xhtml-pres-1.xsd +53 -0
- ddigraph-0.4.0/schemas/ddi/v3_3/XHTML/xhtml-special.ent +82 -0
- ddigraph-0.4.0/schemas/ddi/v3_3/XHTML/xhtml-symbol.ent +204 -0
- ddigraph-0.4.0/schemas/ddi/v3_3/XHTML/xhtml-table-1.xsd +323 -0
- ddigraph-0.4.0/schemas/ddi/v3_3/XHTML/xhtml-text-1.xsd +70 -0
- ddigraph-0.4.0/schemas/ddi/v3_3/archive.xsd +1797 -0
- ddigraph-0.4.0/schemas/ddi/v3_3/comparative.xsd +570 -0
- ddigraph-0.4.0/schemas/ddi/v3_3/conceptualcomponent.xsd +1517 -0
- ddigraph-0.4.0/schemas/ddi/v3_3/datacollection.xsd +7300 -0
- ddigraph-0.4.0/schemas/ddi/v3_3/dataset.xsd +243 -0
- ddigraph-0.4.0/schemas/ddi/v3_3/dc.xsd +119 -0
- ddigraph-0.4.0/schemas/ddi/v3_3/dcmitype.xsd +53 -0
- ddigraph-0.4.0/schemas/ddi/v3_3/dcterms.xsd +383 -0
- ddigraph-0.4.0/schemas/ddi/v3_3/ddi-xhtml11-model-1.xsd +462 -0
- ddigraph-0.4.0/schemas/ddi/v3_3/ddi-xhtml11-modules-1.xsd +537 -0
- ddigraph-0.4.0/schemas/ddi/v3_3/ddi-xhtml11.xsd +83 -0
- ddigraph-0.4.0/schemas/ddi/v3_3/ddiprofile.xsd +227 -0
- ddigraph-0.4.0/schemas/ddi/v3_3/group.xsd +1403 -0
- ddigraph-0.4.0/schemas/ddi/v3_3/instance_3_3.xsd +406 -0
- ddigraph-0.4.0/schemas/ddi/v3_3/logicalproduct.xsd +3488 -0
- ddigraph-0.4.0/schemas/ddi/v3_3/physicaldataproduct.xsd +813 -0
- ddigraph-0.4.0/schemas/ddi/v3_3/physicaldataproduct_ncube_inline.xsd +221 -0
- ddigraph-0.4.0/schemas/ddi/v3_3/physicaldataproduct_ncube_normal.xsd +237 -0
- ddigraph-0.4.0/schemas/ddi/v3_3/physicaldataproduct_ncube_tabular.xsd +283 -0
- ddigraph-0.4.0/schemas/ddi/v3_3/physicaldataproduct_proprietary.xsd +237 -0
- ddigraph-0.4.0/schemas/ddi/v3_3/physicalinstance.xsd +833 -0
- ddigraph-0.4.0/schemas/ddi/v3_3/reusable.xsd +8337 -0
- ddigraph-0.4.0/schemas/ddi/v3_3/studyunit.xsd +325 -0
- ddigraph-0.4.0/schemas/ddi/v3_3/xml.xsd +76 -0
- ddigraph-0.4.0/schemas/ddi-c/XHTML/xhtml-attribs-1.xsd +82 -0
- ddigraph-0.4.0/schemas/ddi-c/XHTML/xhtml-bdo-1.xsd +85 -0
- ddigraph-0.4.0/schemas/ddi-c/XHTML/xhtml-blkphras-1.xsd +206 -0
- ddigraph-0.4.0/schemas/ddi-c/XHTML/xhtml-blkpres-1.xsd +42 -0
- ddigraph-0.4.0/schemas/ddi-c/XHTML/xhtml-blkstruct-1.xsd +57 -0
- ddigraph-0.4.0/schemas/ddi-c/XHTML/xhtml-charent-1.xsd +41 -0
- ddigraph-0.4.0/schemas/ddi-c/XHTML/xhtml-datatypes-1.xsd +147 -0
- ddigraph-0.4.0/schemas/ddi-c/XHTML/xhtml-framework-1.xsd +74 -0
- ddigraph-0.4.0/schemas/ddi-c/XHTML/xhtml-hypertext-1.xsd +51 -0
- ddigraph-0.4.0/schemas/ddi-c/XHTML/xhtml-inlphras-1.xsd +220 -0
- ddigraph-0.4.0/schemas/ddi-c/XHTML/xhtml-inlpres-1.xsd +56 -0
- ddigraph-0.4.0/schemas/ddi-c/XHTML/xhtml-inlstruct-1.xsd +60 -0
- ddigraph-0.4.0/schemas/ddi-c/XHTML/xhtml-inlstyle-1.xsd +27 -0
- ddigraph-0.4.0/schemas/ddi-c/XHTML/xhtml-lat1.ent +121 -0
- ddigraph-0.4.0/schemas/ddi-c/XHTML/xhtml-list-1.xsd +128 -0
- ddigraph-0.4.0/schemas/ddi-c/XHTML/xhtml-notations-1.xsd +105 -0
- ddigraph-0.4.0/schemas/ddi-c/XHTML/xhtml-pres-1.xsd +53 -0
- ddigraph-0.4.0/schemas/ddi-c/XHTML/xhtml-special.ent +82 -0
- ddigraph-0.4.0/schemas/ddi-c/XHTML/xhtml-symbol.ent +204 -0
- ddigraph-0.4.0/schemas/ddi-c/XHTML/xhtml-table-1.xsd +323 -0
- ddigraph-0.4.0/schemas/ddi-c/XHTML/xhtml-text-1.xsd +70 -0
- ddigraph-0.4.0/schemas/ddi-c/codebook.xsd +11702 -0
- ddigraph-0.4.0/schemas/ddi-c/dc.xsd +118 -0
- ddigraph-0.4.0/schemas/ddi-c/dcmitype.xsd +50 -0
- ddigraph-0.4.0/schemas/ddi-c/dcterms.xsd +382 -0
- ddigraph-0.4.0/schemas/ddi-c/ddi-xhtml11-model-1.xsd +493 -0
- ddigraph-0.4.0/schemas/ddi-c/ddi-xhtml11-modules-1.xsd +581 -0
- ddigraph-0.4.0/schemas/ddi-c/ddi-xhtml11.xsd +116 -0
- ddigraph-0.4.0/schemas/ddi-c/xml.xsd +80 -0
- ddigraph-0.4.0/schemas/ddi-cdi/ontology/Agents.onto.ttl +456 -0
- ddigraph-0.4.0/schemas/ddi-cdi/ontology/Classes.onto.ttl +28 -0
- ddigraph-0.4.0/schemas/ddi-cdi/ontology/Components.onto.ttl +352 -0
- ddigraph-0.4.0/schemas/ddi-cdi/ontology/Conceptual.onto.ttl +1315 -0
- ddigraph-0.4.0/schemas/ddi-cdi/ontology/DDICDILibrary.onto.ttl +24 -0
- ddigraph-0.4.0/schemas/ddi-cdi/ontology/DataDescription.onto.ttl +530 -0
- ddigraph-0.4.0/schemas/ddi-cdi/ontology/DataTypes.onto.ttl +91 -0
- ddigraph-0.4.0/schemas/ddi-cdi/ontology/Dimensional.onto.ttl +315 -0
- ddigraph-0.4.0/schemas/ddi-cdi/ontology/Enumerations.onto.ttl +554 -0
- ddigraph-0.4.0/schemas/ddi-cdi/ontology/FormatDescription.onto.ttl +1775 -0
- ddigraph-0.4.0/schemas/ddi-cdi/ontology/KeyValue.onto.ttl +118 -0
- ddigraph-0.4.0/schemas/ddi-cdi/ontology/Long.onto.ttl +202 -0
- ddigraph-0.4.0/schemas/ddi-cdi/ontology/Process.onto.ttl +698 -0
- ddigraph-0.4.0/schemas/ddi-cdi/ontology/Representations.onto.ttl +1998 -0
- ddigraph-0.4.0/schemas/ddi-cdi/ontology/StructuredDataTypes.onto.ttl +2022 -0
- ddigraph-0.4.0/schemas/ddi-cdi/ontology/Wide.onto.ttl +66 -0
- ddigraph-0.4.0/schemas/ddi-cdi/ontology/ddi-cdi.onto.ttl +23 -0
- ddigraph-0.4.0/schemas/ddi-cdi/xml-schema/ddi-cdi.xsd +21290 -0
- ddigraph-0.4.0/schemas/ddi-cdi/xml-schema/xml.xsd +76 -0
- ddigraph-0.4.0/schemas/license.txt +117 -0
- ddigraph-0.4.0/schemas/manifest.json +215 -0
- ddigraph-0.4.0/schemas/readme.txt +169 -0
- ddigraph-0.4.0/scripts/update_schemas.py +409 -0
- ddigraph-0.4.0/src/ddigraph/__init__.py +108 -0
- ddigraph-0.4.0/src/ddigraph/api.py +296 -0
- ddigraph-0.4.0/src/ddigraph/cli.py +694 -0
- ddigraph-0.4.0/src/ddigraph/config.py +202 -0
- ddigraph-0.4.0/src/ddigraph/graph/__init__.py +19 -0
- ddigraph-0.4.0/src/ddigraph/graph/bootstrap.py +158 -0
- ddigraph-0.4.0/src/ddigraph/ingest/__init__.py +31 -0
- ddigraph-0.4.0/src/ddigraph/ingest/_compose.py +175 -0
- ddigraph-0.4.0/src/ddigraph/ingest/_composition_specs.py +581 -0
- ddigraph-0.4.0/src/ddigraph/ingest/cdi_loader.py +860 -0
- ddigraph-0.4.0/src/ddigraph/ingest/fragment_loader.py +1261 -0
- ddigraph-0.4.0/src/ddigraph/ingest/loader.py +3591 -0
- ddigraph-0.4.0/src/ddigraph/logging.py +49 -0
- ddigraph-0.4.0/src/ddigraph/metrics.py +40 -0
- ddigraph-0.4.0/src/ddigraph/paths.py +41 -0
- ddigraph-0.4.0/src/ddigraph/py.typed +1 -0
- ddigraph-0.4.0/src/ddigraph/resources.py +47 -0
- ddigraph-0.4.0/src/ddigraph/schema/__init__.py +21 -0
- ddigraph-0.4.0/src/ddigraph/schema/_generated/__init__.py +21 -0
- ddigraph-0.4.0/src/ddigraph/schema/_generated/cdi.py +1549 -0
- ddigraph-0.4.0/src/ddigraph/schema/_generated/codebook.py +128 -0
- ddigraph-0.4.0/src/ddigraph/schema/_generated/lifecycle.py +516 -0
- ddigraph-0.4.0/src/ddigraph/schema/_overrides/__init__.py +14 -0
- ddigraph-0.4.0/src/ddigraph/schema/_overrides/_loader.py +149 -0
- ddigraph-0.4.0/src/ddigraph/schema/_overrides/schema_overrides.toml +220 -0
- ddigraph-0.4.0/src/ddigraph/schema/adapter.py +79 -0
- ddigraph-0.4.0/src/ddigraph/schema/ddi_graph.py +2127 -0
- ddigraph-0.4.0/src/ddigraph/schema/definitions/__init__.py +166 -0
- ddigraph-0.4.0/src/ddigraph/schema/definitions/_dataclasses.py +60 -0
- ddigraph-0.4.0/src/ddigraph/schema/definitions/cdi.py +22 -0
- ddigraph-0.4.0/src/ddigraph/schema/definitions/codebook.py +1053 -0
- ddigraph-0.4.0/src/ddigraph/schema/definitions/lifecycle.py +1515 -0
- ddigraph-0.4.0/src/ddigraph/schema/neo4j_adapter.py +961 -0
- ddigraph-0.4.0/src/ddigraph/utils/__init__.py +39 -0
- ddigraph-0.4.0/src/ddigraph/utils/chunking.py +48 -0
- ddigraph-0.4.0/src/ddigraph/utils/parsing.py +398 -0
- ddigraph-0.4.0/src/ddigraph/utils/retry.py +77 -0
|
@@ -0,0 +1,217 @@
|
|
|
1
|
+
# Byte-compiled / optimized / DLL files
|
|
2
|
+
__pycache__/
|
|
3
|
+
*.py[codz]
|
|
4
|
+
*$py.class
|
|
5
|
+
|
|
6
|
+
# C extensions
|
|
7
|
+
*.so
|
|
8
|
+
|
|
9
|
+
# Distribution / packaging
|
|
10
|
+
.Python
|
|
11
|
+
build/
|
|
12
|
+
develop-eggs/
|
|
13
|
+
dist/
|
|
14
|
+
downloads/
|
|
15
|
+
eggs/
|
|
16
|
+
.eggs/
|
|
17
|
+
lib/
|
|
18
|
+
lib64/
|
|
19
|
+
parts/
|
|
20
|
+
sdist/
|
|
21
|
+
var/
|
|
22
|
+
wheels/
|
|
23
|
+
share/python-wheels/
|
|
24
|
+
*.egg-info/
|
|
25
|
+
.installed.cfg
|
|
26
|
+
*.egg
|
|
27
|
+
MANIFEST
|
|
28
|
+
|
|
29
|
+
# PyInstaller
|
|
30
|
+
# Usually these files are written by a python script from a template
|
|
31
|
+
# before PyInstaller builds the exe, so as to inject date/other infos into it.
|
|
32
|
+
*.manifest
|
|
33
|
+
*.spec
|
|
34
|
+
|
|
35
|
+
# Installer logs
|
|
36
|
+
pip-log.txt
|
|
37
|
+
pip-delete-this-directory.txt
|
|
38
|
+
|
|
39
|
+
# Unit test / coverage reports
|
|
40
|
+
htmlcov/
|
|
41
|
+
.tox/
|
|
42
|
+
.nox/
|
|
43
|
+
.coverage
|
|
44
|
+
.coverage.*
|
|
45
|
+
.cache
|
|
46
|
+
schemas/.cache/
|
|
47
|
+
nosetests.xml
|
|
48
|
+
coverage.xml
|
|
49
|
+
*.cover
|
|
50
|
+
*.py.cover
|
|
51
|
+
.hypothesis/
|
|
52
|
+
.pytest_cache/
|
|
53
|
+
cover/
|
|
54
|
+
|
|
55
|
+
# Translations
|
|
56
|
+
*.mo
|
|
57
|
+
*.pot
|
|
58
|
+
|
|
59
|
+
# Django stuff:
|
|
60
|
+
*.log
|
|
61
|
+
local_settings.py
|
|
62
|
+
db.sqlite3
|
|
63
|
+
db.sqlite3-journal
|
|
64
|
+
|
|
65
|
+
# Flask stuff:
|
|
66
|
+
instance/
|
|
67
|
+
.webassets-cache
|
|
68
|
+
|
|
69
|
+
# Scrapy stuff:
|
|
70
|
+
.scrapy
|
|
71
|
+
|
|
72
|
+
# Sphinx documentation
|
|
73
|
+
docs/_build/
|
|
74
|
+
|
|
75
|
+
# PyBuilder
|
|
76
|
+
.pybuilder/
|
|
77
|
+
target/
|
|
78
|
+
|
|
79
|
+
# Jupyter Notebook
|
|
80
|
+
.ipynb_checkpoints
|
|
81
|
+
|
|
82
|
+
# IPython
|
|
83
|
+
profile_default/
|
|
84
|
+
ipython_config.py
|
|
85
|
+
|
|
86
|
+
# pyenv
|
|
87
|
+
# For a library or package, you might want to ignore these files since the code is
|
|
88
|
+
# intended to run in multiple environments; otherwise, check them in:
|
|
89
|
+
# .python-version
|
|
90
|
+
|
|
91
|
+
# pipenv
|
|
92
|
+
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
|
|
93
|
+
# However, in case of collaboration, if having platform-specific dependencies or dependencies
|
|
94
|
+
# having no cross-platform support, pipenv may install dependencies that don't work, or not
|
|
95
|
+
# install all needed dependencies.
|
|
96
|
+
#Pipfile.lock
|
|
97
|
+
|
|
98
|
+
# UV
|
|
99
|
+
# Similar to Pipfile.lock, it is generally recommended to include uv.lock in version control.
|
|
100
|
+
# This is especially recommended for binary packages to ensure reproducibility, and is more
|
|
101
|
+
# commonly ignored for libraries.
|
|
102
|
+
#uv.lock
|
|
103
|
+
|
|
104
|
+
# poetry
|
|
105
|
+
# Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
|
|
106
|
+
# This is especially recommended for binary packages to ensure reproducibility, and is more
|
|
107
|
+
# commonly ignored for libraries.
|
|
108
|
+
# https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
|
|
109
|
+
#poetry.lock
|
|
110
|
+
#poetry.toml
|
|
111
|
+
|
|
112
|
+
# pdm
|
|
113
|
+
# Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
|
|
114
|
+
# pdm recommends including project-wide configuration in pdm.toml, but excluding .pdm-python.
|
|
115
|
+
# https://pdm-project.org/en/latest/usage/project/#working-with-version-control
|
|
116
|
+
#pdm.lock
|
|
117
|
+
#pdm.toml
|
|
118
|
+
.pdm-python
|
|
119
|
+
.pdm-build/
|
|
120
|
+
|
|
121
|
+
# pixi
|
|
122
|
+
# Similar to Pipfile.lock, it is generally recommended to include pixi.lock in version control.
|
|
123
|
+
#pixi.lock
|
|
124
|
+
# Pixi creates a virtual environment in the .pixi directory, just like venv module creates one
|
|
125
|
+
# in the .venv directory. It is recommended not to include this directory in version control.
|
|
126
|
+
.pixi
|
|
127
|
+
|
|
128
|
+
# PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
|
|
129
|
+
__pypackages__/
|
|
130
|
+
|
|
131
|
+
# Celery stuff
|
|
132
|
+
celerybeat-schedule
|
|
133
|
+
celerybeat.pid
|
|
134
|
+
|
|
135
|
+
# SageMath parsed files
|
|
136
|
+
*.sage.py
|
|
137
|
+
|
|
138
|
+
# Environments
|
|
139
|
+
.env
|
|
140
|
+
.envrc
|
|
141
|
+
.venv
|
|
142
|
+
env/
|
|
143
|
+
venv/
|
|
144
|
+
ENV/
|
|
145
|
+
env.bak/
|
|
146
|
+
venv.bak/
|
|
147
|
+
|
|
148
|
+
# Spyder project settings
|
|
149
|
+
.spyderproject
|
|
150
|
+
.spyproject
|
|
151
|
+
|
|
152
|
+
# Rope project settings
|
|
153
|
+
.ropeproject
|
|
154
|
+
|
|
155
|
+
# mkdocs documentation
|
|
156
|
+
/site
|
|
157
|
+
|
|
158
|
+
# mypy
|
|
159
|
+
.mypy_cache/
|
|
160
|
+
.dmypy.json
|
|
161
|
+
dmypy.json
|
|
162
|
+
|
|
163
|
+
# Pyre type checker
|
|
164
|
+
.pyre/
|
|
165
|
+
|
|
166
|
+
# pytype static type analyzer
|
|
167
|
+
.pytype/
|
|
168
|
+
|
|
169
|
+
# Cython debug symbols
|
|
170
|
+
cython_debug/
|
|
171
|
+
|
|
172
|
+
# PyCharm
|
|
173
|
+
# JetBrains specific template is maintained in a separate JetBrains.gitignore that can
|
|
174
|
+
# be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
|
|
175
|
+
# and can be added to the global gitignore or merged into this file. For a more nuclear
|
|
176
|
+
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
|
|
177
|
+
#.idea/
|
|
178
|
+
|
|
179
|
+
# Abstra
|
|
180
|
+
# Abstra is an AI-powered process automation framework.
|
|
181
|
+
# Ignore directories containing user credentials, local state, and settings.
|
|
182
|
+
# Learn more at https://abstra.io/docs
|
|
183
|
+
.abstra/
|
|
184
|
+
|
|
185
|
+
# Visual Studio Code
|
|
186
|
+
# Visual Studio Code specific template is maintained in a separate VisualStudioCode.gitignore
|
|
187
|
+
# that can be found at https://github.com/github/gitignore/blob/main/Global/VisualStudioCode.gitignore
|
|
188
|
+
# and can be added to the global gitignore or merged into this file. However, if you prefer,
|
|
189
|
+
# you could uncomment the following to ignore the entire vscode folder
|
|
190
|
+
# .vscode/
|
|
191
|
+
|
|
192
|
+
# Ruff stuff:
|
|
193
|
+
.ruff_cache/
|
|
194
|
+
|
|
195
|
+
# PyPI configuration file
|
|
196
|
+
.pypirc
|
|
197
|
+
|
|
198
|
+
# Cursor
|
|
199
|
+
# Cursor is an AI-powered code editor. `.cursorignore` specifies files/directories to
|
|
200
|
+
# exclude from AI features like autocomplete and code analysis. Recommended for sensitive data
|
|
201
|
+
# refer to https://docs.cursor.com/context/ignore-files
|
|
202
|
+
.cursorignore
|
|
203
|
+
.cursorindexingignore
|
|
204
|
+
|
|
205
|
+
# Marimo
|
|
206
|
+
marimo/_static/
|
|
207
|
+
marimo/_lsp/
|
|
208
|
+
__marimo__/
|
|
209
|
+
|
|
210
|
+
# Other
|
|
211
|
+
*.csv
|
|
212
|
+
*.graphml
|
|
213
|
+
*.json
|
|
214
|
+
!.markdownlint.json
|
|
215
|
+
!schemas/manifest.json
|
|
216
|
+
!tests/fixtures/*.json
|
|
217
|
+
*.xlsx
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
# Contributing to ddigraph
|
|
2
|
+
|
|
3
|
+
Thanks for taking the time to look at the project. This file is the
|
|
4
|
+
short version; the deeper guide lives at
|
|
5
|
+
`docs/en/project/contributing.md` (and `docs/fr/project/contributing.md`).
|
|
6
|
+
|
|
7
|
+
## Quick start
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
git clone https://github.com/pbisson44/ddigraph
|
|
11
|
+
cd ddigraph
|
|
12
|
+
|
|
13
|
+
# uv is the recommended tooling, but ``pip install -e .[dev,docs]`` works too.
|
|
14
|
+
uv sync --extra dev --extra docs
|
|
15
|
+
|
|
16
|
+
# Run every gate the CI uses.
|
|
17
|
+
.venv/bin/ruff format --check .
|
|
18
|
+
.venv/bin/ruff check .
|
|
19
|
+
.venv/bin/mypy .
|
|
20
|
+
.venv/bin/python -m pytest
|
|
21
|
+
.venv/bin/python scripts/xsd_coverage.py --structural --structural-threshold 100
|
|
22
|
+
.venv/bin/python scripts/generate_schema_definitions.py --check
|
|
23
|
+
npx --yes markdownlint-cli2@0.18.1 "**/*.md" "!**/site-packages/**" "!**/.venv/**"
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
The same gates are wrapped as Makefile targets: `make lint`,
|
|
27
|
+
`make typecheck`, `make test`, `make lint-md`, `make check-schemas`,
|
|
28
|
+
`make check-schema-definitions`, and `make check-readability` (the
|
|
29
|
+
last one needs the `docs` extra).
|
|
30
|
+
|
|
31
|
+
## Where things live
|
|
32
|
+
|
|
33
|
+
- `src/ddigraph/` -- the Python package. The public CRUD entry
|
|
34
|
+
points (`load`, `aload`, `detect`, `bootstrap`, `LoadResult`) live
|
|
35
|
+
in `ddigraph.api`; the loaders sit under `ddigraph.ingest/`.
|
|
36
|
+
- `src/ddigraph/schema/_generated/` -- *generated* node and
|
|
37
|
+
relationship metadata. Do not edit by hand; re-run
|
|
38
|
+
`python scripts/generate_schema_definitions.py` after a schema
|
|
39
|
+
change. The override file at
|
|
40
|
+
`src/ddigraph/schema/_overrides/schema_overrides.toml` is the
|
|
41
|
+
human-edited bridge between the XSDs and the runtime tables.
|
|
42
|
+
- `schemas/` -- bundled DDI XSDs (Codebook 2.6, DDI-L 3.x, DDI-CDI 1.0).
|
|
43
|
+
The structural-coverage audit blocks PRs if any concrete
|
|
44
|
+
identifiable element drops below 100% relationship coverage.
|
|
45
|
+
- `tests/` -- pytest tree. New tests follow the existing pattern;
|
|
46
|
+
the `tests/test_public_api.py` guard enforces the public/private
|
|
47
|
+
naming convention.
|
|
48
|
+
- `docs/en/` and `docs/fr/` -- mkdocs-material sources in two
|
|
49
|
+
languages.
|
|
50
|
+
|
|
51
|
+
## Pull requests
|
|
52
|
+
|
|
53
|
+
1. Branch from `main`.
|
|
54
|
+
2. Run the gates above and `pre-commit run --all-files` if you have
|
|
55
|
+
pre-commit installed.
|
|
56
|
+
3. Open the PR; explain *why* the change is needed in the
|
|
57
|
+
description, not just *what* it does.
|
|
58
|
+
4. CI runs the same gates plus a TestPyPI dry-run for the publish
|
|
59
|
+
workflow. The structural-coverage and markdownlint gates are
|
|
60
|
+
blocking.
|
|
61
|
+
|
|
62
|
+
## Security
|
|
63
|
+
|
|
64
|
+
Please report security issues per `SECURITY.md` (do not file a
|
|
65
|
+
public issue).
|
ddigraph-0.4.0/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025 Philippe Bisson
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
ddigraph-0.4.0/NOTICE
ADDED
ddigraph-0.4.0/PKG-INFO
ADDED
|
@@ -0,0 +1,256 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: ddigraph
|
|
3
|
+
Version: 0.4.0
|
|
4
|
+
Summary: DDI to Knowledge Graph toolkit - transform DDI metadata into graph databases (Neo4j, RDF, Gremlin, NetworkX)
|
|
5
|
+
Project-URL: Homepage, https://github.com/pbisson44/ddigraph
|
|
6
|
+
Project-URL: Repository, https://github.com/pbisson44/ddigraph
|
|
7
|
+
Project-URL: Documentation, https://pbisson44.github.io/ddigraph/
|
|
8
|
+
Project-URL: Changelog, https://github.com/pbisson44/ddigraph/blob/main/CHANGELOG.md
|
|
9
|
+
Project-URL: Discussion, https://github.com/pbisson44/ddigraph/discussions
|
|
10
|
+
Project-URL: Issues, https://github.com/pbisson44/ddigraph/issues
|
|
11
|
+
Author-email: ddigraph maintainers <ddigraph@noreply.github.com>
|
|
12
|
+
License: MIT License
|
|
13
|
+
|
|
14
|
+
Copyright (c) 2025 Philippe Bisson
|
|
15
|
+
|
|
16
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
17
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
18
|
+
in the Software without restriction, including without limitation the rights
|
|
19
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
20
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
21
|
+
furnished to do so, subject to the following conditions:
|
|
22
|
+
|
|
23
|
+
The above copyright notice and this permission notice shall be included in all
|
|
24
|
+
copies or substantial portions of the Software.
|
|
25
|
+
|
|
26
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
27
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
28
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
29
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
30
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
31
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
32
|
+
SOFTWARE.
|
|
33
|
+
License-File: LICENSE
|
|
34
|
+
License-File: NOTICE
|
|
35
|
+
Keywords: ddi,ddi-codebook,ddi-l,ddi-lifecycle,fragment-instance,graph-database,gremlin,knowledge-graph,metadata,neo4j,networkx,rdf,sparql,survey,xml
|
|
36
|
+
Classifier: Development Status :: 4 - Beta
|
|
37
|
+
Classifier: Intended Audience :: Developers
|
|
38
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
39
|
+
Classifier: Programming Language :: Python
|
|
40
|
+
Classifier: Programming Language :: Python :: 3
|
|
41
|
+
Classifier: Programming Language :: Python :: 3 :: Only
|
|
42
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
43
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
44
|
+
Classifier: Programming Language :: Python :: 3.14
|
|
45
|
+
Classifier: Topic :: Database
|
|
46
|
+
Classifier: Topic :: Database :: Front-Ends
|
|
47
|
+
Classifier: Topic :: Scientific/Engineering :: Information Analysis
|
|
48
|
+
Classifier: Topic :: Software Development :: Libraries :: Python Modules
|
|
49
|
+
Classifier: Topic :: Text Processing :: Markup :: XML
|
|
50
|
+
Classifier: Typing :: Typed
|
|
51
|
+
Requires-Python: <3.15,>=3.12
|
|
52
|
+
Requires-Dist: lxml>=5.1
|
|
53
|
+
Requires-Dist: neo4j>=5.19
|
|
54
|
+
Requires-Dist: orjson>=3.10
|
|
55
|
+
Requires-Dist: pydantic-settings>=2.13.1
|
|
56
|
+
Requires-Dist: pydantic>=2.7
|
|
57
|
+
Requires-Dist: xmlschema>=3.4
|
|
58
|
+
Provides-Extra: all
|
|
59
|
+
Requires-Dist: gremlinpython<4.0.0,>=3.8.1; extra == 'all'
|
|
60
|
+
Requires-Dist: networkx>=3.6.1; extra == 'all'
|
|
61
|
+
Requires-Dist: openpyxl>=3.1.5; extra == 'all'
|
|
62
|
+
Requires-Dist: pandas>=2.3.3; extra == 'all'
|
|
63
|
+
Requires-Dist: rdflib<8.0.0,>=7.5.0; extra == 'all'
|
|
64
|
+
Requires-Dist: sdmx1>=2.26; extra == 'all'
|
|
65
|
+
Provides-Extra: dev
|
|
66
|
+
Requires-Dist: build>=1.2; extra == 'dev'
|
|
67
|
+
Requires-Dist: check-manifest>=0.50; extra == 'dev'
|
|
68
|
+
Requires-Dist: mypy>=1.10; extra == 'dev'
|
|
69
|
+
Requires-Dist: pre-commit>=3.7; extra == 'dev'
|
|
70
|
+
Requires-Dist: psutil>=5.9; extra == 'dev'
|
|
71
|
+
Requires-Dist: pyroma>=4.2; extra == 'dev'
|
|
72
|
+
Requires-Dist: pytest-asyncio>=0.23; extra == 'dev'
|
|
73
|
+
Requires-Dist: pytest-cov>=4.1; extra == 'dev'
|
|
74
|
+
Requires-Dist: pytest>=8.2; extra == 'dev'
|
|
75
|
+
Requires-Dist: ruff>=0.15.10; extra == 'dev'
|
|
76
|
+
Requires-Dist: twine>=5.1; extra == 'dev'
|
|
77
|
+
Requires-Dist: types-lxml>=2026.2.16; extra == 'dev'
|
|
78
|
+
Provides-Extra: docs
|
|
79
|
+
Requires-Dist: mkdocs-material>=9.5; extra == 'docs'
|
|
80
|
+
Requires-Dist: mkdocs-static-i18n>=1.2; extra == 'docs'
|
|
81
|
+
Requires-Dist: mkdocs<2,>=1.6; extra == 'docs'
|
|
82
|
+
Requires-Dist: pymdown-extensions>=10.21.2; extra == 'docs'
|
|
83
|
+
Requires-Dist: textstat>=0.7; extra == 'docs'
|
|
84
|
+
Provides-Extra: gremlin
|
|
85
|
+
Requires-Dist: gremlinpython<4.0.0,>=3.8.1; extra == 'gremlin'
|
|
86
|
+
Provides-Extra: networkx
|
|
87
|
+
Requires-Dist: networkx>=3.6.1; extra == 'networkx'
|
|
88
|
+
Provides-Extra: pandas
|
|
89
|
+
Requires-Dist: openpyxl>=3.1.5; extra == 'pandas'
|
|
90
|
+
Requires-Dist: pandas>=2.3.3; extra == 'pandas'
|
|
91
|
+
Provides-Extra: rdf
|
|
92
|
+
Requires-Dist: rdflib<8.0.0,>=7.5.0; extra == 'rdf'
|
|
93
|
+
Provides-Extra: sdmx
|
|
94
|
+
Requires-Dist: sdmx1>=2.26; extra == 'sdmx'
|
|
95
|
+
Description-Content-Type: text/markdown
|
|
96
|
+
|
|
97
|
+
# ddigraph
|
|
98
|
+
|
|
99
|
+
[](https://github.com/pbisson44/ddigraph/actions)
|
|
100
|
+
[](https://codecov.io/gh/pbisson44/ddigraph)
|
|
101
|
+
[](https://pypi.org/project/ddigraph/)
|
|
102
|
+
[](LICENSE)
|
|
103
|
+
[](pyproject.toml)
|
|
104
|
+
[](https://neo4j.com/docs/)
|
|
105
|
+
[](https://docs.astral.sh/ruff/)
|
|
106
|
+
[](https://mypy-lang.org/)
|
|
107
|
+
|
|
108
|
+
A modern Python toolkit that transforms [DDI](https://ddialliance.org/) (Data Documentation
|
|
109
|
+
Initiative) XML metadata into knowledge graphs. Supports **DDI Codebook** and **DDI-L
|
|
110
|
+
FragmentInstance** formats with streaming parsing, batched writes, and full async I/O across
|
|
111
|
+
multiple graph backends.
|
|
112
|
+
|
|
113
|
+
[Documentation](https://pbisson44.github.io/ddigraph/) |
|
|
114
|
+
[Getting Started](https://pbisson44.github.io/ddigraph/getting-started/installation/) |
|
|
115
|
+
[PyPI](https://pypi.org/project/ddigraph/) |
|
|
116
|
+
[Source Code](https://github.com/pbisson44/ddigraph)
|
|
117
|
+
|
|
118
|
+
---
|
|
119
|
+
|
|
120
|
+
## Features
|
|
121
|
+
|
|
122
|
+
- **Multi-backend support** -- Neo4j, RDF/SPARQL, Gremlin, NetworkX, and pandas
|
|
123
|
+
- **Streaming XML processing** -- Memory-bounded `iterparse` for files of any size
|
|
124
|
+
- **Batched writes** -- UNWIND-based Cypher for 10-100x fewer database round trips
|
|
125
|
+
- **Async I/O** -- Concurrent parsing and writing with back-pressure control
|
|
126
|
+
- **Format auto-detection** -- Automatically identifies DDI Codebook vs Lifecycle format
|
|
127
|
+
- **Unified schema** -- Single source of truth for all node and relationship definitions
|
|
128
|
+
- **Adapter pattern** -- Plug in custom graph backends via `GraphWriteAdapter` protocol
|
|
129
|
+
- **Production-ready** -- Retry logic, observability hooks, pydantic-based configuration
|
|
130
|
+
|
|
131
|
+
## Quick Start
|
|
132
|
+
|
|
133
|
+
### Install
|
|
134
|
+
|
|
135
|
+
```bash
|
|
136
|
+
pip install ddigraph
|
|
137
|
+
```
|
|
138
|
+
|
|
139
|
+
### Load DDI metadata (CLI)
|
|
140
|
+
|
|
141
|
+
```bash
|
|
142
|
+
# Set Neo4j connection
|
|
143
|
+
export DDIGRAPH_NEO4J_URI=bolt://localhost:7687
|
|
144
|
+
export DDIGRAPH_NEO4J_USER=neo4j
|
|
145
|
+
export DDIGRAPH_NEO4J_PASSWORD=secret
|
|
146
|
+
|
|
147
|
+
# Bootstrap schema and load data (format is auto-detected)
|
|
148
|
+
ddigraph bootstrap
|
|
149
|
+
ddigraph load survey.xml --dataset-id my-survey
|
|
150
|
+
```
|
|
151
|
+
|
|
152
|
+
### Load DDI metadata (Python)
|
|
153
|
+
|
|
154
|
+
```python
|
|
155
|
+
import asyncio
|
|
156
|
+
from neo4j import AsyncGraphDatabase
|
|
157
|
+
from ddigraph import DDILoader, DDIFragmentLoader, detect_ddi_format
|
|
158
|
+
from ddigraph.config import Settings
|
|
159
|
+
|
|
160
|
+
async def main():
|
|
161
|
+
settings = Settings()
|
|
162
|
+
driver = AsyncGraphDatabase.driver(
|
|
163
|
+
settings.neo4j_uri,
|
|
164
|
+
auth=(settings.neo4j_user, settings.neo4j_password.get_secret_value()),
|
|
165
|
+
)
|
|
166
|
+
path = "survey.xml"
|
|
167
|
+
if detect_ddi_format(path) == "lifecycle":
|
|
168
|
+
loader = DDIFragmentLoader(driver, settings=settings)
|
|
169
|
+
result = await loader.load(path)
|
|
170
|
+
else:
|
|
171
|
+
loader = DDILoader(driver, settings=settings)
|
|
172
|
+
result = await loader.load(path, dataset_id="my-survey")
|
|
173
|
+
print(result) # {'Instrument': 1, 'Sequence': 388, 'QuestionItem': 373, ...}
|
|
174
|
+
await driver.close()
|
|
175
|
+
|
|
176
|
+
asyncio.run(main())
|
|
177
|
+
```
|
|
178
|
+
|
|
179
|
+
## Supported Formats
|
|
180
|
+
|
|
181
|
+
| Format | Description | Use Case |
|
|
182
|
+
| ------ | ----------- | -------- |
|
|
183
|
+
| **DDI Codebook** | Traditional flat format with central Dataset node | Survey archives, data catalogs |
|
|
184
|
+
| **DDI-L FragmentInstance** | Lifecycle 3.x format with reusable fragments | Questionnaire design, CAPI/CAWI instruments |
|
|
185
|
+
| **DDI-CDI 1.0** | Cross-Domain Integration metadata | Data integration, statistical production |
|
|
186
|
+
|
|
187
|
+
### XSD Coverage
|
|
188
|
+
|
|
189
|
+
`ddigraph` ships with 100 % coverage of every concrete identifiable element
|
|
190
|
+
declared in the bundled XSD schemas (`schemas/`). Coverage is enforced by the
|
|
191
|
+
audit script and a pytest guardrail so new schema releases surface any gaps:
|
|
192
|
+
|
|
193
|
+
| Flavor | Scope | Target | Covered |
|
|
194
|
+
| ----------- | --------------------------------------------------------------------- | -----: | ------: |
|
|
195
|
+
| DDI-L 3.x | Concrete Maintainable + Versionable + Identifiable elements | 189 | 100 % |
|
|
196
|
+
| DDI-C 2.x | Codebook elements with the `GLOBALS` attribute group (no layout tags) | 73 | 100 % |
|
|
197
|
+
| DDI-CDI 1.0 | Concrete top-level entity elements (associations excluded) | 210 | 100 % |
|
|
198
|
+
|
|
199
|
+
Run `python scripts/xsd_coverage.py` to regenerate the audit or
|
|
200
|
+
`python scripts/xsd_coverage.py --json` for machine-readable output.
|
|
201
|
+
|
|
202
|
+
## Supported Backends
|
|
203
|
+
|
|
204
|
+
| Backend | Description | Use Case |
|
|
205
|
+
| ------- | ----------- | -------- |
|
|
206
|
+
| **Neo4j** | Native graph database (Bolt) | Production deployments, complex queries |
|
|
207
|
+
| **RDF/SPARQL** | Semantic web triplestores | Linked data, ontology integration |
|
|
208
|
+
| **Gremlin** | Graph traversal language | JanusGraph, Neptune, Cosmos DB |
|
|
209
|
+
| **NetworkX** | Python graph library | Local analysis, prototyping |
|
|
210
|
+
| **pandas** | DataFrame-based | Tabular analysis, Excel export |
|
|
211
|
+
|
|
212
|
+
## Docker Quick Start
|
|
213
|
+
|
|
214
|
+
```bash
|
|
215
|
+
docker run --rm --name neo4j-demo \
|
|
216
|
+
-p 7474:7474 -p 7687:7687 \
|
|
217
|
+
-e NEO4J_AUTH=neo4j/password \
|
|
218
|
+
neo4j:5
|
|
219
|
+
|
|
220
|
+
export DDIGRAPH_NEO4J_URI=bolt://localhost:7687
|
|
221
|
+
export DDIGRAPH_NEO4J_USER=neo4j
|
|
222
|
+
export DDIGRAPH_NEO4J_PASSWORD=password
|
|
223
|
+
|
|
224
|
+
ddigraph bootstrap
|
|
225
|
+
ddigraph load your-file.xml --dataset-id demo
|
|
226
|
+
```
|
|
227
|
+
|
|
228
|
+
## Documentation
|
|
229
|
+
|
|
230
|
+
Full documentation is available at **[pbisson44.github.io/ddigraph](https://pbisson44.github.io/ddigraph/)** in English and French.
|
|
231
|
+
|
|
232
|
+
- [Getting Started](https://pbisson44.github.io/ddigraph/getting-started/installation/) -- Installation, quick start, 10-minute tutorial
|
|
233
|
+
- [User Guide](https://pbisson44.github.io/ddigraph/user-guide/architecture/) -- Architecture, DDI formats, relationships, adapters
|
|
234
|
+
- [Graph Backends](https://pbisson44.github.io/ddigraph/backends/neo4j/) -- Neo4j, RDF/SPARQL, Gremlin, NetworkX
|
|
235
|
+
- [Reference](https://pbisson44.github.io/ddigraph/reference/cli/) -- CLI commands, configuration
|
|
236
|
+
- [Advanced](https://pbisson44.github.io/ddigraph/advanced/tuning/) -- Performance tuning, AI readiness, standards interoperability
|
|
237
|
+
- [Contributing](https://pbisson44.github.io/ddigraph/project/contributing/) -- How to contribute
|
|
238
|
+
|
|
239
|
+
## Development
|
|
240
|
+
|
|
241
|
+
```bash
|
|
242
|
+
git clone https://github.com/pbisson44/ddigraph.git
|
|
243
|
+
cd ddigraph
|
|
244
|
+
pip install -e ".[dev,docs]"
|
|
245
|
+
|
|
246
|
+
ruff check . && ruff format .
|
|
247
|
+
# Docstring linting is currently enforced for src/ddigraph only.
|
|
248
|
+
pydocstyle src/ddigraph
|
|
249
|
+
mypy .
|
|
250
|
+
pytest
|
|
251
|
+
mkdocs serve
|
|
252
|
+
```
|
|
253
|
+
|
|
254
|
+
## License
|
|
255
|
+
|
|
256
|
+
MIT -- see [LICENSE](LICENSE) for details.
|