Skip to content

Commit

Permalink
Merge pull request #208 from Capitains/issue-207
Browse files Browse the repository at this point in the history
Issue 207
  • Loading branch information
PonteIneptique committed Apr 28, 2020
2 parents e5dc297 + ce6c19c commit f61bfb4
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 12 deletions.
4 changes: 4 additions & 0 deletions CHANGES.md
@@ -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
Expand Up @@ -9,4 +9,4 @@
"""

__version__ = "3.0.1"
__version__ = "3.0.2"
12 changes: 2 additions & 10 deletions MyCapytain/common/metadata.py
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
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 f61bfb4

Please sign in to comment.