![]() |
![]() |
![]() |
||||||||||||||
| Reification < A TMAPI Tutorial < < Home | ||||||||||||||||
|
ReificationReification - in the TMAPI sense - is used to make a specific part of a map a topic itself, so that we are able to make statements about it. This more advanced use of Topic Maps is often avoided by beginners (and probably rightly so), but it can be quite useful to qualify information. In our example, we show how an occurrence - so the relationship between a topic and a URI reference - can be reified. For this purpose we first create a source locator for the homepage of Sydney airport (ocSydAirportHP from above) and attach it to the existing ocurrence: Locator srcLocWP = tMap.createLocator (
tMap.getBaseLocator().getReference() +
"#sydney-airport-homepage" );
ocSydAirportHP.addSourceLocator ( srcLocWP );
After that we create another topic and make it identify this very occurrence:
Topic tocSydAirportHP = tMap.createTopic(); tocSydAirportHP.addSubjectIdentifier ( srcLocWP ); Once the topic tocSydAirportHPstands for the occurrence, we can use it as part of associations to make statements about it. Examples for this could be, for instance, that we have found the link via Google using a particular search string or that this particular occurrence was added by a particular person. Reification not only works for occurrences, but also for whole TopicMaps, TopicNames (and the rather exotic Variant which we choose not to mention). It also works for associations, where reification is more useful. To see this, let us reify the association assoc between the airports Sydney and Tokyo we had before. This association actually is about a particular flight. To add flight information, such as the flight number JL772 we have to create a topic first: Topic tJL772 = tMap.createTopic(); tJL772.createTopicName ( "Japan Airlines Flight 772", null ); tJL772.createOccurrence ( "JL772", tFlightNumber, null );Then we can connect that topic with the association by (a) adding a source locator to the association and (b) using that as subject locator in the topic: Locator locAssoc = tMap.createLocator ( tMap.getBaseLocator().getReference() +
"#sydney-tokyo-flight" );
assoc.addSourceLocator ( locAssoc );
tJL772.addSubjectIdentifier ( locAssoc );
|
|||||||||||||||