免费视频淫片aa毛片_日韩高清在线亚洲专区vr_日韩大片免费观看视频播放_亚洲欧美国产精品完整版

打開(kāi)APP
userphoto
未登錄

開(kāi)通VIP,暢享免費(fèi)電子書(shū)等14項(xiàng)超值服

開(kāi)通VIP
PSIs for Topic Maps constructs | Larsblog

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]FROMtopic($topic)

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

INSERTtmdm:supertype-subtype(tm:subject : tmdm:supertype, $type : tmdm:subtype)FROMinstance-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]FROMinstance-of($instance, $type)

tm:association-type

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

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

tm:association-role-type

Same here.

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

tm:occurrence-type

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

tm:name-type

INSERT[$type : tm:name-type]FROMtype($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]FROMsubject-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)}.INSERTtmdm:supertype-subtype($SUPER : tm:supertype, $SUB : tm:subtype)FROMsubtype-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]FROMdirect-instance-of($instance, $type),subtype-of($supertype, $type)
本站僅提供存儲(chǔ)服務(wù),所有內(nèi)容均由用戶發(fā)布,如發(fā)現(xiàn)有害或侵權(quán)內(nèi)容,請(qǐng)點(diǎn)擊舉報(bào)
打開(kāi)APP,閱讀全文并永久保存 查看更多類似文章
猜你喜歡
類似文章
construct雙參數(shù)
JS繼承之借用構(gòu)造函數(shù)繼承和組合繼承
javascript構(gòu)造函數(shù),原型和繼承的理解
TDD測(cè)試驅(qū)動(dòng)的javascript開(kāi)發(fā)------ javascript的繼承
JavaScript是如何實(shí)現(xiàn)繼承的(六種方式)
生活服務(wù)
分享 收藏 導(dǎo)長(zhǎng)圖 關(guān)注 下載文章
綁定賬號(hào)成功
后續(xù)可登錄賬號(hào)暢享VIP特權(quán)!
如果VIP功能使用有故障,
可點(diǎn)擊這里聯(lián)系客服!

聯(lián)系客服