public class RF2Importer extends BaseImporter
| Modifier and Type | Class and Description |
|---|---|
protected class |
RF2Importer.OntologyBuilder
Class that knows how to build an
Ontology from a set of RF2 files. |
protected class |
RF2Importer.RoleValuePair
Represents a role-value pair.
|
BaseImporter.ImportEntry, BaseImporter.Module| Modifier and Type | Field and Description |
|---|---|
protected static org.semanticweb.owlapi.model.OWLDocumentFormat |
FUNCTIONAL_SYNTAX_DOCUMENT_FORMAT |
protected Queue<RF2Input> |
inputs
Queue with the inputs to process.
|
protected List<String> |
problems
List of problems found while importing.
|
| Constructor and Description |
|---|
RF2Importer(Collection<Input> inputs)
Imports a set of ontologies using the supplied configuration object.
|
RF2Importer(RF2Input input)
Imports an ontology using the supplied configuration object.
|
| Modifier and Type | Method and Description |
|---|---|
protected VersionRows |
getBundle(BaseImporter.ImportEntry entry)
Returns a
VersionRows object for an ImportEntry. |
protected Concept |
getConcept(String id,
Map<String,Concept> ci) |
protected NamedFeature |
getFeature(String id,
Map<String,NamedFeature> fi) |
protected Map<String,Set<Version>> |
getModuleVersionsToLoad(RF2Input in)
Determines which modules and versions should be loaded based on the
Inputs object. |
protected RF2Importer.OntologyBuilder |
getOntologyBuilder(VersionRows vr,
String rootModuleId,
String rootModuleVersion,
Map<String,String> metadata)
Hook method for subclasses to override.
|
Iterator<Ontology> |
getOntologyVersions(IProgressMonitor monitor)
There are several models used to represent ontologies that have been adopted by different groups.
|
List<String> |
getProblems()
Returns a list of problems that happened during the import process.
|
protected NamedRole |
getRole(String id,
Map<String,NamedRole> ri) |
protected Set<Set<RF2Importer.RoleValuePair>> |
groupRoles(List<String[]> groups) |
protected void |
loadConceptRows(Map<String,String> modMap,
Map<String,ConceptRow> conceptMap,
InputStream inputStream) |
protected IModuleDependencyRefset |
loadModuleDependencies(RF2Input input)
Loads all the module dependency information from all RF2 inputs into a single
IModuleDependencyRefset. |
protected <R extends RefsetRow> |
loadReferenceSet(RF2Input input,
String refsetFile,
Map<String,String> modMap,
Map<String,R> refsetMap,
au.csiro.ontology.importer.rf2.IRefsetFactory<R> factory) |
protected void |
loadRelationshipRows(Map<String,String> modMap,
Map<String,RelationshipRow> relationshipMap,
InputStream inputStream) |
protected void |
populateCDs(Map<String,List<String[]>> cdMap,
String referencedComponentId,
String featureId,
String operator,
String value,
String unit)
Populates concrete domains information.
|
protected void |
populateChildren(String src,
String tgt,
Map<String,Set<String>> children) |
protected void |
populateParent(String src,
String tgt,
Map<String,Set<String>> parents) |
protected void |
populateRels(String comp,
String src,
String role,
String tgt,
String group,
Map<String,List<String[]>> rels) |
protected void |
populateRoleDef(String code,
String rightId,
String parentRole,
Map<String,Map<String,String>> roles) |
protected void |
populateRoles(Set<String> roles,
String parentSCTID,
String rightIdentityIds,
Map<String,Set<String>> children,
Map<String,Map<String,String>> rolesMap) |
protected static final org.semanticweb.owlapi.model.OWLDocumentFormat FUNCTIONAL_SYNTAX_DOCUMENT_FORMAT
public RF2Importer(RF2Input input)
input - public RF2Importer(Collection<Input> inputs)
inputs - public Iterator<Ontology> getOntologyVersions(IProgressMonitor monitor) throws ImportException
IImporterThere are several models used to represent ontologies that have been adopted by different groups. In this implementation a model based on SNOMED's RF2 format is used because it contains features that are not available in other formats.
An ontology in RF2 maps to a set of interdependent modules. This method returns all the ontologies found in a set of files. Implementations of importers for other file formats can simply return a single ontology.
If the files contain related modules then all of them are returned as a single ontology. This method returns an iterator that allows importing each ontology version.
monitor - A progress monitor.ImportException - if a problem occurs when importing the ontologies.public List<String> getProblems()
IImporterImportException is thrown to get a detailed list of problems.protected IModuleDependencyRefset loadModuleDependencies(RF2Input input) throws ImportException
IModuleDependencyRefset.ImportExceptionprotected Map<String,Set<Version>> getModuleVersionsToLoad(RF2Input in)
Inputs object. Returns a Map
with the module ids as keys and the set of versions to import as values.protected void populateCDs(Map<String,List<String[]>> cdMap, String referencedComponentId, String featureId, String operator, String value, String unit)
cdMap - referencedComponentId - featureId - operator - value - unit - protected <R extends RefsetRow> void loadReferenceSet(RF2Input input, String refsetFile, Map<String,String> modMap, Map<String,R> refsetMap, au.csiro.ontology.importer.rf2.IRefsetFactory<R> factory) throws ImportException
ImportExceptionprotected VersionRows getBundle(BaseImporter.ImportEntry entry) throws ImportException
VersionRows object for an ImportEntry.entry - ImportExceptionprotected void loadRelationshipRows(Map<String,String> modMap, Map<String,RelationshipRow> relationshipMap, InputStream inputStream) throws IOException
modMap - The MDRS data for this versionrelationshipMap - Map from Relationship SCTID to parsed rowinputStream - Stream to parse, filtering based on MDRS dataIOExceptionUnsupportedEncodingExceptionprotected void loadConceptRows(Map<String,String> modMap, Map<String,ConceptRow> conceptMap, InputStream inputStream) throws IOException, UnsupportedEncodingException
modMap - The MDRS data for this versionconceptMap - Map from Concept SCTID to parsed rowinputStream - Stream to parse, filtering based on MDRS dataIOExceptionUnsupportedEncodingExceptionprotected NamedFeature getFeature(String id, Map<String,NamedFeature> fi)
protected void populateParent(String src, String tgt, Map<String,Set<String>> parents)
protected void populateChildren(String src, String tgt, Map<String,Set<String>> children)
protected void populateRels(String comp, String src, String role, String tgt, String group, Map<String,List<String[]>> rels)
protected void populateRoles(Set<String> roles, String parentSCTID, String rightIdentityIds, Map<String,Set<String>> children, Map<String,Map<String,String>> rolesMap)
protected void populateRoleDef(String code, String rightId, String parentRole, Map<String,Map<String,String>> roles)
protected Set<Set<RF2Importer.RoleValuePair>> groupRoles(List<String[]> groups)
protected RF2Importer.OntologyBuilder getOntologyBuilder(VersionRows vr, String rootModuleId, String rootModuleVersion, Map<String,String> metadata)
vr - rootModuleId - rootModuleVersion - includeInactiveAxioms - Copyright © 2018 Australian e-Health Research Centre. All Rights Reserved.