From 5a9c0d8bf7e9c02092ea4377be6fa1a06ebdf2e2 Mon Sep 17 00:00:00 2001 From: Martin Larralde Date: Thu, 10 Oct 2019 20:42:49 +0200 Subject: [PATCH] Release v1.0.0-alpha.3 --- CHANGELOG.md | 25 ++++++++++++++++++++++++- pronto/_version.txt | 2 +- pronto/parsers/base.py | 6 ++++-- pronto/parsers/obo.py | 5 ++++- pronto/parsers/obojson.py | 5 ++++- pronto/parsers/rdfxml.py | 3 ++- 6 files changed, 39 insertions(+), 7 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index fd845d9..efeb0b1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,7 +5,30 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html). ## [Unreleased] -[Unreleased]: https://github.com/althonos/pronto/compare/v1.0.0-alpha.2...HEAD +[Unreleased]: https://github.com/althonos/pronto/compare/v1.0.0-alpha.3...HEAD + +## [1.0.0-alpha.3] - 2019-10-10 +[1.0.0-alpha.2]: https://github.com/althonos/pronto/compare/v1.0.0-alpha.2...v1.0.0-alpha.3 +### Added +- Extraction of `oboInOwl:consider` annotation in `RdfXMLParser`. +- Extraction of `oboInOwl:savedBy` annotation in `RdfXMLParser`. +- Extraction of `subsetdef` and `synonymtypedef` as annotation properties in + `RdfXMLParser`. +- Support for `doap:Version` instead of `owl:VersionIri` for specification + of ontology data version. +- Proper comparison of `PropertyValue` classes, based on the lexicographic order + of their serialization. +- `Ontology.dump` and `Ontology.dumps` methods to serialize an ontology in + **obo** or **obojson** format. +### Fixed +- `Metadata` not storing optional description of ID spaces if any. +- Wrong type hints in `RelationshipData.equivalent_to_chain`. +### Changed +- Added type checking to some more property setters. +- Avoid using `networkx` in `Term.subclasses`. +- `fastobo`-derived parsers will not create a new entity if one exists in the + graph of dependencies already. +- Exposed `pronto.warnings` and the complete warnings hierarchy. ## [1.0.0-alpha.2] - 2019-10-03 [1.0.0-alpha.2]: https://github.com/althonos/pronto/compare/v1.0.0-alpha.1...v1.0.0-alpha.2 diff --git a/pronto/_version.txt b/pronto/_version.txt index d136d46..4002114 100644 --- a/pronto/_version.txt +++ b/pronto/_version.txt @@ -1 +1 @@ -1.0.0-alpha.2 +1.0.0-alpha.3 diff --git a/pronto/parsers/base.py b/pronto/parsers/base.py index 9143962..3b2fe51 100644 --- a/pronto/parsers/base.py +++ b/pronto/parsers/base.py @@ -28,6 +28,7 @@ def process_imports( imports: Set[str], import_depth: int = -1, basepath: str = "", + timeout: int = 5, ) -> Dict[str, Ontology]: # check we did not reach the maximum import depth resolved = {} @@ -47,9 +48,10 @@ def process_imports( else: id_ = f"{ref}.obo" if not os.path.splitext(ref)[1] else ref url = f"http://purl.obolibrary.org/obo/{id_}" - resolved[ref] = Ontology( - url, max(import_depth - 1, 0), self.ont.timeout + url, + max(import_depth - 1, 0), + timeout ) # return the resolved imports diff --git a/pronto/parsers/obo.py b/pronto/parsers/obo.py index 0005676..3cd0918 100644 --- a/pronto/parsers/obo.py +++ b/pronto/parsers/obo.py @@ -1,3 +1,5 @@ +import os + import fastobo from .base import BaseParser @@ -18,10 +20,11 @@ def parse_from(self, handle): # Extract metadata from the OBO header and resolve imports self.ont.metadata = self._extract_metadata(doc.header()) - self.ont.medata.imports.update(self.process_imports( + self.ont.imports.update(self.process_imports( self.ont.metadata.imports, self.ont.import_depth, os.path.dirname(self.ont.path or str()), + self.ont.timeout, )) # Extract frames from the current document. diff --git a/pronto/parsers/obojson.py b/pronto/parsers/obojson.py index 31d22fc..e259724 100644 --- a/pronto/parsers/obojson.py +++ b/pronto/parsers/obojson.py @@ -1,3 +1,5 @@ +import os + import fastobo from .base import BaseParser @@ -18,10 +20,11 @@ def parse_from(self, handle): # Extract metadata from the graph metadata and resolve imports self.ont.metadata = self._extract_metadata(doc.header) - self.ont.medata.imports.update(self.process_imports( + self.ont.imports.update(self.process_imports( self.ont.metadata.imports, self.ont.import_depth, os.path.dirname(self.ont.path or str()), + self.ont.timeout, )) # Extract frames from the current document. diff --git a/pronto/parsers/rdfxml.py b/pronto/parsers/rdfxml.py index 6fefa10..2e616a0 100644 --- a/pronto/parsers/rdfxml.py +++ b/pronto/parsers/rdfxml.py @@ -89,10 +89,11 @@ def parse_from(self, handle): self.ont.metadata = self._extract_meta(owl_ontology) # Process imports - self.ont.medata.imports.update(self.process_imports( + self.ont.imports.update(self.process_imports( self.ont.metadata.imports, self.ont.import_depth, os.path.dirname(self.ont.path or str()), + self.ont.timeout, )) # Parse typedef first to handle OBO shorthand renaming