Skip to content

Commit

Permalink
fix: rdf deserialize loop
Browse files Browse the repository at this point in the history
  • Loading branch information
Maximvdw committed Apr 7, 2024
1 parent 98adce6 commit a6fe518
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
4 changes: 0 additions & 4 deletions src/rdf/InternalRDFDeserializer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -241,10 +241,6 @@ export class InternalRDFDeserializer extends Deserializer {
if (predicates !== undefined) {
[...(Array.isArray(predicates) ? predicates : [predicates])].forEach((predicateIri: IriString) => {
usedPredicates.push(predicateIri);
if (!sourceObject.predicates) {
// Named node or blank node
return;
}

if (!sourceObject.predicates[predicateIri]) {
return;
Expand Down
6 changes: 5 additions & 1 deletion src/rdf/RDFSerializer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,11 @@ export class RDFSerializer extends DataSerializer {
*/
function quadsToThing(subject: NamedNode | BlankNode, store: Store): Thing {
if (processedSubjects.includes(subject.value)) {
return subject;
return {
termType: subject.termType,
value: subject.value,
predicates: {},
};
}
processedSubjects.push(subject.value);
return {
Expand Down

0 comments on commit a6fe518

Please sign in to comment.