NCEAS / metacatui

MetacatUI: A client-side web interface for DataONE data repositories
https://nceas.github.io/metacatui
Apache License 2.0
42 stars 27 forks source link

Design EML 2.2.0 semantic annotation display on dataset landing pages #943

Closed amoeba closed 4 years ago

amoeba commented 5 years ago

EML 2.2.0 adds support for semantic annotations. We're in the process of writing up docs for them in a primer. The new XML looks like

<annotation>
  <propertyURI label="is about">http://purl.obolibrary.org/obo/IAO_0000136</propertyURI>
  <valueURI label="grassland biome">http://purl.obolibrary.org/obo/ENVO_01000177</valueURI>
</annotation>

These can be child elements of the eml element (meaning they apply to the whole record), any direct child (e.g., dataset), meaning they can apply to the dataset, entities, attributes, and also in additionalMetadata which essentially allows arbitrary RDF triples [MPS: we haven't defined how to enter an "arbitrary Subject" of a Triple into an EML doc!] to be inserted. Both propertyURI and valueURI are required, and so are label attributes for both.

The previous interface for annotations focused on a tagging interface which displays annotations as tags like on a bookmarking site. This paradigm doesn't quite fit as the new annotations are implicitly RDF triples (subject, predicate, and object). I think a higher level discussion is in order but I wanted to write up my current implementation so we can discuss the current direction and go from there.

The overall goal of semantic annotations in EML 2.2.0 are to let us be more specific about the meaning or identity of EML field fillers, than EML otherwise provides. I think the landing page user interface should help the metadata viewer in this way.

I decided that a fairly literal tabular display makes the most sense. Literal in the sense that the annotations display in a table in the place where they are located in the XML. And the table, then, can be scrolled and searched if desired because it's tabular. I also decided we needed to bring in more information about the annotated properties and values like rdfs:labels or other info. [MPS: yes! definitely need to display text in rdfs:label info, but also display or ready-access to-- rdfs:comment, and potentially skos:altLabel-- maybe more]

I have a clunky demo up at https://neutral-cat.nceas.ucsb.edu/view/afca2e67-58fe-442a-8765-2cbb6a348e37 and you can see (1) the annotations displayed as tables in the various locations annotations can show up. No need to comment on some of the basic display issues as of yet but I am looking for high level feedback. You can see the external lookup feature in action:

Kapture 2019-04-16 at 16 33 21

When the user clicks a concept:

Lookups from Bioportal are cached locally so multiple lookups for the same concept are instantaneous. For a first pass, I loaded the definition which is a Bioportal API thing. We should discuss what all should go in the popover [MPS-- what RDF/OWL structure does Bioportal use to populate "definition"? ]. With this approach, we can include anything in the XML itself and also in this response:

{
  "prefLabel": "air",
  "definition": ["The mixture of gases (roughly (by molar content/volume: 78% nitrogen, 20.95% oxygen, 0.93% argon, 0.038% carbon dioxide, trace amounts of other gases, and a variable amount (average around 1%) of water vapor) that surrounds the planet Earth."],
  "obsolete": false,
  "matchType": "id",
  "ontologyType": "ONTOLOGY",
  "provisional": false,
  "@id": "http://purl.obolibrary.org/obo/ENVO_00002005",
  "@type": "http://www.w3.org/2002/07/owl#Class",
  "links": {
    "self": "http://data.bioontology.org/ontologies/ENVO/classes/http%3A%2F%2Fpurl.obolibrary.org%2Fobo%2FENVO_00002005",
    "ontology": "http://data.bioontology.org/ontologies/ENVO",
    "children": "http://data.bioontology.org/ontologies/ENVO/classes/http%3A%2F%2Fpurl.obolibrary.org%2Fobo%2FENVO_00002005/children",
    "parents": "http://data.bioontology.org/ontologies/ENVO/classes/http%3A%2F%2Fpurl.obolibrary.org%2Fobo%2FENVO_00002005/parents",
    "descendants": "http://data.bioontology.org/ontologies/ENVO/classes/http%3A%2F%2Fpurl.obolibrary.org%2Fobo%2FENVO_00002005/descendants",
    "ancestors": "http://data.bioontology.org/ontologies/ENVO/classes/http%3A%2F%2Fpurl.obolibrary.org%2Fobo%2FENVO_00002005/ancestors",
    "instances": "http://data.bioontology.org/ontologies/ENVO/classes/http%3A%2F%2Fpurl.obolibrary.org%2Fobo%2FENVO_00002005/instances",
    "tree": "http://data.bioontology.org/ontologies/ENVO/classes/http%3A%2F%2Fpurl.obolibrary.org%2Fobo%2FENVO_00002005/tree",
    "notes": "http://data.bioontology.org/ontologies/ENVO/classes/http%3A%2F%2Fpurl.obolibrary.org%2Fobo%2FENVO_00002005/notes",
    "mappings": "http://data.bioontology.org/ontologies/ENVO/classes/http%3A%2F%2Fpurl.obolibrary.org%2Fobo%2FENVO_00002005/mappings",
    "ui": "http://bioportal.bioontology.org/ontologies/ENVO?p=classes&conceptid=http%3A%2F%2Fpurl.obolibrary.org%2Fobo%2FENVO_00002005",
    "@context": {
      "self": "http://www.w3.org/2002/07/owl#Class",
      "ontology": "http://data.bioontology.org/metadata/Ontology",
      "children": "http://www.w3.org/2002/07/owl#Class",
      "parents": "http://www.w3.org/2002/07/owl#Class",
      "descendants": "http://www.w3.org/2002/07/owl#Class",
      "ancestors": "http://www.w3.org/2002/07/owl#Class",
      "instances": "http://data.bioontology.org/metadata/Instance",
      "tree": "http://www.w3.org/2002/07/owl#Class",
      "notes": "http://data.bioontology.org/metadata/Note",
      "mappings": "http://data.bioontology.org/metadata/Mapping",
      "ui": "http://www.w3.org/2002/07/owl#Class"
    }
  },
  "@context": {
    "@vocab": "http://data.bioontology.org/metadata/",
    "prefLabel": "http://data.bioontology.org/metadata/skosprefLabel",
    "definition": "http://data.bioontology.org/metadata/skosdefinition",
    "obsolete": "http://data.bioontology.org/metadata/owlobsolete"
  }
}

Questions:

stevenchong commented 5 years ago

Glad to see you making progress with the interface!

Do you like the tabular display or does a tag-like display still make sense?

Is there an instance of the tagging display up somewhere so we can make comparisons? I think I've only seen screenshots of the tag interface and not a version with working annotations.

From what I see in the tabular display, you probably will need a 'Subject' column to indicate the subjects for the eml/additionalMetadata and eml/annotations annotations. It's hard to tell what the bottom two tables are annotating, especially because the subjects are referenced by their id and can come from different areas in the EML doc. I also think there needs to be a more noticeable indicator showing that the annotations are clickable, rather than just having the mouse cursor transform into a finger when hovering over an annotation.

What info info should go into the popovers? I thought a definition for the term and a link out to more info made the most sense.

For a start, I say definition, URI, and labels (i.e. rdfs:label, alternative, preferred).

Is there value in a document-wide list of annotations? Essentially a list of triples?

I can't think of any additional value at the moment, particularly if we stick with the tabular interface.

How do we look up or help the user look up more info about terms not indexed in Bioportal? I think at least linking to the concept helps. Ontology repositories are somewhat scattered at the moment so picking a happy path like Bioportal seems practical the moment.

Need to think about this one a little more.

mpsaloha commented 5 years ago

Bryce-- thanks for putting this together. I've embedded comments inline in your text, [ MPS: bracketed as such ]

Regarding Bioportal-- I did look-over the ESIP Fed's COR and their API seems pretty minimal. On the other hand, the API for the OLS (Ontology Lookup Service) seems pretty feature-full:

https://www.ebi.ac.uk/ols/docs/api

OLS is open-source. Maybe worth discussing a bit...

amoeba commented 5 years ago

@stevenchong

Is there an instance of the tagging display up somewhere so we can make comparisons? I think I've only seen screenshots of the tag interface and not a version with working annotations.

LeafLitterAnnotation

We can nearly implement the above as-is, minus some of the details related to the external part of those annotations.

Re what I said above,

Is there value in a document-wide list of annotations? Essentially a list of triples?

One thing I'm seeing as I develop and test this is that you can't use your browser's Find feature to find all attribute annotations because our display hides them so I could see some value in a document-wide list but it'd still feel a bit unwieldy.

I've got an Invision mockup I'd like to go over tomorrow if we have time to discuss some of your and @mpsaloha 's comments.

amoeba commented 5 years ago

After some very useful discussions, I've added a more complete mockup in a new Invision freehand: https://projects.invisionapp.com/freehand/document/SRsCkLoYa. I'll be soliciting feedback directly with folks but wanted to pop it in here for others.

amoeba commented 5 years ago

I've been bad about updating this but the code is all in my branch and I'm merging PR'ing this week.

Current look:

Screen Shot 2019-07-25 at 10 45 30 AM

We got some feedback this week on the arctic semantics call which I mocked up here and could use feedback on: https://projects.invisionapp.com/freehand/document/BKyTUhZ7C

amoeba commented 4 years ago

Closing since this was shipped, see #1055.