Skip to content

Commit

Permalink
Fix formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
atextor committed Jan 4, 2025
1 parent 5368e97 commit 9105790
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions src/main/java/de/atextor/turtle/formatter/TurtleFormatter.java
Original file line number Diff line number Diff line change
Expand Up @@ -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 ) {
Expand Down Expand Up @@ -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() ) );
Expand Down

0 comments on commit 9105790

Please sign in to comment.