[
https://issues.apache.org/jira/browse/JENA-1923?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17141940#comment-17141940
]
Andy Seaborne commented on JENA-1923:
-------------------------------------
cc [~fps61]
> Serializing an Empty Model Fails
> --------------------------------
>
> Key: JENA-1923
> URL: https://issues.apache.org/jira/browse/JENA-1923
> Project: Apache Jena
> Issue Type: Bug
> Components: RIOT
> Affects Versions: Jena 3.15.0
> Reporter: BR
> Priority: Minor
>
> Test Case:
> {code:java}
> @Test
> public void testSerialiseEmptyGraph() {
> Context serializationContext = new Context();
> serializationContext.put(JsonLDWriter.JSONLD_FRAME, new HashMap<>());
> Model graphModel = createDefaultModel();
> ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
>
> RDFWriter.create().format(RDFFormat.JSONLD_FRAME_PRETTY).source(graphModel).context(serializationContext)
> .output(outputStream);
> }
> {code}
> Adding any Resource to the model stops this error.
> Probably needs a fix to:
> {code:java}
> com.github.jsonldjava.core.JsonLdApi.generateNodeMap(Object, Map<String,
> Object>, String, Object, String, Map<String, Object>)
> {code}
> This creates the 'activeGraph' if the 'element' is a Map, but not a List.
> However other fixes in Jena are possible.
>
--
This message was sent by Atlassian Jira
(v8.3.4#803005)