Tolog query with /=

瀏覽次數:6 次
跳到第一則未讀訊息

Pierre Thibault

未讀,
2015年3月18日 下午6:03:122015/3/18
收件者:ont...@googlegroups.com
I am using Ontopia 5.3.0, the website itself, with the example file ItalianOpera.ltm and I have difficulties with this query:

instance-of($PERSON, person),
born-in($PLACE : place, $PERSON : person), $PLACE /= "Paris"?

The query is still returning result in Paris. Why? I want to exclude Paris. I also did try with paris but I have the same result.

Dan Speck

未讀,
2015年3月18日 晚上7:55:262015/3/18
收件者:Ontopia list
Pierre,

Tolog is a topic map query language so you need to use topic map constructs when querying. Here is the query to find all people not born in Paris (actually, all people that are born somewhere that is not Paris):

select $PERSON, $PLACE
from
instance-of($PERSON, person),
born-in($PLACE : place, $PERSON : person), 
$PLACE /= i"http://psi.ontopedia.net/Paris"
?

I would recommend that you read the TAO of Topic Maps: http://www.ontopia.net/topicmaps/materials/tao.html

-dan


--
You received this message because you are subscribed to the Google Groups "ontopia" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ontopia+u...@googlegroups.com.
To post to this group, send email to ont...@googlegroups.com.
Visit this group at http://groups.google.com/group/ontopia.
For more options, visit https://groups.google.com/d/optout.

Steve Pepper

未讀,
2015年3月19日 凌晨4:02:212015/3/19
收件者:ont...@googlegroups.com

Pierre,

 

You could also simply replace your "Paris" with paris. (I think – it’s been a while since I worked with this stuff J)

 

The point is that tolog requires identifiers, not names (unless you specifically use the topic-name predicate). Whether you use the (more robust) subject identifier (as Dan suggests), or the item identifier (as above), is up to you. But since you’ve used item identifiers elsewhere (e.g. instance-of($PERSON, person), I thought I’d just mention this. Just remember that item identifiers are case-sensitive and don’t require quotes.

 

Good luck!

 

Steve

Pierre Thibault

未讀,
2015年3月19日 上午8:52:312015/3/19
收件者:ont...@googlegroups.com

Le mercredi 18 mars 2015 19:55:26 UTC-4, Dan Speck a écrit :
Pierre,

Tolog is a topic map query language so you need to use topic map constructs when querying. Here is the query to find all people not born in Paris (actually, all people that are born somewhere that is not Paris):

select $PERSON, $PLACE
from
instance-of($PERSON, person),
born-in($PLACE : place, $PERSON : person), 
$PLACE /= i"http://psi.ontopedia.net/Paris"
?


Thank you Dan. This is working very well.


I would recommend that you read the TAO of Topic Maps: http://www.ontopia.net/topicmaps/materials/tao.html

Yes, I did. It was very helpful.
 

Pierre Thibault

未讀,
2015年3月19日 上午9:00:482015/3/19
收件者:ont...@googlegroups.com

Le jeudi 19 mars 2015 04:02:21 UTC-4, Steve Pepper a écrit :

Pierre,

 

You could also simply replace your "Paris" with paris. (I think – it’s been a while since I worked with this stuff J)

It does not work.
 

 

The point is that tolog requires identifiers, not names (unless you specifically use the topic-name predicate). Whether you use the (more robust) subject identifier (as Dan suggests), or the item identifier (as above), is up to you. But since you’ve used item identifiers elsewhere (e.g. instance-of($PERSON, person), I thought I’d just mention this. Just remember that item identifiers are case-sensitive and don’t require quotes.


I am unable to use the topic-name predicate. An example would be appreciated.
 

 

Good luck!

Thank you Steve.
 
回覆所有人
回覆作者
轉寄
0 則新訊息