Package org.spdx.rdfparser
Interface IModelContainer
- All Known Implementing Classes:
ListedExceptions,ListedLicenses,SPDXDocument,SpdxDocumentContainer
public interface IModelContainer
Interface for a a class that contains an RDF model
- Author:
- Gary O'Neall
-
Method Summary
Modifier and Type Method Description booleanaddCheckNodeObject(org.apache.jena.graph.Node node, IRdfModel rdfModelObject)Add a node object to the container.voidaddSpdxElementRef(String elementRef)Notifies the model container that a new element ref is in use.org.apache.jena.rdf.model.ResourcecreateResource(org.apache.jena.rdf.model.Resource duplicate, String uri, org.apache.jena.rdf.model.Resource type, IRdfModel modelObject)Create a resource in the modelStringdocumentNamespaceToId(String externalNamespace)Translate an external document namespace URI to an external document IDStringexternalDocumentIdToNamespace(String docId)Translate an external document ID to the external document's namespaceStringgetDocumentNamespace()org.apache.jena.rdf.model.ModelgetModel()StringgetNextSpdxElementRef()booleanspdxElementRefExists(String elementRef)Returns true if the element reference already exists in the model
-
Method Details
-
getModel
org.apache.jena.rdf.model.Model getModel()- Returns:
- the RDF model
-
getDocumentNamespace
String getDocumentNamespace()- Returns:
- Namespace for document
-
getNextSpdxElementRef
String getNextSpdxElementRef()- Returns:
- The next available SPDX element reference ID. The ID is unique within a given model.
-
spdxElementRefExists
Returns true if the element reference already exists in the model- Parameters:
id-- Returns:
-
addSpdxElementRef
Notifies the model container that a new element ref is in use. This must be called for all new element references to prevent duplication of elements.- Parameters:
elementRef-- Throws:
InvalidSPDXAnalysisException
-
documentNamespaceToId
Translate an external document namespace URI to an external document ID- Parameters:
externalNamespace-- Returns:
-
externalDocumentIdToNamespace
Translate an external document ID to the external document's namespace- Parameters:
docId-- Returns:
-
createResource
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- Parameters:
duplicate- 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 node- Returns:
-
addCheckNodeObject
Add a node object to the container. This is for containers which keep track of which object are related to which nodes- Parameters:
node-rdfModelObject-- Returns:
- true if there are multiple objects for this node
-