//
var top1,oc,sc,a1 var map=new topicMap('tm-team-bombers') // ============ Base Types ============ add_topic(map,'tt-topicmap','Topic Map Type') add_topic(map,'tt-person','Person Type') add_topic(map,'tt-team','Team Type') add_topic(map,'tt-org','Org Type','') add_topic(map,'tt-assoc','Association Type') add_topic(map,'tt-role','Role Type') add_topic(map,'tt-occur','Occurrence Type') add_topic(map,'tt-scope','Scope Type') // ============ Role topics ============ add_topic(map,'rt-team','role: team','tt-role') add_topic(map,'rt-player','role: player','tt-role') add_topic(map,'rt-coach','role: coach','tt-role') add_topic(map,'rt-sponsor','role: sponsor','tt-role') add_topic(map,'rt-caterer','role: caterer','tt-role') // ============ Occurrence topics ============ add_topic(map,'ot-comment','Comment','tt-occur') add_topic(map,'ot-email','Email address','tt-occur') add_topic(map,'ot-homepage','Home page','tt-occur') add_topic(map,'ot-about','About','tt-occur') // ============ Scope topics ============ add_topic(map,'st-email','Email','tt-scope') add_topic(map,'st-person','People','tt-scope') add_topic(map,'st-coach','Coaches','tt-scope') add_topic(map,'st-team','Teams','tt-scope') add_topic(map,'st-player','Players','tt-scope') add_topic(map,'st-team-assoc','Team Information', 'tt-scope') add_topic(map,'st-topicmap','Topic Maps','tt-scope') // ============ Instance topics ============ add_topic(map,'t-bombersmap','Bombers Topic Map', 'tt-topicmap') add_topic(map,'t-bob','Bob','tt-person') add_topic(map,'t-john','John','tt-person') add_topic(map,'t-red','Red','tt-person') add_topic(map,'t-zips',"Zip's",'tt-org') add_topic(map,'t-bombers','Bombers','tt-team') // ============ Association type topics ======= add_topic(map,'at-team','Team Association Type', 'tt-assoc') // ============ Associations ======== a1=new association('a-team-1') a1.instanceOf='at-team' mem=new member('rt-player') mem.addPlayer(map.getTopicById('t-john')) mem.addPlayer(map.getTopicById('t-red')) a1.addMember(mem) mem=new member('rt-coach') mem.addPlayer(map.getTopicById('t-bob')) a1.addMember(mem) mem=new member('rt-team') mem.addPlayer(map.getTopicById('t-bombers')) a1.addMember(mem) mem=new member('rt-sponsor') mem.addPlayer(map.getTopicById('t-zips')) a1.addMember(mem) a1.addScope(new scope('st-team-assoc')) map.addAssoc(a1) // ============ Occurrences ======= oc=new occur() oc.instanceOf='ot-comment' oc.data='Bob is a pretty good coach' top1=map.getTopicById('t-bob') if (top1){top1.addOccur(oc)} oc=new occur() oc.instanceOf='ot-email' oc.data='john@bombers.com' top1=map.getTopicById('t-john') if (top1){top1.addOccur(oc)} oc=new occur() oc.resourceRef='http://www.bombers.com' oc.instanceOf='ot-homepage' top1=map.getTopicById('t-bombers') if (top1){top1.addOccur(oc)} oc=new occur() oc.data='fans@bombers.com' oc.instanceOf='ot-email' sc=new scope('st-email') oc.addScope(sc) if (top1){top1.addOccur(oc)} oc=new occur() oc.instanceOf='ot-comment' oc.data='The leading Zingo team in the North-central \ part of the country today.' if (top1){top1.addOccur(oc)} oc=new occur() oc.instanceOf='ot-about' oc.data= 'This Bombers Topic Map illustrates some key features \ of topic maps. In this simplified example, the list \ of topics can be filtered by any single scope.
\ \ Scopes that are actually applied (to names, occurrences,\ or associations) are listed, to be used for filtering. \
\ You can choose to see instances or occurrences of a \ selected topic, or the associations in which it plays \ some role. However, filtering by scopes hasn\'t been \ applied to the display of associations and occurrences. \ This feature could be added without much trouble.' top1=map.getTopicById('t-bombersmap') if (top1){top1.addOccur(oc)} // ============ Add scopes to names ============== top1=map.getTopicById('tt-person') top1.nameList[0].addScope(new scope('st-person')) top1=map.getTopicById('t-bob') top1.nameList[0].addScope(new scope('st-person')) top1.nameList[0].addScope(new scope('st-coach')) top1=map.getTopicById('t-john') top1.nameList[0].addScope(new scope('st-person')) top1.nameList[0].addScope(new scope('st-player')) top1=map.getTopicById('t-red') top1.nameList[0].addScope(new scope('st-person')) top1.nameList[0].addScope(new scope('st-player')) top1=map.getTopicById('t-bombers') top1.nameList[0].addScope(new scope('st-team')) top1=map.getTopicById('t-bombersmap') top1.nameList[0].addScope(new scope('st-topicmap')) //