Skip to content

Commit

Permalink
datatype = URIRef(datatype) if datatype is not None else None
Browse files Browse the repository at this point in the history
  • Loading branch information
arcangelo7 committed Oct 22, 2024
1 parent 29d8968 commit 1fa2f35
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions oc_ocdm/support/support.py
Original file line number Diff line number Diff line change
Expand Up @@ -372,12 +372,12 @@ def build_graph_from_results(results: List[Dict]) -> Graph:
o = URIRef(triple['o']['value'])
else:
datatype = triple['o'].get('datatype', None)
datatype = URIRef(datatype) if datatype is not None else XSD.string
datatype = URIRef(datatype) if datatype is not None else None
o = Literal(triple['o']['value'], datatype=datatype)
graph.add((s, p, o))
return graph


def is_dataset(res: URIRef) -> bool:
string_iri: str = str(res)
return re.search(r"^.+/[0-9]+(-[0-9]+)?(/[0-9]+)?$", string_iri) is None
return re.search(r"^.+/[0-9]+(-[0-9]+)?(/[0-9]+)?$", string_iri) is None
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "oc_ocdm"
version = "9.1.1"
version = "9.1.2"
description = "Object mapping library for manipulating RDF graphs that are compliant with the OpenCitations datamodel."
authors = [
"Silvio Peroni <essepuntato@gmail.com>",
Expand Down

0 comments on commit 1fa2f35

Please sign in to comment.