From 71b9e010593c82f302de97b948f074df2ea889a7 Mon Sep 17 00:00:00 2001 From: Georgy Litvinov Date: Tue, 3 Mar 2020 13:09:31 +0100 Subject: [PATCH] Additional check to avoid empty excerpts --- src/main/java/writer2latex/rdf/DocumentStructure.java | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/main/java/writer2latex/rdf/DocumentStructure.java b/src/main/java/writer2latex/rdf/DocumentStructure.java index c2fa1d7..fd9c658 100644 --- a/src/main/java/writer2latex/rdf/DocumentStructure.java +++ b/src/main/java/writer2latex/rdf/DocumentStructure.java @@ -247,6 +247,9 @@ public class DocumentStructure { if (docPart.isEmpty()) { return; } + if (docPart.getBody().isEmpty() && isMaster(element)) { + return; + } Resource excerpt = createExcerpt(docPart); excerpt.addProperty( RDFS.label, docPart.getName()); Property hasText = m.createProperty(TS + "hasText"); @@ -255,6 +258,9 @@ public class DocumentStructure { addMetadataProperties(excerpt,docPart.getMetadata()); } } + private boolean isMaster(Resource element) { + return element.getNameSpace().contains(TS + ELENPHARTICLE); + } public void createTree() { createElements();