Package org.spdx.rdfparser.model
Class RdfModelObject
java.lang.Object
org.spdx.rdfparser.model.RdfModelObject
- Direct Known Subclasses:
Annotation,AnyLicenseInfo,Checksum,CompoundPointer,CrossRef,DoapProject,ExternalDocumentRef,ExternalRef,ReferenceType,Relationship,SinglePointer,SpdxElement
public abstract class RdfModelObject extends Object implements IRdfModel, Cloneable
The superclass for all classes the use the Jena RDF model.
There are two different lifecycles for objects that subclass RdfModelObject:
- If there is an existing model which already contains this object, use the static
method
RdfModelObject.createModelObject(ModelContainer container, Node node)
where the node contains the property values for the class. The subclass
implementations should implement the population of the Java properties from the
model. From that point forward, using standard getters and setters will keep
the Jena model updated along with the Java properties.
- If creating a new object use the constructor and pass in the initial property
values or use setters to set the property values. To populate the Jena model,
invoke the method Resource createResource(IModelContainer modelContainer).
This create a new resource in the model and populate the Jena model from the
Java properties. Once this method has been invoked, all subsequent calls to
setters will update both the Java properties and the Jena RDF property values.
To implement a new RdfModelObject subclass, the following methods must be implemented:
- Clone: All concrete classes must implement a clone method which will copy the
Java values but not copy the model data. The clone method can be used to duplicate
an RdfModelObject in a different Jena model.
- getType: Return the RDF Resource that describes RDF class associated with the Java class
- getUri: Returns a URI string for RDF resoures where an absolute URI is required. If null, an anonymous node is created.
- populateModel: Populates the RDF model from the Java properties
- equivalent: Returns true if the parameter has the same property values
- A constructor of the form O(Type1 p1, Type2 p2, ...) where p1, p2, ... are Java properties to initialize the Java object.
- A constructor of the form O(ModelContainer modelContainer, Node node)
This class implements several common and helper methods including
methods to find and set resources to the model. The methods to set a resource
are named setPropertyValue while the methods to find a
resource value is named findTypePropertyValue where where Type
is the type of Java object to be found. If no property value is found, null is returned.- Author:
- Gary O'Neall
-
Field Summary
Fields Modifier and Type Field Description protected org.apache.jena.rdf.model.Modelmodelprotected IModelContainermodelContainerprotected org.apache.jena.graph.Nodenodeprotected booleanrefreshOnGetForce a refresh for the model on every property get.protected org.apache.jena.rdf.model.Resourceresource -
Constructor Summary
Constructors Constructor Description RdfModelObject()Create an Rdf Model Object without any associated nodes.RdfModelObject(IModelContainer modelContainer, org.apache.jena.graph.Node node)Create an RDF Model Object based on an existing Node -
Method Summary
Modifier and Type Method Description protected voidaddPropertyUriValue(String nameSpace, String propertyName, String uri)Adds a property value as a list of UrisvoidaddPropertyValue(String nameSpace, String propertyName, AnyLicenseInfo license)Add a property value of type AnyLicenseInfo without removing the existing property valuesprotected voidaddPropertyValue(String nameSpace, String propertyName, Annotation annotation)protected voidaddPropertyValue(String nameSpace, String propertyName, Checksum checksumValue)Add a checksum as a property to this resourceprotected voidaddPropertyValue(String nameSpace, String propertyName, ExternalRef externalRef)protected voidaddPropertyValue(String nameSpace, String propertyName, Relationship relationship)Add a relationship property valueprotected voidaddPropertyValue(String nameSpace, String propertyName, SpdxElement element)Adds an SPDX element property value for this resource without removing the old property valuesprotected voidaddPropertyValue(String nameSpace, String propertyName, SpdxElement element, boolean updateModel)Adds an SPDX element property value for this resource without removing the old property valuesbooleanarraysEquivalent(IRdfModel[] array1, IRdfModel[] array2)Compares 2 arrays to see if the property values for the element RdfModelObjects are the same independent of order and considering nullsorg.apache.jena.rdf.model.ResourcecreateResource(IModelContainer modelContainer)Create a resource from the Java model objectorg.apache.jena.rdf.model.ResourcecreateResource(IModelContainer modelContainer, boolean updateModel)booleanequals(Object o)booleanequivalentConsideringNull(IRdfModel o1, IRdfModel o2)Compares the properties of two RdfModelObjects considering possible null valuesprotected Annotation[]findAnnotationPropertyValues(String nameSpace, String propertyName)Find all annotations with a subject of this objectAnyLicenseInfofindAnyLicenseInfoPropertyValue(String namespace, String propertyName)Find a property value with a subject of this objectAnyLicenseInfo[]findAnyLicenseInfoPropertyValues(String namespace, String propertyName)Find a property value with a subject of this objectprotected ChecksumfindChecksumPropertyValue(String nameSpace, String propertyName)protected SPDXCreatorInformationfindCreationInfoPropertyValue(String nameSpace, String propertyName)org.apache.jena.rdf.model.ResourcefindDuplicateResource(IModelContainer modelContainer, String uri)Search the model to see if there is a duplicate resource either based on the URI or based on other information.protected SpdxElementfindElementPropertyValue(String namespace, String propertyName)Find an SPDX element with a subject of this objectExternalDocumentRef[]findExternalDocRefPropertyValues(String nameSpace, String propertyName)static ExternalDocumentRef[]findExternalDocRefPropertyValues(String nameSpace, String propertyName, IModelContainer extDocModelContainer, org.apache.jena.graph.Node nodeContainingExternalRefs)protected ExternalRef[]findExternalRefPropertyValues(String nameSpace, String propertyName)IntegerfindIntPropertyValue(String namespace, String propertyName)Find an integer property value with a subject of this objectprotected Checksum[]findMultipleChecksumPropertyValues(String nameSpace, String propertyName)protected CrossRef[]findMultipleCrossRefPropertyValues(String nameSpace, String propertyName)protected DoapProject[]findMultipleDoapPropertyValues(String nameSpace, String propertyName)protected SpdxElement[]findMultipleElementPropertyValues(String namespace, String propertyName)Finds all SPDX elements with a subject of this objectString[]findMultiplePropertyValues(String namespace, String propertyName)Finds multiple property values with a subject of this objectprotected ReferenceTypefindReferenceTypePropertyValue(String nameSpace, String propertyName)Find the reference type within a specific property in the model for this nodeprotected Relationship[]findRelationshipPropertyValues(String nameSpace, String propertyName)Find all annotations with a subject of this objectprotected SPDXReview[]findReviewPropertyValues(String nameSpace, String propertyName)protected SinglePointerfindSinglePointerPropertyValue(String nameSpace, String propertyName)StringfindSinglePropertyValue(String namespace, String propertyName)Find a property value with a subject of this objectprotected StartEndPointer[]findStartEndPointerPropertyValues(String nameSpace, String propertyName)Find all StartEndPointers assocated with a propertyprotected StringfindUriPropertyValue(String namespace, String propertyName)Find a single URI as a property value to this nodeprotected String[]findUriPropertyValues(String namespace, String propertyName)Find a single URI as a property value to this nodeprotected SpdxPackageVerificationCodefindVerificationCodePropertyValue(String nameSpace, String propertyName)org.apache.jena.graph.NodegetNode()abstract voidgetPropertiesFromModel()Fetch all of the properties from the model and populate the local Java propertiesabstract org.apache.jena.rdf.model.ResourcegetType(org.apache.jena.rdf.model.Model model)abstract StringgetUri(IModelContainer modelContainer)Get the URI for this RDF object.inthashCode()booleanisRefreshOnGet()abstract voidpopulateModel()Populate the RDF model from the Java propertiesprotected voidremovePropertyValue(String nameSpace, String propertyName)Removes all property values for this resource.protected booleanresourcesEqual(org.apache.jena.rdf.model.Resource r1, org.apache.jena.rdf.model.Resource r2)Returns true if the two resources represent the same nodevoidsetMultipleObjectsForSameNode()Called to signal that there are multiple objects representing the same nodeprotected voidsetPropertyUriValue(String nameSpace, String propertyName, String uri)Sets a property value as a Uriprotected voidsetPropertyUriValues(String nameSpace, String propertyName, String[] uris)Sets a property value as a list of Urisprotected voidsetPropertyValue(String nameSpace, String propertyName, boolean value)Set a property values for this resource.protected voidsetPropertyValue(String nameSpace, String propertyName, Integer value)Set a property value for this resource.protected voidsetPropertyValue(String nameSpace, String propertyName, String value)Set a property value for this resource.protected voidsetPropertyValue(String nameSpace, String propertyName, String[] values)Set a property values for this resource.protected voidsetPropertyValue(String nameSpace, String propertyName, AnyLicenseInfo license)Set a property value for this resource.protected voidsetPropertyValue(String nameSpace, String propertyName, Checksum checksumValue)protected voidsetPropertyValue(String nameSpace, String propertyName, DoapProject[] doapProjectValues)protected voidsetPropertyValue(String nameSpace, String propertyName, ExternalRef[] externalRefs)Set the external refs as a value for the propertyprotected voidsetPropertyValue(String nameSpace, String propertyName, SinglePointer singlePointer)protected voidsetPropertyValue(String nameSpace, String propertyName, StartEndPointer[] values)Set a property value for this resource.protected voidsetPropertyValue(String nameSpace, String propertyName, SpdxElement element)protected voidsetPropertyValue(String nameSpace, String propertyName, SpdxElement[] element)protected voidsetPropertyValue(String nameSpace, String propertyName, SpdxElement[] elements, boolean updateModel)Sets the spdx element property value for this resourceprotected voidsetPropertyValue(String nameSpace, String propertyName, SpdxElement element, boolean updateModel)Sets the spdx element property value for this resourceprotected voidsetPropertyValue(String nameSpace, String propertyName, ReferenceType referenceType)protected voidsetPropertyValue(String nameSpace, String propertyName, SPDXCreatorInformation creatorInfo)protected voidsetPropertyValue(String nameSpace, String propertyName, SpdxPackageVerificationCode verificationCode)protected voidSetPropertyValue(String nameSpace, String propertyName, CrossRef[] crossRefValues)voidsetPropertyValues(String nameSpace, String propertyName, AnyLicenseInfo[] licenses)Set a property value for this resource.protected voidsetPropertyValues(String nameSpace, String propertyName, Annotation[] annotations)protected voidsetPropertyValues(String nameSpace, String propertyName, Checksum[] checksumValues)voidsetPropertyValues(String nameSpace, String propertyName, ExternalDocumentRef[] externalDocRefs)protected voidsetPropertyValues(String nameSpace, String propertyName, Relationship[] relationships)Set a property value for this resource.protected voidsetPropertyValues(String nameSpace, String propertyName, SPDXReview[] reviewers)voidsetSingleObjectForSameNode()Called to signal that a newly created resource is only used for a single node
-
Field Details
-
model
protected org.apache.jena.rdf.model.Model model -
resource
protected org.apache.jena.rdf.model.Resource resource -
node
protected org.apache.jena.graph.Node node -
modelContainer
-
refreshOnGet
protected boolean refreshOnGetForce a refresh for the model on every property get. This is slower, but will make sure that the correct value is returned if there happens to be two Java objects using the same RDF properties. The property should be set based on if there are more than two objects for the same node in the container containing this model
-
-
Constructor Details
-
RdfModelObject
public RdfModelObject(IModelContainer modelContainer, org.apache.jena.graph.Node node) throws InvalidSPDXAnalysisExceptionCreate an RDF Model Object based on an existing Node- Parameters:
modelContainer- Container containing the RDF Modelnode- Node describing this object- Throws:
InvalidSPDXAnalysisException
-
RdfModelObject
public RdfModelObject()Create an Rdf Model Object without any associated nodes. It is assumed that populate model will be called to intialize the model
-
-
Method Details
-
createResource
public org.apache.jena.rdf.model.Resource createResource(IModelContainer modelContainer) throws InvalidSPDXAnalysisExceptionDescription copied from interface:IRdfModelCreate a resource from the Java model object- Specified by:
createResourcein interfaceIRdfModel- Parameters:
modelContainer- Contains the Jena model where to create the resource- Returns:
- The created resource
- Throws:
InvalidSPDXAnalysisException
-
createResource
public org.apache.jena.rdf.model.Resource createResource(IModelContainer modelContainer, boolean updateModel) throws InvalidSPDXAnalysisException- Parameters:
modelContainer-updateModel- If true, update the model from the element. If false, update the element from the model. This is used for relationships to make sure we don't overwrite the original element when setting the related element property value.- Returns:
- Throws:
InvalidSPDXAnalysisException
-
getPropertiesFromModel
Fetch all of the properties from the model and populate the local Java properties- Throws:
InvalidSPDXAnalysisException
-
findDuplicateResource
public org.apache.jena.rdf.model.Resource findDuplicateResource(IModelContainer modelContainer, String uri) throws InvalidSPDXAnalysisExceptionSearch the model to see if there is a duplicate resource either based on the URI or based on other information. Subclasses may choose to override this method to prevent duplicate resource from being created with the same properties.- Parameters:
modelContainer-uri-- Returns:
- Any duplicate resource found. Null if no duplicate resource was found.
- Throws:
InvalidSPDXAnalysisException
-
getUri
Get the URI for this RDF object. Null if this is for an anonomous node.- Parameters:
modelContainer-- Returns:
- Throws:
InvalidSPDXAnalysisException
-
getType
public abstract org.apache.jena.rdf.model.Resource getType(org.apache.jena.rdf.model.Model model)- Returns:
- the RDF class name for the object
-
populateModel
Populate the RDF model from the Java properties- Throws:
InvalidSPDXAnalysisException
-
resourcesEqual
protected boolean resourcesEqual(org.apache.jena.rdf.model.Resource r1, org.apache.jena.rdf.model.Resource r2)Returns true if the two resources represent the same node- Parameters:
r1-r2-- Returns:
-
equals
-
hashCode
public int hashCode() -
findMultipleElementPropertyValues
protected SpdxElement[] findMultipleElementPropertyValues(String namespace, String propertyName) throws InvalidSPDXAnalysisExceptionFinds all SPDX elements with a subject of this object- Parameters:
namespace-propertyName-- Returns:
- Throws:
InvalidSPDXAnalysisException
-
findElementPropertyValue
protected SpdxElement findElementPropertyValue(String namespace, String propertyName) throws InvalidSPDXAnalysisExceptionFind an SPDX element with a subject of this object- Parameters:
namespace-propertyName-- Returns:
- Throws:
InvalidSPDXAnalysisException
-
findSinglePropertyValue
Find a property value with a subject of this object- Parameters:
namespace- Namespace for the property namepropertyName- Name of the property- Returns:
- The string value of the property or null if no property exists
-
findIntPropertyValue
Find an integer property value with a subject of this object- Parameters:
namespace- Namespace for the property namepropertyName- Name of the property- Returns:
- The string value of the property or null if no property exists
-
setPropertyValue
Set a property value for this resource. Clears any existing resource.- Parameters:
nameSpace- RDF Namespace for the propertypropertyName- RDF Property Name (the RDFvalue- Integer value to associate to this resource
-
findMultiplePropertyValues
Finds multiple property values with a subject of this object- Parameters:
namespace- Namespace for the property namepropertyName- Name of the property- Returns:
- The string value of the property or null if no property exists
-
setPropertyValue
Set a property values for this resource. Clears any existing resource. If the string matches one of the SPDX pre-defined string values, the URI for that value is stored. Otherwise, it is stored as a literal value.- Parameters:
nameSpace- RDF Namespace for the propertypropertyName- RDF Property Name (the RDFvalues- Values to associate to this resource
-
setPropertyValue
Set a property values for this resource. Clears any existing resource.- Parameters:
nameSpace- RDF Namespace for the propertypropertyName- RDF Property Namevalue- boolean value to set
-
setPropertyValue
protected void setPropertyValue(String nameSpace, String propertyName, SpdxElement[] elements, boolean updateModel) throws InvalidSPDXAnalysisExceptionSets the spdx element property value for this resource- Parameters:
nameSpace-propertyName-element-updateModel- If true, update the model from the element. If false, update the element from the model. This is used for relationships to make sure we don't overwrite the original element when setting the related element property value.- Throws:
InvalidSPDXAnalysisException
-
setPropertyValue
protected void setPropertyValue(String nameSpace, String propertyName, SpdxElement element, boolean updateModel) throws InvalidSPDXAnalysisExceptionSets the spdx element property value for this resource- Parameters:
nameSpace-propertyName-element-updateModel- If true, update the model from the element. If false, update the element from the model. This is used for relationships to make sure we don't overwrite the original element when setting the related element property value.- Throws:
InvalidSPDXAnalysisException
-
addPropertyValue
protected void addPropertyValue(String nameSpace, String propertyName, SpdxElement element, boolean updateModel) throws InvalidSPDXAnalysisExceptionAdds an SPDX element property value for this resource without removing the old property values- Parameters:
nameSpace-propertyName-element-updateModel- If true, update the model from the element. If false, update the element from the model. This is used for relationships to make sure we don't overwrite the original element when setting the related element property value.- Throws:
InvalidSPDXAnalysisException
-
addPropertyValue
protected void addPropertyValue(String nameSpace, String propertyName, SpdxElement element) throws InvalidSPDXAnalysisExceptionAdds an SPDX element property value for this resource without removing the old property values- Parameters:
nameSpace-propertyName-element-- Throws:
InvalidSPDXAnalysisException
-
setPropertyValue
protected void setPropertyValue(String nameSpace, String propertyName, SpdxElement element) throws InvalidSPDXAnalysisException- Throws:
InvalidSPDXAnalysisException
-
setPropertyValue
protected void setPropertyValue(String nameSpace, String propertyName, SpdxElement[] element) throws InvalidSPDXAnalysisException- Throws:
InvalidSPDXAnalysisException
-
setPropertyValues
protected void setPropertyValues(String nameSpace, String propertyName, Annotation[] annotations) throws InvalidSPDXAnalysisException- Throws:
InvalidSPDXAnalysisException
-
addPropertyValue
protected void addPropertyValue(String nameSpace, String propertyName, Annotation annotation) throws InvalidSPDXAnalysisException- Throws:
InvalidSPDXAnalysisException
-
addPropertyValue
protected void addPropertyValue(String nameSpace, String propertyName, ExternalRef externalRef) throws InvalidSPDXAnalysisException- Throws:
InvalidSPDXAnalysisException
-
findAnnotationPropertyValues
protected Annotation[] findAnnotationPropertyValues(String nameSpace, String propertyName) throws InvalidSPDXAnalysisExceptionFind all annotations with a subject of this object- Parameters:
nameSpace-propertyName-- Returns:
- Throws:
InvalidSPDXAnalysisException
-
findRelationshipPropertyValues
protected Relationship[] findRelationshipPropertyValues(String nameSpace, String propertyName) throws InvalidSPDXAnalysisExceptionFind all annotations with a subject of this object- Parameters:
nameSpace-propertyName-- Returns:
- Throws:
InvalidSPDXAnalysisException
-
findStartEndPointerPropertyValues
protected StartEndPointer[] findStartEndPointerPropertyValues(String nameSpace, String propertyName) throws InvalidSPDXAnalysisExceptionFind all StartEndPointers assocated with a property- Parameters:
nameSpace-propertyName-- Returns:
- Throws:
InvalidSPDXAnalysisException
-
setPropertyValue
protected void setPropertyValue(String nameSpace, String propertyName, StartEndPointer[] values) throws InvalidSPDXAnalysisExceptionSet a property value for this resource. Clears any existing resource.- Parameters:
nameSpace- RDF Namespace for the propertypropertyName- RDF Property Namevalue- Values to set- Throws:
InvalidSPDXAnalysisException
-
setPropertyValue
Set a property value for this resource. Clears any existing resource.- Parameters:
nameSpace- RDF Namespace for the propertypropertyName- RDF Property Namevalue- Values to set
-
removePropertyValue
Removes all property values for this resource.- Parameters:
nameSpace- RDF Namespace for the propertypropertyName- RDF Property Name
-
setPropertyValues
protected void setPropertyValues(String nameSpace, String propertyName, Relationship[] relationships) throws InvalidSPDXAnalysisExceptionSet a property value for this resource. Clears any existing resource.- Parameters:
nameSpace-propertyName-relationships-- Throws:
InvalidSPDXAnalysisException
-
addPropertyValue
protected void addPropertyValue(String nameSpace, String propertyName, Relationship relationship) throws InvalidSPDXAnalysisExceptionAdd a relationship property value- Parameters:
nameSpace-propertyName-relationship-- Throws:
InvalidSPDXAnalysisException
-
setPropertyValues
public void setPropertyValues(String nameSpace, String propertyName, AnyLicenseInfo[] licenses) throws InvalidSPDXAnalysisExceptionSet a property value for this resource. Clears any existing resource.- Parameters:
nameSpace-propertyName-licenses-- Throws:
InvalidSPDXAnalysisException
-
addPropertyValue
public void addPropertyValue(String nameSpace, String propertyName, AnyLicenseInfo license) throws InvalidSPDXAnalysisExceptionAdd a property value of type AnyLicenseInfo without removing the existing property values- Parameters:
nameSpace-propertyName-license-- Throws:
InvalidSPDXAnalysisException
-
setPropertyValue
protected void setPropertyValue(String nameSpace, String propertyName, AnyLicenseInfo license) throws InvalidSPDXAnalysisExceptionSet a property value for this resource. Clears any existing resource.- Parameters:
nameSpace-propertyName-license-- Throws:
InvalidSPDXAnalysisException
-
findAnyLicenseInfoPropertyValues
public AnyLicenseInfo[] findAnyLicenseInfoPropertyValues(String namespace, String propertyName) throws InvalidSPDXAnalysisExceptionFind a property value with a subject of this object- Parameters:
namespace- Namespace for the property namepropertyName- Name of the property- Returns:
- The AnyLicenseInfo value of the property or null if no property exists
- Throws:
InvalidSPDXAnalysisException
-
findAnyLicenseInfoPropertyValue
public AnyLicenseInfo findAnyLicenseInfoPropertyValue(String namespace, String propertyName) throws InvalidSPDXAnalysisExceptionFind a property value with a subject of this object- Parameters:
namespace- Namespace for the property namepropertyName- Name of the property- Returns:
- The AnyLicenseInfo value of the property or null if no property exists
- Throws:
InvalidSPDXAnalysisException
-
findMultipleChecksumPropertyValues
protected Checksum[] findMultipleChecksumPropertyValues(String nameSpace, String propertyName) throws InvalidSPDXAnalysisException- Parameters:
nameSpace-propertyName-- Returns:
- Throws:
InvalidSPDXAnalysisException
-
findMultipleCrossRefPropertyValues
protected CrossRef[] findMultipleCrossRefPropertyValues(String nameSpace, String propertyName) throws InvalidSPDXAnalysisException- Parameters:
nameSpace-propertyName-- Returns:
- Throws:
InvalidSPDXAnalysisException
-
findChecksumPropertyValue
protected Checksum findChecksumPropertyValue(String nameSpace, String propertyName) throws InvalidSPDXAnalysisException- Parameters:
nameSpace-propertyName-- Returns:
- Throws:
InvalidSPDXAnalysisException
-
addPropertyValue
protected void addPropertyValue(String nameSpace, String propertyName, Checksum checksumValue) throws InvalidSPDXAnalysisExceptionAdd a checksum as a property to this resource- Parameters:
nameSpace-propertyName-checksumValues-- Throws:
InvalidSPDXAnalysisException
-
setPropertyValues
protected void setPropertyValues(String nameSpace, String propertyName, Checksum[] checksumValues) throws InvalidSPDXAnalysisException- Parameters:
nameSpace-propertyName-checksumValues-- Throws:
InvalidSPDXAnalysisException
-
setPropertyValue
protected void setPropertyValue(String nameSpace, String propertyName, ReferenceType referenceType) throws InvalidSPDXAnalysisException- Parameters:
nameSpace-propertyName-referenceType-- Throws:
InvalidSPDXAnalysisException
-
findReferenceTypePropertyValue
protected ReferenceType findReferenceTypePropertyValue(String nameSpace, String propertyName) throws InvalidSPDXAnalysisExceptionFind the reference type within a specific property in the model for this node- Parameters:
nameSpace-propertyName-- Returns:
- Throws:
InvalidSPDXAnalysisException
-
setPropertyValue
protected void setPropertyValue(String nameSpace, String propertyName, Checksum checksumValue) throws InvalidSPDXAnalysisException- Parameters:
nameSpace-propertyName-checksumValue-- Throws:
InvalidSPDXAnalysisException
-
findMultipleDoapPropertyValues
protected DoapProject[] findMultipleDoapPropertyValues(String nameSpace, String propertyName) throws InvalidSPDXAnalysisException- Parameters:
nameSpace-propertyName-checksumValue-- Returns:
- Throws:
InvalidSPDXAnalysisException
-
setPropertyValue
protected void setPropertyValue(String nameSpace, String propertyName, DoapProject[] doapProjectValues) throws InvalidSPDXAnalysisException- Parameters:
nameSpace-propertyName-doapProjectValues-- Throws:
InvalidSPDXAnalysisException
-
SetPropertyValue
protected void SetPropertyValue(String nameSpace, String propertyName, CrossRef[] crossRefValues) throws InvalidSPDXAnalysisException- Parameters:
nameSpace-propertyName-crossRefValues-- Throws:
InvalidSPDXAnalysisException
-
findUriPropertyValue
Find a single URI as a property value to this node- Parameters:
namespace-propertyName-- Returns:
-
findUriPropertyValues
Find a single URI as a property value to this node- Parameters:
namespace-propertyName-- Returns:
-
setPropertyUriValues
protected void setPropertyUriValues(String nameSpace, String propertyName, String[] uris) throws InvalidSPDXAnalysisExceptionSets a property value as a list of Uris- Parameters:
nameSpace-propertyName-referenceTypeUri-- Throws:
InvalidSPDXAnalysisException
-
addPropertyUriValue
protected void addPropertyUriValue(String nameSpace, String propertyName, String uri) throws InvalidSPDXAnalysisExceptionAdds a property value as a list of Uris- Parameters:
nameSpace-propertyName-uri-- Throws:
InvalidSPDXAnalysisException
-
setPropertyUriValue
protected void setPropertyUriValue(String nameSpace, String propertyName, String uri) throws InvalidSPDXAnalysisExceptionSets a property value as a Uri- Parameters:
nameSpace-propertyName-uri-- Throws:
InvalidSPDXAnalysisException
-
findCreationInfoPropertyValue
protected SPDXCreatorInformation findCreationInfoPropertyValue(String nameSpace, String propertyName) throws InvalidSPDXAnalysisException- Parameters:
nameSpace-propertyName-- Returns:
- Throws:
InvalidSPDXAnalysisException
-
setPropertyValue
protected void setPropertyValue(String nameSpace, String propertyName, SPDXCreatorInformation creatorInfo)- Parameters:
nameSpace-propertyName-creatorInfo-
-
findSinglePointerPropertyValue
protected SinglePointer findSinglePointerPropertyValue(String nameSpace, String propertyName) throws InvalidSPDXAnalysisException- Parameters:
nameSpace-propertyName-- Returns:
- a compound pointer as an object for the property
- Throws:
InvalidSPDXAnalysisException
-
setPropertyValue
protected void setPropertyValue(String nameSpace, String propertyName, SinglePointer singlePointer) throws InvalidSPDXAnalysisException- Parameters:
nameSpace-propertyName-creatorInfo-- Throws:
InvalidSPDXAnalysisException
-
findExternalDocRefPropertyValues
public ExternalDocumentRef[] findExternalDocRefPropertyValues(String nameSpace, String propertyName) throws InvalidSPDXAnalysisException- Throws:
InvalidSPDXAnalysisException
-
findExternalDocRefPropertyValues
public static ExternalDocumentRef[] findExternalDocRefPropertyValues(String nameSpace, String propertyName, IModelContainer extDocModelContainer, org.apache.jena.graph.Node nodeContainingExternalRefs) throws InvalidSPDXAnalysisException- Parameters:
nameSpace-propSpdxExternalDocRef-- Returns:
- Throws:
InvalidSPDXAnalysisException
-
setPropertyValues
public void setPropertyValues(String nameSpace, String propertyName, ExternalDocumentRef[] externalDocRefs) throws InvalidSPDXAnalysisException- Parameters:
nameSpace-propertyName-externalDocRefs-- Throws:
InvalidSPDXAnalysisException
-
setPropertyValues
- Parameters:
nameSpace-propertyName-reviewers-
-
findReviewPropertyValues
protected SPDXReview[] findReviewPropertyValues(String nameSpace, String propertyName) throws InvalidSPDXAnalysisException- Parameters:
nameSpace-propertyName-- Returns:
- Throws:
InvalidSPDXAnalysisException
-
findVerificationCodePropertyValue
protected SpdxPackageVerificationCode findVerificationCodePropertyValue(String nameSpace, String propertyName) throws InvalidSPDXAnalysisException- Parameters:
nameSpace-propertyName-- Returns:
- Throws:
InvalidSPDXAnalysisException
-
setPropertyValue
protected void setPropertyValue(String nameSpace, String propertyName, SpdxPackageVerificationCode verificationCode) throws InvalidSPDXAnalysisException- Parameters:
nameSpace-propertyName-verificationCode-- Throws:
InvalidSPDXAnalysisException
-
findExternalRefPropertyValues
protected ExternalRef[] findExternalRefPropertyValues(String nameSpace, String propertyName) throws InvalidSPDXAnalysisException- Parameters:
nameSpace-propertyName-externalRef-- Returns:
- all external references found as objects to the property
- Throws:
InvalidSPDXAnalysisException
-
setPropertyValue
protected void setPropertyValue(String nameSpace, String propertyName, ExternalRef[] externalRefs) throws InvalidSPDXAnalysisExceptionSet the external refs as a value for the property- Parameters:
nameSpace-propertyName-externalRefs-- Throws:
InvalidSPDXAnalysisException
-
arraysEquivalent
Compares 2 arrays to see if the property values for the element RdfModelObjects are the same independent of order and considering nulls- Parameters:
array1-array2-- Returns:
-
equivalentConsideringNull
Compares the properties of two RdfModelObjects considering possible null values- Parameters:
o1-o2-- Returns:
-
setMultipleObjectsForSameNode
public void setMultipleObjectsForSameNode()Description copied from interface:IRdfModelCalled to signal that there are multiple objects representing the same node- Specified by:
setMultipleObjectsForSameNodein interfaceIRdfModel
-
setSingleObjectForSameNode
public void setSingleObjectForSameNode()Description copied from interface:IRdfModelCalled to signal that a newly created resource is only used for a single node- Specified by:
setSingleObjectForSameNodein interfaceIRdfModel
-
isRefreshOnGet
public boolean isRefreshOnGet()- Returns:
- true if every get of a property will be refreshsed from the RDF Model - primarily used for unit testing
-
getNode
public org.apache.jena.graph.Node getNode()- Returns:
- the RDF Node (null if not initialized)
-