Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Serialization with embedded context attempts to add the context to incorrect node #51

Closed
ledsoft opened this issue Mar 30, 2023 · 0 comments
Labels

Comments

@ledsoft
Copy link
Contributor

ledsoft commented Mar 30, 2023

When serializing a graph where an embedded context is generated for an instance (let's call it A) which has a reference to a collection of further objects, JB4JSON-LD attempts to add the embedded context to the collection node, causing the following exception:

java.lang.UnsupportedOperationException: Prepending items is not supported by this composite node.

	at cz.cvut.kbss.jsonld.serialization.model.CompositeNode.prependItem(CompositeNode.java:45)
	at cz.cvut.kbss.jsonld.serialization.JsonLdTreeBuilder.closeObject(JsonLdTreeBuilder.java:86)
	at cz.cvut.kbss.jsonld.serialization.JsonLdTreeBuilder.closeCollection(JsonLdTreeBuilder.java:129)
	at cz.cvut.kbss.jsonld.serialization.traversal.ObjectGraphTraverser.closeCollection(ObjectGraphTraverser.java:221)
	at cz.cvut.kbss.jsonld.serialization.traversal.ObjectGraphTraverser.traverseCollection(ObjectGraphTraverser.java:78)
	at cz.cvut.kbss.jsonld.serialization.traversal.ObjectGraphTraverser.traverse(ObjectGraphTraverser.java:64)
	at cz.cvut.kbss.jsonld.serialization.serializer.compact.ObjectPropertyValueSerializer.serialize(ObjectPropertyValueSerializer.java:40)
	at cz.cvut.kbss.jsonld.serialization.serializer.context.ContextBuildingObjectPropertyValueSerializer.serialize(ContextBuildingObjectPropertyValueSerializer.java:19)
	at cz.cvut.kbss.jsonld.serialization.JsonLdTreeBuilder.visitAttribute(JsonLdTreeBuilder.java:110)
	at cz.cvut.kbss.jsonld.serialization.traversal.ObjectGraphTraverser.visitAttribute(ObjectGraphTraverser.java:213)
	at cz.cvut.kbss.jsonld.serialization.traversal.ObjectGraphTraverser.serializeFields(ObjectGraphTraverser.java:116)
	at cz.cvut.kbss.jsonld.serialization.traversal.ObjectGraphTraverser.traverseSingular(ObjectGraphTraverser.java:94)
	at cz.cvut.kbss.jsonld.serialization.traversal.ObjectGraphTraverser.traverse(ObjectGraphTraverser.java:66)
	at cz.cvut.kbss.jsonld.serialization.serializer.compact.ObjectPropertyValueSerializer.serialize(ObjectPropertyValueSerializer.java:40)
	at cz.cvut.kbss.jsonld.serialization.serializer.context.ContextBuildingObjectPropertyValueSerializer.serialize(ContextBuildingObjectPropertyValueSerializer.java:19)
	at cz.cvut.kbss.jsonld.serialization.JsonLdTreeBuilder.visitAttribute(JsonLdTreeBuilder.java:110)
	at cz.cvut.kbss.jsonld.serialization.traversal.ObjectGraphTraverser.visitAttribute(ObjectGraphTraverser.java:213)
	at cz.cvut.kbss.jsonld.serialization.traversal.ObjectGraphTraverser.serializeFields(ObjectGraphTraverser.java:116)
	at cz.cvut.kbss.jsonld.serialization.traversal.ObjectGraphTraverser.traverseSingular(ObjectGraphTraverser.java:94)
	at cz.cvut.kbss.jsonld.serialization.traversal.ObjectGraphTraverser.traverse(ObjectGraphTraverser.java:66)
	at cz.cvut.kbss.jsonld.serialization.traversal.ObjectGraphTraverser.traverse(ObjectGraphTraverser.java:57)
	at cz.cvut.kbss.jsonld.serialization.ContextBuildingJsonLdSerializer.buildJsonTree(ContextBuildingJsonLdSerializer.java:82)
	at cz.cvut.kbss.jsonld.serialization.JsonLdSerializer.serialize(JsonLdSerializer.java:79)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant