Skip to content

Commit

Permalink
Merge pull request #92 from emmo-repo/dev
Browse files Browse the repository at this point in the history
update data types and examples
  • Loading branch information
jsimonclark authored Aug 20, 2024
2 parents 312b564 + 5ae1dc9 commit 5d381ed
Show file tree
Hide file tree
Showing 10 changed files with 442 additions and 49 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Ignore the virtual environment directory
.venv/
6 changes: 3 additions & 3 deletions catalog-v001.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@
<catalog prefer="public" xmlns="urn:oasis:names:tc:entity:xmlns:xml:catalog">
<uri id="Imports Wizard Entry" name="https://w3id.org/emmo/1.0.0-beta7" uri="https://raw.githubusercontent.com/emmo-repo/EMMO/1.0.0-beta7/emmo.ttl"/>
<group id="Folder Repository, directory=, recursive=true, Auto-Update=false, version=2" prefer="public" xml:base="">
<uri name="https://w3id.org/emmo/domain/chemical-substance/0.7.0-beta/chemical-substance" uri="https://raw.githubusercontent.com/emmo-repo/domain-chemical-substance/main/chemical-substance.ttl"/>
<uri name="https://w3id.org/emmo/domain/chemical-substance/0.8.0-beta/chemical-substance" uri="https://raw.githubusercontent.com/emmo-repo/domain-chemical-substance/main/chemical-substance.ttl"/>
<uri name="https://w3id.org/emmo/domain/characterisation-methodology/chameo" uri="https://raw.githubusercontent.com/emmo-repo/domain-characterisation-methodology/main/chameo.ttl"/>
<uri name="https://w3id.org/emmo/domain/electrochemistry/0.20.0-beta/electrochemistry" uri="./electrochemistry.ttl"/>
<uri name="https://w3id.org/emmo/domain/electrochemistry/0.20.0-beta/electrochemicalquantities" uri="./electrochemicalquantities.ttl"/>
<uri name="https://w3id.org/emmo/domain/electrochemistry/0.21.0-beta/electrochemistry" uri="./electrochemistry.ttl"/>
<uri name="https://w3id.org/emmo/domain/electrochemistry/0.21.0-beta/electrochemicalquantities" uri="./electrochemicalquantities.ttl"/>

<uri name="https://w3id.org/emmo/1.0.0-beta7/mereocausality" uri="https://raw.githubusercontent.com/emmo-repo/EMMO/1.0.0-beta7/mereocausality/mereocausality.ttl"/>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,19 @@
}
]
},
"hasInput": [
{
"@type": "ElectrochemicalDevice"
},
{
"@type": "NumberOfIterations",
"hasNumericalPart": {
"@type": "Real",
"hasNumericalValue": 10
},
"hasMeasurementUnit": "emmo:UnitOne"
}
],
"hasOutput": [
{
"@type": "TimeSeriesDataSet",
Expand All @@ -39,14 +52,63 @@
"@type": "VoltageData"
},
{
"@type": "CurrentData"
"@type": "ElectricCurrentData"
}
]
}
],
"hasTemporaryParticipant": {
"@type": "ElectrochemicalWorkstation"
},
"hasSubProcess": [
{
"@type": ["VoltageMeasurement", "TimeSeriesMeasurement"],
"hasMeasurementParameter": [
{
"@type": "SamplingRate"
},
{
"@type": "Precision"
}
]
},
{
"@type": ["ElectricCurrentMeasurement", "TimeSeriesMeasurement"],
"hasMeasurementParameter": [
{
"@type": "SamplingRate"
},
{
"@type": "Precision"
}
]
},
{
"@type": ["TimeMeasurement", "TimeSeriesMeasurement"],
"hasMeasurementParameter": [
{
"@type": "SamplingRate"
},
{
"@type": "Precision"
}
]
},
{
"@type": ["TemperatureMeasurement", "TimeSeriesMeasurement"],
"hasMeasurementParameter": [
{
"@type": "SamplingRate"
},
{
"@type": "Precision"
}
]
}
],
"hasTask": {
"@type": "ConstantCurrentDischarging",
"hasMeasurementParameter": [
"hasInput": [
{
"@type": "DischargingCurrent",
"hasNumericalPart": {
Expand All @@ -56,7 +118,7 @@
"hasMeasurementUnit": "emmo:Ampere"
},
{
"@type": ["LowerVoltageLimit", "TerminationQuantity"],
"@type": ["LowerVoltageLimit"],
"hasNumericalPart": {
"@type": "Real",
"hasNumericalValue": 2.4
Expand All @@ -66,7 +128,7 @@
],
"hasNext": {
"@type": "ConstantCurrentCharging",
"hasMeasurementParameter": [
"hasInput": [
{
"@type": "ChargingCurrent",
"hasNumericalPart": {
Expand All @@ -76,7 +138,7 @@
"hasMeasurementUnit": "emmo:Ampere"
},
{
"@type": ["UpperVoltageLimit", "TerminationQuantity"],
"@type": ["UpperVoltageLimit"],
"hasNumericalPart": {
"@type": "Real",
"hasNumericalValue": 4.2
Expand All @@ -85,8 +147,8 @@
}
],
"hasNext": {
"@type": "ConstantVoltageCharging",
"hasMeasurementParameter": [
"@type": ["ConstantVoltageCharging", "EndTask"],
"hasInput": [
{
"@type": "ChargingVoltage",
"hasNumericalPart": {
Expand All @@ -96,7 +158,7 @@
"hasMeasurementUnit": "emmo:Volt"
},
{
"@type": ["UpperCurrentLimit", "TerminationQuantity"],
"@type": ["LowerCurrentLimit"],
"hasNumericalPart": {
"@type": "Real",
"hasNumericalValue": 10
Expand Down
3 changes: 1 addition & 2 deletions docs/assets/jsonld/fair_compliance_template.jsonld
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,7 @@
},
"http://schema.org/license": "http://opendefinition.org/licenses/cc-by/",
"dc:format": "application/ld+json",
"dc:accessRights": "public",
"dc:rights": "public",
"dc:accessRights": "open access",
"dc:publisher": {
"@type": "schema:ResearchOrganization",
"@id": "https://ror.org/01f677e56",
Expand Down
137 changes: 137 additions & 0 deletions docs/examples/example_zinc_foil.ipynb
Original file line number Diff line number Diff line change
@@ -0,0 +1,137 @@
{

Check warning on line 1 in docs/examples/example_zinc_foil.ipynb

View workflow job for this annotation

GitHub Actions / updatepages

Each notebook should have at least one section title
"cells": [
{
"cell_type": "code",
"execution_count": 12,
"metadata": {},
"outputs": [],
"source": [
"# Import necessary libraries\n",
"from rdflib import Graph\n",
"from ontopy import get_ontology\n",
"import json\n",
"\n",
"# Load the ontology\n",
"echo = get_ontology('https://w3id.org/emmo/domain/electrochemistry/inferred').load()\n"
]
},
{
"cell_type": "code",
"execution_count": 13,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Diameter: 2 https://w3id.org/emmo#CentiMetre\n"
]
}
],
"source": [
"# Create an RDF graph\n",
"g = Graph()\n",
"\n",
"# Load the JSON-LD data\n",
"json_ld_data = {\n",
" \"@context\": \"https://w3id.org/emmo/domain/electrochemistry/context\",\n",
" \"@type\": \"Electrode\",\n",
" \"schema:manufacturer\": {\n",
" \"@type\": \"schema:ResearchOrganization\",\n",
" \"@id\": \"https://www.wikidata.org/wiki/Q3041255\",\n",
" \"schema:name\": \"SINTEF\"\n",
" },\n",
" \"schema:creator\": {\n",
" \"@type\": \"schema:Person\",\n",
" \"@id\": \"https://orcid.org/0000-0002-8758-6109\",\n",
" \"schema:name\": \"Simon Clark\"\n",
" },\n",
" \"hasActiveMaterial\": {\n",
" \"@type\": [\"Zinc\", \"Foil\"]\n",
" },\n",
" \"hasProperty\": [\n",
" {\n",
" \"@type\": [\"SpecificCapacity\", \"MeasuredProperty\"],\n",
" \"hasNumericalPart\": {\n",
" \"@type\": \"Real\",\n",
" \"hasNumericalValue\": 800\n",
" },\n",
" \"hasMeasurementUnit\": \"emmo:MilliAmpereHourPerGram\"\n",
" },\n",
" {\n",
" \"@type\": [\"Thickness\", \"ConventionalProperty\"],\n",
" \"hasNumericalPart\": {\n",
" \"@type\": \"Real\",\n",
" \"hasNumericalValue\": 250\n",
" },\n",
" \"hasMeasurementUnit\": \"emmo:MicroMetre\"\n",
" },\n",
" {\n",
" \"@type\": [\"Diameter\", \"MeasuredProperty\"],\n",
" \"hasNumericalPart\": {\n",
" \"@type\": \"Real\",\n",
" \"hasNumericalValue\": 2\n",
" },\n",
" \"hasMeasurementUnit\": \"emmo:CentiMetre\"\n",
" },\n",
" {\n",
" \"@type\": [\"Mass\", \"MeasuredProperty\"],\n",
" \"hasNumericalPart\": {\n",
" \"@type\": \"Real\",\n",
" \"hasNumericalValue\": 2.5\n",
" },\n",
" \"hasMeasurementUnit\": \"emmo:Gram\"\n",
" }\n",
" ]\n",
"}\n",
"\n",
"# Convert JSON-LD data to RDF and add to the graph\n",
"g.parse(data=json.dumps(json_ld_data), format='json-ld')\n",
"\n",
"# Query the graph to get the diameter\n",
"query = f\"\"\"\n",
"SELECT ?diameterValue ?measurementUnit\n",
"WHERE {{\n",
" ?electrode a <{echo.Electrode.iri}> ;\n",
" <{echo.hasProperty.iri}> ?property .\n",
"\n",
" ?property a <{echo.Diameter.iri}> ;\n",
" <{echo.hasNumericalPart.iri}> ?numericalPart ;\n",
" <{echo.hasMeasurementUnit.iri}> ?measurementUnit .\n",
"\n",
" ?numericalPart <{echo.hasNumericalValue.iri}> ?diameterValue .\n",
"}}\n",
"\"\"\"\n",
"\n",
"# Run the query\n",
"results = g.query(query)\n",
"\n",
"# Print results\n",
"for row in results:\n",
" unit = row.measurementUnit\n",
" print(f\"Diameter: {row.diameterValue} {row.measurementUnit}\")\n"
]
}
],
"metadata": {
"kernelspec": {
"display_name": ".venv",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.10.10"
}
},
"nbformat": 4,
"nbformat_minor": 2
}
1 change: 1 addition & 0 deletions docs/scripts/file
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"_actions":{"delete":"https://kadi-dlr.hiu-batteries.de/api/records/5334/files/3282eaa3-d8f8-4f8e-8f3d-cb618c34ae80","edit_data":"https://kadi-dlr.hiu-batteries.de/api/records/5334/files/3282eaa3-d8f8-4f8e-8f3d-cb618c34ae80","edit_metadata":"https://kadi-dlr.hiu-batteries.de/api/records/5334/files/3282eaa3-d8f8-4f8e-8f3d-cb618c34ae80"},"_links":{"download":"https://kadi-dlr.hiu-batteries.de/api/records/5334/files/3282eaa3-d8f8-4f8e-8f3d-cb618c34ae80/download","record":"https://kadi-dlr.hiu-batteries.de/api/records/5334","self":"https://kadi-dlr.hiu-batteries.de/api/records/5334/files/3282eaa3-d8f8-4f8e-8f3d-cb618c34ae80"},"checksum":"a2be68921f0c0046e530d951590576d3","created_at":"2024-08-02T09:22:39.972837+00:00","description":"","id":"3282eaa3-d8f8-4f8e-8f3d-cb618c34ae80","last_modified":"2024-08-02T09:22:40.027077+00:00","magic_mimetype":"application/json","mimetype":"application/json","name":"18650-LG-3500-MJ1-Graphite.jsonld","size":226,"state":"active","storage":{"storage_name":"Local","storage_type":"local"}}
4 changes: 2 additions & 2 deletions electrochemicalquantities.ttl
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
@base <https://w3id.org/emmo/domain/electrochemistry/electrochemicalquantities> .

<https://w3id.org/emmo/domain/electrochemistry/electrochemicalquantities> rdf:type owl:Ontology ;
owl:versionIRI <https://w3id.org/emmo/domain/electrochemistry/0.20.0-beta/electrochemicalquantities> ;
owl:versionIRI <https://w3id.org/emmo/domain/electrochemistry/0.21.0-beta/electrochemicalquantities> ;
owl:imports <https://w3id.org/emmo/1.0.0-beta7/disciplines/isq> ;
dcterms:abstract "This electrochemical quantities ontology is a domain of the Elementary Multiperspective Materials Ontology (EMMO). It is a specialized framework designed to represent and organize knowledge about electrochemical quantities. It is designed to integrate with the electrochemistry domain ontology or other ontologies from the EMMO ecosystem. The main focus of this ontology is to provide machine-readable descriptions of common electrochemical quantities, linking both to the larger descriptions of physical quantities in EMMO as well as other sources of information like the IEC, QUDT, Wikidata, etc. It should be used to support linked data generation in the electrochemistry domain."@en ;
dcterms:contributor <https://orcid.org/0000-0001-8869-3718> ,
Expand All @@ -21,7 +21,7 @@
dcterms:creator <https://orcid.org/0000-0002-8758-6109> ,
<https://orcid.org/0000-0003-2954-1233> ;
dcterms:license "https://creativecommons.org/licenses/by/4.0/legalcode" ;
owl:versionInfo "0.20.0-beta" .
owl:versionInfo "0.21.0-beta" .

#################################################################
# Annotation properties
Expand Down
Loading

0 comments on commit 5d381ed

Please sign in to comment.