From 9105790dce03bc5740264e112fc022f185bc849a Mon Sep 17 00:00:00 2001 From: Andreas Textor Date: Sat, 4 Jan 2025 14:56:22 +0100 Subject: [PATCH] Fix formatting --- .../turtle/formatter/TurtleFormatter.java | 20 +++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/src/main/java/de/atextor/turtle/formatter/TurtleFormatter.java b/src/main/java/de/atextor/turtle/formatter/TurtleFormatter.java index f9f184c..130c076 100644 --- a/src/main/java/de/atextor/turtle/formatter/TurtleFormatter.java +++ b/src/main/java/de/atextor/turtle/formatter/TurtleFormatter.java @@ -468,20 +468,20 @@ private State writeClosingSquareBracket( final State state ) { } private boolean isList( final RDFNode node, final State state ) { - if (!node.isResource()){ + if ( !node.isResource() ) { return false; } - boolean listNodeHasAdditionalTriples = state.model.listStatements(node.asResource(), null, (RDFNode) null) - .toList() - .stream() - .map(Statement::getPredicate) - .filter(p -> ! p.equals(RDF.first)) - .anyMatch(p -> ! p.equals(RDF.rest)); - if (listNodeHasAdditionalTriples){ + final boolean listNodeHasAdditionalTriples = state.model.listStatements( node.asResource(), null, (RDFNode) null ) + .toList() + .stream() + .map( Statement::getPredicate ) + .filter( p -> !p.equals( RDF.first ) ) + .anyMatch( p -> !p.equals( RDF.rest ) ); + if ( listNodeHasAdditionalTriples ) { return false; } return ( node.isAnon() - && state.model.contains( node.asResource(), RDF.rest, (RDFNode) null ) ); + && state.model.contains( node.asResource(), RDF.rest, (RDFNode) null ) ); } private State writeResource( final Resource resource, final State state ) { @@ -639,7 +639,7 @@ private State writeUriResource( final Resource resource, final State state ) { } private State writeLiteral( final Literal literal, final State state ) { - String datatypeUri = literal.getDatatypeURI(); + final String datatypeUri = literal.getDatatypeURI(); if ( datatypeUri.equals( XSD.xdouble.getURI() ) ) { if ( style.enableDoubleFormatting ) { return state.write( style.doubleFormat.format( literal.getDouble() ) );