Package org.spdx.spdxRdfStore
Class SpdxOwlOntology
java.lang.Object
org.spdx.spdxRdfStore.SpdxOwlOntology
Singleton class to manage the OWL ontology
- Author:
- Gary O'Neall
-
Field Summary
FieldsModifier and TypeFieldDescriptionMap of the properties renamed due to spec inconsistencies between the RDF format and other formats -
Method Summary
Modifier and TypeMethodDescriptionstatic String
checkGetOwlUriFromRenamed
(String renamedPropertyUri) Checks to see if a property name has been renamed from the OWL property name and returns the OWL compliant namestatic String
checkGetRenamedUri
(String owlPropertyUri) Checks to see if a property name has been renamed from the OWL property URI and returns the renamed URIgetClassUriRestrictions
(String classUri, String propertyUri) getDataUriRestrictions
(String classUri, String propertyUri) org.apache.jena.ontology.OntModel
getModel()
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 SpdxOwlOntology
boolean
-
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
- URI of the property- Returns:
- the OWL compliant name
-
checkGetRenamedUri
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
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 classpropertyUri
- 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 classpropertyUri
- URI for the property- Returns:
- any data restrictions for the values of the property in the class
- Throws:
SpdxRdfException
- on RDF related errors
-
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
- on RDF related errors
-