小男孩‘自慰网亚洲一区二区,亚洲一级在线播放毛片,亚洲中文字幕av每天更新,黄aⅴ永久免费无码,91成人午夜在线精品,色网站免费在线观看,亚洲欧洲wwwww在线观看

分享

PSIs for Topic Maps constructs | Larsblog

 昵稱9011 2006-05-31

One thing that‘s lacking in the current set of Topic Maps standards is defined identifiers for the Topic Maps constructs, like subject, topic, association, etc. The TMDM doesn‘t really need this for its own purposes, but it does mean that there are some semantics that aren‘t described as fully as they could be. There are also other standards (TMCL and TMQL) which could make use of such identifiers (with additional semantics).

Notation

How to define the identifiers is dead easy, but how would we define the semantics? In this blog entry I use a rather ad-hoc solution: a set of tolog update statements which add to the topic map the information that is implied by these topic map constructs. The syntax is INSERT ... FROM ... where the first part contains an LTM template using variables whose values are defined by the tolog query in the FROM. This syntax is not defined anywhere, and not necessarily beautiful, but it gets the job done.

You can (informally) interpret this in several ways:

  • The tolog queries specify the statements implied by these concstructs
  • Topic Maps that contain this additional information mean the same thing (or contain the same information, if you like) as Topic Maps that do not
  • Queries against Topic Maps should produce the same result whether the information specified by the tolog query is present in the topic map or not

I‘ll use the PSI prefix tm: here, but I won‘t define what it stands for, since these PSIs don‘t actually exist. I‘m just trying out ideas here, not defining anything for real.

Identifiers and semantics

tm:subject

The term "subject" is defined very clearly in the standard as being absolutely anything at all. This is clearly a class, and it‘s equally clear that there isn‘t anything that isn‘t an instance of this class (including tm:subject itself).

INSERT
[$topic : tm:subject]
FROM
topic($topic)

In other words, every topic is an instance of tm:subject.

INSERT
tmdm:supertype-subtype(tm:subject : tmdm:supertype, $type : tmdm:subtype)
FROM
instance-of($type, tmdm:type)

In other words, every type is a subtype of tm:subject.

tm:topic

This is an interesting term, because none of the topics in the topic map actually represent topics. This may sound like it‘s wrong, but stop for a moment to consider the following:

[lmg : person = "Lars Marius Garshol"]

Clearly, lmg is a subject (because everything is). But is lmg a topic? Yes. But lmg does not represent a topic; it represents a person, and persons are not topics.

So does topic have any semantics? Well, in a sense it does: every topic is a topic map construct. But we will specify this when we get to that term.

tm:topic-map-construct

This is the common supertype for topics, associations, and all the other constructs that can appear in a topic map. The semantics are easily defined as given below.

[tm:topic-map-construct = "Topic map construct"]
tmdm:supertype-subtype(tm:topic-map-construct : tm:supertype, tm:topic : tm:subtype)
tmdm:supertype-subtype(tm:topic-map-construct : tm:supertype, tm:association : tm:subtype)
tmdm:supertype-subtype(tm:topic-map-construct : tm:supertype, tm:association-role : tm:subtype)
tmdm:supertype-subtype(tm:topic-map-construct : tm:supertype, tm:occurrence : tm:subtype)
tmdm:supertype-subtype(tm:topic-map-construct : tm:supertype, tm:topic-name : tm:subtype)
tmdm:supertype-subtype(tm:topic-map-construct : tm:supertype, tm:topic-map : tm:subtype)
tmdm:supertype-subtype(tm:topic-map-construct : tm:supertype, tm:variant-name : tm:subtype)

Subtypes of tm:topic-map-construct

There is not really a whole lot unsaid about these from the formal point of view, so we say no more here.

tm:type

This term doesn‘t actually exist, but we need it for the semantics defined above, so we define it. The definition can easily be done in LTM alone.

[tm:type = "Type"]
tmdm:supertype-subtype(tm:type : tm:supertype, tm:topic-type : tm:subtype)
tmdm:supertype-subtype(tm:type : tm:supertype, tm:association-type : tm:subtype)
tmdm:supertype-subtype(tm:type : tm:supertype, tm:association-role-type : tm:subtype)
tmdm:supertype-subtype(tm:type : tm:supertype, tm:occurrence-type : tm:subtype)
tmdm:supertype-subtype(tm:type : tm:supertype, tm:name-type : tm:subtype)

Given this definition, we also know what it means to be a type. Once we‘ve defined the semantics of the subtypes we should be OK. There is one more thing, though. Anything that is a supertype or subtype of something else must itself be a type. We specify this formally as follows.

INSERT
[$type : tm:type]
FROM
{ tmdm:supertype-subtype($type : tmdm:supertype, $stype : tmdm:subtype) |
tmdm:supertype-subtype($stype : tmdm:supertype, $type : tmdm:subtype) }

tm:topic-type

A topic type is something that‘s either declared to be a topic type (by this being stated explicitly), or that‘s used as a topic type. The former case needs no handling, and the latter is handled below.

INSERT
[$type : tm:topic-type]
FROM
instance-of($instance, $type)

tm:association-type

The same logic goes for association types, so we provide similar semantics:

INSERT
[$type : tm:association-type]
FROM
type($assoc, $type), association($assoc)

tm:association-role-type

Same here.

INSERT
[$type : tm:association-role-type]
FROM
type($ar, $type), association-role($assoc, $type)

tm:occurrence-type

INSERT
[$type : tm:occurrence-type]
FROM
type($occ, $type), occurrence($occ, $type)

tm:name-type

INSERT
[$type : tm:name-type]
FROM
type($name, $type), topic-name($name, $type)

tm:information-resource

Now this is an interesting term, since it allows us to spell out one part of the meaning of the subject locator construct, which is that any topic which has a subject locator must necessarily represent an information resource.

INSERT
[$res : tm:information-resource]
FROM
subject-locator($res, $uri)

tm:statement

This is another interesting term. Every association, topic name, variant, and occurrence is a statement in Topic Maps.

[tm:statement = "Statement"]
tmdm:supertype-subtype(tm:statement : tm:supertype, tm:association : tm:subtype)
tmdm:supertype-subtype(tm:statement : tm:supertype, tm:occurrence : tm:subtype)
tmdm:supertype-subtype(tm:statement : tm:supertype, tm:topic-name : tm:subtype)
tmdm:supertype-subtype(tm:statement : tm:supertype, tm:variant-name : tm:subtype)

tm:supertype-subtype

The semantics that need to be defined here are only the transitivity of this association type, which are easily defined:

subtype-of($SUP, $SUB) :- {
tmdm:supertype-subtype($SUP : tm:supertype, $SUB : tm:subtype) |
tmdm:supertype-subtype($SUP : tm:supertype, $MID : tm:subtype),
subtype-of($MID, $SUB)
}.
INSERT
tmdm:supertype-subtype($SUPER : tm:supertype, $SUB : tm:subtype)
FROM
subtype-of($SUPER, $SUB)

tm:type-instance

The type-instance relationship is trivial, once the above is taken care of.

/* using subtype-of from above */
INSERT
[$instance : $supertype]
FROM
direct-instance-of($instance, $type),
subtype-of($supertype, $type)

    本站是提供個(gè)人知識(shí)管理的網(wǎng)絡(luò)存儲(chǔ)空間,所有內(nèi)容均由用戶發(fā)布,不代表本站觀點(diǎn)。請(qǐng)注意甄別內(nèi)容中的聯(lián)系方式、誘導(dǎo)購(gòu)買等信息,謹(jǐn)防詐騙。如發(fā)現(xiàn)有害或侵權(quán)內(nèi)容,請(qǐng)點(diǎn)擊一鍵舉報(bào)。
    轉(zhuǎn)藏 分享 獻(xiàn)花(0

    0條評(píng)論

    發(fā)表

    請(qǐng)遵守用戶 評(píng)論公約

    類似文章 更多