public void setExcludedFileNames(String[] excludedFileNames) { this.excludedFileNames.clear(); if (this.verificationCodeNode != null && this.model != null) { // clear old list Property p = model.getProperty(SpdxRdfConstants.SPDX_NAMESPACE, SpdxRdfConstants.PROP_VERIFICATIONCODE_IGNORED_FILES); model.removeAll(this.verificationCodeResource, p, null); } for (int i = 0; i < excludedFileNames.length; i++) { addExcludedFileName(excludedFileNames[i]); } }
/** * Remove all properties by the property name within the nameSpace from the subject node * @param node * @param propertyName * @throws InvalidSPDXAnalysisException */ private void removeProperties(Node subject, String nameSpace, String propertyName) throws InvalidSPDXAnalysisException { Property p = model.getProperty(nameSpace, propertyName); Resource s = getResource(subject); model.removeAll(s, p, null); }
private void removeOne(String IRI) { boolean removeDefault = "default".equals(IRI); if (isVerbose()) { if (removeDefault) System.out.println("Removing default graph"); else System.out.println("Removing graph named <" + IRI + ">"); } Model model = (removeDefault) ? SDBFactory.connectDefaultModel(getStore()) : SDBFactory.connectNamedModel(getStore(), IRI) ; model.removeAll(); } }
/** * @param name the name to set */ public void setName(String name) { this.name = name; if (this.projectNode != null && this.model != null) { Property p = model.createProperty(SpdxRdfConstants.DOAP_NAMESPACE, SpdxRdfConstants.PROP_PROJECT_NAME); model.removeAll(projectResource, p, null); p = model.createProperty(SpdxRdfConstants.DOAP_NAMESPACE, SpdxRdfConstants.PROP_PROJECT_NAME); projectResource.addProperty(p, name); } }
public void setComment(String comment) { this.comment = comment; if (this.model != null && this.resource != null) { Property p = model.createProperty(SpdxRdfConstants.RDFS_NAMESPACE, SpdxRdfConstants.RDFS_PROP_COMMENT); model.removeAll(this.resource, p, null); p = model.createProperty(SpdxRdfConstants.RDFS_NAMESPACE, SpdxRdfConstants.RDFS_PROP_COMMENT); this.resource.addProperty(p, this.comment); } } /**
@Override public void put(String graphName, Model model) { checkOpen(); Txn.executeWrite(dataset, ()-> { Model modelDst = modelFor(graphName); modelDst.removeAll(); modelDst.add(model); }); }
/** * @param licenseComments the licenseComments to set */ public void setLicenseComments(String licenseComments) { this.licenseComments = licenseComments; if (this.model != null && this.resource != null) { Property p = model.createProperty(SpdxRdfConstants.SPDX_NAMESPACE, SpdxRdfConstants.PROP_LIC_COMMENTS); model.removeAll(this.resource, p, null); p = model.createProperty(SpdxRdfConstants.SPDX_NAMESPACE, SpdxRdfConstants.PROP_LIC_COMMENTS); this.resource.addProperty(p, this.getLicenseComments()); } }
@Override public void populateModel() throws InvalidSPDXAnalysisException { // delete any previous created Property licProperty = model.createProperty(SpdxRdfConstants.SPDX_NAMESPACE, SpdxRdfConstants.PROP_LICENSE_SET_MEMEBER); model.removeAll(resource, licProperty, null); licProperty = model.createProperty(SpdxRdfConstants.SPDX_NAMESPACE, SpdxRdfConstants.PROP_LICENSE_SET_MEMEBER); for (AnyLicenseInfo licenseInfo:this.licenseInfos) { Resource licResource = licenseInfo.createResource(this.modelContainer); resource.addProperty(licProperty, licResource); } } }
/** * @param licenseComments the licenseComments to set */ public void setLicenseComments(String licenseComments) { this.licenseComments = licenseComments; if (this.model != null && this.resource != null) { Property p = model.createProperty(SpdxRdfConstants.SPDX_NAMESPACE, SpdxRdfConstants.PROP_LIC_COMMENTS); model.removeAll(this.resource, p, null); p = model.createProperty(SpdxRdfConstants.SPDX_NAMESPACE, SpdxRdfConstants.PROP_LIC_COMMENTS); this.resource.addProperty(p, this.getLicenseComments()); } }
@Override public void populateModel() throws InvalidSPDXAnalysisException { // delete any previous created Property licProperty = model.createProperty(SpdxRdfConstants.SPDX_NAMESPACE, SpdxRdfConstants.PROP_LICENSE_SET_MEMEBER); model.removeAll(resource, licProperty, null); licProperty = model.createProperty(SpdxRdfConstants.SPDX_NAMESPACE, SpdxRdfConstants.PROP_LICENSE_SET_MEMEBER); Resource licResource = license.createResource(this.modelContainer); resource.addProperty(licProperty, licResource); }
@Override public void delete(String graph) { checkOpen(); Txn.executeWrite(dataset,() ->{ if ( LibRDFConn.isDefault(graph) ) dataset.getDefaultModel().removeAll(); else dataset.removeNamedModel(graph); }); }
@Override public void delete(String graph) { checkOpen(); Txn.executeWrite(dataset,() ->{ if ( LibRDFConn.isDefault(graph) ) dataset.getDefaultModel().removeAll(); else dataset.removeNamedModel(graph); }); }
@Before public void setup() { baseModel = ModelFactory.createDefaultModel(); baseModel.removeAll(); URL url = SecuredModelDetailTest.class.getClassLoader().getResource( "org/apache/jena/permissions/model/detail.ttl"); baseModel.read(url.toExternalForm()); secEval = new DetailEvaluator(baseModel); securedModel = Factory.getInstance(secEval, "http://example.com/detailModelTest", baseModel); }
protected void testRemoveAll( final String statements ) { ModelHelper.modelAdd(model, statements); Assert.assertSame(model, model.removeAll()); Assert.assertEquals("model should have size 0 following removeAll(): ", 0, model.size()); }
protected void testRemoveAll( String statements ) { modelAdd( model, statements ); assertSame( model, model.removeAll() ); assertEquals( "model should have size 0 following removeAll(): ", 0, model.size() ); }
protected void testRemoveAll( final String statements ) { ModelHelper.modelAdd(model, statements); Assert.assertSame(model, model.removeAll()); Assert.assertEquals("model should have size 0 following removeAll(): ", 0, model.size()); }
protected void testRemoveAll( String statements ) { modelAdd( model, statements ); assertSame( model, model.removeAll() ); assertEquals( "model should have size 0 following removeAll(): ", 0, model.size() ); }
public void testCount() { for (int i = 0; i <= 5; i++) { model.removeAll(); model.read( getFileName("ontology/list" + i + ".rdf")); final RDFList l0 = getListRoot(model); Assert.assertEquals("List size should be " + i, i, l0.size()); } }
public void testCount() { for (int i = 0; i <= 5; i++) { model.removeAll(); model.read( getFileName("ontology/list" + i + ".rdf")); final RDFList l0 = getListRoot(model); Assert.assertEquals("List size should be " + i, i, l0.size()); } }
@Before public void setup() { baseModel = createModel(); baseModel.removeAll(); baseModel.add(SecuredRDFNodeTest.s, SecuredRDFNodeTest.p, SecuredRDFNodeTest.o); baseModel.add(SecuredRDFNodeTest.s, SecuredRDFNodeTest.p2, "yeehaw"); baseModel.add(SecuredRDFNodeTest.s, SecuredRDFNodeTest.p2, "yeehaw yall", "us"); baseModel.add(SecuredRDFNodeTest.s, SecuredRDFNodeTest.p2, "whohoo", "uk"); securedModel = Factory.getInstance(securityEvaluator, "http://example.com/securedGraph", baseModel); baseRDFNode = baseModel.getResource(SecuredRDFNodeTest.o.getURI()); securedRDFNode = SecuredRDFNodeImpl.getInstance(securedModel, baseRDFNode); }