h5rdmtoolbox 2.7.0__tar.gz → 2.7.2__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.
Files changed (130) hide show
  1. {h5rdmtoolbox-2.7.0 → h5rdmtoolbox-2.7.2}/PKG-INFO +1 -1
  2. {h5rdmtoolbox-2.7.0 → h5rdmtoolbox-2.7.2}/h5rdmtoolbox/catalog/abstracts.py +2 -1
  3. {h5rdmtoolbox-2.7.0 → h5rdmtoolbox-2.7.2}/h5rdmtoolbox/catalog/core.py +7 -1
  4. h5rdmtoolbox-2.7.2/h5rdmtoolbox/ld/user/datasets.py +45 -0
  5. {h5rdmtoolbox-2.7.0 → h5rdmtoolbox-2.7.2}/h5rdmtoolbox/ld/utils.py +4 -4
  6. {h5rdmtoolbox-2.7.0 → h5rdmtoolbox-2.7.2}/h5rdmtoolbox/wrapper/core.py +1 -0
  7. {h5rdmtoolbox-2.7.0 → h5rdmtoolbox-2.7.2}/h5rdmtoolbox.egg-info/PKG-INFO +1 -1
  8. {h5rdmtoolbox-2.7.0 → h5rdmtoolbox-2.7.2}/pyproject.toml +1 -1
  9. h5rdmtoolbox-2.7.0/h5rdmtoolbox/ld/user/datasets.py +0 -24
  10. {h5rdmtoolbox-2.7.0 → h5rdmtoolbox-2.7.2}/LICENSE +0 -0
  11. {h5rdmtoolbox-2.7.0 → h5rdmtoolbox-2.7.2}/README.md +0 -0
  12. {h5rdmtoolbox-2.7.0 → h5rdmtoolbox-2.7.2}/h5rdmtoolbox/__init__.py +0 -0
  13. {h5rdmtoolbox-2.7.0 → h5rdmtoolbox-2.7.2}/h5rdmtoolbox/_cfg.py +0 -0
  14. {h5rdmtoolbox-2.7.0 → h5rdmtoolbox-2.7.2}/h5rdmtoolbox/_repr.py +0 -0
  15. {h5rdmtoolbox-2.7.0 → h5rdmtoolbox-2.7.2}/h5rdmtoolbox/_version.py +0 -0
  16. {h5rdmtoolbox-2.7.0 → h5rdmtoolbox-2.7.2}/h5rdmtoolbox/catalog/__init__.py +0 -0
  17. {h5rdmtoolbox-2.7.0 → h5rdmtoolbox-2.7.2}/h5rdmtoolbox/catalog/_initialization.py +0 -0
  18. {h5rdmtoolbox-2.7.0 → h5rdmtoolbox-2.7.2}/h5rdmtoolbox/catalog/profiles.py +0 -0
  19. {h5rdmtoolbox-2.7.0 → h5rdmtoolbox-2.7.2}/h5rdmtoolbox/catalog/query_templates.py +0 -0
  20. {h5rdmtoolbox-2.7.0 → h5rdmtoolbox-2.7.2}/h5rdmtoolbox/catalog/stores/__init__.py +0 -0
  21. {h5rdmtoolbox-2.7.0 → h5rdmtoolbox-2.7.2}/h5rdmtoolbox/catalog/stores/hdf5.py +0 -0
  22. {h5rdmtoolbox-2.7.0 → h5rdmtoolbox-2.7.2}/h5rdmtoolbox/catalog/utils.py +0 -0
  23. {h5rdmtoolbox-2.7.0 → h5rdmtoolbox-2.7.2}/h5rdmtoolbox/cli.py +0 -0
  24. {h5rdmtoolbox-2.7.0 → h5rdmtoolbox-2.7.2}/h5rdmtoolbox/consts.py +0 -0
  25. {h5rdmtoolbox-2.7.0 → h5rdmtoolbox-2.7.2}/h5rdmtoolbox/convention/__init__.py +0 -0
  26. {h5rdmtoolbox-2.7.0 → h5rdmtoolbox-2.7.2}/h5rdmtoolbox/convention/cfg.py +0 -0
  27. {h5rdmtoolbox-2.7.0 → h5rdmtoolbox-2.7.2}/h5rdmtoolbox/convention/consts.py +0 -0
  28. {h5rdmtoolbox-2.7.0 → h5rdmtoolbox-2.7.2}/h5rdmtoolbox/convention/core.py +0 -0
  29. {h5rdmtoolbox-2.7.0 → h5rdmtoolbox-2.7.2}/h5rdmtoolbox/convention/errors.py +0 -0
  30. {h5rdmtoolbox-2.7.0 → h5rdmtoolbox-2.7.2}/h5rdmtoolbox/convention/generate.py +0 -0
  31. {h5rdmtoolbox-2.7.0 → h5rdmtoolbox-2.7.2}/h5rdmtoolbox/convention/ontology/__init__.py +0 -0
  32. {h5rdmtoolbox-2.7.0 → h5rdmtoolbox-2.7.2}/h5rdmtoolbox/convention/ontology/h5ontocls.py +0 -0
  33. {h5rdmtoolbox-2.7.0 → h5rdmtoolbox-2.7.2}/h5rdmtoolbox/convention/ontology/hdf_datatypes.py +0 -0
  34. {h5rdmtoolbox-2.7.0 → h5rdmtoolbox-2.7.2}/h5rdmtoolbox/convention/references.py +0 -0
  35. {h5rdmtoolbox-2.7.0 → h5rdmtoolbox-2.7.2}/h5rdmtoolbox/convention/standard_attributes.py +0 -0
  36. {h5rdmtoolbox-2.7.0 → h5rdmtoolbox-2.7.2}/h5rdmtoolbox/convention/toolbox_validators.py +0 -0
  37. {h5rdmtoolbox-2.7.0 → h5rdmtoolbox-2.7.2}/h5rdmtoolbox/convention/utils.py +0 -0
  38. {h5rdmtoolbox-2.7.0 → h5rdmtoolbox-2.7.2}/h5rdmtoolbox/data/def_icon.png +0 -0
  39. {h5rdmtoolbox-2.7.0 → h5rdmtoolbox-2.7.2}/h5rdmtoolbox/data/fluid-v1.yml +0 -0
  40. {h5rdmtoolbox-2.7.0 → h5rdmtoolbox-2.7.2}/h5rdmtoolbox/data/h5tbx.yaml +0 -0
  41. {h5rdmtoolbox-2.7.0 → h5rdmtoolbox-2.7.2}/h5rdmtoolbox/data/id_icon.png +0 -0
  42. {h5rdmtoolbox-2.7.0 → h5rdmtoolbox-2.7.2}/h5rdmtoolbox/data/iri_icon.png +0 -0
  43. {h5rdmtoolbox-2.7.0 → h5rdmtoolbox-2.7.2}/h5rdmtoolbox/data/ld_icon.png +0 -0
  44. {h5rdmtoolbox-2.7.0 → h5rdmtoolbox-2.7.2}/h5rdmtoolbox/data/piv-v1.yml +0 -0
  45. {h5rdmtoolbox-2.7.0 → h5rdmtoolbox-2.7.2}/h5rdmtoolbox/data/style.css +0 -0
  46. {h5rdmtoolbox-2.7.0 → h5rdmtoolbox-2.7.2}/h5rdmtoolbox/data/tutorial_convention.yaml +0 -0
  47. {h5rdmtoolbox-2.7.0 → h5rdmtoolbox-2.7.2}/h5rdmtoolbox/data/tutorial_convention_vfuncs.py +0 -0
  48. {h5rdmtoolbox-2.7.0 → h5rdmtoolbox-2.7.2}/h5rdmtoolbox/data/tutorial_standard_name_table.yaml +0 -0
  49. {h5rdmtoolbox-2.7.0 → h5rdmtoolbox-2.7.2}/h5rdmtoolbox/data/type_icon.png +0 -0
  50. {h5rdmtoolbox-2.7.0 → h5rdmtoolbox-2.7.2}/h5rdmtoolbox/database/__init__.py +0 -0
  51. {h5rdmtoolbox-2.7.0 → h5rdmtoolbox-2.7.2}/h5rdmtoolbox/database/hdfdb/__init__.py +0 -0
  52. {h5rdmtoolbox-2.7.0 → h5rdmtoolbox-2.7.2}/h5rdmtoolbox/database/hdfdb/filedb.py +0 -0
  53. {h5rdmtoolbox-2.7.0 → h5rdmtoolbox-2.7.2}/h5rdmtoolbox/database/hdfdb/objdb.py +0 -0
  54. {h5rdmtoolbox-2.7.0 → h5rdmtoolbox-2.7.2}/h5rdmtoolbox/database/hdfdb/query.py +0 -0
  55. {h5rdmtoolbox-2.7.0 → h5rdmtoolbox-2.7.2}/h5rdmtoolbox/database/hdfdb/utils.py +0 -0
  56. {h5rdmtoolbox-2.7.0 → h5rdmtoolbox-2.7.2}/h5rdmtoolbox/database/interface.py +0 -0
  57. {h5rdmtoolbox-2.7.0 → h5rdmtoolbox-2.7.2}/h5rdmtoolbox/database/lazy.py +0 -0
  58. {h5rdmtoolbox-2.7.0 → h5rdmtoolbox-2.7.2}/h5rdmtoolbox/database/mongo.py +0 -0
  59. {h5rdmtoolbox-2.7.0 → h5rdmtoolbox-2.7.2}/h5rdmtoolbox/errors.py +0 -0
  60. {h5rdmtoolbox-2.7.0 → h5rdmtoolbox-2.7.2}/h5rdmtoolbox/extensions/__init__.py +0 -0
  61. {h5rdmtoolbox-2.7.0 → h5rdmtoolbox-2.7.2}/h5rdmtoolbox/extensions/magnitude.py +0 -0
  62. {h5rdmtoolbox-2.7.0 → h5rdmtoolbox-2.7.2}/h5rdmtoolbox/extensions/normalize.py +0 -0
  63. {h5rdmtoolbox-2.7.0 → h5rdmtoolbox-2.7.2}/h5rdmtoolbox/extensions/onto.py +0 -0
  64. {h5rdmtoolbox-2.7.0 → h5rdmtoolbox-2.7.2}/h5rdmtoolbox/extensions/units.py +0 -0
  65. {h5rdmtoolbox-2.7.0 → h5rdmtoolbox-2.7.2}/h5rdmtoolbox/extensions/vector.py +0 -0
  66. {h5rdmtoolbox-2.7.0 → h5rdmtoolbox-2.7.2}/h5rdmtoolbox/gui/__init__.py +0 -0
  67. {h5rdmtoolbox-2.7.0 → h5rdmtoolbox-2.7.2}/h5rdmtoolbox/gui/fairify.py +0 -0
  68. {h5rdmtoolbox-2.7.0 → h5rdmtoolbox-2.7.2}/h5rdmtoolbox/gui/src/__init__.py +0 -0
  69. {h5rdmtoolbox-2.7.0 → h5rdmtoolbox-2.7.2}/h5rdmtoolbox/gui/src/main.py +0 -0
  70. {h5rdmtoolbox-2.7.0 → h5rdmtoolbox-2.7.2}/h5rdmtoolbox/identifiers.py +0 -0
  71. {h5rdmtoolbox-2.7.0 → h5rdmtoolbox-2.7.2}/h5rdmtoolbox/layout/__init__.py +0 -0
  72. {h5rdmtoolbox-2.7.0 → h5rdmtoolbox-2.7.2}/h5rdmtoolbox/layout/core.py +0 -0
  73. {h5rdmtoolbox-2.7.0 → h5rdmtoolbox-2.7.2}/h5rdmtoolbox/ld/__init__.py +0 -0
  74. {h5rdmtoolbox-2.7.0 → h5rdmtoolbox-2.7.2}/h5rdmtoolbox/ld/_types.py +0 -0
  75. {h5rdmtoolbox-2.7.0 → h5rdmtoolbox-2.7.2}/h5rdmtoolbox/ld/globals.py +0 -0
  76. {h5rdmtoolbox-2.7.0 → h5rdmtoolbox-2.7.2}/h5rdmtoolbox/ld/hdf/__init__.py +0 -0
  77. {h5rdmtoolbox-2.7.0 → h5rdmtoolbox-2.7.2}/h5rdmtoolbox/ld/hdf/attributes.py +0 -0
  78. {h5rdmtoolbox-2.7.0 → h5rdmtoolbox-2.7.2}/h5rdmtoolbox/ld/hdf/datasets.py +0 -0
  79. {h5rdmtoolbox-2.7.0 → h5rdmtoolbox-2.7.2}/h5rdmtoolbox/ld/hdf/file.py +0 -0
  80. {h5rdmtoolbox-2.7.0 → h5rdmtoolbox-2.7.2}/h5rdmtoolbox/ld/hdf/groups.py +0 -0
  81. {h5rdmtoolbox-2.7.0 → h5rdmtoolbox-2.7.2}/h5rdmtoolbox/ld/rdf.py +0 -0
  82. {h5rdmtoolbox-2.7.0 → h5rdmtoolbox-2.7.2}/h5rdmtoolbox/ld/shacl.py +0 -0
  83. {h5rdmtoolbox-2.7.0 → h5rdmtoolbox-2.7.2}/h5rdmtoolbox/ld/user/__init__.py +0 -0
  84. {h5rdmtoolbox-2.7.0 → h5rdmtoolbox-2.7.2}/h5rdmtoolbox/ld/user/attributes.py +0 -0
  85. {h5rdmtoolbox-2.7.0 → h5rdmtoolbox-2.7.2}/h5rdmtoolbox/ld/user/file.py +0 -0
  86. {h5rdmtoolbox-2.7.0 → h5rdmtoolbox-2.7.2}/h5rdmtoolbox/ld/user/groups.py +0 -0
  87. {h5rdmtoolbox-2.7.0 → h5rdmtoolbox-2.7.2}/h5rdmtoolbox/ld/user/utils.py +0 -0
  88. {h5rdmtoolbox-2.7.0 → h5rdmtoolbox-2.7.2}/h5rdmtoolbox/plotting.py +0 -0
  89. {h5rdmtoolbox-2.7.0 → h5rdmtoolbox-2.7.2}/h5rdmtoolbox/protected_attributes.py +0 -0
  90. {h5rdmtoolbox-2.7.0 → h5rdmtoolbox-2.7.2}/h5rdmtoolbox/protocols.py +0 -0
  91. {h5rdmtoolbox-2.7.0 → h5rdmtoolbox-2.7.2}/h5rdmtoolbox/repository/__init__.py +0 -0
  92. {h5rdmtoolbox-2.7.0 → h5rdmtoolbox-2.7.2}/h5rdmtoolbox/repository/default_metamapper.py +0 -0
  93. {h5rdmtoolbox-2.7.0 → h5rdmtoolbox-2.7.2}/h5rdmtoolbox/repository/interface.py +0 -0
  94. {h5rdmtoolbox-2.7.0 → h5rdmtoolbox-2.7.2}/h5rdmtoolbox/repository/utils.py +0 -0
  95. {h5rdmtoolbox-2.7.0 → h5rdmtoolbox-2.7.2}/h5rdmtoolbox/repository/zenodo/__init__.py +0 -0
  96. {h5rdmtoolbox-2.7.0 → h5rdmtoolbox-2.7.2}/h5rdmtoolbox/repository/zenodo/core.py +0 -0
  97. {h5rdmtoolbox-2.7.0 → h5rdmtoolbox-2.7.2}/h5rdmtoolbox/repository/zenodo/metadata.py +0 -0
  98. {h5rdmtoolbox-2.7.0 → h5rdmtoolbox-2.7.2}/h5rdmtoolbox/repository/zenodo/tokens.py +0 -0
  99. {h5rdmtoolbox-2.7.0 → h5rdmtoolbox-2.7.2}/h5rdmtoolbox/repository/zenodo/utils.py +0 -0
  100. {h5rdmtoolbox-2.7.0 → h5rdmtoolbox-2.7.2}/h5rdmtoolbox/tutorial.py +0 -0
  101. {h5rdmtoolbox-2.7.0 → h5rdmtoolbox-2.7.2}/h5rdmtoolbox/user.py +0 -0
  102. {h5rdmtoolbox-2.7.0 → h5rdmtoolbox-2.7.2}/h5rdmtoolbox/utils.py +0 -0
  103. {h5rdmtoolbox-2.7.0 → h5rdmtoolbox-2.7.2}/h5rdmtoolbox/wrapper/__init__.py +0 -0
  104. {h5rdmtoolbox-2.7.0 → h5rdmtoolbox-2.7.2}/h5rdmtoolbox/wrapper/accessor.py +0 -0
  105. {h5rdmtoolbox-2.7.0 → h5rdmtoolbox-2.7.2}/h5rdmtoolbox/wrapper/accessors/__init__.py +0 -0
  106. {h5rdmtoolbox-2.7.0 → h5rdmtoolbox-2.7.2}/h5rdmtoolbox/wrapper/accessors/provenance.py +0 -0
  107. {h5rdmtoolbox-2.7.0 → h5rdmtoolbox-2.7.2}/h5rdmtoolbox/wrapper/ds_decoder.py +0 -0
  108. {h5rdmtoolbox-2.7.0 → h5rdmtoolbox-2.7.2}/h5rdmtoolbox/wrapper/h5attr.py +0 -0
  109. {h5rdmtoolbox-2.7.0 → h5rdmtoolbox-2.7.2}/h5rdmtoolbox/wrapper/h5ext.py +0 -0
  110. {h5rdmtoolbox-2.7.0 → h5rdmtoolbox-2.7.2}/h5rdmtoolbox/wrapper/h5utils.py +0 -0
  111. {h5rdmtoolbox-2.7.0 → h5rdmtoolbox-2.7.2}/h5rdmtoolbox/wrapper/h5yaml.py +0 -0
  112. {h5rdmtoolbox-2.7.0 → h5rdmtoolbox-2.7.2}/h5rdmtoolbox/wrapper/jsonld.py +0 -0
  113. {h5rdmtoolbox-2.7.0 → h5rdmtoolbox-2.7.2}/h5rdmtoolbox/wrapper/xr2hdf.py +0 -0
  114. {h5rdmtoolbox-2.7.0 → h5rdmtoolbox-2.7.2}/h5rdmtoolbox.egg-info/SOURCES.txt +0 -0
  115. {h5rdmtoolbox-2.7.0 → h5rdmtoolbox-2.7.2}/h5rdmtoolbox.egg-info/dependency_links.txt +0 -0
  116. {h5rdmtoolbox-2.7.0 → h5rdmtoolbox-2.7.2}/h5rdmtoolbox.egg-info/entry_points.txt +0 -0
  117. {h5rdmtoolbox-2.7.0 → h5rdmtoolbox-2.7.2}/h5rdmtoolbox.egg-info/requires.txt +0 -0
  118. {h5rdmtoolbox-2.7.0 → h5rdmtoolbox-2.7.2}/h5rdmtoolbox.egg-info/top_level.txt +0 -0
  119. {h5rdmtoolbox-2.7.0 → h5rdmtoolbox-2.7.2}/setup.cfg +0 -0
  120. {h5rdmtoolbox-2.7.0 → h5rdmtoolbox-2.7.2}/tests/test_cli.py +0 -0
  121. {h5rdmtoolbox-2.7.0 → h5rdmtoolbox-2.7.2}/tests/test_config.py +0 -0
  122. {h5rdmtoolbox-2.7.0 → h5rdmtoolbox-2.7.2}/tests/test_extensions.py +0 -0
  123. {h5rdmtoolbox-2.7.0 → h5rdmtoolbox-2.7.2}/tests/test_identifiers.py +0 -0
  124. {h5rdmtoolbox-2.7.0 → h5rdmtoolbox-2.7.2}/tests/test_plotting.py +0 -0
  125. {h5rdmtoolbox-2.7.0 → h5rdmtoolbox-2.7.2}/tests/test_readme.py +0 -0
  126. {h5rdmtoolbox-2.7.0 → h5rdmtoolbox-2.7.2}/tests/test_repr.py +0 -0
  127. {h5rdmtoolbox-2.7.0 → h5rdmtoolbox-2.7.2}/tests/test_user.py +0 -0
  128. {h5rdmtoolbox-2.7.0 → h5rdmtoolbox-2.7.2}/tests/test_utils.py +0 -0
  129. {h5rdmtoolbox-2.7.0 → h5rdmtoolbox-2.7.2}/tests/test_version.py +0 -0
  130. {h5rdmtoolbox-2.7.0 → h5rdmtoolbox-2.7.2}/tests/test_xarray_export.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: h5rdmtoolbox
3
- Version: 2.7.0
3
+ Version: 2.7.2
4
4
  Summary: Supporting a FAIR Research Data lifecycle using Python and HDF5.
5
5
  Author-email: Matthias Probst <matth.probst@gmail.com>
6
6
  License-Expression: MIT
@@ -80,7 +80,8 @@ class DataStore(Store, ABC):
80
80
  class MetadataStore(Store, ABC):
81
81
  """Metadata database interface using."""
82
82
 
83
- __populate_on_init__ = False
83
+ __supports_named_graphs__: bool
84
+ __populate_on_init__: bool = False
84
85
  __shacl_shapes__: Dict[str, rdflib.Graph] = {}
85
86
 
86
87
  @abstractmethod
@@ -121,6 +121,8 @@ class RemoteSparqlStore(MetadataStore):
121
121
 
122
122
  class GraphDB(RemoteSparqlStore):
123
123
  """GraphDB RDF database store."""
124
+
125
+ __supports_named_graphs__: bool=True
124
126
  __supported_file_extensions__ = {".ttl", ".rdf", ".jsonld"}
125
127
 
126
128
  def __init__(self,
@@ -401,7 +403,7 @@ class GraphDB(RemoteSparqlStore):
401
403
 
402
404
  class InMemoryRDFStore(RDFStore):
403
405
  """In-memory RDF database that can upload files and return a combined graph."""
404
-
406
+ __supports_named_graphs__=False
405
407
  __default_expected_file_extensions__ = {".ttl", ".rdf", ".jsonld", ".nt", ".xml", ".n3"}
406
408
  __populate_on_init__ = True
407
409
 
@@ -786,6 +788,10 @@ class HDF5SqlDB(DataStore):
786
788
  class MetadataStoreQuery(Query, ABC):
787
789
  """RDF Store Query interface."""
788
790
 
791
+ @abstractmethod
792
+ def execute(self, store: "Store", named_graph: Optional[str]=None) -> "QueryResult":
793
+ """Executes the query against the given metadata store with optional named graph."""
794
+
789
795
 
790
796
  class SparqlQuery(MetadataStoreQuery):
791
797
  """A SPARQL query interface for RDF stores."""
@@ -0,0 +1,45 @@
1
+ import rdflib
2
+ from ontolutils.namespacelib import SCHEMA
3
+
4
+ from h5rdmtoolbox.ld.rdf import PROTECTED_ATTRIBUTE_NAMES
5
+ from h5rdmtoolbox.ld.user.attributes import process_attribute
6
+ from h5rdmtoolbox.ld.utils import get_obj_bnode
7
+ from .utils import apply_rdf_mappings
8
+ from ..rdf import RDFManager
9
+ import json
10
+
11
+ def process_dataset(*, dataset, graph, rdf_mappings, blank_node_iri_base=None):
12
+ dataset_uri = get_obj_bnode(dataset, blank_node_iri_base=blank_node_iri_base)
13
+ for ak, av in dataset.attrs.items():
14
+ if ak not in PROTECTED_ATTRIBUTE_NAMES:
15
+ process_attribute(dataset, ak, av, graph, blank_node_iri_base=blank_node_iri_base)
16
+ apply_rdf_mappings(dataset, dataset_uri, graph, rdf_mappings)
17
+
18
+ rdf_type = RDFManager(dataset.attrs).type
19
+ if rdf_type is not None:
20
+ graph.add((dataset_uri, rdflib.RDF.type, rdflib.URIRef(rdf_type)))
21
+
22
+ rdf_subject = RDFManager(dataset.attrs).subject
23
+ if rdf_subject:
24
+ graph.add((dataset_uri, SCHEMA.about, rdflib.URIRef(rdf_subject)))
25
+
26
+ rdf_predicate = RDFManager(dataset.attrs).predicate
27
+ if rdf_predicate:
28
+ _predicates = dataset.attrs.get("RDF_PREDICATE", None)
29
+ if _predicates:
30
+ self_predicate = json.loads(dataset.attrs["RDF_PREDICATE"]).get("SELF", None)
31
+ if self_predicate:
32
+ parent_uri = get_obj_bnode(dataset.parent, blank_node_iri_base=blank_node_iri_base)
33
+
34
+ _parent_subject = RDFManager(dataset.parent.attrs).subject
35
+
36
+ if _parent_subject:
37
+ if rdf_subject:
38
+ graph.add((rdflib.URIRef(_parent_subject), rdflib.URIRef(self_predicate), rdflib.URIRef(rdf_subject)))
39
+ else:
40
+ graph.add((rdflib.URIRef(_parent_subject), rdflib.URIRef(self_predicate), dataset_uri))
41
+ else:
42
+ if rdf_subject:
43
+ graph.add((parent_uri, rdflib.URIRef(self_predicate), rdflib.URIRef(rdf_subject)))
44
+ else:
45
+ graph.add((parent_uri, rdflib.URIRef(self_predicate), dataset_uri))
@@ -132,9 +132,9 @@ def get_property_node(
132
132
  """Get a property node for an HDF5 object."""
133
133
  _file_id = _get_file_id(obj.file)
134
134
  if obj.name == "/":
135
- _id = f"{_file_id}@{name}"
135
+ _id = f"{_file_id}@{_parse_obj_name(name)}"
136
136
  else:
137
- _id = f"{_file_id}{_parse_obj_name(obj.name)}__{name}"
137
+ _id = f"{_file_id}{_parse_obj_name(obj.name)}__{_parse_obj_name(name)}"
138
138
  if blank_node_iri_base:
139
139
  return rdflib.URIRef(f'{blank_node_iri_base}{_id}')
140
140
  return rdflib.BNode(_id)
@@ -146,9 +146,9 @@ def get_attr_node(
146
146
  blank_node_iri_base: str) -> Union[rdflib.URIRef, rdflib.BNode]:
147
147
  _file_id = _get_file_id(obj.file)
148
148
  if obj.name == "/":
149
- _id = f"{_file_id}@{name}"
149
+ _id = f"{_file_id}@{_parse_obj_name(name)}"
150
150
  else:
151
- _id = f"{_file_id}{_parse_obj_name(obj.name)}@{name}"
151
+ _id = f"{_file_id}{_parse_obj_name(obj.name)}@{_parse_obj_name(name)}"
152
152
  if blank_node_iri_base:
153
153
  return rdflib.URIRef(f'{blank_node_iri_base}{_id}')
154
154
  return rdflib.BNode(f"{_id}")
@@ -2513,6 +2513,7 @@ class File(h5py.File, Group):
2513
2513
  contextual=contextual,
2514
2514
  file_uri=file_uri,
2515
2515
  skipND=skipND,
2516
+ context=context,
2516
2517
  rdf_mappings=rdf_mappings)
2517
2518
  if prefix:
2518
2519
  graph.bind(prefix, file_uri)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: h5rdmtoolbox
3
- Version: 2.7.0
3
+ Version: 2.7.2
4
4
  Summary: Supporting a FAIR Research Data lifecycle using Python and HDF5.
5
5
  Author-email: Matthias Probst <matth.probst@gmail.com>
6
6
  License-Expression: MIT
@@ -7,7 +7,7 @@ build-backend = "setuptools.build_meta"
7
7
 
8
8
  [project]
9
9
  name = "h5rdmtoolbox"
10
- version = "2.7.0"
10
+ version = "2.7.2"
11
11
  description = "Supporting a FAIR Research Data lifecycle using Python and HDF5."
12
12
  readme = "README.md"
13
13
  requires-python = ">=3.9, <3.14"
@@ -1,24 +0,0 @@
1
- import rdflib
2
- from ontolutils.namespacelib import SCHEMA
3
-
4
- from h5rdmtoolbox.ld.rdf import PROTECTED_ATTRIBUTE_NAMES
5
- from h5rdmtoolbox.ld.user.attributes import process_attribute
6
- from h5rdmtoolbox.ld.utils import get_obj_bnode
7
- from .utils import apply_rdf_mappings
8
- from ..rdf import RDFManager
9
-
10
-
11
- def process_dataset(*, dataset, graph, rdf_mappings, blank_node_iri_base=None):
12
- dataset_uri = get_obj_bnode(dataset, blank_node_iri_base=blank_node_iri_base)
13
- for ak, av in dataset.attrs.items():
14
- if ak not in PROTECTED_ATTRIBUTE_NAMES:
15
- process_attribute(dataset, ak, av, graph, blank_node_iri_base=blank_node_iri_base)
16
- apply_rdf_mappings(dataset, dataset_uri, graph, rdf_mappings)
17
-
18
- rdf_type = RDFManager(dataset.attrs).type
19
- if rdf_type is not None:
20
- graph.add((dataset_uri, rdflib.RDF.type, rdflib.URIRef(rdf_type)))
21
-
22
- rdf_subject = RDFManager(dataset.attrs).subject
23
- if rdf_subject:
24
- graph.add((dataset_uri, SCHEMA.about, rdflib.URIRef(rdf_subject)))
File without changes
File without changes
File without changes