File tree Expand file tree Collapse file tree
src/main/java/org/spdx/spdxRdfStore Expand file tree Collapse file tree Original file line number Diff line number Diff line change 4040import java .util .concurrent .locks .ReadWriteLock ;
4141import java .util .concurrent .locks .ReentrantReadWriteLock ;
4242import java .util .regex .Matcher ;
43+ import java .util .regex .Pattern ;
4344import java .util .stream .Stream ;
4445import java .util .stream .StreamSupport ;
4546
@@ -102,6 +103,7 @@ public class RdfSpdxDocumentModelManager implements IModelStoreLock {
102103
103104 private static final String HTTPS_LISTED_LICENSE_NAMESPACE_PREFIX = SpdxConstants .LISTED_LICENSE_NAMESPACE_PREFIX .replaceAll ("http:" , "https:" );
104105
106+ private static final Pattern LICENSE_NAMESPACE_PATTERN = Pattern .compile ("(http:|https:)" +SpdxConstants .LISTED_LICENSE_NAMESPACE_PREFIX .substring ("http:" .length ())+".+" );
105107 /**
106108 * subset of the listed license namespace to be used for matching
107109 */
@@ -818,6 +820,8 @@ private String resourceToId(Resource resource) throws SpdxRdfException {
818820 } else {
819821 retval = resource .getURI ().substring (resource .getURI ().lastIndexOf ('/' )+1 );
820822 }
823+ } else if (LICENSE_NAMESPACE_PATTERN .matcher (resource .getURI ()).matches ()) {
824+ retval = resource .getURI ().substring (resource .getURI ().lastIndexOf ('/' )+1 );
821825 } else {
822826 retval = resource .getLocalName ();
823827 }
You can’t perform that action at this time.
0 commit comments