Package org.spdx.rdfparser
Class RdfModelHelper
java.lang.Object
org.spdx.rdfparser.RdfModelHelper
public final class RdfModelHelper extends Object
Static class containing helper methods for implementations of IRdfModel
- Author:
- Gary O'Neall
-
Method Summary
Modifier and Type Method Description static booleanarraysEqual(Object[] array1, Object[] array2)Compares 2 arrays to see if thier content is the same independent of order and considering nullsstatic booleanarraysEquivalent(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 nullsstatic booleanequivalentConsideringNull(IRdfModel o1, IRdfModel o2)Compares the properties of two RdfModelObjects considering possible null valuesstatic 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.static booleanstringsEquivalent(String s1, String s2)Strings are considered equivalent if they are equal, or if they are null and/or empty (null and empty strings are considered equivalent) linefeeds are also normalized (e.g.
-
Method Details
-
arraysEqual
Compares 2 arrays to see if thier content is the same independent of order and considering nulls- Parameters:
array1-array2-- Returns:
-
stringsEquivalent
Strings are considered equivalent if they are equal, or if they are null and/or empty (null and empty strings are considered equivalent) linefeeds are also normalized (e.g. \r\n is the same as \r)- Parameters:
s1-s2-- Returns:
-
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:
-
findDuplicateResource
public static org.apache.jena.rdf.model.Resource findDuplicateResource(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. 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
-