From 6e1cad507072dd22794c8b3902846049dda01f48 Mon Sep 17 00:00:00 2001 From: sanbrock Date: Wed, 11 Sep 2024 01:43:58 +0200 Subject: [PATCH] create proper Entity ELN --- src/pynxtools/nomad/schema.py | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/src/pynxtools/nomad/schema.py b/src/pynxtools/nomad/schema.py index a5154f4bd..64676f489 100644 --- a/src/pynxtools/nomad/schema.py +++ b/src/pynxtools/nomad/schema.py @@ -32,6 +32,7 @@ from nomad.datamodel.metainfo.basesections import ( BaseSection, Component, CompositeSystem, CompositeSystemReference, Entity, EntityReference, Instrument) + from nomad.datamodel.metainfo.eln import BasicEln from nomad.metainfo import (Attribute, Bytes, Datetime, Definition, MEnum, Package, Quantity, Section, SubSection) from nomad.metainfo.data_type import (Bytes, Datatype, Datetime, Number, @@ -839,8 +840,16 @@ def normalize_nxidentifier(self, archive, logger): def create_Entity(lab_id, archive, f_name): #entity = section.m_def #new_archive = EntryArchive() - entity=Entity() + + #entity=Entity() + #entity.lab_id=lab_id + entity=BasicEln() entity.lab_id=lab_id + entity.entity=Entity() + entity.entity.lab_id=lab_id + + + #new_archive.data=entity import json @@ -855,7 +864,7 @@ def get_entry_reference(archive, f_name): upload_id = archive.metadata.upload_id entry_id = hash(upload_id, f_name) - return f"/entries/{entry_id}/archive#/data/data" + return f"/entries/{entry_id}/archive#/data"