Hello,
I am a newbie to Tolog.
I'm having some difficulties with Tolog. I am trying a query from
Ontopia Tolog documentation:
select $A, count($B) from
composed-by($A : composer, $B : opera)?
I am using Ontopia 5.3.0, the website itself, with the example file ItalianOpera.ltm and the query above returns no row at all.
But if I change the query by changing 'opera' to 'work':
select $A, count($B) from
composed-by($A : composer, $B : work)?
then it returns:
A | B |
---|
Alfano, Franco | 12 |
Puccini, Giacomo | 12 |
Ponchielli, Amilcare | 12 |
Montemezzi, Italo | 8 |
Smareglia, Antonio | 10 |
Franchetti, Alberto | 10 |
Giordano, Umberto | 13 |
Leoni, Franco | 10 |
Leoncavallo, Ruggero | 10 |
Cilèa, Francesco | 7 |
Faccio, Franco | 4 |
Boïto, Arrigo | 2 |
Mascagni, Pietro | 16 |
Catalani, Alfredo | 5 |
Zandonai, Riccardo | 13 |
Verdi, Giuseppe | 28 |
The definition of composed-by is:
[composed-by = "Composed by"
= "Composed" / composer
@"
http://psi.ontopedia.net/composed_by"]
and each time it used with "work":
composed-by( alfano : composer, cyrano-de-bergerac : work )
and "cyrano-de-bergerac" is an opera:
[cyrano-de-bergerac : opera = "Cyrano di Bergerac"
@"
http://psi.ontopedia.net/Cyrano_di_Bergerac"]
So why is the initial query for the tutorial returns no result?
The fix to me is:
select $A, count($B) from
composed-by($A : composer, $B : work),
instance-of($B, opera)?
It gives the same result. I guess all works are opera. Right?
But a problem here is that I don't know the type of the second end of "composed-by". And why would I need to know?
It does not make sense for me. Could someone explain?