Digging variant with tolog

7 views
Skip to first unread message

Pierre Thibault

unread,
Mar 24, 2015, 3:37:39 PM3/24/15
to ont...@googlegroups.com
In 'opera.ltm' the topic of city is quite rich:

  <topic>
   
<subjectIdentifier href="http://psi.ontopedia.net/City"></subjectIdentifier>
   
<name>
     
<scope>
       
<subjectIdentifierRef href="http://www.topicmaps.org/xtm/1.0/language.xtm#cs"></subjectIdentifierRef>
     
</scope>
     
<value>Město</value>
     
<variant>
       
<scope>
         
<subjectIdentifierRef href="http://www.topicmaps.org/xtm/1.0/language.xtm#cs"></subjectIdentifierRef>
         
<subjectIdentifierRef href="http://www.topicmaps.org/xtm/1.0/core.xtm#sort"></subjectIdentifierRef>
       
</scope>
       
<resourceData>Mesto</resourceData>
     
</variant>
   
</name>
   
<name>
     
<scope>
       
<subjectIdentifierRef href="http://www.topicmaps.org/xtm/1.0/language.xtm#no"></subjectIdentifierRef>
     
</scope>
     
<value>By</value>
   
</name>
   
<name>
     
<scope>
       
<subjectIdentifierRef href="http://www.topicmaps.org/xtm/1.0/language.xtm#de"></subjectIdentifierRef>
     
</scope>
     
<value>Stadt</value>
   
</name>
   
<name>
     
<scope>
       
<subjectIdentifierRef href="http://www.topicmaps.org/xtm/1.0/language.xtm#fr"></subjectIdentifierRef>
     
</scope>
     
<value>Ville</value>
   
</name>
   
<name>
     
<scope>
       
<subjectIdentifierRef href="http://www.topicmaps.org/xtm/1.0/language.xtm#it"></subjectIdentifierRef>
     
</scope>
     
<value>Città</value>
     
<variant>
       
<scope>
         
<subjectIdentifierRef href="http://www.topicmaps.org/xtm/1.0/language.xtm#it"></subjectIdentifierRef>
         
<subjectIdentifierRef href="http://www.topicmaps.org/xtm/1.0/core.xtm#sort"></subjectIdentifierRef>
       
</scope>
       
<resourceData>Citta</resourceData>
     
</variant>
   
</name>
   
<name>
     
<value>City</value>
     
<variant>
       
<scope>
         
<subjectIdentifierRef href="http://psi.ontopedia.net/plural"></subjectIdentifierRef>
       
</scope>
       
<resourceData>Cities</resourceData>
     
</variant>
   
</name>
 
</topic>


Is it possible to write a tolog query to access the <resourceData>Cities</resourceData> giving "Cities" as a result?

Dan Speck

unread,
Mar 24, 2015, 7:11:17 PM3/24/15
to Ontopia list
Pierre,

I thought that this would be easier but the documentation IMHO is incomplete. Here is my solution:

using ont for i"http://psi.ontopedia.net/"

select $T, $TNAME, $VARIANT, $VNAME, $SCOPE from
  $T = ont:City,
  $SCOPE = plural,
  topic-name($T, $TNAME),
  variant($TNAME, $VARIANT),
  scope($VARIANT, $SCOPE),
  value($VARIANT, $VNAME)
?

The documentation of variant() in the Built-in tolog Predicates Manual (http://www.ontopia.net/omnigator/docs/query/predicate-reference.html#p-variant) is misleading as it doesn't really show how to obtain the topic name variant in a given scope.

-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.

Pierre Thibault

unread,
Mar 24, 2015, 8:18:15 PM3/24/15
to ont...@googlegroups.com
Thank you Dan,

I had to slightly modify the query to make it work:


select $T, $TNAME, $VARIANT, $VNAME, $SCOPE from
  $T = city,

  $SCOPE = plural,
  topic-name($T, $TNAME),
  variant($TNAME, $VARIANT),
  scope($VARIANT, $SCOPE),
  value($VARIANT, $VNAME)
?

Reply all
Reply to author
Forward
0 new messages