Skip to content

Commit

Permalink
Merge branch 'master' into build-wheel7
Browse files Browse the repository at this point in the history
  • Loading branch information
jesper-friis authored Jan 11, 2025
2 parents 7373c6f + 990b0df commit 3a54832
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 8 deletions.
14 changes: 7 additions & 7 deletions bindings/python/dataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@

# XXX TODO - Make a local cache of EMMO such that we only download it once
TS_EMMO = Triplestore("rdflib")
TS_EMMO.parse("https://w3id.org/emmo/1.0.0-rc3")
TS_EMMO.parse("https://w3id.org/emmo/1.0.0")

EMMO_VERSIONIRI = TS_EMMO.value("https://w3id.org/emmo", OWL.versionIRI)

Expand Down Expand Up @@ -64,7 +64,7 @@
"float32": "FloatData",
"float64": "DoubleData",
"string": "StringData",
"ref": "DataSet",
"ref": "Dataset",
#"dimension": "Dimension",
#"property": "Datum",
#"relation": NotImplemented,
Expand Down Expand Up @@ -258,13 +258,13 @@ def addmap(uri, iri):
# Start populating triples
triples = []

# Add datamodel (emmo:DataSet)
# Add datamodel (emmo:Dataset)
if iri is None:
iri = meta.uri
iri = str(iri).rstrip("#/")
triples.extend([
(iri, RDF.type, OWL.Class),
(iri, RDFS.subClassOf, EMMO.DataSet),
(iri, RDFS.subClassOf, EMMO.Dataset),
(iri, SKOS.prefLabel, en(title(meta.name))),
(iri, OTEIO.hasURI, Literal(meta.uri, datatype=XSD.anyURI)),
])
Expand Down Expand Up @@ -428,7 +428,7 @@ def get_dataset(
mappings.append((uri, onprop, oncls))
elif onprop and someval:
mappings.append((uri, onprop, someval))
elif obj not in (EMMO.DataSet, ):
elif obj not in (EMMO.Dataset, ):
mappings.append((uri, MAP.mapsTo, obj))
elif prop == EMMO.elucidation:
description = str(obj)
Expand Down Expand Up @@ -493,7 +493,7 @@ def add_data(
"""Save DLite instance as an EMMO dataset to a triplestore.
Data instances are represented as individuals of the corresponding
EMMO DataSet. The corresponding metadata is also stored if it not
EMMO Dataset. The corresponding metadata is also stored if it not
already exists in the triplestore.
Arguments:
Expand Down Expand Up @@ -565,7 +565,7 @@ def get_data(

if not metairi:
# `iri` does not correspond to a data instance, check for metadata
if ts.has(iri, RDFS.subClassOf, EMMO.DataSet):
if ts.has(iri, RDFS.subClassOf, EMMO.Dataset):
return get_dataset(ts, iri), mappings
raise KBError(
f"Cannot find neither a data instance nor metadata with IRI: {iri}"
Expand Down
4 changes: 4 additions & 0 deletions bindings/python/dlite-python.i
Original file line number Diff line number Diff line change
Expand Up @@ -1354,7 +1354,11 @@ PyObject *dlite_run_file(const char *path, PyObject *globals, PyObject *locals)
argout = Py_None;
Py_INCREF(argout);
}
#if SWIG_VERSION >= 0x040100
$result = SWIG_Python_AppendOutput($result, argout, 0);
#else
$result = SWIG_Python_AppendOutput($result, argout);
#endif
}


Expand Down
2 changes: 1 addition & 1 deletion examples/dataset/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ properties:
description: Array of measured temperatures.
```
A DLite datamodel is represented with an emmo:DataSet, and its properties are represented with emmo:Datum as illustrated in the figure above.
A DLite datamodel is represented with an emmo:Dataset, and its properties are represented with emmo:Datum as illustrated in the figure above.
It shows how a simple [`FluidData`] datamodel is represented.

The datamodel is semantically enhanced using the following mappings
Expand Down

0 comments on commit 3a54832

Please sign in to comment.