obographs 0.0.7__tar.gz → 0.0.8__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {obographs-0.0.7 → obographs-0.0.8}/PKG-INFO +1 -1
- {obographs-0.0.7 → obographs-0.0.8}/pyproject.toml +2 -2
- {obographs-0.0.7 → obographs-0.0.8}/src/obographs/model.py +17 -0
- {obographs-0.0.7 → obographs-0.0.8}/src/obographs/standardized.py +13 -5
- {obographs-0.0.7 → obographs-0.0.8}/src/obographs/version.py +1 -1
- {obographs-0.0.7 → obographs-0.0.8}/LICENSE +0 -0
- {obographs-0.0.7 → obographs-0.0.8}/README.md +0 -0
- {obographs-0.0.7 → obographs-0.0.8}/src/obographs/__init__.py +0 -0
- {obographs-0.0.7 → obographs-0.0.8}/src/obographs/contrib.py +0 -0
- {obographs-0.0.7 → obographs-0.0.8}/src/obographs/py.typed +0 -0
|
@@ -4,7 +4,7 @@ build-backend = "uv_build"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "obographs"
|
|
7
|
-
version = "0.0.
|
|
7
|
+
version = "0.0.8"
|
|
8
8
|
description = "A python data model for OBO Graphs"
|
|
9
9
|
readme = "README.md"
|
|
10
10
|
authors = [
|
|
@@ -232,7 +232,7 @@ known-first-party = [
|
|
|
232
232
|
docstring-code-format = true
|
|
233
233
|
|
|
234
234
|
[tool.bumpversion]
|
|
235
|
-
current_version = "0.0.
|
|
235
|
+
current_version = "0.0.8"
|
|
236
236
|
parse = "(?P<major>\\d+)\\.(?P<minor>\\d+)\\.(?P<patch>\\d+)(?:-(?P<release>[0-9A-Za-z-]+(?:\\.[0-9A-Za-z-]+)*))?(?:\\+(?P<build>[0-9A-Za-z-]+(?:\\.[0-9A-Za-z-]+)*))?"
|
|
237
237
|
serialize = [
|
|
238
238
|
"{major}.{minor}.{patch}-{release}+{build}",
|
|
@@ -184,6 +184,23 @@ class Graph(BaseModel):
|
|
|
184
184
|
domainRangeAxioms: list[DomainRangeAxiom] = Field(default_factory=list) # noqa:N815
|
|
185
185
|
propertyChainAxioms: list[PropertyChainAxiom] = Field(default_factory=list) # noqa:N815
|
|
186
186
|
|
|
187
|
+
def _get_property(self, predicate: str) -> str | None:
|
|
188
|
+
if self.meta is not None:
|
|
189
|
+
for prop in self.meta.basicPropertyValues or []:
|
|
190
|
+
if prop.pred == predicate and prop.val:
|
|
191
|
+
return prop.val
|
|
192
|
+
return None
|
|
193
|
+
|
|
194
|
+
@property
|
|
195
|
+
def name(self) -> str | None:
|
|
196
|
+
"""Get the title."""
|
|
197
|
+
return self._get_property("http://purl.org/dc/terms/title")
|
|
198
|
+
|
|
199
|
+
@property
|
|
200
|
+
def version(self) -> str | None:
|
|
201
|
+
"""Get the version."""
|
|
202
|
+
return self._get_property("http://www.w3.org/2002/07/owl#versionInfo")
|
|
203
|
+
|
|
187
204
|
def standardize(
|
|
188
205
|
self, converter: curies.Converter, *, strict: bool = False
|
|
189
206
|
) -> StandardizedGraph:
|
|
@@ -8,7 +8,7 @@ from typing import Generic, TypeVar, cast
|
|
|
8
8
|
|
|
9
9
|
import curies.preprocessing
|
|
10
10
|
from curies import Converter, Reference, Triple, vocabulary
|
|
11
|
-
from curies.vocabulary import SynonymScopeOIO
|
|
11
|
+
from curies.vocabulary import SynonymScopeOIO, has_title, owl_version_info
|
|
12
12
|
from pydantic import BaseModel, Field
|
|
13
13
|
from typing_extensions import Self
|
|
14
14
|
|
|
@@ -209,7 +209,7 @@ class StandardizedMeta(StandardizedBaseModel[Meta]):
|
|
|
209
209
|
synonyms: list[StandardizedSynonym] | None = None
|
|
210
210
|
comments: list[str] | None = None
|
|
211
211
|
deprecated: bool = False
|
|
212
|
-
|
|
212
|
+
version_iri: str | None = None
|
|
213
213
|
properties: list[StandardizedProperty] | None = None
|
|
214
214
|
|
|
215
215
|
@classmethod
|
|
@@ -272,7 +272,7 @@ class StandardizedMeta(StandardizedBaseModel[Meta]):
|
|
|
272
272
|
xrefs=xrefs or None,
|
|
273
273
|
synonyms=synonyms or None,
|
|
274
274
|
comments=meta.comments,
|
|
275
|
-
|
|
275
|
+
version_iri=meta.version,
|
|
276
276
|
deprecated=meta.deprecated,
|
|
277
277
|
properties=props or None,
|
|
278
278
|
)
|
|
@@ -287,7 +287,7 @@ class StandardizedMeta(StandardizedBaseModel[Meta]):
|
|
|
287
287
|
xrefs=[xref.to_raw(converter) for xref in self.xrefs] if self.xrefs else None,
|
|
288
288
|
synonyms=[s.to_raw(converter) for s in self.synonyms] if self.synonyms else None,
|
|
289
289
|
comments=self.comments,
|
|
290
|
-
version=self.
|
|
290
|
+
version=self.version_iri,
|
|
291
291
|
deprecated=self.deprecated,
|
|
292
292
|
basicPropertyValues=[p.to_raw(converter) for p in self.properties]
|
|
293
293
|
if self.properties
|
|
@@ -623,7 +623,15 @@ class StandardizedGraph(StandardizedBaseModel[Graph]):
|
|
|
623
623
|
@property
|
|
624
624
|
def name(self) -> str | None:
|
|
625
625
|
"""Look up the name of the graph."""
|
|
626
|
-
r = self._get_property(
|
|
626
|
+
r = self._get_property(has_title)
|
|
627
|
+
if isinstance(r, Reference):
|
|
628
|
+
raise TypeError
|
|
629
|
+
return r
|
|
630
|
+
|
|
631
|
+
@property
|
|
632
|
+
def version(self) -> str | None:
|
|
633
|
+
"""Get the version."""
|
|
634
|
+
r = self._get_property(owl_version_info)
|
|
627
635
|
if isinstance(r, Reference):
|
|
628
636
|
raise TypeError
|
|
629
637
|
return r
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|