Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Message class should be slightly amended #75

Open
fabrizio-turchi opened this issue Sep 25, 2024 · 5 comments · Fixed by #77
Open

Message class should be slightly amended #75

fabrizio-turchi opened this issue Sep 25, 2024 · 5 comments · Fixed by #77

Comments

@fabrizio-turchi
Copy link
Contributor

In the init method there is the call self.append_indexed_items included in base.py but the code is useless even though it can be ignored, no issues are raised by the case_validate.

def append_indexed_items(self, *args):
        """
        :param args: A single/tuple of ObservableObjects
        """

        for key in ["olo:length", "olo:slot"]:
            if self.get(key) is None:
                self[key] = None

        if len(args) == 1 and not args[0]:  # True if no objects to append provided
            pass
        else:
            if len(args) and self["olo:slot"] is None:
                self["olo:slot"] = list()
...
@ajnelson-nist
Copy link
Member

My understanding is this method was built on an example pre-dating UCO's adoption of the Collections Ontology (done in Issue 389).

If there's a desire for this method, it should:

  1. Replace Ordered List Ontology (olo:) references with Collections Ontology (co:).
  2. Move to MessageThreadFacet, or to a yet-unwritten class specifically for uco-types:Thread management.

I think the right direction is to remove this function, and code up a demo of the thread illustrated in the ASCII art in UCO Issue 393, Competency 1 ("Suppose an email message set is found..."). Threads being non-linear, diverging, and converging, will open up some questions on class design.

@fabrizio-turchi
Copy link
Contributor Author

Every time I use the Message class the following code is included:

 {
            "@id": "kb:...",
            "@type": "uco-observable:Message",
            "olo:length": null,
            "olo:slot": null,
            "uco-core:hasFacet": [
            ]
}

It's a harmless but useless code.

ajnelson-nist added a commit that referenced this issue Sep 27, 2024
A follow-on patch will regenerate Make-managed files.

References:
* #75

Reported-by: Fabrizio Turchi <fabrizio.turchi@igsg.cnr.it>
Signed-off-by: Alex Nelson <alexander.nelson@nist.gov>
ajnelson-nist added a commit that referenced this issue Sep 27, 2024
References:
* #75

Signed-off-by: Alex Nelson <alexander.nelson@nist.gov>
@ajnelson-nist
Copy link
Member

I've removed the affect from uco-observable:Message in #77 .

I haven't looked into addressing the longer-term questions, though.

@fabrizio-turchi
Copy link
Contributor Author

@ajnelson-nist thanks! It's up to you to close it or leave it open.

@ajnelson-nist
Copy link
Member

There's at least one more PR I'll push later next week to convert olo to co, because I saw that the append_indexed_items function is being used in the drafting module. So, let's leave this open for now, but by my understanding, it's no longer a blocker for you, or generating distracting data.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants