Class SpdxResourceFactory

java.lang.Object
org.spdx.spdxRdfStore.SpdxResourceFactory

public class SpdxResourceFactory extends Object
Factory to create specific SPDX resources
  • Field Details

    • RDF_PROPERTIES

      public static final Set<String> RDF_PROPERTIES
    • RDFS_PROPERTIES

      public static final Set<String> RDFS_PROPERTIES
    • DOAP_TYPES

      public static final Set<String> DOAP_TYPES
    • DOAP_PROPERTIES

      public static final Set<String> DOAP_PROPERTIES
    • OWL_PROPERTIES

      public static final Set<String> OWL_PROPERTIES
    • POINTER_TYPES

      public static final Set<String> POINTER_TYPES
    • POINTER_PROPERTIES

      public static final Set<String> POINTER_PROPERTIES
  • Constructor Details

    • SpdxResourceFactory

      public SpdxResourceFactory()
  • Method Details

    • typeToResource

      public static org.apache.jena.rdf.model.Resource typeToResource(String type)
      Create a Resource based on an SPDX class or type
      Parameters:
      type - type of SPDX object
      Returns:
      RDF Type representation of the string type
    • classNameToUri

      public static String classNameToUri(String className)
      Converts a class name to its corresponding URI
      Parameters:
      className - the name of the class to convert to a URI
      Returns:
      the URI for the type or the class name
      Throws:
      NullPointerException - if the className is null
    • propertyNameToUri

      public static String propertyNameToUri(String propertyName)
      Create a Resource based on a standard SPDX property name
      Parameters:
      propertyName - name of the property
      Returns:
      Resource representing the property
    • resourceToSpdxType

      public static Optional<String> resourceToSpdxType(org.apache.jena.rdf.model.Resource type)
      Convert a type resource to the SPDX class or type
      Parameters:
      type - Resource representing the type
      Returns:
      the SPDX class or type string, null if none of the class names match