/** * Convenience methods for creating TupleQueryResultParser objects. This method uses the registry returned * by {@link TupleQueryResultParserRegistry#getInstance()} to get a factory for the specified format and * uses this factory to create the appropriate parser. * * @return A TupleQueryResultParser matching the given format. * @throws UnsupportedQueryResultFormatException * If no parser is available for the specified tuple query result format. */ public static TupleQueryResultParser createTupleParser(QueryResultFormat format) throws UnsupportedQueryResultFormatException { TupleQueryResultParserFactory factory = TupleQueryResultParserRegistry.getInstance().get( format).orElseThrow( () -> new UnsupportedQueryResultFormatException( "No parser factory available for tuple query result format " + format)); return factory.getParser(); }
/** * Convenience methods for creating TupleQueryResultParser objects. This method uses the registry returned * by {@link TupleQueryResultParserRegistry#getInstance()} to get a factory for the specified format and * uses this factory to create the appropriate parser. * * @return A TupleQueryResultParser matching the given format. * @throws UnsupportedQueryResultFormatException * If no parser is available for the specified tuple query result format. */ public static TupleQueryResultParser createTupleParser(QueryResultFormat format) throws UnsupportedQueryResultFormatException { TupleQueryResultParserFactory factory = TupleQueryResultParserRegistry.getInstance().get( format).orElseThrow( () -> new UnsupportedQueryResultFormatException( "No parser factory available for tuple query result format " + format)); return factory.getParser(); }