Package org.spdx.spdxRdfStore
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 Summary
Fields Modifier and Type Field Description static Map<String,String>OWL_PROPERTY_TO_RENAMED_PROPERTYstatic Map<String,String>RENAMED_PROPERTY_TO_OWL_PROPERTYMap of the properties renamed due to spec inconsistencies between the RDF format and other formats -
Method Summary
Modifier and Type Method Description static StringcheckGetOwlUriFromRenamed(String renamedPropertyUri)Checks to see if a property name has been renamed from the OWL property name and returns the OWL compliant namestatic StringcheckGetRenamedUri(String owlPropertyUri)Checks to see if a property name has been renamed from the OWL property URI and returns the renamed URIList<String>getClassUriRestrictions(String classUri, String propertyUri)List<String>getDataUriRestrictions(String classUri, String propertyUri)org.apache.jena.ontology.OntModelgetModel()Optional<Class<? extends Object>>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 typestatic SpdxOwlOntologygetSpdxOwlOntology()booleanisList(String classUri, String propertyUri)
-
Field Details
-
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
-
-
Method Details
-
getSpdxOwlOntology
-
checkGetOwlUriFromRenamed
Checks to see if a property name has been renamed from the OWL property name and returns the OWL compliant name- Parameters:
renamedPropertyUri-- Returns:
-
checkGetRenamedUri
Checks to see if a property name has been renamed from the OWL property URI and returns the renamed URI- Parameters:
owlPropertyUri-- Returns:
-
getPropertyClass
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:
-
getModel
public org.apache.jena.ontology.OntModel getModel() -
getClassUriRestrictions
public List<String> getClassUriRestrictions(String classUri, String propertyUri) throws SpdxRdfException- Parameters:
classUri- URI for the classpropertyUri- URI for the property- Returns:
- any class restrictions for the values of the property in the class
- Throws:
SpdxRdfException
-
getDataUriRestrictions
public List<String> getDataUriRestrictions(String classUri, String propertyUri) throws SpdxRdfException- Parameters:
classUri- URI for the classpropertyUri- URI for the property- Returns:
- any data restrictions for the values of the property in the class
- Throws:
SpdxRdfException
-
isList
- Parameters:
classUri- URI for the class containing the propertypropertyUri- 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
-