Class SpdxOwlOntology

java.lang.Object
org.spdx.spdxRdfStore.SpdxOwlOntology

public class SpdxOwlOntology extends Object
Singleton class to manage the OWL ontology
Author:
Gary O'Neall
  • Field Details

    • RENAMED_PROPERTY_TO_OWL_PROPERTY

      public static final Map<String,String> RENAMED_PROPERTY_TO_OWL_PROPERTY
      Map of the properties renamed due to spec inconsistencies between the RDF format and other formats
    • OWL_PROPERTY_TO_RENAMED_PROPERTY

      public static final Map<String,String> OWL_PROPERTY_TO_RENAMED_PROPERTY
  • Method Details

    • getSpdxOwlOntology

      public static SpdxOwlOntology getSpdxOwlOntology()
    • checkGetOwlUriFromRenamed

      public static String checkGetOwlUriFromRenamed(String renamedPropertyUri)
      Checks to see if a property name has been renamed from the OWL property name and returns the OWL compliant name
      Parameters:
      renamedPropertyUri - URI of the property
      Returns:
      the OWL compliant name
    • checkGetRenamedUri

      public static String checkGetRenamedUri(String owlPropertyUri)
      Checks to see if a property name has been renamed from the OWL property URI and returns the renamed URI
      Parameters:
      owlPropertyUri - URI for the OWL compliant property
      Returns:
      if renamed, return the renamed URI
    • getPropertyClass

      public Optional<Class<?>> getPropertyClass(org.apache.jena.rdf.model.Property p)
      Search the ontology range for a property and return the Java class that best matches the property type
      Parameters:
      p - property to search for the class range
      Returns:
      the Java class that best matches the property type
    • getModel

      public org.apache.jena.ontology.OntModel getModel()
    • getClassUriRestrictions

      public List<String> getClassUriRestrictions(String classUri, String propertyUri) throws SpdxRdfException
      Parameters:
      classUri - URI for the class
      propertyUri - URI for the property
      Returns:
      any class restrictions for the values of the property in the class
      Throws:
      SpdxRdfException - on RDF related errors
    • getDataUriRestrictions

      public List<String> getDataUriRestrictions(String classUri, String propertyUri) throws SpdxRdfException
      Parameters:
      classUri - URI for the class
      propertyUri - URI for the property
      Returns:
      any data restrictions for the values of the property in the class
      Throws:
      SpdxRdfException - on RDF related errors
    • isList

      public boolean isList(String classUri, String propertyUri) throws SpdxRdfException
      Parameters:
      classUri - URI for the class containing the property
      propertyUri - URI for the property with the (possible) cardinality restrictions
      Returns:
      true if the property has a max cardinality greater than 1 or does not have a max cardinality
      Throws:
      SpdxRdfException - on RDF related errors