/** * Return the best {@link BooleanQueryResultFormat} from the * <code>Accept</code> header, where "best" is measured by the * <code>q</code> parameter. * * @return The best {@link BooleanQueryResultFormat} -or- <code>null</code> * if no {@link BooleanQueryResultFormat} was requested. */ public BooleanQueryResultFormat getBooleanQueryResultFormat() { return getBooleanQueryResultFormat(null/* fallback */); }
/** * Return the best {@link BooleanQueryResultFormat} from the * <code>Accept</code> header, where "best" is measured by the * <code>q</code> parameter. * * @return The best {@link BooleanQueryResultFormat} -or- <code>null</code> * if no {@link BooleanQueryResultFormat} was requested. */ public BooleanQueryResultFormat getBooleanQueryResultFormat() { return getBooleanQueryResultFormat(null/* fallback */); }
public void test_conneg_ask_json() { final ConnegUtil util = new ConnegUtil( BigdataRDFServlet.MIME_SPARQL_RESULTS_JSON); final BooleanQueryResultFormat format = util .getBooleanQueryResultFormat(BooleanQueryResultFormat.SPARQL); assertFalse(format.toString(), format.toString().toLowerCase() .contains("xml")); }
public void test_conneg_ask_json() { final ConnegUtil util = new ConnegUtil( BigdataRDFServlet.MIME_SPARQL_RESULTS_JSON); final BooleanQueryResultFormat format = util .getBooleanQueryResultFormat(BooleanQueryResultFormat.SPARQL); assertFalse(format.toString(), format.toString().toLowerCase() .contains("xml")); }
.getBooleanQueryResultFormat(BooleanQueryResultFormat.SPARQL);
.getBooleanQueryResultFormat(BooleanQueryResultFormat.SPARQL);
/** Test the default mime type for each {@link BooleanQueryResultFormat}. */ @SuppressWarnings({ "rawtypes", "unchecked" }) public void test_conneg_sparql_boolean_result_set_01() { for (BooleanQueryResultFormat format : BooleanQueryResultFormat.values()) { final ConnegUtil util = new ConnegUtil(format.getDefaultMIMEType()); if (!format.getName().equals("SPARQL/JSON")) { assertNull(format.getName(), util.getRDFFormat()); } assertEquals(format.getName(), format, util.getBooleanQueryResultFormat()); assertSameArray(new ConnegScore[] {// new ConnegScore(1f, format) },// util.getScores(BooleanQueryResultFormat.class)); } }
/** Test the default mime type for each {@link BooleanQueryResultFormat}. */ @SuppressWarnings({ "rawtypes", "unchecked" }) public void test_conneg_sparql_boolean_result_set_01() { for (BooleanQueryResultFormat format : BooleanQueryResultFormat.values()) { final ConnegUtil util = new ConnegUtil(format.getDefaultMIMEType()); if (!format.getName().equals("SPARQL/JSON")) { assertNull(format.getName(), util.getRDFFormat()); } assertEquals(format.getName(), format, util.getBooleanQueryResultFormat()); assertSameArray(new ConnegScore[] {// new ConnegScore(1f, format) },// util.getScores(BooleanQueryResultFormat.class)); } }