BIG-MAP / BattINFO

A Battery Interface Ontology based on EMMO
https://big-map.github.io/BattINFO/index.html
Creative Commons Attribution 4.0 International
39 stars 10 forks source link

Example: How to describe the electrode composition hierarchy #117

Open jsimonclark opened 8 months ago

jsimonclark commented 8 months ago

Continued discussion from Issue #109

"I want to use this connector for type of item in general. For example: Cathode binder type, My current intended link is: Battery-hasPart-Cathode-hasPart-Binder-hasType Cathode current collector, My current intended link is: Battery-hasPart-Cathode-hasPart-CurrentCollector-hasType Please advice me on what I should use."

jsimonclark commented 8 months ago

@NukP, Generally, it's best to avoid making custom "type" properties, because it will be easy to confuse with other concepts like rdf:type, rdfs:SubClassOf, and the @type keyword in JSON-LD.

In your example, you are creating a holistic description of a battery. A holistic description focuses on how the "whole" (a battery) is comprised of "parts" (a cathode, a binder, a current collector, etc.). It is technically acceptable to use hasPartrelations, but hasPartis the most primitive parthood property and we have dedicated object properties for holistic constituents in electrochemistry that you can also use (see example below). Also, please be careful with the term "cathode". It has a specific meaning in electrochemistry (the electrode where a reduction reaction occurs) and it is widely misused in the battery field. For example, when you charge a battery, the electrode that you typically think of as the cathode is actually the anode and vice versa. For that reason we recommend to use "positive electrode" and "negative electrode" instead.

A pseudo description in JSON-LD would be like:

{
    "@context": "https://w3id.org/emmo/domain/battery/context/context",
    "@type": "BatteryCell",
    "hasPositiveElectrode":{
        "@type": "CoatedElectrode",
        "hasCoating": {
            "@type": "ElectrodeCoating",
            "hasActiveMaterial": {
                "@type": "LithiumIronPhosphate",
                "rdfs:comment": "for example"
            },
            "hasConstituent": [
                {
                    "@type": "Binder"
                },
                {
                    "@type": "ConductiveAdditive"
                }
            ]
        },
        "hasCurrentCollector": {
            "@type": ["CurrentCollector", "Aluminium"],
            "rdfs:comment": "for example"
        }
    }
}

and expressed as a graph it would look like:

image

NukP commented 7 months ago

@jsimonclark Quick question, what tool do you use to transform JSON-LD into this diagram? I have been finding the appropriate tool to do this. With this structure

Another broad question is concerning the dialect of JSON-LD. What would happen if say everyone use different dialect of JSON-LD, would this be an issue when JSON-LD is used for query? I am now running into the situation where you provide one recommendation on the dialect of JSON-LD. My JSON-LD's dialect is different from yours. A collaborator from another work package (PREMISE project) are now exploring the use of JSON-LD in ro-crate to carry data/metadata across ELN and work flow manager, they too will probably develop a different dialect of JSON-LD.

Do you have a real use case (say a website / database) where I can try put multiple JSON-LD files and query the info in them just to test the dialect? Thank you.

jsimonclark commented 7 months ago

I made the drawing here by hand with draw.io. Here are some other options for visualizing RDF graphs.

For more dynamic visualization, I also like streamlit with streamlit-agraph. My only complaint is that the dark mode option isn't the best.

jsimonclark commented 7 months ago

Just like real dialects it's easiest if you use the same one as the people you talk to. And as the development settles, the dialect should too. But you can get around some variation by using more generic SPARQL queries. Check out the SPARQL documentation or just ask ChatGPT - it's pretty good at writing SPARQL queries.

jsimonclark commented 7 months ago

For testing graph operations and queries, I use rdflib in python. Some people prefer environments like GraphDB that looks a bit fancier. There are a lot of options like blazegraph, fuseki, etc.

Cordis also maintains a SPARQL endpoint for EU research projects that's cool.