@Override public boolean getDefaultBoolean() throws ReadDeniedException, AuthenticationRequiredException { // getDefaultStatement() calls checkRead return getDefaultStatement().getBoolean(); }
@Override public boolean getDefaultBoolean() { return needDefaultStatement().getBoolean(); }
/** * Answer true if this option is set to true, either on the command line * or in the config model * * @return boolean */ protected boolean isTrue( List<String> cmdLineArgs, Resource confRoot ) { if (cmdLineArgs.contains( m_cmdLineForm )) { return true; } if (confRoot.hasProperty( m_prop )) { return confRoot.getRequiredProperty( m_prop ).getBoolean(); } return false; }
public static boolean parseAskResult(final String resultURI) throws FileNotFoundException { if (resultURI.endsWith("srx")) return XMLInput.booleanFromXML(new FileInputStream(resultURI.substring(5))); else if (resultURI.endsWith("ttl") || resultURI.endsWith("rdf")) return FileManager.get().loadModel(resultURI.substring(5)).getProperty(null, ResourceFactory.createProperty("http://www.w3.org/2001/sw/DataAccess/tests/result-set#boolean")).getBoolean(); else throw new OpenError("Unknown format."); }
public static boolean parseAskResult(final String resultURI) throws FileNotFoundException { if (resultURI.endsWith("srx")) return ResultsStAX.read(new FileInputStream(resultURI.substring(5)), null, null).getBooleanResult(); else if (resultURI.endsWith("ttl") || resultURI.endsWith("rdf")) return FileManager.get().loadModel(resultURI.substring(5)).getProperty(null, ResourceFactory.createProperty("http://www.w3.org/2001/sw/DataAccess/tests/result-set#boolean")).getBoolean(); else throw new OpenError("Unknown format."); }
public static boolean parseAskResult(final String resultURI) throws FileNotFoundException { if (resultURI.endsWith("srx")) return ResultsStAX.read(new FileInputStream(resultURI.substring(5)), null, null).getBooleanResult(); else if (resultURI.endsWith("ttl") || resultURI.endsWith("rdf")) return FileManager.get().loadModel(resultURI.substring(5)).getProperty(null, ResourceFactory.createProperty("http://www.w3.org/2001/sw/DataAccess/tests/result-set#boolean")).getBoolean(); else throw new OpenError("Unknown format."); }
@Override public boolean getBoolean(int index) { checkIndex(index); return getRequiredProperty(RDF.li(index)).getBoolean(); }
@Override public boolean getBoolean(int index) { checkIndex(index); return getRequiredProperty(RDF.li(index)).getBoolean(); }
public static boolean getBooleanProperty(Resource subject, Property predicate) { Statement s = subject.getProperty(predicate); if(s != null && s.getObject().isLiteral()) { return s.getBoolean(); } else { return false; } }
public static boolean getBooleanProperty(Resource subject, Property predicate) { Statement s = subject.getProperty(predicate); if(s != null && s.getObject().isLiteral()) { return s.getBoolean(); } else { return false; } }
@Override public boolean getBoolean() throws ReadDeniedException, AuthenticationRequiredException { checkRead(); checkRead(holder.getBaseItem().asTriple()); return holder.getBaseItem().getBoolean(); }
private static boolean argBoolean(Resource r, Property p, boolean dftValue) { try { GraphUtils.atmostOneProperty(r, p); } catch (NotUniqueException ex) { throw new FusekiConfigException(ex.getMessage()); } Statement stmt = r.getProperty(p); if ( stmt == null ) return dftValue; try { return stmt.getBoolean(); } catch (JenaException ex) { throw new FusekiConfigException("Not a boolean for '"+p+"' : "+stmt.getObject()); } }
public void testListWithRDFSelector() { final StmtIterator it5 = model.listStatements(new SimpleSelector(null, null, model.createTypedLiteral(false))); final List<Statement> L5 = GraphTestBase.iteratorToList(it5); for ( Statement aL5 : L5 ) { Assert.assertEquals( false, aL5.getBoolean() ); } Assert.assertEquals(2, L5.size()); }
public void testListWithRDFSelector() { final StmtIterator it5 = model.listStatements(new SimpleSelector(null, null, model.createTypedLiteral(false))); final List<Statement> L5 = GraphTestBase.iteratorToList(it5); for ( Statement aL5 : L5 ) { Assert.assertEquals( false, aL5.getBoolean() ); } Assert.assertEquals(2, L5.size()); }
public void testBoolean() { final Statement s = model.createLiteralStatement(r, RDF.value, true); Assert.assertEquals(model.createTypedLiteral(true), s.getObject()); Assert.assertEquals(true, s.getBoolean()); }
public void testBoolean() { final Statement s = model.createLiteralStatement(r, RDF.value, true); Assert.assertEquals(model.createTypedLiteral(true), s.getObject()); Assert.assertEquals(true, s.getBoolean()); }
public void testCreateStatementTrue() { final Statement s = model.createLiteralStatement(r, p, true); Assert.assertEquals(r, s.getSubject()); Assert.assertEquals(p, s.getPredicate()); Assert.assertEquals(true, s.getBoolean()); }
public void testCreateStatementTrue() { final Statement s = model.createLiteralStatement(r, p, true); Assert.assertEquals(r, s.getSubject()); Assert.assertEquals(p, s.getPredicate()); Assert.assertEquals(true, s.getBoolean()); }
public void testChangeObjectBoolean() { final Statement sTrue = loadInitialStatement(); final Statement sFalse = sTrue.changeLiteralObject(false); checkChangedStatementSP(sFalse); Assert.assertEquals(model.createTypedLiteral(false), sFalse.getObject()); Assert.assertEquals(false, sFalse.getBoolean()); checkCorrectStatements(sTrue, sFalse); Assert.assertTrue(model.containsLiteral(r, RDF.value, false)); }
public void testChangeObjectBoolean() { final Statement sTrue = loadInitialStatement(); final Statement sFalse = sTrue.changeLiteralObject(false); checkChangedStatementSP(sFalse); Assert.assertEquals(model.createTypedLiteral(false), sFalse.getObject()); Assert.assertEquals(false, sFalse.getBoolean()); checkCorrectStatements(sTrue, sFalse); Assert.assertTrue(model.containsLiteral(r, RDF.value, false)); }