Class AlignmentModel
java.lang.Object
it.uniroma2.art.semanticturkey.alignment.AlignmentModel
-
Nested Class Summary
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
acceptAlignment
(org.eclipse.rdf4j.model.IRI entity1, org.eclipse.rdf4j.model.IRI entity2, String relation, RDFResourceRole entity1Role, org.eclipse.rdf4j.model.IRI forcedProperty, boolean setAsDefault, org.eclipse.rdf4j.repository.RepositoryConnection projRepoConn) Accepts an alignment and update the alignment model with the outcome of the validationvoid
acceptAllAlignment
(org.eclipse.rdf4j.repository.RepositoryConnection projRepoConn) Accepts all the alignments and update the alignment model with the outcome of the validationsvoid
void
Adds aCell
to the alignmentvoid
addCells
(Collection<Cell> cells) Adds a collection ofCell
s to the alignmentvoid
changeMappingProperty
(org.eclipse.rdf4j.model.IRI entity1, org.eclipse.rdf4j.model.IRI entity2, String relation, org.eclipse.rdf4j.model.IRI mappingProperty) Sets (forcing) the mapping property of an alignmentvoid
close()
void
Deletes all theCell
s from the alignmentvoid
deleteCell
(Cell cell) Deletes the givenCell
from the alignmentvoid
deleteCell
(org.eclipse.rdf4j.model.IRI entity1, org.eclipse.rdf4j.model.IRI entity2) Deletes aCell
that contains the given entities from the alignment.Returns if exists the aligned Cell with the given entities, null otherwisegetLevel()
Gets the level of the alignment.getOnto1()
Gets the baseURI of the first aligned ontologygetOnto2()
Gets the baseURI of the second aligned ontologygetType()
Gets the type (or arity) of the alignment.Returns a list of unknown relations (classnames or not known symbols) used in the alignmentboolean
getXml()
Gets the xml compatibilityboolean
Returns true if the alignment contains a custom relation (e.g. a relation not in knownRelations)Lists allCell
s declared in the alignmentLists allCell
s with the given statusvoid
Processes all the cells and stores the relations in a map that will stores the default mapping properties for themvoid
rejectAlignment
(org.eclipse.rdf4j.model.IRI entity1, org.eclipse.rdf4j.model.IRI entity2, String relation) Rejects an alignment and update the model with the outcome of the validationvoid
Rejects all the alignments and update the model with the outcome of the validationsvoid
reverse()
Reverses the two ontologies aligned the alignment and the entities in the cellsvoid
Serializes the Alignment content in the given file according to AlignAPI format @param outputFile @throws IOException @throwsvoid
Sets the level of the alignment.void
Sets the baseURI of the first aligned ontologyvoid
Sets the baseURI of the second aligned ontologyvoid
Sets the type (or arity) of the alignment.void
setXml
(boolean xml) Sets the xml compatibilityList<org.eclipse.rdf4j.model.IRI>
suggestPropertiesForRelation
(RDFResourceRole role, String relation, boolean withDefault) Converts the given relation to a property.List<org.eclipse.rdf4j.model.IRI>
suggestPropertiesForRelation
(org.eclipse.rdf4j.model.IRI entity, String relation, boolean withDefault, org.eclipse.rdf4j.repository.RepositoryConnection projRepoConn) Converts the given relation to a property.void
updateRelation
(org.eclipse.rdf4j.model.IRI entity1, org.eclipse.rdf4j.model.IRI entity2, String oldRelation, String newRelation, float measure) Sets (forcing) the relation between two entity.
-
Field Details
-
logger
protected static org.slf4j.Logger logger
-
-
Constructor Details
-
AlignmentModel
public AlignmentModel()
-
-
Method Details
-
add
- Throws:
AlignmentInitializationException
-
preProcess
public void preProcess()Processes all the cells and stores the relations in a map that will stores the default mapping properties for them -
getUnknownRelations
Returns a list of unknown relations (classnames or not known symbols) used in the alignment- Returns:
-
getLevel
Gets the level of the alignment. Values: "0", "1", "2EDOAL"- Returns:
-
setLevel
Sets the level of the alignment. Values: "0", "1", "2EDOAL"- Parameters:
level
-
-
getXml
public boolean getXml()Gets the xml compatibility- Returns:
-
setXml
public void setXml(boolean xml) Sets the xml compatibility- Parameters:
xml
-
-
getType
Gets the type (or arity) of the alignment. Values: "11", "1?", "1+", "1*", "?1", "??", "?+", "?*", "+1", "+?", "++", "+*", "*1", "*?", "?+", "**"- Returns:
-
setType
Sets the type (or arity) of the alignment. Values: "11", "1?", "1+", "1*", "?1", "??", "?+", "?*", "+1", "+?", "++", "+*", "*1", "*?", "?+", "**"- Parameters:
type
-
-
getOnto1
Gets the baseURI of the first aligned ontology- Returns:
-
setOnto1
Sets the baseURI of the first aligned ontology- Parameters:
ontologyBaseURI
-
-
getOnto2
Gets the baseURI of the second aligned ontology- Returns:
-
setOnto2
Sets the baseURI of the second aligned ontology- Parameters:
ontologyBaseURI
-
-
getCell
public Cell getCell(org.eclipse.rdf4j.model.IRI entity1, org.eclipse.rdf4j.model.IRI entity2, String relation) Returns if exists the aligned Cell with the given entities, null otherwise- Parameters:
entity1
-entity2
-- Returns:
-
listCells
Lists allCell
s declared in the alignment- Returns:
-
listCellsByStatus
Lists allCell
s with the given status- Returns:
-
addCell
Adds aCell
to the alignment- Parameters:
cell
-
-
addCells
Adds a collection ofCell
s to the alignment- Parameters:
cells
-
-
deleteCell
Deletes the givenCell
from the alignment- Parameters:
cell
-
-
deleteCell
public void deleteCell(org.eclipse.rdf4j.model.IRI entity1, org.eclipse.rdf4j.model.IRI entity2) Deletes aCell
that contains the given entities from the alignment. The order of the entities is not relevant- Parameters:
entity1
-entity2
-
-
deleteAllCells
public void deleteAllCells()Deletes all theCell
s from the alignment -
acceptAlignment
public void acceptAlignment(org.eclipse.rdf4j.model.IRI entity1, org.eclipse.rdf4j.model.IRI entity2, String relation, @Nullable RDFResourceRole entity1Role, @Nullable org.eclipse.rdf4j.model.IRI forcedProperty, boolean setAsDefault, org.eclipse.rdf4j.repository.RepositoryConnection projRepoConn) Accepts an alignment and update the alignment model with the outcome of the validation- Parameters:
entity1
-entity2
-relation
-projRepoConn
- repository connection of the ontology, used only for checking the role of the left entity and thus for initializing the mapping property accordingly (e.g. concept => skos:exactMatch, class => owl:equivalentClass, ...) No write operation are performed on such repo- Throws:
InvalidAlignmentRelationException
-
acceptAllAlignment
public void acceptAllAlignment(org.eclipse.rdf4j.repository.RepositoryConnection projRepoConn) Accepts all the alignments and update the alignment model with the outcome of the validations- Parameters:
projRepoConn
- repository connection of the ontology, used to check if relation is valid respect entity1
-
rejectAlignment
public void rejectAlignment(org.eclipse.rdf4j.model.IRI entity1, org.eclipse.rdf4j.model.IRI entity2, String relation) Rejects an alignment and update the model with the outcome of the validation- Parameters:
entity1
-entity2
-
-
rejectAllAlignment
public void rejectAllAlignment()Rejects all the alignments and update the model with the outcome of the validations -
updateRelation
public void updateRelation(org.eclipse.rdf4j.model.IRI entity1, org.eclipse.rdf4j.model.IRI entity2, String oldRelation, String newRelation, float measure) Sets (forcing) the relation between two entity.- Parameters:
entity1
-entity2
-oldRelation
-measure
-
-
changeMappingProperty
public void changeMappingProperty(org.eclipse.rdf4j.model.IRI entity1, org.eclipse.rdf4j.model.IRI entity2, String relation, org.eclipse.rdf4j.model.IRI mappingProperty) Sets (forcing) the mapping property of an alignment- Parameters:
entity1
-entity2
-relation
-mappingProperty
-
-
suggestPropertiesForRelation
public List<org.eclipse.rdf4j.model.IRI> suggestPropertiesForRelation(org.eclipse.rdf4j.model.IRI entity, String relation, boolean withDefault, org.eclipse.rdf4j.repository.RepositoryConnection projRepoConn) throws InvalidAlignmentRelationException Converts the given relation to a property. The conversion depends on:- Relation: =, >, <, %, InstanceOf, HasInstance
- Type of entity: property, class, instance, concept
- Parameters:
entity
-relation
-withDefault
- if cannot infer a property, determine if consider an eventual default property assigned to the relationprojRepoConn
- repository connection for detecting role of entity parameter- Returns:
- Throws:
InvalidAlignmentRelationException
-
suggestPropertiesForRelation
public List<org.eclipse.rdf4j.model.IRI> suggestPropertiesForRelation(RDFResourceRole role, String relation, boolean withDefault) throws InvalidAlignmentRelationException Converts the given relation to a property. The conversion depends on:- Relation: =, >, <, %, InstanceOf, HasInstance
- Type of entity: property, class, instance, concept
- Parameters:
role
-relation
-withDefault
- if cannot infer a property, determine if consider an eventual default property stored in the alignment model as default for the relation- Returns:
- Throws:
InvalidAlignmentRelationException
-
hasCustomRelation
public boolean hasCustomRelation()Returns true if the alignment contains a custom relation (e.g. a relation not in knownRelations)- Returns:
-
reverse
public void reverse()Reverses the two ontologies aligned the alignment and the entities in the cells -
serialize
Serializes the Alignment content in the given file according to AlignAPI format @param outputFile @throws IOException @throws- Throws:
IOException
-
close
public void close()
-