Skip to content

Commit

Permalink
Merge pull request #209 from Capitains/dev
Browse files Browse the repository at this point in the history
3.0.2
  • Loading branch information
PonteIneptique authored Apr 28, 2020
2 parents 983e4a1 + 60e699b commit 342568c
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 12 deletions.
4 changes: 4 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
### 2020-04-28 3.0.2 @ponteineptique

- Fixed a bug related to a dependency update (rdflib) (Issue #207)

### 2020-10-29 3.0.1 @sonofmun

- Corrected an error when calculating the siblings for a range when the end of the range + the length equaled doc length
Expand Down
2 changes: 1 addition & 1 deletion MyCapytain/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@
"""

__version__ = "3.0.1"
__version__ = "3.0.2"
12 changes: 2 additions & 10 deletions MyCapytain/common/metadata.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,11 +62,7 @@ def set(self, key: URIRef, value: Union[Literal, BNode, URIRef, str, int], lang:
if not isinstance(value, Literal) and lang is not None:
value = Literal(value, lang=lang)
elif not isinstance(value, (BNode, URIRef)):
value, _type = term._castPythonToLiteral(value)
if _type is None:
value = Literal(value)
else:
value = Literal(value, datatype=_type)
value = Literal(value)
self.graph.set((self.asNode(), key, value))

def add(self, key, value, lang=None):
Expand All @@ -79,11 +75,7 @@ def add(self, key, value, lang=None):
if not isinstance(value, Literal) and lang is not None:
value = Literal(value, lang=lang)
elif not isinstance(value, (BNode, URIRef)):
value, _type = term._castPythonToLiteral(value)
if _type is None:
value = Literal(value)
else:
value = Literal(value, datatype=_type)
value = Literal(value)
self.graph.add((self.asNode(), key, value))

def get(self, key, lang=None):
Expand Down
2 changes: 1 addition & 1 deletion MyCapytain/resources/collections/cts.py
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ def _parse_structured_metadata(obj, xml):
if s_m.startswith("urn:") or s_m.startswith("http:") or s_m.startswith("https:") or s_m.startswith("hdl:"):
obj.metadata.add(
tag,
URIRef(metadata)
URIRef(str(metadata))
)
elif '{http://www.w3.org/XML/1998/namespace}lang' in metadata.attrib:
obj.metadata.add(
Expand Down

0 comments on commit 342568c

Please sign in to comment.