public static GraphEvents remove( Node s, Node p, Node o ) { return new GraphEvents( "remove", Triple.createMatch( s, p, o ) ){ @Override public Triple getTriple() { return (Triple)content; } }; }
public static GraphEvents remove( Node s, Node p, Node o ) { return new GraphEvents( "remove", Triple.createMatch( s, p, o ) ){ @Override public Triple getTriple() { return (Triple)content; } }; }
/** Answer <code>true</code> if this graph contains <code>(s, p, o)</code>; this canonical implementation cannot be over-ridden. */ @Override public final boolean contains( Node s, Node p, Node o ) { checkOpen(); return contains( Triple.createMatch( s, p, o ) ); }
/** Answer <code>true</code> if this graph contains <code>(s, p, o)</code>; this canonical implementation cannot be over-ridden. */ @Override public final boolean contains( Node s, Node p, Node o ) { checkOpen(); return contains( Triple.createMatch( s, p, o ) ); }
/** * Return the triple pattern as a triple match (concrete terms + Node.ANY) */ public Triple asTripleMatch() { return Triple.createMatch(toMatch(subject), toMatch(predicate), toMatch(object)); }
/** * Return the triple pattern as a triple match (concrete terms + Node.ANY) */ public Triple asTripleMatch() { return Triple.createMatch(toMatch(subject), toMatch(predicate), toMatch(object)); }
public SPDXFile[] getFileReferences() throws InvalidSPDXAnalysisException { List<SPDXFile> alFiles = Lists.newArrayList(); Node p = model.getProperty(SPDX_NAMESPACE, PROP_SPDX_FILE_REFERENCE).asNode(); Triple m = Triple.createMatch(getSpdxDocNode(), p, null); ExtendedIterator<Triple> tripleIter = model.getGraph().find(m); while (tripleIter.hasNext()) { Triple t = tripleIter.next(); alFiles.add(new SPDXFile(this, t.getObject())); } SPDXFile[] retval = new SPDXFile[alFiles.size()]; return alFiles.toArray(retval); }
public SPDXFile[] getFileReferences() throws InvalidSPDXAnalysisException { List<SPDXFile> alFiles = Lists.newArrayList(); Node p = model.getProperty(SPDX_NAMESPACE, PROP_SPDX_FILE_REFERENCE).asNode(); Triple m = Triple.createMatch(getSpdxDocNode(), p, null); ExtendedIterator<Triple> tripleIter = model.getGraph().find(m); while (tripleIter.hasNext()) { Triple t = tripleIter.next(); alFiles.add(new SPDXFile(this, t.getObject())); } SPDXFile[] retval = new SPDXFile[alFiles.size()]; return alFiles.toArray(retval); }
@Override public void getPropertiesFromModel() throws InvalidSPDXAnalysisException { this.licenseInfos.clear(); Node p = model.getProperty(SpdxRdfConstants.SPDX_NAMESPACE, SpdxRdfConstants.PROP_LICENSE_SET_MEMEBER).asNode(); Triple m = Triple.createMatch(node, p, null); ExtendedIterator<Triple> tripleIter = model.getGraph().find(m); while (tripleIter.hasNext()) { Triple t = tripleIter.next(); this.licenseInfos.add(LicenseInfoFactory.getLicenseInfoFromModel(modelContainer, t.getObject())); } }
@Override public void getPropertiesFromModel() throws InvalidSPDXAnalysisException { this.licenseInfos.clear(); Node p = model.getProperty(SpdxRdfConstants.SPDX_NAMESPACE, SpdxRdfConstants.PROP_LICENSE_SET_MEMEBER).asNode(); Triple m = Triple.createMatch(node, p, null); ExtendedIterator<Triple> tripleIter = model.getGraph().find(m); while (tripleIter.hasNext()) { Triple t = tripleIter.next(); this.licenseInfos.add(LicenseInfoFactory.getLicenseInfoFromModel(modelContainer, t.getObject())); } }
public List<SpdxPackage> findAllPackages() throws InvalidSPDXAnalysisException { Node rdfTypePredicate = model.getProperty(SpdxRdfConstants.RDF_NAMESPACE, SpdxRdfConstants.RDF_PROP_TYPE).asNode(); Node packageTypeObject = model.createResource(SPDX_NAMESPACE + CLASS_SPDX_PACKAGE).asNode(); Triple m = Triple.createMatch(null, rdfTypePredicate, packageTypeObject); List<SpdxPackage> retval = Lists.newArrayList(); ExtendedIterator<Triple> tripleIter = model.getGraph().find(m); while (tripleIter.hasNext()) { retval.add((SpdxPackage)SpdxElementFactory.createElementFromModel(this, tripleIter.next().getSubject())); } return retval; }
public List<SpdxPackage> findAllPackages() throws InvalidSPDXAnalysisException { Node rdfTypePredicate = model.getProperty(SpdxRdfConstants.RDF_NAMESPACE, SpdxRdfConstants.RDF_PROP_TYPE).asNode(); Node packageTypeObject = model.createResource(SPDX_NAMESPACE + CLASS_SPDX_PACKAGE).asNode(); Triple m = Triple.createMatch(null, rdfTypePredicate, packageTypeObject); List<SpdxPackage> retval = Lists.newArrayList(); ExtendedIterator<Triple> tripleIter = model.getGraph().find(m); while (tripleIter.hasNext()) { retval.add((SpdxPackage)SpdxElementFactory.createElementFromModel(this, tripleIter.next().getSubject())); } return retval; }
public List<SpdxFile> findAllFiles() throws InvalidSPDXAnalysisException { Node rdfTypePredicate = model.getProperty(SpdxRdfConstants.RDF_NAMESPACE, SpdxRdfConstants.RDF_PROP_TYPE).asNode(); Node fileTypeObject = model.createResource(SPDX_NAMESPACE + CLASS_SPDX_FILE).asNode(); Triple m = Triple.createMatch(null, rdfTypePredicate, fileTypeObject); List<SpdxFile> retval = Lists.newArrayList(); ExtendedIterator<Triple> tripleIter = model.getGraph().find(m); while (tripleIter.hasNext()) { retval.add((SpdxFile)SpdxElementFactory.createElementFromModel(this, tripleIter.next().getSubject())); } return retval; }
public List<SpdxFile> findAllFiles() throws InvalidSPDXAnalysisException { Node rdfTypePredicate = model.getProperty(SpdxRdfConstants.RDF_NAMESPACE, SpdxRdfConstants.RDF_PROP_TYPE).asNode(); Node fileTypeObject = model.createResource(SPDX_NAMESPACE + CLASS_SPDX_FILE).asNode(); Triple m = Triple.createMatch(null, rdfTypePredicate, fileTypeObject); List<SpdxFile> retval = Lists.newArrayList(); ExtendedIterator<Triple> tripleIter = model.getGraph().find(m); while (tripleIter.hasNext()) { retval.add((SpdxFile)SpdxElementFactory.createElementFromModel(this, tripleIter.next().getSubject())); } return retval; }
/** * @param id * @return true if the license ID is already in the model as an extracted license info * @throws InvalidSPDXAnalysisException */ protected boolean extractedLicenseExists(String id) throws InvalidSPDXAnalysisException { Node p = model.getProperty(SPDX_NAMESPACE, PROP_LICENSE_ID).asNode(); Node o = NodeFactory.createLiteral(id); Triple m = Triple.createMatch(null, p, o); ExtendedIterator<Triple> tripleIter = model.getGraph().find(m); return tripleIter.hasNext(); }
/** * @param id * @return true if the license ID is already in the model as an extracted license info * @throws InvalidSPDXAnalysisException */ protected boolean extractedLicenseExists(String id) throws InvalidSPDXAnalysisException { Node p = model.getProperty(SPDX_NAMESPACE, PROP_LICENSE_ID).asNode(); Node o = NodeFactory.createLiteral(id); Triple m = Triple.createMatch(null, p, o); ExtendedIterator<Triple> tripleIter = model.getGraph().find(m); return tripleIter.hasNext(); }
public SpdxPackageVerificationCode getVerificationCode() throws InvalidSPDXAnalysisException { SpdxPackageVerificationCode retval = null; Node p = model.getProperty(SPDX_NAMESPACE, PROP_PACKAGE_VERIFICATION_CODE).asNode(); Triple m = Triple.createMatch(this.node, p, null); ExtendedIterator<Triple> tripleIter = model.getGraph().find(m); while (tripleIter.hasNext()) { Triple t = tripleIter.next(); retval = new SpdxPackageVerificationCode(model, t.getObject()); } return retval; }
public SpdxPackageVerificationCode getVerificationCode() throws InvalidSPDXAnalysisException { SpdxPackageVerificationCode retval = null; Node p = model.getProperty(SPDX_NAMESPACE, PROP_PACKAGE_VERIFICATION_CODE).asNode(); Triple m = Triple.createMatch(this.node, p, null); ExtendedIterator<Triple> tripleIter = model.getGraph().find(m); while (tripleIter.hasNext()) { Triple t = tripleIter.next(); retval = new SpdxPackageVerificationCode(model, t.getObject()); } return retval; }
public String getComment() { if (this.model != null && this.resource != null) { Node p = model.getProperty(SpdxRdfConstants.RDFS_NAMESPACE, SpdxRdfConstants.RDFS_PROP_COMMENT).asNode(); Triple m = Triple.createMatch(this.resource.asNode(), p, null); ExtendedIterator<Triple> tripleIter = model.getGraph().find(m); while (tripleIter.hasNext()) { this.comment = tripleIter.next().getObject().toString(false); } } return this.comment; }
public String getComment() { if (this.model != null && this.resource != null) { Node p = model.getProperty(SpdxRdfConstants.RDFS_NAMESPACE, SpdxRdfConstants.RDFS_PROP_COMMENT).asNode(); Triple m = Triple.createMatch(this.resource.asNode(), p, null); ExtendedIterator<Triple> tripleIter = model.getGraph().find(m); while (tripleIter.hasNext()) { this.comment = tripleIter.next().getObject().toString(false); } } return this.comment; }