Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Syntax support for inverses #79

Open
6 tasks
NicolasRouquette opened this issue Jul 31, 2021 · 12 comments
Open
6 tasks

Syntax support for inverses #79

NicolasRouquette opened this issue Jul 31, 2021 · 12 comments

Comments

@NicolasRouquette
Copy link
Member

User Story

As an ontology author, I would like oml syntactic support for referring to an inverse of a relation entity or of a property that does not have a named inverse so that I can author vocabularies that require this expressiveness..

Detailed Description

Description providing additional details and context.

There are a few places where OML lacks syntax for referring to an inverse relation entity or property:

Specialization of an inverse relation entity.

This is currently not possible. For example, suppose that there is a relation R with domain A and range B and forward property r:

relation entity R [
  from A
  to B
  forward r
]

In OWL functional syntax, the above means (ignoring the rule):

Declaration(Class :R))
Declaration(ObjectProperty :r))
ObjectPropertyDomain(:r, :A)
ObjectPropertyRange(:r, :B)

Elsewhere, one may need to define S, a specialization of the inverse of R for some domain C that may be B or a specialization and for some range D that may be A or a specialization.

It would be useful to define S as follows with a new OML keyword inverse() like the following:

relation entity S :> inverse(R) [
  from C
  to D
  forward s
]

The syntax above would map in OML to the following in functional syntax:

Declaration(Class :S))
SubClassOf(:S, :R)
Declaration(ObjectProperty :s))
ObjectPropertyDomain(:s, :C)
ObjectPropertyRange(:s, :D)
SubObjectPropertyOf(:s ObjectInverseOf(:r))

It is currently not possible to do this.

Restriction of an inverse property

This is currently not possible. For example, suppose that there is a relation R with domain A and range B and forward property r without a named inverse:

relation entity R [
  from A
  to B
  forward r
]

There is currently no syntax to specify a restriction on the inverse of r.

Propose adding new syntax like the following based on a new OML keyword inverse() like the following:

concept C :> A
concept D :> B [
  restricts all relation inverse(r) to C
]

This syntax should be available for all OML restrictions of entity relation properties.

OML syntax extension

The proposed OML keyword inverse() and syntax could be replaced with something else that achieves the expressive intent of this ticket.

Acceptance Criteria

  • Given [Condition], then [Expected Result]
  • Given [Condition], then [Expected Result]
  • Given [Condition], then [Expected Result]

Sub-task List

  • Task 1
  • Task 2
  • Task 3
@melaasar
Copy link
Member

melaasar commented Oct 4, 2021

re: Specialization of an inverse relation entity

Instead, you can do the following and it should have the same intended semantics:

relation entity S :> R [
  from D
  to C
  reverse s
]

@melaasar
Copy link
Member

melaasar commented Oct 4, 2021

re: Restriction of an inverse property

Couldn't you simply add a name to the reverse property?

@NicolasRouquette
Copy link
Member Author

NicolasRouquette commented Oct 4, 2021

Well, to be clear, we need to look at the mapping of :> for a relation entity.

I expect that S :> R means:

  • S.forward :> R.forward
  • S.reverse :> R.reverse

This usually works with asserting D :> B and C :> A, if not, this may be inferred by the reasoner.

That is:

relation entity S :> R [
  from D
  to C
  reverse s
]

and

relation entity S :> R [
  from C
  to D
  forward s
]

mean completely different things.

@melaasar
Copy link
Member

melaasar commented Nov 1, 2021

When you declare:

relation entity S :> R [
  from D
  to C
  reverse s
]

You get:

Declaration(Class :S))
SubClassOf(:S, :R)
Declaration(ObjectProperty :s))
ObjectPropertyDomain(:s, :C)
ObjectPropertyRange(:s, :D)
SubObjectPropertyOf(:s ObjectInverseOf(:r))

In your last comment, if you labeled the forward/reverse, you get the following (which is the same as above):

S.forward  (inverse of s) :> R.forward (r)
S.reverse (s) :> R.reverse (inverse of r)

@NicolasRouquette
Copy link
Member Author

NicolasRouquette commented Nov 1, 2021

In your example, the reverse property of S is a sub-object property of the reverse property of R.

The point of the proposed syntax is to make the forward property of the specializing relation a sub-object property of the reverse property of the specialized relation.

Clarifying the original example:

concept A
concept B

relation entity R [
  from A
  to B
  forward r
]

concept C :> B
concept D :> A

relation entity S :> inverse(R) [
  from C
  to D
  forward s
]

That is:

Declaration(Class :A))
Declaration(Class :B))
Declaration(Class :R))
Declaration(ObjectProperty :r))
ObjectPropertyDomain(:r, :A)
ObjectPropertyRange(:r, :B)


Declaration(Class :C))
SubClassOf(:C, :B)
Declaration(Class :D))
SubClassOf(:D, :A)
Declaration(Class :S))
SubClassOf(:S, :R)
Declaration(ObjectProperty :s))
ObjectPropertyDomain(:s, :C)
ObjectPropertyRange(:s, :D)
SubObjectPropertyOf(:s ObjectInverseOf(:r))

@melaasar
Copy link
Member

melaasar commented Nov 1, 2021

Nic, those inferences are exactly what you get with:

relation entity S :> R [
  from D
  to C
  reverse s
]

Where do you see the difference?

@NicolasRouquette
Copy link
Member Author

The difference is that the domain of S must be C, not D; similarly the range must be D, not C.
Finally, the forward property of S must be the inverse of the forward property of R.

@melaasar
Copy link
Member

melaasar commented Nov 1, 2021

Since "s" is a reverse, its domain is the "to" of the relation (i.e., C), and its range is the "from" of the relation (i.e., D), which is what you want and said above.

@melaasar
Copy link
Member

melaasar commented Nov 1, 2021

and since "s" is a reverse, it becomes subproperty of the super relationentity's reverse. Since R's reverse is unnamed, we can refer to it as inverseOf (r), i.e.,

s :> inverseof (r)

which is what you want.

@NicolasRouquette
Copy link
Member Author

NicolasRouquette commented Nov 1, 2021

This would be a completely different situation.

Consider the original example split in two parts:

relation entity S [
  from C
  to D
  forward s
]

Then later, we can add:

ref relation entity S :> inverse(R), R2, inverse(R3)

or:

ref relation entity S :> R, inverse(R2), R3

The point here is that the two specialization axioms are completely independent of the definition of S and R, R2 and R3; however, it does make a difference whether we specialize the relation R or inverse(R).

@melaasar
Copy link
Member

melaasar commented Nov 1, 2021

OK so the requirement here is to be able to declare the specialization between S and R without having to change S (since this is possible as I suggested).

@NicolasRouquette
Copy link
Member Author

yes

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants