Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/spdx_tools/spdx/parser/rdf/graph_parsing_functions.py
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ def get_value_from_graph(
# this is a helper method to cast some rdf types from graph.value() to be compatible with the
# code that follows
value = graph.value(subject=subject, predicate=predicate, object=_object, default=default, any=_any)
if value and not isinstance(value, (URIRef, Literal, BNode)):
if value != default and value is not None and not isinstance(value, (URIRef, Literal, BNode)):
logger.append(
f"Warning: Node {value} should be of type BNode, Literal or URIRef, but is {type(value).__name__}. "
f"This might lead to a failure."
Expand Down
4 changes: 3 additions & 1 deletion src/spdx_tools/spdx/parser/rdf/package_parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,9 @@ def parse_package(package_node: URIRef, graph: Graph, doc_namespace: str) -> Pac
)
homepage = parse_literal(logger, graph, package_node, DOAP.homepage)
attribution_texts = []
for _, _, attribution_text_literal in graph.triples((package_node, SPDX_NAMESPACE.attributionText, None)):
for _, _, attribution_text_literal in get_correctly_typed_triples(
logger, graph, package_node, SPDX_NAMESPACE.attributionText, None
):
attribution_texts.append(attribution_text_literal.toPython())

release_date = parse_literal(
Expand Down