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.
- {h5rdmtoolbox-2.7.0 → h5rdmtoolbox-2.7.2}/PKG-INFO +1 -1
- {h5rdmtoolbox-2.7.0 → h5rdmtoolbox-2.7.2}/h5rdmtoolbox/catalog/abstracts.py +2 -1
- {h5rdmtoolbox-2.7.0 → h5rdmtoolbox-2.7.2}/h5rdmtoolbox/catalog/core.py +7 -1
- h5rdmtoolbox-2.7.2/h5rdmtoolbox/ld/user/datasets.py +45 -0
- {h5rdmtoolbox-2.7.0 → h5rdmtoolbox-2.7.2}/h5rdmtoolbox/ld/utils.py +4 -4
- {h5rdmtoolbox-2.7.0 → h5rdmtoolbox-2.7.2}/h5rdmtoolbox/wrapper/core.py +1 -0
- {h5rdmtoolbox-2.7.0 → h5rdmtoolbox-2.7.2}/h5rdmtoolbox.egg-info/PKG-INFO +1 -1
- {h5rdmtoolbox-2.7.0 → h5rdmtoolbox-2.7.2}/pyproject.toml +1 -1
- h5rdmtoolbox-2.7.0/h5rdmtoolbox/ld/user/datasets.py +0 -24
- {h5rdmtoolbox-2.7.0 → h5rdmtoolbox-2.7.2}/LICENSE +0 -0
- {h5rdmtoolbox-2.7.0 → h5rdmtoolbox-2.7.2}/README.md +0 -0
- {h5rdmtoolbox-2.7.0 → h5rdmtoolbox-2.7.2}/h5rdmtoolbox/__init__.py +0 -0
- {h5rdmtoolbox-2.7.0 → h5rdmtoolbox-2.7.2}/h5rdmtoolbox/_cfg.py +0 -0
- {h5rdmtoolbox-2.7.0 → h5rdmtoolbox-2.7.2}/h5rdmtoolbox/_repr.py +0 -0
- {h5rdmtoolbox-2.7.0 → h5rdmtoolbox-2.7.2}/h5rdmtoolbox/_version.py +0 -0
- {h5rdmtoolbox-2.7.0 → h5rdmtoolbox-2.7.2}/h5rdmtoolbox/catalog/__init__.py +0 -0
- {h5rdmtoolbox-2.7.0 → h5rdmtoolbox-2.7.2}/h5rdmtoolbox/catalog/_initialization.py +0 -0
- {h5rdmtoolbox-2.7.0 → h5rdmtoolbox-2.7.2}/h5rdmtoolbox/catalog/profiles.py +0 -0
- {h5rdmtoolbox-2.7.0 → h5rdmtoolbox-2.7.2}/h5rdmtoolbox/catalog/query_templates.py +0 -0
- {h5rdmtoolbox-2.7.0 → h5rdmtoolbox-2.7.2}/h5rdmtoolbox/catalog/stores/__init__.py +0 -0
- {h5rdmtoolbox-2.7.0 → h5rdmtoolbox-2.7.2}/h5rdmtoolbox/catalog/stores/hdf5.py +0 -0
- {h5rdmtoolbox-2.7.0 → h5rdmtoolbox-2.7.2}/h5rdmtoolbox/catalog/utils.py +0 -0
- {h5rdmtoolbox-2.7.0 → h5rdmtoolbox-2.7.2}/h5rdmtoolbox/cli.py +0 -0
- {h5rdmtoolbox-2.7.0 → h5rdmtoolbox-2.7.2}/h5rdmtoolbox/consts.py +0 -0
- {h5rdmtoolbox-2.7.0 → h5rdmtoolbox-2.7.2}/h5rdmtoolbox/convention/__init__.py +0 -0
- {h5rdmtoolbox-2.7.0 → h5rdmtoolbox-2.7.2}/h5rdmtoolbox/convention/cfg.py +0 -0
- {h5rdmtoolbox-2.7.0 → h5rdmtoolbox-2.7.2}/h5rdmtoolbox/convention/consts.py +0 -0
- {h5rdmtoolbox-2.7.0 → h5rdmtoolbox-2.7.2}/h5rdmtoolbox/convention/core.py +0 -0
- {h5rdmtoolbox-2.7.0 → h5rdmtoolbox-2.7.2}/h5rdmtoolbox/convention/errors.py +0 -0
- {h5rdmtoolbox-2.7.0 → h5rdmtoolbox-2.7.2}/h5rdmtoolbox/convention/generate.py +0 -0
- {h5rdmtoolbox-2.7.0 → h5rdmtoolbox-2.7.2}/h5rdmtoolbox/convention/ontology/__init__.py +0 -0
- {h5rdmtoolbox-2.7.0 → h5rdmtoolbox-2.7.2}/h5rdmtoolbox/convention/ontology/h5ontocls.py +0 -0
- {h5rdmtoolbox-2.7.0 → h5rdmtoolbox-2.7.2}/h5rdmtoolbox/convention/ontology/hdf_datatypes.py +0 -0
- {h5rdmtoolbox-2.7.0 → h5rdmtoolbox-2.7.2}/h5rdmtoolbox/convention/references.py +0 -0
- {h5rdmtoolbox-2.7.0 → h5rdmtoolbox-2.7.2}/h5rdmtoolbox/convention/standard_attributes.py +0 -0
- {h5rdmtoolbox-2.7.0 → h5rdmtoolbox-2.7.2}/h5rdmtoolbox/convention/toolbox_validators.py +0 -0
- {h5rdmtoolbox-2.7.0 → h5rdmtoolbox-2.7.2}/h5rdmtoolbox/convention/utils.py +0 -0
- {h5rdmtoolbox-2.7.0 → h5rdmtoolbox-2.7.2}/h5rdmtoolbox/data/def_icon.png +0 -0
- {h5rdmtoolbox-2.7.0 → h5rdmtoolbox-2.7.2}/h5rdmtoolbox/data/fluid-v1.yml +0 -0
- {h5rdmtoolbox-2.7.0 → h5rdmtoolbox-2.7.2}/h5rdmtoolbox/data/h5tbx.yaml +0 -0
- {h5rdmtoolbox-2.7.0 → h5rdmtoolbox-2.7.2}/h5rdmtoolbox/data/id_icon.png +0 -0
- {h5rdmtoolbox-2.7.0 → h5rdmtoolbox-2.7.2}/h5rdmtoolbox/data/iri_icon.png +0 -0
- {h5rdmtoolbox-2.7.0 → h5rdmtoolbox-2.7.2}/h5rdmtoolbox/data/ld_icon.png +0 -0
- {h5rdmtoolbox-2.7.0 → h5rdmtoolbox-2.7.2}/h5rdmtoolbox/data/piv-v1.yml +0 -0
- {h5rdmtoolbox-2.7.0 → h5rdmtoolbox-2.7.2}/h5rdmtoolbox/data/style.css +0 -0
- {h5rdmtoolbox-2.7.0 → h5rdmtoolbox-2.7.2}/h5rdmtoolbox/data/tutorial_convention.yaml +0 -0
- {h5rdmtoolbox-2.7.0 → h5rdmtoolbox-2.7.2}/h5rdmtoolbox/data/tutorial_convention_vfuncs.py +0 -0
- {h5rdmtoolbox-2.7.0 → h5rdmtoolbox-2.7.2}/h5rdmtoolbox/data/tutorial_standard_name_table.yaml +0 -0
- {h5rdmtoolbox-2.7.0 → h5rdmtoolbox-2.7.2}/h5rdmtoolbox/data/type_icon.png +0 -0
- {h5rdmtoolbox-2.7.0 → h5rdmtoolbox-2.7.2}/h5rdmtoolbox/database/__init__.py +0 -0
- {h5rdmtoolbox-2.7.0 → h5rdmtoolbox-2.7.2}/h5rdmtoolbox/database/hdfdb/__init__.py +0 -0
- {h5rdmtoolbox-2.7.0 → h5rdmtoolbox-2.7.2}/h5rdmtoolbox/database/hdfdb/filedb.py +0 -0
- {h5rdmtoolbox-2.7.0 → h5rdmtoolbox-2.7.2}/h5rdmtoolbox/database/hdfdb/objdb.py +0 -0
- {h5rdmtoolbox-2.7.0 → h5rdmtoolbox-2.7.2}/h5rdmtoolbox/database/hdfdb/query.py +0 -0
- {h5rdmtoolbox-2.7.0 → h5rdmtoolbox-2.7.2}/h5rdmtoolbox/database/hdfdb/utils.py +0 -0
- {h5rdmtoolbox-2.7.0 → h5rdmtoolbox-2.7.2}/h5rdmtoolbox/database/interface.py +0 -0
- {h5rdmtoolbox-2.7.0 → h5rdmtoolbox-2.7.2}/h5rdmtoolbox/database/lazy.py +0 -0
- {h5rdmtoolbox-2.7.0 → h5rdmtoolbox-2.7.2}/h5rdmtoolbox/database/mongo.py +0 -0
- {h5rdmtoolbox-2.7.0 → h5rdmtoolbox-2.7.2}/h5rdmtoolbox/errors.py +0 -0
- {h5rdmtoolbox-2.7.0 → h5rdmtoolbox-2.7.2}/h5rdmtoolbox/extensions/__init__.py +0 -0
- {h5rdmtoolbox-2.7.0 → h5rdmtoolbox-2.7.2}/h5rdmtoolbox/extensions/magnitude.py +0 -0
- {h5rdmtoolbox-2.7.0 → h5rdmtoolbox-2.7.2}/h5rdmtoolbox/extensions/normalize.py +0 -0
- {h5rdmtoolbox-2.7.0 → h5rdmtoolbox-2.7.2}/h5rdmtoolbox/extensions/onto.py +0 -0
- {h5rdmtoolbox-2.7.0 → h5rdmtoolbox-2.7.2}/h5rdmtoolbox/extensions/units.py +0 -0
- {h5rdmtoolbox-2.7.0 → h5rdmtoolbox-2.7.2}/h5rdmtoolbox/extensions/vector.py +0 -0
- {h5rdmtoolbox-2.7.0 → h5rdmtoolbox-2.7.2}/h5rdmtoolbox/gui/__init__.py +0 -0
- {h5rdmtoolbox-2.7.0 → h5rdmtoolbox-2.7.2}/h5rdmtoolbox/gui/fairify.py +0 -0
- {h5rdmtoolbox-2.7.0 → h5rdmtoolbox-2.7.2}/h5rdmtoolbox/gui/src/__init__.py +0 -0
- {h5rdmtoolbox-2.7.0 → h5rdmtoolbox-2.7.2}/h5rdmtoolbox/gui/src/main.py +0 -0
- {h5rdmtoolbox-2.7.0 → h5rdmtoolbox-2.7.2}/h5rdmtoolbox/identifiers.py +0 -0
- {h5rdmtoolbox-2.7.0 → h5rdmtoolbox-2.7.2}/h5rdmtoolbox/layout/__init__.py +0 -0
- {h5rdmtoolbox-2.7.0 → h5rdmtoolbox-2.7.2}/h5rdmtoolbox/layout/core.py +0 -0
- {h5rdmtoolbox-2.7.0 → h5rdmtoolbox-2.7.2}/h5rdmtoolbox/ld/__init__.py +0 -0
- {h5rdmtoolbox-2.7.0 → h5rdmtoolbox-2.7.2}/h5rdmtoolbox/ld/_types.py +0 -0
- {h5rdmtoolbox-2.7.0 → h5rdmtoolbox-2.7.2}/h5rdmtoolbox/ld/globals.py +0 -0
- {h5rdmtoolbox-2.7.0 → h5rdmtoolbox-2.7.2}/h5rdmtoolbox/ld/hdf/__init__.py +0 -0
- {h5rdmtoolbox-2.7.0 → h5rdmtoolbox-2.7.2}/h5rdmtoolbox/ld/hdf/attributes.py +0 -0
- {h5rdmtoolbox-2.7.0 → h5rdmtoolbox-2.7.2}/h5rdmtoolbox/ld/hdf/datasets.py +0 -0
- {h5rdmtoolbox-2.7.0 → h5rdmtoolbox-2.7.2}/h5rdmtoolbox/ld/hdf/file.py +0 -0
- {h5rdmtoolbox-2.7.0 → h5rdmtoolbox-2.7.2}/h5rdmtoolbox/ld/hdf/groups.py +0 -0
- {h5rdmtoolbox-2.7.0 → h5rdmtoolbox-2.7.2}/h5rdmtoolbox/ld/rdf.py +0 -0
- {h5rdmtoolbox-2.7.0 → h5rdmtoolbox-2.7.2}/h5rdmtoolbox/ld/shacl.py +0 -0
- {h5rdmtoolbox-2.7.0 → h5rdmtoolbox-2.7.2}/h5rdmtoolbox/ld/user/__init__.py +0 -0
- {h5rdmtoolbox-2.7.0 → h5rdmtoolbox-2.7.2}/h5rdmtoolbox/ld/user/attributes.py +0 -0
- {h5rdmtoolbox-2.7.0 → h5rdmtoolbox-2.7.2}/h5rdmtoolbox/ld/user/file.py +0 -0
- {h5rdmtoolbox-2.7.0 → h5rdmtoolbox-2.7.2}/h5rdmtoolbox/ld/user/groups.py +0 -0
- {h5rdmtoolbox-2.7.0 → h5rdmtoolbox-2.7.2}/h5rdmtoolbox/ld/user/utils.py +0 -0
- {h5rdmtoolbox-2.7.0 → h5rdmtoolbox-2.7.2}/h5rdmtoolbox/plotting.py +0 -0
- {h5rdmtoolbox-2.7.0 → h5rdmtoolbox-2.7.2}/h5rdmtoolbox/protected_attributes.py +0 -0
- {h5rdmtoolbox-2.7.0 → h5rdmtoolbox-2.7.2}/h5rdmtoolbox/protocols.py +0 -0
- {h5rdmtoolbox-2.7.0 → h5rdmtoolbox-2.7.2}/h5rdmtoolbox/repository/__init__.py +0 -0
- {h5rdmtoolbox-2.7.0 → h5rdmtoolbox-2.7.2}/h5rdmtoolbox/repository/default_metamapper.py +0 -0
- {h5rdmtoolbox-2.7.0 → h5rdmtoolbox-2.7.2}/h5rdmtoolbox/repository/interface.py +0 -0
- {h5rdmtoolbox-2.7.0 → h5rdmtoolbox-2.7.2}/h5rdmtoolbox/repository/utils.py +0 -0
- {h5rdmtoolbox-2.7.0 → h5rdmtoolbox-2.7.2}/h5rdmtoolbox/repository/zenodo/__init__.py +0 -0
- {h5rdmtoolbox-2.7.0 → h5rdmtoolbox-2.7.2}/h5rdmtoolbox/repository/zenodo/core.py +0 -0
- {h5rdmtoolbox-2.7.0 → h5rdmtoolbox-2.7.2}/h5rdmtoolbox/repository/zenodo/metadata.py +0 -0
- {h5rdmtoolbox-2.7.0 → h5rdmtoolbox-2.7.2}/h5rdmtoolbox/repository/zenodo/tokens.py +0 -0
- {h5rdmtoolbox-2.7.0 → h5rdmtoolbox-2.7.2}/h5rdmtoolbox/repository/zenodo/utils.py +0 -0
- {h5rdmtoolbox-2.7.0 → h5rdmtoolbox-2.7.2}/h5rdmtoolbox/tutorial.py +0 -0
- {h5rdmtoolbox-2.7.0 → h5rdmtoolbox-2.7.2}/h5rdmtoolbox/user.py +0 -0
- {h5rdmtoolbox-2.7.0 → h5rdmtoolbox-2.7.2}/h5rdmtoolbox/utils.py +0 -0
- {h5rdmtoolbox-2.7.0 → h5rdmtoolbox-2.7.2}/h5rdmtoolbox/wrapper/__init__.py +0 -0
- {h5rdmtoolbox-2.7.0 → h5rdmtoolbox-2.7.2}/h5rdmtoolbox/wrapper/accessor.py +0 -0
- {h5rdmtoolbox-2.7.0 → h5rdmtoolbox-2.7.2}/h5rdmtoolbox/wrapper/accessors/__init__.py +0 -0
- {h5rdmtoolbox-2.7.0 → h5rdmtoolbox-2.7.2}/h5rdmtoolbox/wrapper/accessors/provenance.py +0 -0
- {h5rdmtoolbox-2.7.0 → h5rdmtoolbox-2.7.2}/h5rdmtoolbox/wrapper/ds_decoder.py +0 -0
- {h5rdmtoolbox-2.7.0 → h5rdmtoolbox-2.7.2}/h5rdmtoolbox/wrapper/h5attr.py +0 -0
- {h5rdmtoolbox-2.7.0 → h5rdmtoolbox-2.7.2}/h5rdmtoolbox/wrapper/h5ext.py +0 -0
- {h5rdmtoolbox-2.7.0 → h5rdmtoolbox-2.7.2}/h5rdmtoolbox/wrapper/h5utils.py +0 -0
- {h5rdmtoolbox-2.7.0 → h5rdmtoolbox-2.7.2}/h5rdmtoolbox/wrapper/h5yaml.py +0 -0
- {h5rdmtoolbox-2.7.0 → h5rdmtoolbox-2.7.2}/h5rdmtoolbox/wrapper/jsonld.py +0 -0
- {h5rdmtoolbox-2.7.0 → h5rdmtoolbox-2.7.2}/h5rdmtoolbox/wrapper/xr2hdf.py +0 -0
- {h5rdmtoolbox-2.7.0 → h5rdmtoolbox-2.7.2}/h5rdmtoolbox.egg-info/SOURCES.txt +0 -0
- {h5rdmtoolbox-2.7.0 → h5rdmtoolbox-2.7.2}/h5rdmtoolbox.egg-info/dependency_links.txt +0 -0
- {h5rdmtoolbox-2.7.0 → h5rdmtoolbox-2.7.2}/h5rdmtoolbox.egg-info/entry_points.txt +0 -0
- {h5rdmtoolbox-2.7.0 → h5rdmtoolbox-2.7.2}/h5rdmtoolbox.egg-info/requires.txt +0 -0
- {h5rdmtoolbox-2.7.0 → h5rdmtoolbox-2.7.2}/h5rdmtoolbox.egg-info/top_level.txt +0 -0
- {h5rdmtoolbox-2.7.0 → h5rdmtoolbox-2.7.2}/setup.cfg +0 -0
- {h5rdmtoolbox-2.7.0 → h5rdmtoolbox-2.7.2}/tests/test_cli.py +0 -0
- {h5rdmtoolbox-2.7.0 → h5rdmtoolbox-2.7.2}/tests/test_config.py +0 -0
- {h5rdmtoolbox-2.7.0 → h5rdmtoolbox-2.7.2}/tests/test_extensions.py +0 -0
- {h5rdmtoolbox-2.7.0 → h5rdmtoolbox-2.7.2}/tests/test_identifiers.py +0 -0
- {h5rdmtoolbox-2.7.0 → h5rdmtoolbox-2.7.2}/tests/test_plotting.py +0 -0
- {h5rdmtoolbox-2.7.0 → h5rdmtoolbox-2.7.2}/tests/test_readme.py +0 -0
- {h5rdmtoolbox-2.7.0 → h5rdmtoolbox-2.7.2}/tests/test_repr.py +0 -0
- {h5rdmtoolbox-2.7.0 → h5rdmtoolbox-2.7.2}/tests/test_user.py +0 -0
- {h5rdmtoolbox-2.7.0 → h5rdmtoolbox-2.7.2}/tests/test_utils.py +0 -0
- {h5rdmtoolbox-2.7.0 → h5rdmtoolbox-2.7.2}/tests/test_version.py +0 -0
- {h5rdmtoolbox-2.7.0 → h5rdmtoolbox-2.7.2}/tests/test_xarray_export.py +0 -0
|
@@ -80,7 +80,8 @@ class DataStore(Store, ABC):
|
|
|
80
80
|
class MetadataStore(Store, ABC):
|
|
81
81
|
"""Metadata database interface using."""
|
|
82
82
|
|
|
83
|
-
|
|
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}")
|
|
@@ -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
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{h5rdmtoolbox-2.7.0 → h5rdmtoolbox-2.7.2}/h5rdmtoolbox/data/tutorial_standard_name_table.yaml
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|