Package org.spdx.tools.schema
Class AbstractOwlRdfConverter
java.lang.Object
org.spdx.tools.schema.AbstractOwlRdfConverter
- Direct Known Subclasses:
OwlToJsonContext,OwlToJsonSchema,OwlToXsd
Abstract class for implementing classes which convert from RDF/XML OWL format to some other format
- Author:
- Gary O'Neall
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected org.apache.jena.ontology.OntModelMap of the properties renamed due to spec inconsistencies between the RDF format and other formats -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic StringcheckConvertRenamedPropertyName(String owlPropertyName) Checks to see if an OWL property name has been renamed for the JSON/YAML formatsorg.spdx.tools.schema.AbstractOwlRdfConverter.PropertyRestrictionsgetPropertyRestrictions(org.apache.jena.ontology.OntClass ontClass, org.apache.jena.ontology.OntProperty property) protected Optional<org.apache.jena.rdf.model.Resource>getPropertyType(org.apache.jena.ontology.OntProperty property) protected Collection<org.apache.jena.ontology.OntProperty>propertiesFromClassRestrictions(org.apache.jena.ontology.OntClass oClass) protected Collection<org.apache.jena.ontology.OntProperty>propertiesFromClassRestrictions(org.apache.jena.ontology.OntClass oClass, boolean excludeSuperClassProperties)
-
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
-
model
protected org.apache.jena.ontology.OntModel model
-
-
Constructor Details
-
AbstractOwlRdfConverter
public AbstractOwlRdfConverter(org.apache.jena.ontology.OntModel model)
-
-
Method Details
-
getPropertyRestrictions
public org.spdx.tools.schema.AbstractOwlRdfConverter.PropertyRestrictions getPropertyRestrictions(org.apache.jena.ontology.OntClass ontClass, org.apache.jena.ontology.OntProperty property) -
checkConvertRenamedPropertyName
Checks to see if an OWL property name has been renamed for the JSON/YAML formats- Parameters:
owlPropertyName-- Returns:
- renamed property if it was renamed, owlPropertyName if not renamed
-
propertiesFromClassRestrictions
protected Collection<org.apache.jena.ontology.OntProperty> propertiesFromClassRestrictions(org.apache.jena.ontology.OntClass oClass, boolean excludeSuperClassProperties) - Parameters:
oClass-excludeSuperClassProperties- if true, only return properties for the class but not any superclasses- Returns:
- collection of all properties which have a restriction on the class or superclasses if not direct
-
propertiesFromClassRestrictions
protected Collection<org.apache.jena.ontology.OntProperty> propertiesFromClassRestrictions(org.apache.jena.ontology.OntClass oClass) - Parameters:
oClass-- Returns:
- collection of all properties which have a restriction on the class or superclasses
-
getPropertyType
protected Optional<org.apache.jena.rdf.model.Resource> getPropertyType(org.apache.jena.ontology.OntProperty property) throws SchemaException - Parameters:
property-- Returns:
- The class or type for the property
- Throws:
SchemaException
-