@Override public Statement getStatementProperty( Property p ) { return asResource().getRequiredProperty( p ); }
@Override public Statement getStatementProperty( Property p ) { return asResource().getRequiredProperty( p ); }
@Override public Statement getProperty(Property p) { return getResource().getRequiredProperty( p ); }
@Override public Statement getProperty(Property p) { return getResource().getRequiredProperty( p ); }
/** * 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; }
/** * 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 XChartStatBarChartBuilder setErrorProperty(Property property) { setErrorAccessor(property == null ? null : r -> r.asResource().getRequiredProperty(property).getLiteral().getValue()); return this; }
public XChartStatBarChartBuilder setValueProperty(Property property) { setValueAccessor(r -> r.asResource().getRequiredProperty(property).getLiteral().getValue()); return this; }
public void testNoSuchPropertyException() { try { r.getRequiredProperty(RDF.type); Assert.fail("missing property should throw exception"); } catch (final PropertyNotFoundException e) { JenaTestBase.pass(); } }
public void testCorrectSubject() { Assert.assertEquals(r, r.getRequiredProperty(RDF.value).getSubject()); }
public void testNoSuchPropertyException() { try { r.getRequiredProperty(RDF.type); Assert.fail("missing property should throw exception"); } catch (final PropertyNotFoundException e) { JenaTestBase.pass(); } }
public void testCorrectSubject() { Assert.assertEquals(r, r.getRequiredProperty(RDF.value).getSubject()); }
String create(Property p) { Resource file = testID.getRequiredProperty(p).getResource(); Resource t = file.getRequiredProperty(RDF.type).getResource(); if (ntriple.equals(t)) { return "\"" + file.getURI() + "\",false"; } else if (rdfxml.equals(t)) { return "\"" + file.getURI() + "\",true"; } else { return "Unrecognized file type: " + t; } } Model read(Property p) throws IOException {
String create(Property p) { Resource file = testID.getRequiredProperty(p).getResource(); Resource t = file.getRequiredProperty(RDF.type).getResource(); if (ntriple.equals(t)) { return "\"" + file.getURI() + "\",false"; } else if (rdfxml.equals(t)) { return "\"" + file.getURI() + "\",true"; } else { return "Unrecognized file type: " + t; } } Model read(Property p) throws IOException {
void save(Property p) { if (factory.savable()) { String uri = testID.getRequiredProperty(p).getResource().getURI(); int suffix = uri.lastIndexOf('.'); String saveUri = uri.substring(0, suffix) + ".ntx"; // System.out.println("Saving to " + saveUri); try ( OutputStream w = factory.openOutput(saveUri) ) { m1.write(w, "N-TRIPLE"); } catch (IOException e) { throw new JenaException( e ); } } } void initExpectedFromModel() {
void save(Property p) { if (factory.savable()) { String uri = testID.getRequiredProperty(p).getResource().getURI(); int suffix = uri.lastIndexOf('.'); String saveUri = uri.substring(0, suffix) + ".ntx"; // System.out.println("Saving to " + saveUri); try ( OutputStream w = factory.openOutput(saveUri) ) { m1.write(w, "N-TRIPLE"); } catch (IOException e) { throw new JenaException( e ); } } } void initExpectedFromModel() {
/** * Load the datafile given by the property name. * @param test the test being processed * @param predicate the property of the test giving the file name to load * @return a graph containing the file contents or an empty graph if the property * is not present * @throws IOException if the property is present but the file can't be found */ public Graph loadTestFile(Resource test, Property predicate) throws IOException { if (test.hasProperty(predicate)) { String fileName = test.getRequiredProperty(predicate).getObject().toString(); boolean cache = predicate.equals(tboxP) || predicate.equals(dataP); return loadFile(fileName, cache).getGraph(); } else { return Factory.createGraphMem(); } }
protected RDFList getListRoot( final Model m ) { final Resource root = m.getResource(TestList.NS + "root"); Assert.assertNotNull("Root resource should not be null", root); final Resource listHead = root.getRequiredProperty( m.getProperty(TestList.NS + "p")).getResource(); final RDFList l = listHead.as(RDFList.class); Assert.assertNotNull("as(RDFList) should not return null for root", l); return l; }
protected RDFList getListRoot( final Model m ) { final Resource root = m.getResource(TestList.NS + "root"); Assert.assertNotNull("Root resource should not be null", root); final Resource listHead = root.getRequiredProperty( m.getProperty(TestList.NS + "p")).getResource(); final RDFList l = listHead.as(RDFList.class); Assert.assertNotNull("as(RDFList) should not return null for root", l); return l; }
/** * Load the datafile given by the property name. * @param test the test being processed * @param predicate the property of the test giving the file name to load * @return a graph containing the file contents or an empty graph if the property * is not present * @throws IOException if the property is present but the file can't be found */ private Graph loadTestFile(Resource test, Property predicate) throws IOException { if (test.hasProperty(predicate)) { String fileName = test.getRequiredProperty(predicate).getObject().toString(); return loadFile(fileName).getGraph(); } else { return Factory.createGraphMem(); } }