Skip to content

Commit

Permalink
core: disable switch to value action when an individual represents a …
Browse files Browse the repository at this point in the history
…subject in a property assertion

Closes #25
  • Loading branch information
mnamici committed Sep 20, 2019
1 parent a803e60 commit a72ef52
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
5 changes: 2 additions & 3 deletions eddy/core/factory.py
Original file line number Diff line number Diff line change
Expand Up @@ -569,6 +569,7 @@ def buildIndividualNodeMenu(self, diagram, node):
menu.insertMenu(self.session.action('node_properties'), self.session.menu('switch_individual'))
self.insertLabelActions(menu, node)
menu.insertSeparator(self.session.action('node_properties'))
menu.insertSeparator(self.session.action('node_description'))

#############################################
# BEGIN CONSTRAIN IDENTITY SWITCH
Expand All @@ -592,6 +593,7 @@ def buildIndividualNodeMenu(self, diagram, node):

assertion = first(node.outgoingNodes(filter_on_edges=f1, filter_on_nodes=f4))
if assertion:
value = value and node is not first(assertion.incomingNodes(filter_on_edges=f1, filter_on_nodes=f3))
operand = first(assertion.outgoingNodes(filter_on_edges=f5, filter_on_nodes=f6))
if operand:
if operand.identity() is Identity.Role:
Expand All @@ -605,9 +607,6 @@ def buildIndividualNodeMenu(self, diagram, node):
a.setChecked(a.data() is node.identity())
a.setVisible(a.data() is Identity.Individual and instance or a.data() is Identity.Value and value)

#ADD DESCRIPTION LINK TO THE MENU OF INDIVIDUAL NODE
menu.addAction(self.session.action('node_description'))

#############################################
# END CONSTRAIN IDENTITY SWITCH
#################################
Expand Down
2 changes: 1 addition & 1 deletion eddy/core/items/nodes/property_assertion.py
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ def identify(self):
* If the node has 2 individuals as inputs => Identity == RoleInstance
* If the node has 1 individual and 1 value as inputs => Identity == AttributeInstance
In both the cases, whether we establish or not an idendity for this node,
In both the cases, whether we establish or not an identity for this node,
we mark it for EXCLUSION from the STRONG and WEAK sets. This is due to the
PropertyAssertion node being used to perform assertions at ABox level
while every other node in the graph is used at TBox level. Additionally we
Expand Down

0 comments on commit a72ef52

Please sign in to comment.