Skip to content

Commit

Permalink
Updating tem demo (#841)
Browse files Browse the repository at this point in the history
Updated TEM demo to use access EMMO with w3id URLs.
  • Loading branch information
jesper-friis authored Jul 3, 2024
1 parent f876714 commit 95b7737
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 27 deletions.
44 changes: 22 additions & 22 deletions examples/TEM_data/data/resources.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@ data_resources:
mappingType: mappings
prefixes:
temimage: http://onto-ns.com/meta/0.1/TEMImage#
map: http://emmo.info/domain-mappings#
emmo: http://emmo.info/emmo#
oteio: http://emmo.info/oteio#
map: https://w3id.org/emmo/domain/mappings#
emmo: https://w3id.org/emmo#
oteio: https://w3id.org/emmo/domain/oteio#
triples:
- [temimage:filename, map:mapsTo, oteio.FileName]
- [temimage:data, map:mapsTo, emmo.Array]
Expand All @@ -44,9 +44,9 @@ data_resources:
mappingType: mappings
prefixes:
temimage: http://onto-ns.com/meta/0.1/TEMImage#
map: http://emmo.info/domain-mappings#
emmo: http://emmo.info/emmo#
oteio: http://emmo.info/oteio#
map: https://w3id.org/emmo/domain/mappings#
emmo: https://w3id.org/emmo#
oteio: https://w3id.org/emmo/domain/oteio#
triples:
- [temimage:filename, map:mapsTo, oteio.FileName]
- [temimage:data, map:mapsTo, emmo.Array]
Expand All @@ -67,9 +67,9 @@ data_resources:
mappingType: mappings
prefixes:
temimage: http://onto-ns.com/meta/0.1/TEMImage#
map: http://emmo.info/domain-mappings#
emmo: http://emmo.info/emmo#
oteio: http://emmo.info/oteio#
map: https://w3id.org/emmo/domain/mappings#
emmo: https://w3id.org/emmo#
oteio: https://w3id.org/emmo/domain/oteio#
triples:
- [temimage:filename, map:mapsTo, oteio.FileName]
- [temimage:data, map:mapsTo, emmo.Array]
Expand All @@ -85,9 +85,9 @@ data_resources:
mappingType: mappings
prefixes:
image: http://onto-ns.com/meta/0.1/Image#
map: http://emmo.info/domain-mappings#
emmo: http://emmo.info/emmo#
oteio: http://emmo.info/oteio#
map: https://w3id.org/emmo/domain/mappings#
emmo: https://w3id.org/emmo#
oteio: https://w3id.org/emmo/domain/oteio#
triples:
- [image:filename, map:mapsTo, oteio.FileName]
- [image:data, map:mapsTo, emmo.Array]
Expand Down Expand Up @@ -129,10 +129,10 @@ data_resources:
mappingType: mappings
prefixes:
ps: http://onto-ns.com/meta/0.1/PrecipitateStatistics#
mo: http://emmo.info/microstructure#
map: http://emmo.info/domain-mappings#
emmo: http://emmo.info/emmo#
oteio: http://emmo.info/oteio#
mo: https://w3id.org/emmo/domain/microstructure#
map: https://w3id.org/emmo/domain/mappings#
emmo: https://w3id.org/emmo#
oteio: https://w3id.org/emmo/domain/oteio#
triples:
- [ps:alloy, map:mapsTo, mo:Alloy]
- [ps:condition, map:mapsTo, mo:AlloyCondition]
Expand Down Expand Up @@ -170,9 +170,9 @@ data_resources:
mappingType: mappings
prefixes:
comp: http://onto-ns.com/meta/0.1/Composition#
mo: http://emmo.info/microstructure#
map: http://emmo.info/domain-mappings#
emmo: http://emmo.info/emmo#
mo: https://w3id.org/emmo/domain/microstructure#
map: https://w3id.org/emmo/domain/mappings#
emmo: https://w3id.org/emmo#
triples:
- [comp:alloy, map:mapsTo, mo:Alloy]
- [comp:elements, map:mapsTo, emmo:ChemicalElement]
Expand All @@ -188,9 +188,9 @@ data_resources:
mappingType: mappings
prefixes:
chem: http://onto-ns.com/meta/0.3/Chemistry#
mo: http://emmo.info/microstructure#
map: http://emmo.info/domain-mappings#
emmo: http://emmo.info/emmo#
mo: https://w3id.org/emmo/domain/microstructure#
map: https://w3id.org/emmo/domain/mappings#
emmo: https://w3id.org/emmo#
triples:
- [chem:alloy, map:mapsTo, mo:Alloy]
- [chem:elements, map:mapsTo, emmo:ChemicalElement]
Expand Down
3 changes: 1 addition & 2 deletions examples/TEM_data/demo.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
"""Demo: access and use TEM data"""
from tripper import RDF, Namespace, Triplestore
from tripper import OTEIO, RDF, Namespace, Triplestore

from tem_paths import indir, outdir
from utils.utils import get_data, populate_triplestore
Expand All @@ -11,7 +11,6 @@
ts.serialize(outdir / "resources.ttl")

# Namespace used for the data resources
OTEIO = Namespace("http://emmo.info/oteio#")
PM = ts.bind("pm", "https://www.ntnu.edu/physmet/data#")


Expand Down
5 changes: 2 additions & 3 deletions examples/TEM_data/tests/test_pipeline.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,14 @@

from otelib import OTEClient

from tripper import EMMO, MAP, Namespace
from tripper import EMMO, MAP, OTEIO, Namespace


temimage = "6c8cm_008"
thumbnail = outdir / f"{temimage}.png"

# Namespaces
MO = Namespace("http://emmo.info/microstructure#")
OTEIO = Namespace("http://emmo.info/oteio#")
MO = Namespace("https://w3id.org/emmo/domain/microstructure#")
TEMIMAGE = Namespace("http://onto-ns.com/meta/0.1/TEMImage#")
IMAGE = Namespace("http://onto-ns.com/meta/0.1/Image#")
PS = Namespace("http://onto-ns.com/meta/0.1/PrecipitateStatistics#")
Expand Down

0 comments on commit 95b7737

Please sign in to comment.