isamplesorg / isamples_webui

Web interface to iSB and iSC APIs

Home Page:https://isamplesorg.github.io/isamples_webui/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Convolved metadata fields on full record page

NatalieRaia opened this issue · comments

When viewing full record page (from clicking on an IGSN pop up window in map view), some discrete metadata items under “Value” and “ProducedBy Description” are convolved.

Hi @NatalieRaia -- this is how the fields are calculated and indexed. The only real choice here would be to omit them from the page. (Or maybe somehow abbreviate them)

Ok! To be more specific on the item I encountered here, in the attached screenshot, I was trying to say that there are three separate SESAR metadata fields merged within "ProducedBy Description" ("Manual>Hammer," "Banded serpentinized spinel peridotite," and "navigation type:GPS"). Am I understanding correctly then that this is a product of the metadata mapping into iSamples, and thus why, "it is what it is," so to speak?
Screenshot 2023-12-06 at 12 54 26 AM

Yes, this is by design. @smrgeoinfo can suggest any updates but that was what was requested when we implemented it.

@dannymandel @smrgeoinfo can we talk about this issue at a stand up or in a tech meeting? I think there's actually a few things going on here. 1) in Natalie's screenshot above, the mappings are in this case sometimes bringing together information that doesn't seem to be related, and 2) the field names (e.g. "ProducedBy Description") aren't making sense to users. Are the field names set by iSamples or are then imported by contributing databases?

The field names are set by iSamples. The information for the field is produced differently for each provider:

GEOME:

    def produced_by_description(self) -> str:
        parent_record = self._source_record_parent_record()
        if parent_record is not None:
            description_pieces = []
            event_remarks = parent_record.get("eventRemarks")
            if event_remarks is not None:
                description_pieces.append(event_remarks)
            self._transform_key_to_label(
                "samplingProtocol", parent_record, description_pieces
            )
            self._transform_key_to_label(
                "permitInformation", parent_record, description_pieces
            )
            self._transform_key_to_label(
                "expeditionCode", parent_record, description_pieces
            )
            self._transform_key_to_label(
                "taxTeam", parent_record, description_pieces, "taxonomy team"
            )
            self._transform_key_to_label(
                "projectId", parent_record, description_pieces
            )
            return Transformer.DESCRIPTION_SEPARATOR.join(description_pieces)
        return Transformer.NOT_PROVIDED

OpenContext:

    def produced_by_description(self) -> str:
        return self._project_dict().get("id", Transformer.NOT_PROVIDED)

SESAR:

    def produced_by_description(self) -> str:  # noqa: C901 -- need to examine computational complexity
        description_components = list()
        description_dict = self._source_record_description()
        if description_dict is not None:
            supplement_metadata = self._supplement_metadata()
            if supplement_metadata is not None:
                if "cruiseFieldPrgrm" in supplement_metadata:
                    description_components.append(
                        "cruiseFieldPrgrm:{0}".format(
                            supplement_metadata["cruiseFieldPrgrm"]
                        )
                    )
                if "launchPlatformName" in supplement_metadata:
                    description_components.append(
                        "launchPlatformName:{0}".format(
                            supplement_metadata["launchPlatformName"]
                        )
                    )

            if "collectionMethod" in description_dict:
                description_components.append(description_dict["collectionMethod"])
            if "description" in description_dict:
                description_components.append(description_dict["description"])

            if supplement_metadata is not None:
                launch_type_str = ""
                if "launchTypeName" in supplement_metadata:
                    launch_type_str += "launch type:{0}, ".format(
                        supplement_metadata["launchTypeName"]
                    )
                if "navigationType" in supplement_metadata:
                    launch_type_str += "navigation type:{0}".format(
                        supplement_metadata["navigationType"]
                    )
                if len(launch_type_str) > 0:
                    description_components.append(launch_type_str)

            return ". ".join(description_components)

        return Transformer.NOT_PROVIDED

Smithsonian:

    def produced_by_description(self) -> str:
        description_pieces: list[str] = []
        self._transform_key_to_label("verbatimEventDate", self.source_record, description_pieces)
        return " | ".join(description_pieces)

If I'm interpreting the code above for SESAR, the text that gets concatenated in the 'produced_by/description' field is from these fields in the SESAR data (that end up in the self._source_record_description() dictionary).

cruiseFieldPrgrm
launchPlatformName
collectionMethod
description
launchTypeName
navigationType

produced_by/description is a free text field for description of the sampling event. I suspect the text 'Banded serpentinized spinel peridotite' is coming from 'description', and that that field probably shouldn't be concatenated in the produced_by/description, rather it should go into /description (the sample description).

We should certainly come up with some better labels for the fields in the metadata results display. I'd suggest
$schema --> metadata schema identifier [this is still the old metadata schema in the screen shot from Natalie]
@id --> metadata identifier
Label --> Original sample name
SampleIdentifier -- Sample identifier
hasContextCategory --> What was sampled
hasContextCategoryConfidence -- I don't know where this comes from, but integer should be mapped to word
hasMaterialCategory -- what is the sample made of
hasSpecimenCategory -- what kind of thing is the sample
...confidence see above
InformalClassification --0 this is not in the current (v1.0 schema)
Keywords -- Keywords
ProductedBy Label --> Sampling event name
ProductedBy Description -- Sampling event description
ProductedBy HasFeatureOfInterest --> What was sampled