MetaDone
metadone.client.functions.importer.owl.OWLImporter Class Reference
Inheritance diagram for metadone.client.functions.importer.owl.OWLImporter:
Collaboration diagram for metadone.client.functions.importer.owl.OWLImporter:

List of all members.

Public Types

enum  PathType { WEB_PATH, FILE_PATH }

Public Member Functions

 OWLImporter ()
ConcreteModel createConcreteModel (String ext, String source) throws BadPreCondition, IOException
ConcreteModel createConcreteModel (String ext, InputStream input) throws BadPreCondition, IOException
void readFile (String path) throws BadPreCondition
void readFile (InputStream input) throws BadPreCondition
void readOntologyModel (OntModel m) throws BadPreCondition

Protected Member Functions

MetaModel createMetamodel (Workspace workspace) throws BadPreCondition
void promoteToMetamodel (MetaModel metamodel, ConcreteModel model, MetaModel newMetamodel) throws BadPreCondition

Private Member Functions

void readOntology (Ontology or, MetaProperty< String > owlOntologyID, MetaProperty< String > owlOntologyVersionInfo, MetaProperty< String > owlOntologyComment, MetaProperty< String > owlOntologyLabel, MetaProperty< String > owlOntologySeeAlso, MetaProperty< String > owlOntologyIsDefinedBy) throws BadPreCondition
void readOntologyObject (OntResource or, MetaObject mo) throws BadPreCondition
void readGenericAssociation (OntResource or, MetaRole mrAssociation, ArrayList< OntResource > alOr, boolean order) throws BadPreCondition
void readOntologyProperties (MetaObject mo, ConcreteObject co, Ontology ont, MetaProperty< String > owlOntologyID, MetaProperty< String > owlOntologyVersionInfo, MetaProperty< String > owlOntologyComment, MetaProperty< String > owlOntologyLabel, MetaProperty< String > owlOntologySeeAlso, MetaProperty< String > owlOntologyIsDefinedBy) throws BadPreCondition
void readGenericProperties (MetaObject mo, ConcreteObject co, OntResource or) throws BadPreCondition
void readValueProperty (Restriction oc, MetaObject owlCardinalityConstraint, MetaProperty< Long > owlCardinalityConstraintValue) throws BadPreCondition
void readRangeProperty (DatatypeProperty dp, MetaObject owlDataTypeProperty, RDFNode range, MetaProperty< String > owlDataTypePropertyPrimitiveRange) throws BadPreCondition
void readOneOfProperty (DataRange dr, MetaObject owlDataRange, ArrayList< Literal > ones, MetaProperty< String > owlDataRangeOneOf) throws BadPreCondition
void readHasValueProperty (HasValueRestriction hvr, MetaObject owlHasValueRestriction, MetaProperty< String > owlHasValueRestrictionHasPrimitiveValue) throws BadPreCondition
void readFunctionalProperty (OntProperty dp, MetaObject owlProperty, MetaProperty< Boolean > owlPropertyIsFunctional) throws BadPreCondition
void readInverseFunctionalProperty (ObjectProperty dp, MetaObject owlObjectProperty, MetaProperty< Boolean > owlObjectPropertyIsInverseFunctional) throws BadPreCondition
void readSymmetricProperty (ObjectProperty dp, MetaObject owlObjectProperty, MetaProperty< Boolean > owlObjectPropertyIsSymmetric) throws BadPreCondition
void readTransitiveProperty (ObjectProperty dp, MetaObject owlObjectProperty, MetaProperty< Boolean > owlObjectPropertyIsTransitive) throws BadPreCondition

Private Attributes

MetaModel mm
ConcreteModel cm
Map< OntResource, ConcreteObjectontResourceToConcreteObjectMap
MetaObject owlOntologyObject
MetaProperty< String > owlOntologyObjectID
MetaProperty< String > owlOntologyObjectVersionInfo
MetaProperty< String > owlOntologyObjectComment
MetaProperty< String > owlOntologyObjectLabel
MetaProperty< String > owlOntologyObjectSeeAlso
MetaProperty< String > owlOntologyObjectIsDefinedBy

Static Private Attributes

static final String OWL_JENA_PROCESSING_S = "OWL: Jena processing=%s"
static final String OWL_REPOSITORY_CREATION_S = "OWL: Repository creation=%s"
final static Logger logger = Logger.getLogger(OWLImporter.class)

Member Enumeration Documentation


Constructor & Destructor Documentation

metadone.client.functions.importer.owl.OWLImporter.OWLImporter ( )

Member Function Documentation

ConcreteModel metadone.client.functions.importer.owl.OWLImporter.createConcreteModel ( String  ext,
String  source 
) throws BadPreCondition, IOException
ConcreteModel metadone.client.functions.importer.owl.OWLImporter.createConcreteModel ( String  ext,
InputStream  input 
) throws BadPreCondition, IOException

Creates a concrete model for a given extension and contents.

The model is generated using getMetamodel(String) for the creation of the concrete model.

Parameters:
extThe extension
inputThe contents of the file
Returns:
A concrete metamodel
Exceptions:
BadPreConditionwhen the model couldn't be created
IOExceptionwhen the input couldn't be parsed

Implements metadone.client.functions.importer.Importer.

References metadone.client.functions.importer.owl.OWLImporter.cm, metadone.client.functions.importer.owl.OWLImporter.createMetamodel(), metadone.metabusiness.ConcreteModel.createModel(), metadone.metabusiness.Workspace.getMainModel(), metadone.client.MainClientMetadone.getSingleton(), metadone.client.MainClientMetadone.getWorkspace(), metadone.client.functions.importer.owl.OWLImporter.mm, and metadone.client.functions.importer.owl.OWLImporter.readFile().

MetaModel metadone.client.functions.importer.owl.OWLImporter.createMetamodel ( Workspace  workspace) throws BadPreCondition [protected, virtual]
void metadone.client.functions.importer.owl.OWLImporter.promoteToMetamodel ( MetaModel  metamodel,
ConcreteModel  model,
MetaModel  newMetamodel 
) throws BadPreCondition [protected, virtual]

Initializes a metamodel from a model.

Parameters:
metamodelThe metamodel of the concrete model
modelThe concrete model
newMetamodelThe metamodel to initialize
Exceptions:
BadPreCondition

Implements metadone.client.functions.importer.PromotingImporter.AbstractPromotingImporter.

References metadone.exception.InternalException.SHOULD_NEVER_BE_CALLED.

void metadone.client.functions.importer.owl.OWLImporter.readFunctionalProperty ( OntProperty  dp,
MetaObject  owlProperty,
MetaProperty< Boolean >  owlPropertyIsFunctional 
) throws BadPreCondition [private]

Instantiates the OWLProperty.isFunctional property

Parameters:
dp: the jena OntProperty
owlProperty: the OWLProperty MetaObject
owlPropertyIsFunctional: the OWLProperty.IsFunctional MetaProperty
Exceptions:
BadPreCondition

References metadone.client.functions.importer.owl.OWLImporter.cm, metadone.metabusiness.ConcreteObject.createProperty(), metadone.client.functions.importer.owl.OWLImporter.logger, and metadone.client.functions.importer.owl.OWLImporter.ontResourceToConcreteObjectMap.

Referenced by metadone.client.functions.importer.owl.OWLImporter.readOntologyModel().

void metadone.client.functions.importer.owl.OWLImporter.readGenericAssociation ( OntResource  or,
MetaRole  mrAssociation,
ArrayList< OntResource >  alOr,
boolean  order 
) throws BadPreCondition [private]

Instantiates an association between OWLOntologyObjects

Parameters:
or: a jena ontology resource as domain
mrAssociation: a MetaRole from the OWL MetaModel
alOr: an arrayList of one or more jena ontology resource as range
order: true if the ontology resource is effectively domain of the association false if the association is backward and the ontology resource is the range
Exceptions:
BadPreCondition

References metadone.client.functions.importer.owl.OWLImporter.cm, metadone.metabusiness.ConcreteModel.createRole(), metadone.client.functions.importer.owl.OWLImporter.logger, and metadone.client.functions.importer.owl.OWLImporter.ontResourceToConcreteObjectMap.

Referenced by metadone.client.functions.importer.owl.OWLImporter.readOntologyModel().

void metadone.client.functions.importer.owl.OWLImporter.readGenericProperties ( MetaObject  mo,
ConcreteObject  co,
OntResource  or 
) throws BadPreCondition [private]
void metadone.client.functions.importer.owl.OWLImporter.readHasValueProperty ( HasValueRestriction  hvr,
MetaObject  owlHasValueRestriction,
MetaProperty< String >  owlHasValueRestrictionHasPrimitiveValue 
) throws BadPreCondition [private]

Instantiates the OWLHasValueRestriction.hasPrimitiveValue property

Parameters:
hvr: the jena HasValueRestriction
owlHasValueRestriction: the OWLHasValueRestriction MetaObject
owlHasValueRestrictionHasPrimitiveValue: the OWLHasValueRestriction.HasPrimitiveValue MetaProperty
Exceptions:
BadPreCondition

References metadone.client.functions.importer.owl.OWLImporter.cm, metadone.metabusiness.ConcreteObject.createProperty(), metadone.client.functions.importer.owl.OWLImporter.logger, and metadone.client.functions.importer.owl.OWLImporter.ontResourceToConcreteObjectMap.

Referenced by metadone.client.functions.importer.owl.OWLImporter.readOntologyModel().

void metadone.client.functions.importer.owl.OWLImporter.readInverseFunctionalProperty ( ObjectProperty  dp,
MetaObject  owlObjectProperty,
MetaProperty< Boolean >  owlObjectPropertyIsInverseFunctional 
) throws BadPreCondition [private]

Instantiates the OWLObjectProperty.isInverseFunctional property

Parameters:
dp: the jena ObjectProperty
owlObjectProperty: the OWLObjectProperty MetaObject
owlObjectPropertyIsInverseFunctional: the OWLObjectProperty.IsInverseFunctional MetaProperty
Exceptions:
BadPreCondition

References metadone.client.functions.importer.owl.OWLImporter.cm, metadone.metabusiness.ConcreteObject.createProperty(), metadone.client.functions.importer.owl.OWLImporter.logger, and metadone.client.functions.importer.owl.OWLImporter.ontResourceToConcreteObjectMap.

Referenced by metadone.client.functions.importer.owl.OWLImporter.readOntologyModel().

void metadone.client.functions.importer.owl.OWLImporter.readOneOfProperty ( DataRange  dr,
MetaObject  owlDataRange,
ArrayList< Literal >  ones,
MetaProperty< String >  owlDataRangeOneOf 
) throws BadPreCondition [private]

Instantiates the OWLDataRange.oneOf property

Parameters:
dr: the jena DataRange
owlDataRange: the OWLDataRange MetaObject
ones: ArrayList of jena Literals
owlDataRangeOneOf: the OWLDataRange.OneOf MetaProperty
Exceptions:
BadPreCondition

References metadone.client.functions.importer.owl.OWLImporter.cm, metadone.metabusiness.ConcreteObject.createProperty(), metadone.client.functions.importer.owl.OWLImporter.logger, and metadone.client.functions.importer.owl.OWLImporter.ontResourceToConcreteObjectMap.

Referenced by metadone.client.functions.importer.owl.OWLImporter.readOntologyModel().

void metadone.client.functions.importer.owl.OWLImporter.readOntology ( Ontology  or,
MetaProperty< String >  owlOntologyID,
MetaProperty< String >  owlOntologyVersionInfo,
MetaProperty< String >  owlOntologyComment,
MetaProperty< String >  owlOntologyLabel,
MetaProperty< String >  owlOntologySeeAlso,
MetaProperty< String >  owlOntologyIsDefinedBy 
) throws BadPreCondition [private]

Instantiates an OWLOntology

Parameters:
or: a jena Ontology
owlOntologyID: the ID MetaProperty for OWLOntology
owlOntologyVersionInfo: the VersionInfo MetaProperty for OWLOntology
owlOntologyComment: the Comment MetaProperty for OWLOntology
owlOntologyLabel: the Label MetaProperty for OWLOntology
owlOntologySeeAlso: the SeeAlso MetaProperty for OWLOntology
owlOntologyIsDefinedBy: the IsDefinedBy MetaProperty for OWLOntology
Exceptions:
BadPreCondition

References metadone.client.functions.importer.owl.OWLImporter.cm, metadone.metabusiness.ConcreteModel.createObject(), metadone.metabusiness.MetaModel.getMOByName(), metadone.client.functions.importer.owl.OWLImporter.logger, metadone.client.functions.importer.owl.OWLImporter.mm, metadone.client.functions.importer.owl.OWLImporter.ontResourceToConcreteObjectMap, and metadone.client.functions.importer.owl.OWLImporter.readOntologyProperties().

Referenced by metadone.client.functions.importer.owl.OWLImporter.readOntologyModel().

void metadone.client.functions.importer.owl.OWLImporter.readOntologyModel ( OntModel  m) throws BadPreCondition

Reads an owl ontology model and instantiates its objects

Parameters:
m: jena OntModel
Exceptions:
BadPreCondition

References metadone.metabusiness.MetaModel.getMOByName(), metadone.client.functions.importer.owl.OWLImporter.logger, metadone.client.functions.importer.owl.OWLImporter.mm, metadone.metabusiness.WorkspaceObject.narrow2MetaProperty(), metadone.metabusiness.WorkspaceObject.narrow2MetaRole(), metadone.client.functions.importer.owl.OWLImporter.ontResourceToConcreteObjectMap, metadone.client.functions.importer.owl.OWLImporter.owlOntologyObject, metadone.client.functions.importer.owl.OWLImporter.owlOntologyObjectComment, metadone.client.functions.importer.owl.OWLImporter.owlOntologyObjectID, metadone.client.functions.importer.owl.OWLImporter.owlOntologyObjectIsDefinedBy, metadone.client.functions.importer.owl.OWLImporter.owlOntologyObjectLabel, metadone.client.functions.importer.owl.OWLImporter.owlOntologyObjectSeeAlso, metadone.client.functions.importer.owl.OWLImporter.owlOntologyObjectVersionInfo, metadone.client.functions.importer.owl.OWLImporter.readFunctionalProperty(), metadone.client.functions.importer.owl.OWLImporter.readGenericAssociation(), metadone.client.functions.importer.owl.OWLImporter.readHasValueProperty(), metadone.client.functions.importer.owl.OWLImporter.readInverseFunctionalProperty(), metadone.client.functions.importer.owl.OWLImporter.readOneOfProperty(), metadone.client.functions.importer.owl.OWLImporter.readOntology(), metadone.client.functions.importer.owl.OWLImporter.readOntologyObject(), metadone.client.functions.importer.owl.OWLImporter.readRangeProperty(), metadone.client.functions.importer.owl.OWLImporter.readSymmetricProperty(), metadone.client.functions.importer.owl.OWLImporter.readTransitiveProperty(), and metadone.client.functions.importer.owl.OWLImporter.readValueProperty().

Referenced by metadone.client.functions.importer.owl.OWLImporter.readFile().

void metadone.client.functions.importer.owl.OWLImporter.readOntologyProperties ( MetaObject  mo,
ConcreteObject  co,
Ontology  ont,
MetaProperty< String >  owlOntologyID,
MetaProperty< String >  owlOntologyVersionInfo,
MetaProperty< String >  owlOntologyComment,
MetaProperty< String >  owlOntologyLabel,
MetaProperty< String >  owlOntologySeeAlso,
MetaProperty< String >  owlOntologyIsDefinedBy 
) throws BadPreCondition [private]

Instantiates the OWLOntology properties (id, versionInfo, comment, label, seeAlso, isDefinedBy)

Parameters:
mo: the MetaObject on which the properties are bound
co: the ConcreteObject on which the ConcreteProperties will be created
ont: the jena ontology
owlOntologyID: the ID MetaProperty for OWLOntology
owlOntologyVersionInfo: the VersionInfo MetaProperty for OWLOntology
owlOntologyComment: the Comment MetaProperty for OWLOntology
owlOntologyLabel: the Label MetaProperty for OWLOntology
owlOntologySeeAlso: the SeeAlso MetaProperty for OWLOntology
owlOntologyIsDefinedBy: the IsDefinedBy MetaProperty for OWLOntology
Exceptions:
BadPreCondition

References metadone.client.functions.importer.owl.OWLImporter.cm.

Referenced by metadone.client.functions.importer.owl.OWLImporter.readOntology().

void metadone.client.functions.importer.owl.OWLImporter.readRangeProperty ( DatatypeProperty  dp,
MetaObject  owlDataTypeProperty,
RDFNode  range,
MetaProperty< String >  owlDataTypePropertyPrimitiveRange 
) throws BadPreCondition [private]

Instantiates the OWLDataTypeProperty.primitiveRange property

Parameters:
dp: the jena DatatypeProperty
owlDataTypeProperty: the OWLDataTypeProperty MetaObject
thejena RDFNode range (can be null)
owlDataTypePropertyPrimitiveRange: the OWLDataTypeProperty.PrimitiveRange MetaProperty
Exceptions:
BadPreCondition

References metadone.client.functions.importer.owl.OWLImporter.cm, metadone.metabusiness.ConcreteObject.createProperty(), metadone.client.functions.importer.owl.OWLImporter.logger, and metadone.client.functions.importer.owl.OWLImporter.ontResourceToConcreteObjectMap.

Referenced by metadone.client.functions.importer.owl.OWLImporter.readOntologyModel().

void metadone.client.functions.importer.owl.OWLImporter.readSymmetricProperty ( ObjectProperty  dp,
MetaObject  owlObjectProperty,
MetaProperty< Boolean >  owlObjectPropertyIsSymmetric 
) throws BadPreCondition [private]

Instantiates the OWLObjectProperty.isSymmetric property

Parameters:
dp: the jena ObjectProperty
owlObjectProperty: the OWLObjectProperty MetaObject
owlObjectPropertyIsSymmetric: the OWLObjectProperty.IsSymmetric MetaProperty
Exceptions:
BadPreCondition

References metadone.client.functions.importer.owl.OWLImporter.cm, metadone.metabusiness.ConcreteObject.createProperty(), metadone.client.functions.importer.owl.OWLImporter.logger, and metadone.client.functions.importer.owl.OWLImporter.ontResourceToConcreteObjectMap.

Referenced by metadone.client.functions.importer.owl.OWLImporter.readOntologyModel().

void metadone.client.functions.importer.owl.OWLImporter.readTransitiveProperty ( ObjectProperty  dp,
MetaObject  owlObjectProperty,
MetaProperty< Boolean >  owlObjectPropertyIsTransitive 
) throws BadPreCondition [private]

Instantiates the OWLObjectProperty.isTransitive property

Parameters:
dp: the jena ObjectProperty
owlObjectProperty: the OWLObjectProperty MetaObject
owlObjectPropertyIsTransitive: the OWLObjectProperty.IsTransitive MetaProperty
Exceptions:
BadPreCondition

References metadone.client.functions.importer.owl.OWLImporter.cm, metadone.metabusiness.ConcreteObject.createProperty(), metadone.client.functions.importer.owl.OWLImporter.logger, and metadone.client.functions.importer.owl.OWLImporter.ontResourceToConcreteObjectMap.

Referenced by metadone.client.functions.importer.owl.OWLImporter.readOntologyModel().

void metadone.client.functions.importer.owl.OWLImporter.readValueProperty ( Restriction  oc,
MetaObject  owlCardinalityConstraint,
MetaProperty< Long >  owlCardinalityConstraintValue 
) throws BadPreCondition [private]

Instantiates the OWLCardinalityConstraint.value property

Parameters:
oc: the jena Restriction
owlCardinalityConstraint: the OWLCardinalityConstraint MetaObject
owlCardinalityConstraintValue: the OWLCardinalityConstraint.Value MetaProperty
Exceptions:
BadPreCondition

References metadone.client.functions.importer.owl.OWLImporter.cm, metadone.metabusiness.ConcreteObject.createProperty(), metadone.client.functions.importer.owl.OWLImporter.logger, and metadone.client.functions.importer.owl.OWLImporter.ontResourceToConcreteObjectMap.

Referenced by metadone.client.functions.importer.owl.OWLImporter.readOntologyModel().


Member Data Documentation


The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Enumerations