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
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
- Invalid IRI base values within lists are now skipped when serializing to RDF. Fixes [toRdf#tli12](https://w3c.github.io/json-ld-api/tests/toRdf-manifest#tli12) and [toRdf#tli14](https://w3c.github.io/json-ld-api/tests/toRdf-manifest#tli14).
- Literals with invalid `@language` no longer output triples. Fixes [toRdf#twf05](https://w3c.github.io/json-ld-api/tests/toRdf-manifest#twf05).
- IRI validation now detects multiple # fragments so these IRI's are skipped during toRDF. Fixes [toRdf#te111](https://w3c.github.io/json-ld-api/tests/toRdf-manifest#te111) and [toRdf#te112](https://w3c.github.io/json-ld-api/tests/toRdf-manifest#te112).
- In `_create_node_map()`, ignored `@id: None` subjects are now dropped before they enter the node map to prevent `_graph_to_rdf()` from crashing when sorting mixed `None` and string keys. Fixes [toRdf#te122](https://w3c.github.io/json-ld-api/tests/toRdf-manifest#te122).

### Changed
- **BREAKING**: Migrated `jsonld.to_rdf()`, `jsonld.from_rdf()`, and N-Quads parsing/serialization to use `rdflib.Dataset` and RDFLib terms directly.
Expand Down
4 changes: 4 additions & 0 deletions lib/pyld/jsonld.py
Original file line number Diff line number Diff line change
Expand Up @@ -4241,6 +4241,10 @@ def _create_node_map(
id_ = input_.get('@id')
if _is_bnode(input_):
id_ = issuer.get_id(id_)
# drop explicitly ignored @id: None subjects before they enter the node map,
# while leaving normal blank nodes without @id alone.
elif id_ is None and '@id' in input_:
return

# create new subject or merge into existing one
node = graph_map.setdefault(active_graph, {}).setdefault(id_, {'@id': id_})
Expand Down
1 change: 0 additions & 1 deletion tests/runtests.py
Original file line number Diff line number Diff line change
Expand Up @@ -1016,7 +1016,6 @@ def write(self, filename):
'idRegex': [
# blank node property
'.*toRdf-manifest#te075$',
'.*toRdf-manifest#te122$',
]
},
'skip': {
Expand Down
Loading