public class OwlApi2LG
extends java.lang.Object
Constructor and Description |
---|
OwlApi2LG(java.net.URI owlURI,
CodingSchemeManifest manifest,
LoaderPreferences loadPrefs,
int memoryMode,
LgMessageDirectorIF messages)
Create a new instance for conversion.
|
Modifier and Type | Method and Description |
---|---|
protected AssociationWrapper |
addAssociation(org.semanticweb.owlapi.model.OWLAnnotation owlProp) |
protected AssociationWrapper |
addAssociation(org.semanticweb.owlapi.model.OWLProperty owlProp) |
protected AssociationSource |
addAssocSrc2Assoc(AssociationWrapper aw,
AssociationSource assocSource) |
protected void |
addEntity(AssociationEntity lgEntity) |
protected void |
addEntity(Entity lgEntity) |
protected Entity |
addPropertiesToAssociationEntity(Entity lgEntity,
org.semanticweb.owlapi.model.OWLEntity owlProp)
Defines an EMF concept and properties based on the given rdf source.
|
protected void |
addToSupportedPropertyAndMap(java.lang.String label,
java.lang.String propertyName,
org.semanticweb.owlapi.model.OWLNamedObject rdfProp) |
protected java.lang.String |
generateDatatypeID(int i)
Constructs a new datatype id with the given integer suffix.
|
protected java.lang.String |
generateDatatypeInstanceID(int i)
Constructs a new datatype instance id (e.g., instance of xsd:int is "24")
with the given integer suffix.
|
protected java.lang.String |
generatePropertyID(int i)
Constructs a new property id with the given integer suffix.
|
protected java.lang.String |
getAssociationLabel(java.lang.String associationName,
boolean forward) |
protected java.lang.String |
getFromLastIndexOfColonOrHash(java.lang.String str) |
java.lang.String |
getNameSpace(org.semanticweb.owlapi.model.IRI iri) |
protected java.lang.String |
getNameSpace(org.semanticweb.owlapi.model.OWLEntity entity) |
org.semanticweb.owlapi.model.OWLOntology |
getOntology() |
protected void |
initAnnotationProperties() |
protected void |
initAssociationEntities() |
protected void |
initOWLOntologyFromSource()
Initialize the Java model from source.
|
protected void |
initScheme()
Initializes the EMF coding scheme and adds top-level containers for codes
and relations.
|
protected void |
initSchemeMetadata()
Initialize further metadata about the coding scheme.
|
protected Entity |
initSubtypeRoot()
Initialize and return the root node for the subclass hierarchy.
|
protected void |
initSupportedAssociationAnnotationProperties()
We need to find which annotation properties have a OWLNamedClass or
OWLIndividual as the RHS and treat them as an association.
|
protected void |
initSupportedDataProperties()
This method initializes the OWL data properties.
|
protected void |
initSupportedDatatypes()
This method determines the various data types that are used in the
ontology and stores them.
|
protected void |
initSupportedMappings()
Initialize tracking of supported behavior specified in LexGrid metadata.
|
protected void |
initSupportedObjectProperties()
This method initializes the user defined OWL object properties in the
ontology.
|
protected boolean |
isEntityCodeRegistered(java.lang.String namespace,
java.lang.String code)
Indicates if the given entity code has been registered against a
namespace.
|
protected boolean |
isNoop(java.lang.String s)
Indicates whether the given string represents a null or empty resource.
|
protected boolean |
isNoopNamespace(java.lang.String s)
Indicates whether the given string defines a resource in a non-operative
namespace.
|
protected boolean |
isRootNode(org.semanticweb.owlapi.model.OWLClass owlClass)
Determines if a given concept is a root node or not.
|
protected java.util.Date |
parseEffectiveDate(java.lang.String dateText) |
protected void |
processAllAnnotationProperties(SimpleMemUsageReporter.Snapshot snap) |
protected void |
processAllConceptsAndProperties(SimpleMemUsageReporter.Snapshot snap)
This method is responsible for processing of all the OWL concepts.
|
protected void |
processAllConceptsRelations() |
protected void |
processAllInstanceAndProperties(SimpleMemUsageReporter.Snapshot snap)
Process the instance information in the ontology.
|
protected void |
processAllInstanceRelations() |
protected java.lang.String |
processEquivalentClassExp(java.lang.String formattedExpression) |
protected void |
processOWL()
Create and populate the EMF representation of the coding scheme.
|
protected void |
processOWLDataProperties(SimpleMemUsageReporter.Snapshot snap)
This method determines the domain and ranges for the OWL DataProperties.
|
protected void |
processOWLObjectProperties(SimpleMemUsageReporter.Snapshot snap)
This method determines the domain and ranges for the OWL Object
properties.
|
protected void |
processRestriction(org.semanticweb.owlapi.model.OWLRestriction restriction,
AssociationSource assocParentSource,
AssociationSource source) |
protected void |
relateAssociationSourceData(AssociationWrapper aw,
AssociationSource source,
AssociationData data) |
protected void |
relateAssociationSourceTarget(AssociationWrapper aw,
AssociationSource source,
AssociationTarget target) |
protected void |
relateAssocSourceWithAnnotationIRITarget(EntityTypes type,
AssociationWrapper aw,
AssociationSource source,
org.semanticweb.owlapi.model.OWLAnnotation tgtResource,
org.semanticweb.owlapi.model.OWLAxiom ax,
java.lang.String prefix) |
protected void |
relateAssocSourceWithAnnotationTarget(EntityTypes type,
AssociationWrapper aw,
AssociationSource source,
org.semanticweb.owlapi.model.OWLAnnotation tgtResource,
org.semanticweb.owlapi.model.OWLAxiom ax,
java.lang.String prefix) |
protected void |
relateAssocSourceWithIriTarget(EntityTypes type,
AssociationWrapper aw,
AssociationSource source,
org.semanticweb.owlapi.model.IRI tgtResource,
org.semanticweb.owlapi.model.OWLAxiom ax) |
protected void |
relateAssocSourceWithOWLClassExpressionTarget(EntityTypes type,
AssociationWrapper aw,
AssociationSource source,
org.semanticweb.owlapi.model.OWLClassExpression tgtResource,
org.semanticweb.owlapi.model.OWLAxiom ax)
The OWLClassExpression is used to compute the target.
|
protected void |
relateAssocSourceWithOWLClassTarget(EntityTypes type,
AssociationWrapper aw,
AssociationSource source,
org.semanticweb.owlapi.model.OWLClass tgtResource,
org.semanticweb.owlapi.model.OWLAxiom ax)
The OWLClass is used to compute the target.
|
protected void |
relateAssocSourceWithRDFResourceTarget(EntityTypes type,
AssociationWrapper aw,
AssociationSource source,
org.semanticweb.owlapi.model.OWLNamedIndividual tgtResource)
The RDFResource is used to compute the target.
|
protected java.lang.String |
resolveAnonymousClass(org.semanticweb.owlapi.model.OWLClassExpression owlClassExp,
AssociationSource assocSource)
This method handles the resolution of owl:Anonymous classes.
|
protected void |
resolveAnonymousProperties(Entity lgEntity,
org.semanticweb.owlapi.model.OWLClassExpression owlClass) |
protected void |
resolveAssociationProperty(AssociationEntity assocEntity,
org.semanticweb.owlapi.model.OWLDataProperty property) |
protected void |
resolveAssociationProperty(AssociationEntity assocEntity,
org.semanticweb.owlapi.model.OWLObjectProperty property) |
protected void |
resolveComplementOfRelations(AssociationSource source,
org.semanticweb.owlapi.model.OWLClass rdfsNamedClass)
Defines EMF complementOf relations based on OWL source.
|
protected Entity |
resolveConcept(org.semanticweb.owlapi.model.OWLClass owlClass)
Defines an EMF concept and properties based on the given rdf source.
|
protected java.lang.String |
resolveConceptID(org.semanticweb.owlapi.model.OWLEntity rdfResource)
Return the concept identifier mapped to the given rdf resource, or the
null if no mapping exists.
|
protected java.lang.String |
resolveConceptIDfromIRI(org.semanticweb.owlapi.model.IRI iri) |
protected void |
resolveDifferentFromRelations(AssociationSource source,
org.semanticweb.owlapi.model.OWLNamedIndividual individual)
Defines EMF differentFrom relations based on OWL source.
|
protected void |
resolveDisjointWithRelations(AssociationSource source,
org.semanticweb.owlapi.model.OWLClass owlClass)
Defines EMF DisjointWith relations based on OWL source.
|
protected void |
resolveEntityProperties(Entity lgEntity,
org.semanticweb.owlapi.model.OWLEntity owlClass)
Resolve and assign all property information contained by the given RDF
resource to the EMF Entity.
|
protected void |
resolveEquivalentClassRelations(AssociationSource source,
org.semanticweb.owlapi.model.OWLClass owlClass)
Defines EMF equivalentClass relations based on OWL source.
|
protected Entity |
resolveIndividual(org.semanticweb.owlapi.model.OWLNamedIndividual owlIndividual)
Defines an EMF instance.
|
protected java.lang.String |
resolveInstanceID(org.semanticweb.owlapi.model.OWLNamedIndividual owlIndividual)
Return the instance identifier mapped to the given rdf resource name, or
the rdf class name if no mapping exists.
|
protected java.lang.String |
resolveInstanceIDfromIRI(org.semanticweb.owlapi.model.IRI iri) |
protected java.lang.String |
resolveLabel(org.semanticweb.owlapi.model.OWLEntity entity)
Return the first label assigned to the given resource, or the rdf
resource name if no labels are assigned.
|
protected java.util.List<java.lang.String> |
resolveLabels(org.semanticweb.owlapi.model.OWLEntity entity) |
protected void |
resolveOWLObjectPropertyRelations(AssociationSource source,
org.semanticweb.owlapi.model.OWLEntity owlClass)
Defines EMF class RDF properties.
|
protected Property |
resolveProp(org.semanticweb.owlapi.model.OWLAnnotationAssertionAxiom prop,
java.lang.String lgClass,
java.lang.String lgID,
java.lang.String lgLabel,
java.lang.String lgDType,
java.lang.String rdfNamespace,
java.lang.String rdfText,
java.lang.String lang)
Instantiate and return a new EMF property based on the provided values.
|
protected Entity |
resolvePunnedIndividual(org.semanticweb.owlapi.model.OWLNamedIndividual owlIndividual) |
protected void |
resolveRdfTypeRelations(AssociationSource source,
org.semanticweb.owlapi.model.OWLNamedIndividual individual)
Defines EMF RDFType relations based on OWL source.
|
protected void |
resolveSameAsRelations(AssociationSource source,
org.semanticweb.owlapi.model.OWLNamedIndividual individual)
Defines sameAs relations based on OWL source.
|
protected void |
resolveSubClassOfRelations(AssociationSource source,
org.semanticweb.owlapi.model.OWLClass owlClass) |
protected java.util.Map<java.lang.String,java.lang.String> |
resolveXMLTagsAndValues(java.lang.String src) |
CodingScheme |
run()
Runs the conversion.
|
void |
setOntology(org.semanticweb.owlapi.model.OWLOntology ontology) |
void |
storeAssociationPredicateIfNeeded(java.lang.String uri,
java.lang.String version,
java.lang.String relationsName,
AssociationPredicate predicate) |
protected java.lang.String |
stripDataType(java.lang.String shortForm) |
protected java.lang.String |
stripLastColon(java.lang.String str) |
protected java.lang.String |
stripQuotes(java.lang.String textToParse) |
protected void |
updateApproximateConceptNumber() |
protected void |
writeAssociationSourceTarget(AssociationWrapper aw,
AssociationSource source,
AssociationTarget target) |
protected void |
writeEntity(Entity entity) |
public OwlApi2LG(java.net.URI owlURI, CodingSchemeManifest manifest, LoaderPreferences loadPrefs, int memoryMode, LgMessageDirectorIF messages)
owlURI
- The OWL input file.manifest
- The OWL manifest ObjectloadPrefs
- memoryMode
- messages
- Responsible for handling display of program messages to the
user.public CodingScheme run() throws LgConvertException
LgConvertException
- If an error occurs in processing.protected void processOWL() throws LgConvertException
LgConvertException
- If an error occurs in processing.protected void processAllConceptsAndProperties(SimpleMemUsageReporter.Snapshot snap)
protected void processAllConceptsRelations()
protected void processOWLObjectProperties(SimpleMemUsageReporter.Snapshot snap)
protected void processOWLDataProperties(SimpleMemUsageReporter.Snapshot snap)
protected Entity resolveConcept(org.semanticweb.owlapi.model.OWLClass owlClass)
owlClass
- The resource to evaluate.protected Entity addPropertiesToAssociationEntity(Entity lgEntity, org.semanticweb.owlapi.model.OWLEntity owlProp)
owlProp
- The resource to evaluate.protected void resolveSubClassOfRelations(AssociationSource source, org.semanticweb.owlapi.model.OWLClass owlClass)
protected void resolveEquivalentClassRelations(AssociationSource source, org.semanticweb.owlapi.model.OWLClass owlClass)
protected void resolveDisjointWithRelations(AssociationSource source, org.semanticweb.owlapi.model.OWLClass owlClass)
protected void processRestriction(org.semanticweb.owlapi.model.OWLRestriction restriction, AssociationSource assocParentSource, AssociationSource source)
restriction
- assocParentSource
- - The assocSource that should be added if not processing strict
owlsource
- - The normal source of the associationprotected void resolveComplementOfRelations(AssociationSource source, org.semanticweb.owlapi.model.OWLClass rdfsNamedClass)
protected void resolveOWLObjectPropertyRelations(AssociationSource source, org.semanticweb.owlapi.model.OWLEntity owlClass)
protected void resolveDifferentFromRelations(AssociationSource source, org.semanticweb.owlapi.model.OWLNamedIndividual individual)
protected void resolveSameAsRelations(AssociationSource source, org.semanticweb.owlapi.model.OWLNamedIndividual individual)
protected void resolveAnonymousProperties(Entity lgEntity, org.semanticweb.owlapi.model.OWLClassExpression owlClass)
protected void resolveEntityProperties(Entity lgEntity, org.semanticweb.owlapi.model.OWLEntity owlClass)
lgEntity
- owlClass
- Last updated: 05/28/2008protected Property resolveProp(org.semanticweb.owlapi.model.OWLAnnotationAssertionAxiom prop, java.lang.String lgClass, java.lang.String lgID, java.lang.String lgLabel, java.lang.String lgDType, java.lang.String rdfNamespace, java.lang.String rdfText, java.lang.String lang)
lgClass
- The EMF property class to instantiate (presentation, comment,
etc).lgID
- The identifier to assign to the new property; not null.lgLabel
- The name or label for the new property; not null.lgDType
- The data type of the new property; null if not applicable.rdfNamespace
- Namespace of the RDF property being converted.rdfText
- Text from the RDF property being converted.protected java.lang.String resolveAnonymousClass(org.semanticweb.owlapi.model.OWLClassExpression owlClassExp, AssociationSource assocSource)
owlClassExp
- protected java.lang.String processEquivalentClassExp(java.lang.String formattedExpression)
protected void initOWLOntologyFromSource() throws LgConvertException
LgConvertException
protected void initSupportedMappings()
protected void initScheme()
protected void initSchemeMetadata()
protected java.lang.String stripQuotes(java.lang.String textToParse)
protected java.util.Date parseEffectiveDate(java.lang.String dateText) throws java.text.ParseException
java.text.ParseException
protected void initAnnotationProperties()
protected void initSupportedDataProperties()
protected void addToSupportedPropertyAndMap(java.lang.String label, java.lang.String propertyName, org.semanticweb.owlapi.model.OWLNamedObject rdfProp)
protected void initAssociationEntities()
protected void initSupportedDatatypes()
protected void initSupportedObjectProperties()
protected void initSupportedAssociationAnnotationProperties()
protected AssociationWrapper addAssociation(org.semanticweb.owlapi.model.OWLProperty owlProp)
protected AssociationWrapper addAssociation(org.semanticweb.owlapi.model.OWLAnnotation owlProp)
protected Entity initSubtypeRoot()
protected boolean isEntityCodeRegistered(java.lang.String namespace, java.lang.String code)
code
- protected boolean isNoop(java.lang.String s)
s
- protected boolean isNoopNamespace(java.lang.String s)
s
- protected boolean isRootNode(org.semanticweb.owlapi.model.OWLClass owlClass)
rdfsNamedClass
- protected java.lang.String generatePropertyID(int i)
i
- protected java.lang.String generateDatatypeID(int i)
i
- protected java.lang.String generateDatatypeInstanceID(int i)
i
- protected void resolveAssociationProperty(AssociationEntity assocEntity, org.semanticweb.owlapi.model.OWLObjectProperty property)
protected void resolveAssociationProperty(AssociationEntity assocEntity, org.semanticweb.owlapi.model.OWLDataProperty property)
protected java.lang.String resolveLabel(org.semanticweb.owlapi.model.OWLEntity entity)
rdf
- protected java.util.List<java.lang.String> resolveLabels(org.semanticweb.owlapi.model.OWLEntity entity)
protected java.util.Map<java.lang.String,java.lang.String> resolveXMLTagsAndValues(java.lang.String src)
protected java.lang.String resolveConceptID(org.semanticweb.owlapi.model.OWLEntity rdfResource)
rdfResource
- protected java.lang.String resolveConceptIDfromIRI(org.semanticweb.owlapi.model.IRI iri)
protected java.lang.String resolveInstanceIDfromIRI(org.semanticweb.owlapi.model.IRI iri)
protected void processAllAnnotationProperties(SimpleMemUsageReporter.Snapshot snap)
protected void processAllInstanceAndProperties(SimpleMemUsageReporter.Snapshot snap)
protected Entity resolveIndividual(org.semanticweb.owlapi.model.OWLNamedIndividual owlIndividual)
protected Entity resolvePunnedIndividual(org.semanticweb.owlapi.model.OWLNamedIndividual owlIndividual)
protected void processAllInstanceRelations()
protected void resolveRdfTypeRelations(AssociationSource source, org.semanticweb.owlapi.model.OWLNamedIndividual individual)
protected java.lang.String resolveInstanceID(org.semanticweb.owlapi.model.OWLNamedIndividual owlIndividual)
owlIndividual
- protected AssociationSource addAssocSrc2Assoc(AssociationWrapper aw, AssociationSource assocSource)
protected java.lang.String getAssociationLabel(java.lang.String associationName, boolean forward)
protected java.lang.String stripLastColon(java.lang.String str)
protected java.lang.String getFromLastIndexOfColonOrHash(java.lang.String str)
protected java.lang.String getNameSpace(org.semanticweb.owlapi.model.OWLEntity entity)
public java.lang.String getNameSpace(org.semanticweb.owlapi.model.IRI iri)
protected void addEntity(Entity lgEntity)
protected void addEntity(AssociationEntity lgEntity)
protected void writeEntity(Entity entity) throws java.lang.Exception
java.lang.Exception
protected void relateAssocSourceWithRDFResourceTarget(EntityTypes type, AssociationWrapper aw, AssociationSource source, org.semanticweb.owlapi.model.OWLNamedIndividual tgtResource)
type
- assoc
- source
- tgtResource
- protected void relateAssocSourceWithOWLClassExpressionTarget(EntityTypes type, AssociationWrapper aw, AssociationSource source, org.semanticweb.owlapi.model.OWLClassExpression tgtResource, org.semanticweb.owlapi.model.OWLAxiom ax)
type
- assoc
- source
- tgtResource
- protected void relateAssocSourceWithIriTarget(EntityTypes type, AssociationWrapper aw, AssociationSource source, org.semanticweb.owlapi.model.IRI tgtResource, org.semanticweb.owlapi.model.OWLAxiom ax)
protected void relateAssocSourceWithOWLClassTarget(EntityTypes type, AssociationWrapper aw, AssociationSource source, org.semanticweb.owlapi.model.OWLClass tgtResource, org.semanticweb.owlapi.model.OWLAxiom ax)
type
- assoc
- source
- tgtResource
- protected void relateAssocSourceWithAnnotationTarget(EntityTypes type, AssociationWrapper aw, AssociationSource source, org.semanticweb.owlapi.model.OWLAnnotation tgtResource, org.semanticweb.owlapi.model.OWLAxiom ax, java.lang.String prefix)
protected void relateAssocSourceWithAnnotationIRITarget(EntityTypes type, AssociationWrapper aw, AssociationSource source, org.semanticweb.owlapi.model.OWLAnnotation tgtResource, org.semanticweb.owlapi.model.OWLAxiom ax, java.lang.String prefix)
protected java.lang.String stripDataType(java.lang.String shortForm)
protected void relateAssociationSourceTarget(AssociationWrapper aw, AssociationSource source, AssociationTarget target)
protected void relateAssociationSourceData(AssociationWrapper aw, AssociationSource source, AssociationData data)
protected void writeAssociationSourceTarget(AssociationWrapper aw, AssociationSource source, AssociationTarget target)
public void storeAssociationPredicateIfNeeded(java.lang.String uri, java.lang.String version, java.lang.String relationsName, AssociationPredicate predicate)
protected void updateApproximateConceptNumber()
public org.semanticweb.owlapi.model.OWLOntology getOntology()
public void setOntology(org.semanticweb.owlapi.model.OWLOntology ontology)