public class ListedLicenses extends Object implements IModelContainer
| Modifier and Type | Field and Description |
|---|---|
static String |
DEFAULT_LICENSE_LIST_VERSION |
static String |
LISTED_LICENSE_URI_PREFIX |
| Modifier and Type | Method and Description |
|---|---|
boolean |
addCheckNodeObject(org.apache.jena.graph.Node node,
IRdfModel rdfModelObject)
Add a node object to the container.
|
void |
addSpdxElementRef(String elementRef)
Notifies the model container that a new element ref is in use.
|
org.apache.jena.rdf.model.Resource |
createResource(org.apache.jena.rdf.model.Resource duplicate,
String uri,
org.apache.jena.rdf.model.Resource type,
IRdfModel modelObject)
Create a resource in the model
|
String |
documentNamespaceToId(String externalNamespace)
Translate an external document namespace URI to an external document ID
|
String |
externalDocumentIdToNamespace(String docId)
Translate an external document ID to the external document's namespace
|
String |
getDocumentNamespace() |
AnyLicenseInfo |
getLicenseFromStdLicModel(IModelContainer modelContainer,
org.apache.jena.graph.Node node)
Get or create a standard license in the model container copying any
relevant information from the standard model to the model in the modelContainer
|
protected SpdxListedLicense |
getLicenseFromUri(String uri)
Get a listed license based on a URI.
|
String |
getLicenseListVersion() |
SpdxListedLicense |
getListedLicenseById(String licenseId) |
static ListedLicenses |
getListedLicenses() |
org.apache.jena.rdf.model.Model |
getModel() |
String |
getNextSpdxElementRef() |
String[] |
getSpdxListedLicenseIds() |
boolean |
isSpdxListedLicenseID(String licenseID) |
static ListedLicenses |
resetListedLicenses()
Resets all of the cached license information and reloads the license IDs
NOTE: This method should be used with caution, it will negatively impact
performance.
|
boolean |
spdxElementRefExists(String elementRef)
Returns true if the element reference already exists in the model
|
public static final String DEFAULT_LICENSE_LIST_VERSION
public static final String LISTED_LICENSE_URI_PREFIX
public static ListedLicenses getListedLicenses()
public static ListedLicenses resetListedLicenses()
public org.apache.jena.rdf.model.Model getModel()
getModel in interface IModelContainerprotected SpdxListedLicense getLicenseFromUri(String uri) throws InvalidSPDXAnalysisException
uri - InvalidSPDXAnalysisExceptionpublic boolean isSpdxListedLicenseID(String licenseID)
licenseID - InvalidSPDXAnalysisExceptionpublic String[] getSpdxListedLicenseIds()
public String getLicenseListVersion()
public SpdxListedLicense getListedLicenseById(String licenseId) throws InvalidSPDXAnalysisException
licenseId - SPDX Listed License IDInvalidSPDXAnalysisExceptionpublic AnyLicenseInfo getLicenseFromStdLicModel(IModelContainer modelContainer, org.apache.jena.graph.Node node) throws InvalidSPDXAnalysisException
modelContainer - node - InvalidSPDXAnalysisExceptionpublic String getDocumentNamespace()
getDocumentNamespace in interface IModelContainerpublic String getNextSpdxElementRef()
getNextSpdxElementRef in interface IModelContainerpublic boolean spdxElementRefExists(String elementRef)
IModelContainerspdxElementRefExists in interface IModelContainerpublic void addSpdxElementRef(String elementRef)
IModelContaineraddSpdxElementRef in interface IModelContainerpublic String documentNamespaceToId(String externalNamespace)
IModelContainerdocumentNamespaceToId in interface IModelContainerpublic String externalDocumentIdToNamespace(String docId)
IModelContainerexternalDocumentIdToNamespace in interface IModelContainerpublic org.apache.jena.rdf.model.Resource createResource(org.apache.jena.rdf.model.Resource duplicate,
String uri,
org.apache.jena.rdf.model.Resource type,
IRdfModel modelObject)
IModelContainercreateResource in interface IModelContainerduplicate - A duplicate resource who's node and resource should be returneduri - If not null, the URI for the resource - if null, an anonomous resource will be usedtype - Type of the resourcemodelObject - the object representing this nodepublic boolean addCheckNodeObject(org.apache.jena.graph.Node node,
IRdfModel rdfModelObject)
IModelContaineraddCheckNodeObject in interface IModelContainerCopyright © 2017 Linux Foundation. All Rights Reserved.