public static Stream<Quad> parseQuad(final String line) {
        final List<Token> tokens = new ArrayList<>();
        makeTokenizerString(line).forEachRemaining(tokens::add);

        final List<Node> nodes = tokens.stream().filter(Token::isNode).map(Token::asNode).filter(Objects::nonNull)
            .collect(toList());

        if (nodes.size() == 3) {
            return of(rdf.asQuad(create(defaultGraphIRI, nodes.get(0), nodes.get(1), nodes.get(2))));
        } else if (nodes.size() == 4) {
            return of(rdf.asQuad(create(nodes.get(3), nodes.get(0), nodes.get(1), nodes.get(2))));
        } else {
            LOGGER.warn("Skipping invalid data value: {}", line);
            return empty();
        }
    }
public static Stream < Quad > parseQuad ( final String line ) { final List < Token > tokens = new ArrayList < > ( ) ; makeTokenizerString ( line ) . forEachRemaining ( tokens :: add ) ; final List < Node > nodes = tokens . stream ( ) . filter ( Token :: isNode ) . map ( Token :: asNode ) . filter ( Objects :: nonNull ) . collect ( toList ( ) ) ; if ( nodes . size ( ) == 3 ) { return of ( rdf . asQuad ( create ( defaultGraphIRI , nodes . get ( 0 ) , nodes . get ( 1 ) , nodes . get ( 2 ) ) ) ) ; } else if ( nodes . size ( ) == 4 ) { return of ( rdf . asQuad ( create ( nodes . get ( 3 ) , nodes . get ( 0 ) , nodes . get ( 1 ) , nodes . get ( 2 ) ) ) ) ; } else { LOGGER . warn ( "Skipping invalid data value: {}" , line ) ; return empty ( ) ; } }
Parse a string into a stream of Quads.
@param line the line of text
@return the Quad