BR created JENA-1923:
------------------------
Summary: 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
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)