Skip to content

Commit

Permalink
Ensure that instance uuid and uri are literals in the rdf representat…
Browse files Browse the repository at this point in the history
…ion of dataset. (#928)

* Ensure that instance uuid and uri are literals in the rdf
representation of dataset.

* Updated requirements on tripper

* Reverted dependency of tripper 0.3.1

* Updated requirements
  • Loading branch information
jesper-friis authored Aug 17, 2024
1 parent bd8dc6b commit 53778e6
Show file tree
Hide file tree
Showing 5 changed files with 33 additions and 27 deletions.
7 changes: 4 additions & 3 deletions bindings/python/dataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -513,12 +513,13 @@ def add_data(
triples = []
triples.extend([
(iri, RDF.type, metairi),
(iri, OTEIO.hasUUID, inst.uuid),
(iri, OTEIO.hasUUID, Literal(inst.uuid, datatype=XSD.string)),
(iri, RDF.value, Literal(inst.asjson(), datatype=RDF.JSON)),
])
if inst.uri:
triples.append((iri, OTEIO.hasURI, inst.uri))

triples.append(
(iri, OTEIO.hasURI, Literal(inst.uri, datatype=XSD.string))
)
ts.add_triples(triples)

used_namespaces = {"oteio": OTEIO}
Expand Down
3 changes: 1 addition & 2 deletions examples/TEM_data/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
dlite-python>=0.4.1,<1
#tripper>=0.2.16,<1
tripper @ git+https://github.com/EMMC-ASBL/tripper.git@fix-for-rdflib-literals
tripper>=0.3.1,<0.3.2
rdflib>=6,<8
#oteapi-dlite>=0.1.5,<1
-e git+https://github.com/EMMC-ASBL/oteapi-dlite.git@fa1b820383eb54a1c37f32f7b8ac9406b556dace#egg=oteapi_dlite
Expand Down
8 changes: 3 additions & 5 deletions requirements_dev.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
# Requirements building wheel and testing
# Requirements building
cmake>=1.21.6
mongomock>=4.1.2,<5
openpyxl>=3.0.9,<3.2

# Requirements for building wheel
cmake>=1.21.6
# Requirements for running tests
mongomock>=4.1.2,<5
27 changes: 16 additions & 11 deletions requirements_full.txt
Original file line number Diff line number Diff line change
@@ -1,23 +1,28 @@
# Optional requirements - used by various plugins or additional features like mappings
fortran-language-server>=1.12.0,<1.13

# RDF
rdflib>=4.2.1,<8
#tripper>=0.2.16,<0.3.1
tripper @ git+https://github.com/EMMC-ASBL/tripper.git@master
pint>=0.15,<1

# Plugins
PyYAML>=5.4.1,<7
#psycopg2>=2,<3
pandas>=1.2,<2.3
pyarrow>=14.0,<18.0
tables>=3.8,<5.0
rdflib>=4.2.1,<8
pint>=0.15,<1
openpyxl>=3.0.9,<3.2
jinja2>=3.0,<4
requests>=2.10,<3
redis>=5.0,<6
minio>=6.0,<8
pymongo>=4.4.0,<5
#psycopg2>=2,<3

#tripper>=0.2.16,<0.3.1
tripper @ git+https://github.com/EMMC-ASBL/tripper.git@master

requests>=2.10,<3
jinja2>=3.0,<4
# Utilities
pydantic>=1.10.0,<3
typing_extensions>=4.1,<5
redis>=5.0,<6
minio>=6.0,<8
fortran-language-server>=1.12.0,<1.13

# For TEM demo
matplotlib>=3,<4
Expand Down
15 changes: 9 additions & 6 deletions requirements_mappings.txt
Original file line number Diff line number Diff line change
@@ -1,15 +1,18 @@
# Requirements for property mappings
#tripper>=0.2.16,<0.3.1
rdflib>=4.2.1,<8
#tripper>=0.3.1,<0.3.2
tripper @ git+https://github.com/EMMC-ASBL/tripper.git@master
pint>=0.15,<1


# oteexample.py in the mappings example also require OTEAPI (including oteapi-dlite).
# We don't include that requirement here, since it depends on the DLite-Python
# PyPI package, which can interfere with installation from source.
# oteexample.py in the mappings example also require OTEAPI (including
# oteapi-dlite). We don't include that requirement here, since it
# depends on the DLite-Python PyPI package, which can interfere with
# installation from source.
#
# If you uncomment the lines below and want to use DLite built from source, please
# `pip uninstall DLite-Python` before installing DLite from source.
# If you uncomment the lines below and want to use DLite built from
# source, please `pip uninstall DLite-Python` before installing DLite
# from source.
#
#oteapi-core>=0.6.1,<1
##oteapi-dlite>0.1.6,<1 # update once after migrating to pydantic v2
Expand Down

0 comments on commit 53778e6

Please sign in to comment.