Package org.spdx.rdfparser.model
Class Relationship
java.lang.Object
org.spdx.rdfparser.model.RdfModelObject
org.spdx.rdfparser.model.Relationship
- All Implemented Interfaces:
Cloneable,Comparable<Relationship>,IRdfModel
public class Relationship extends RdfModelObject implements Comparable<Relationship>
A Relationship represents a relationship between two SpdxElements.
- Author:
- Gary O'Neall
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classRelationship.RelationshipType -
Field Summary
Fields inherited from class org.spdx.rdfparser.model.RdfModelObject
model, modelContainer, node, refreshOnGet, resource -
Constructor Summary
Constructors Constructor Description Relationship(IModelContainer modelContainer, org.apache.jena.graph.Node node)Relationship(SpdxElement relatedSpdxElement, Relationship.RelationshipType relationshipType, String comment) -
Method Summary
Modifier and Type Method Description Relationshipclone()Relationshipclone(Map<String,SpdxElement> clonedElementIds)intcompareTo(Relationship o)booleanequivalent(IRdfModel o)Returns true if the compare object contains properties which would be equal if they were contained in the same RDF ModelStringgetComment()voidgetPropertiesFromModel()Fetch all of the properties from the model and populate the local Java propertiesSpdxElementgetRelatedSpdxElement()Relationship.RelationshipTypegetRelationshipType()org.apache.jena.rdf.model.ResourcegetType(org.apache.jena.rdf.model.Model model)StringgetUri(IModelContainer modelContainer)Get the URI for this RDF object.voidpopulateModel()Populate the RDF model from the Java propertiesvoidsetComment(String comment)voidsetRelatedSpdxElement(SpdxElement relatedSpdxElement)voidsetRelationshipType(Relationship.RelationshipType relationshipType)List<String>verify()Methods inherited from class org.spdx.rdfparser.model.RdfModelObject
addPropertyUriValue, addPropertyValue, addPropertyValue, addPropertyValue, addPropertyValue, addPropertyValue, addPropertyValue, addPropertyValue, arraysEquivalent, createResource, createResource, equals, equivalentConsideringNull, findAnnotationPropertyValues, findAnyLicenseInfoPropertyValue, findAnyLicenseInfoPropertyValues, findChecksumPropertyValue, findCreationInfoPropertyValue, findDuplicateResource, findElementPropertyValue, findExternalDocRefPropertyValues, findExternalDocRefPropertyValues, findExternalRefPropertyValues, findIntPropertyValue, findMultipleChecksumPropertyValues, findMultipleCrossRefPropertyValues, findMultipleDoapPropertyValues, findMultipleElementPropertyValues, findMultiplePropertyValues, findReferenceTypePropertyValue, findRelationshipPropertyValues, findReviewPropertyValues, findSinglePointerPropertyValue, findSinglePropertyValue, findStartEndPointerPropertyValues, findUriPropertyValue, findUriPropertyValues, findVerificationCodePropertyValue, getNode, hashCode, isRefreshOnGet, removePropertyValue, resourcesEqual, setMultipleObjectsForSameNode, setPropertyUriValue, setPropertyUriValues, setPropertyValue, setPropertyValue, setPropertyValue, setPropertyValue, setPropertyValue, setPropertyValue, setPropertyValue, setPropertyValue, setPropertyValue, setPropertyValue, setPropertyValue, setPropertyValue, setPropertyValue, setPropertyValue, setPropertyValue, setPropertyValue, setPropertyValue, SetPropertyValue, setPropertyValues, setPropertyValues, setPropertyValues, setPropertyValues, setPropertyValues, setPropertyValues, setSingleObjectForSameNode
-
Constructor Details
-
Relationship
public Relationship(SpdxElement relatedSpdxElement, Relationship.RelationshipType relationshipType, String comment)- Parameters:
relatedSpdxElement- The SPDX Element that is relatedrelationshipType- Type of relationship - See the specification for a description of the typescomment- optional comment for the relationship
-
Relationship
public Relationship(IModelContainer modelContainer, org.apache.jena.graph.Node node) throws InvalidSPDXAnalysisException- Parameters:
model- Model containing the relationshipnode- Node describing the relationship- Throws:
InvalidSPDXAnalysisException
-
-
Method Details
-
getPropertiesFromModel
Description copied from class:RdfModelObjectFetch all of the properties from the model and populate the local Java properties- Specified by:
getPropertiesFromModelin classRdfModelObject- Throws:
InvalidSPDXAnalysisException
-
verify
-
getType
public org.apache.jena.rdf.model.Resource getType(org.apache.jena.rdf.model.Model model)- Specified by:
getTypein classRdfModelObject- Returns:
- the RDF class name for the object
-
populateModel
Description copied from class:RdfModelObjectPopulate the RDF model from the Java properties- Specified by:
populateModelin classRdfModelObject- Throws:
InvalidSPDXAnalysisException
-
getUri
Description copied from class:RdfModelObjectGet the URI for this RDF object. Null if this is for an anonomous node.- Specified by:
getUriin classRdfModelObject- Returns:
-
getRelationshipType
- Returns:
- the relationshipType
-
setRelationshipType
public void setRelationshipType(Relationship.RelationshipType relationshipType) throws InvalidSPDXAnalysisException- Parameters:
relationshipType- the relationshipType to set- Throws:
InvalidSPDXAnalysisException
-
getComment
- Returns:
- the comment
-
setComment
- Parameters:
comment- the comment to set
-
getRelatedSpdxElement
- Returns:
- the relatedSpdxElement
-
setRelatedSpdxElement
public void setRelatedSpdxElement(SpdxElement relatedSpdxElement) throws InvalidSPDXAnalysisException- Parameters:
relatedSpdxElement- the relatedSpdxElement to set- Throws:
InvalidSPDXAnalysisException
-
clone
-
equivalent
Description copied from interface:IRdfModelReturns true if the compare object contains properties which would be equal if they were contained in the same RDF Model- Specified by:
equivalentin interfaceIRdfModel- Returns:
-
clone
- Parameters:
clonedElementIds-- Returns:
-
compareTo
- Specified by:
compareToin interfaceComparable<Relationship>
-