/** * Tries to match a MIME type against the list of tuple query result formats that can be parsed. * * @param mimeType * A MIME type, e.g. "application/sparql-results+xml". * @return An RDFFormat object if a match was found, or {@link Optional#empty()} otherwise. * @see #getParserFormatForMIMEType(String, TupleQueryResultFormat) */ public static Optional<QueryResultFormat> getParserFormatForMIMEType(String mimeType) { return TupleQueryResultParserRegistry.getInstance().getFileFormatForMIMEType(mimeType); }
/** * Tries to match the extension of a file name against the list of RDF formats that can be parsed. * * @param fileName * A file name. * @return An TupleQueryResultFormat object if a match was found, or {@link Optional#empty()} otherwise. * @see #getParserFormatForFileName(String, TupleQueryResultFormat) */ public static Optional<QueryResultFormat> getParserFormatForFileName(String fileName) { return TupleQueryResultParserRegistry.getInstance().getFileFormatForFileName(fileName); }
Set<QueryResultFormat> tqrFormats = TupleQueryResultParserRegistry.getInstance().getKeys(); if (tqrFormats.isEmpty()) { throw new RepositoryException("No tuple query result parsers have been registered");
/** * 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(); }
Set<QueryResultFormat> tqrFormats = TupleQueryResultParserRegistry.getInstance().getKeys(); if (tqrFormats.isEmpty()) { throw new RepositoryException("No tuple query result parsers have been registered");
/** * 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(); }
Set<QueryResultFormat> tqrFormats = TupleQueryResultParserRegistry.getInstance().getKeys(); if (tqrFormats.isEmpty()) { throw new RepositoryException("No tuple query result parsers have been registered");
/** * Tries to match a MIME type against the list of tuple query result formats that can be parsed. * * @param mimeType * A MIME type, e.g. "application/sparql-results+xml". * @return An RDFFormat object if a match was found, or {@link Optional#empty()} otherwise. * @see #getParserFormatForMIMEType(String, TupleQueryResultFormat) */ public static Optional<QueryResultFormat> getParserFormatForMIMEType(String mimeType) { return TupleQueryResultParserRegistry.getInstance().getFileFormatForMIMEType(mimeType); }
/** * Tries to match the extension of a file name against the list of RDF formats that can be parsed. * * @param fileName * A file name. * @return An TupleQueryResultFormat object if a match was found, or {@link Optional#empty()} otherwise. * @see #getParserFormatForFileName(String, TupleQueryResultFormat) */ public static Optional<QueryResultFormat> getParserFormatForFileName(String fileName) { return TupleQueryResultParserRegistry.getInstance().getFileFormatForFileName(fileName); }
Set<QueryResultFormat> tqrFormats = TupleQueryResultParserRegistry.getInstance().getKeys(); if (tqrFormats.isEmpty()) { throw new RepositoryException("No tuple query result parsers have been registered");
Set<QueryResultFormat> tqrFormats = TupleQueryResultParserRegistry.getInstance().getKeys(); if (tqrFormats.isEmpty()) { throw new RepositoryException("No tuple query result parsers have been registered");
Set<QueryResultFormat> tqrFormats = TupleQueryResultParserRegistry.getInstance().getKeys(); if (tqrFormats.isEmpty()) { throw new RepositoryException("No tuple query result parsers have been registered");