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

Example: How to describe the electrode composition hierarchy #117

Open
jsimonclark opened this issue Mar 1, 2024 · 5 comments
Open

Example: How to describe the electrode composition hierarchy #117

jsimonclark opened this issue Mar 1, 2024 · 5 comments
Assignees
Labels
question Further information is requested

Comments

@jsimonclark
Copy link
Collaborator

jsimonclark commented Mar 1, 2024

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 jsimonclark self-assigned this Mar 1, 2024
@jsimonclark jsimonclark added the question Further information is requested label Mar 1, 2024
@jsimonclark
Copy link
Collaborator Author

jsimonclark commented Mar 1, 2024

@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 hasPart relations, but hasPart is 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
Copy link

NukP commented Mar 26, 2024

@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
Copy link
Collaborator Author

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
Copy link
Collaborator Author

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
Copy link
Collaborator Author

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.

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

No branches or pull requests

2 participants