HTML Translation for the Semantic web
- 格式:pdf
- 大小:1.05 MB
- 文档页数:33
彼得•纽马克是英国著名的翻译理论家和翻译教育家。
纽马克在分析和总结各家各派的翻译思想的基础上,将文体论、话语分析、符号学、格语法的理论、功能语法和跨文化交际理论应用于翻译理论和研究,对于翻译理论、翻译教学、翻译语言学以及翻译技巧都进行了精辟的论述。
纽马克翻译理论的核心是语义翻译和交际翻译,这也是其翻译理论中最主要、最有特色的组成部分。
他的代表作包括《翻译问题探索》(Approaches to Translation, 1981) 、《翻译教程》(A Textbook of Translation, 1988)、《翻译论》(About Translation, 1991)和《翻译短评》(Paragraphs on Translation, 1993)。
在《翻译问题探索》一书中,纽马克提出,针对不同的文本类型应当采用不同的翻译方法——语义翻译(semantic translation) 或交际翻译(communicative translation)。
根据不同的内容和文体,他将文本分为抒发功能(expressive function)、信息功能(informative function)、呼唤功能(vocative function)、审美功能(aesthetic function)、应酬功能(phatic function)和元语言功能(metalingual function)。
20世纪90年代他又提出“关联翻译法”,这标志着他的翻译理论渐趋系统。
下面本文将就纽马克的主要译论观点进行初步解读,以求对纽马克的翻译理论做更深层次的理解,并将相关翻译标准应用到英汉、汉英翻译中去。
一.语言功能与文本类型纽马克认为,翻译活动即是对文本的翻译,研究翻译不能离开文本。
在修正布勒(Buhler)、雅各布森(Jakobson)功能模式的语言理论基础上,根据不同的内容和文体,纽马克提出了一套自己的文本功能及其分类。
网页制作Dreamweaver外文文献及翻译Dreamweaver 3.0 is the newest version of Dreamweaver-a tool for compiling web pages, introduced by Macromedia Company. Its feature is "what you see is what you get"-this is really a blessing for novice. Also, it has functions for web site management, facilitating design and management of multiple web sites. Fig. 1 is the interface when Dreamweaver 3. 0 is activated.1. A Brief Introduction of Dream weaverCompared with its predecessor Dreamweaver 2.0, Dreamweaver3.0 is more friendly and practical for use in its operating interface, and its function has been further improved. Readers will see it is so easy to create web pages, without writing any page of code to rapidly create dynamic HTML web pages, for example, cartoon and layers; and by using its object browser, it is also possible to create web pages applicable to various platforms and browsers with very good compatibility; and it is also possible to make use of Roundtrip HTML technology provided by Dreamweaver to control the source code generated by Dreamweaver with high precision.More significantly, Dreamweaver provides you with individualized space. Your can create your own object and command, revise menu and quick keys, or even create you own JavaScript to expand Dreamweaver. It is not exaggerated at all that Dreamweaver brings in unlimited space for you to create your web pages.2. A General Description of Dreamweaver Functions(1) documents foundation and useThe documents operation is the homepage manufacture foundation. Dreamweaver not only may found the blank documents and based on the template documents, but also may edit the HTML document which in other procedures founds, for example FrontPage and so on. Dream weaver has also provided the history (History) the kneading board. The historical kneading board has recorded the reader the history which operates in the documents window, it may help you to abolish or the repetition step, and greatly simplified the homepage manufacture process. Chart 2 has demonstrated one demonstration history kneading board method.* Joins the picture and the super linkA homepage only has the text is unable to attract the person, must in the documents China and Canada person other elements. The picture certainly is inevitable, form and ultra link also essential, is abundant can suffice fascinatingly.Dream weaver provided two kinds to insert the person picture the way. The reader may choose the menu to order Insert/Image; Also may select The super link is in the documents the most important part. Had it to be allowed freely to jump from a position to another weaver formidable function has provided the many kinds of links way possibility. The mostcommon link is between the documents link, this regarding Dream weaver said certainly is a cinch. Also may found the special link using Dream weaver, for example uses the E-Mail linking the homepage, in order to promptly gains the outside each kind of feedback information, this regarding a good website said is extremely important. Also may found the script link, moves the corresponding JavaScript script, thus realizes the corresponding operation.*Website managementThe website management is the Dream weaver essence are partial. Using Dream weaver, may facilitate quickly establishes the local website and the far-end website. Dream weaver may help user's to duplicate far-end server on far-end website on the local computer, constitution local website; Also may duplicate the local website on the far-end server, constitution far-end website. Dream weaver can maintain between the local website and far-end website content synchronization, guaranteed the user carries on the renewal with wishes fulfilled to the far-end website. It also may carry on the test to in the website link, discovers break and the mistake, and carries on the repair, guarantees the website structure the accuracy.Dynamic homepage manufactureThe newest standard HTML 4.0 languages the original will expand some brand-new domains, turned the true abbreviation will be DHTML). But JavaScript and the CSS language is in function formidable DHTML the most main part. CSS and the JavaScript coordination use, may extremely simply realize the homepage dynamic effect.(2) Dream weaver 3.0 new functionsDream the weaver 3.0 new characteristics strengthened the function, improved the website management, the permission user increase navigation fence (Navigation Bar), the picture map (Images Maps) and so on the element, causes the work flow, the user and expands Dream weaver.(a) HTML edition functionFast label editorCauses the user not to need to leave Dream the weaver documents window to be allowed fast to revise, the increase, to move the HTML label.HTML styleIn 3.0 may use the standard HTML label in Dream weaver which the multi- browsers supports to found the style (for instance label and label), but in the before edition, only could use the level to fold the style list (CSS).(c) Founds and the edition object and the page elementThe user may be allowed with ease to obtain the commonly used object in the object kneading board. 1662。
传播学视角下的网页汉英翻译--兼评故宫博物院英语网页翻译孙建成 李昕亚(天津财经大学,300222)摘要 本文在传播学视角下,阐述了汉英翻译活动这一跨语言、跨文化传播活动的过程和特点, 并结合网络传播的特点,从传播学角度对故宫博物院英文网页中的总说部分进行了评析,探讨了网页翻译的特点和方法。
关键字 大众传播 网络传播 传播者 受传者Abstract Chinese to English translation process, an interlingual and intercultural process, is approached from the perspective of mass communication in this paper. Under the framework of mass communication, the Chinese to English translation of General Introduction of the Palace Museum on the website is evaluated in an effort to explore features and methods in C-E webpage translation.Key Words mass communication web communication the source the receptor1. 引言在信息技术发达的今天,大众传播在经历了语言传播、文字传播、印刷传播和模拟式电子传播革命之后,1 进入了以网络传播为特征的信息传播阶段。
各国纷纷借助互联网,搭建网上平台,占据信息传播的要地。
由于网络传播具有受众面广、传播速度快、互动及时等特点, 已成为各国进行对外宣传不可缺少的方式。
各国政府及社会组织利用先进的网络技术,借助第四媒体--网络媒体,建立英语网站,积极传播本国的文化。
HTML语言与网页设计题库(含答案)第1题判断正误(1)HTML标记符的属性一般不区分大小写。
(对)(2)网站就是一个链接的页面集合。
(对)(3)将网页上传到Internet时通常采用FTP方式。
(对)(4)所有的HTML标记符都包括开始标记符和结束标记符。
(错)(5)用H1标记符修饰的文字通常比用H6标记符修饰的要小(错)。
(6)B标记符表示用粗体显示所包括的文字。
(对)(7)GIF格式的图象最多可以显示256种颜色。
(对)(8)HTML表格在默认情况下有边框。
(错)(9)创建图象映射时,理论上可以指定任何形状作为热点。
(对)(10)指定滚动字幕时,不允许其中嵌入图象。
(错)(11)在HTML表格中,TD和TH标记符都可以用来包括单元格内容。
(对)(12)在HTML表格中,表格的行数等于TR标记符的个数。
(对)(13)在HTML表格中,表格的列数等于任意一行中TH与TD的个数。
(错)(14)在HTML表格中,表格的列数等于任意一行中TH与TD的colspan属性的和。
(错)(15)在HTML表格中,表格的列数等于第一行中TH与TD的colspan属性的和。
(对)(16)在HTML表格中,在TR、TD或TH标记符中使用align 属性可以控制单元格内容的垂直对齐。
(错)(17)HTML表格内容的垂直对齐方式默认为垂直居中。
(对)(18)框架是一种能在同一个浏览器窗口中显示多个网页的技术。
(对)(19)要想在一个网页中嵌套另外一个网页,一般可以使用页内框架。
(对)(20)只有在框架结构的网页中,才能将A标记符的target属性指定为_blank,从而使超链接目标文件在一个新的浏览器窗口中打开。
(21)在HTML中,与表格一样,表单也能嵌套。
(错)(22)一个网页中只能包含一个表单。
(错)(23)在HTML表单中,文本框、口令框和复选框都是用INPUT标记符生成的。
(对)(24)在HTML表单中,提交按钮和重置按钮都可以用图象表示。
翻译的定义1词典定义:1)Translation is the communication of the meaning of a source-language text by means of an equivalent target-language text.-------- From Wikipedia, the free encyclopedia翻译,是指在准确通顺的基础上,把一种语言信息转变成另一种语言信息的活动。
2)《辞海》:把一种语言文字的意义用另一种语言文字表达出来。
3)《牛津英语词典》:在保留意义的情况下从一种语言转变成另一种语言4) Changing (speech or writing) from one language into another.-------------- Longman Dictionary of Contemporary English) 5)2 国内学者下的定义:老舍:翻译不是结结巴巴的学舌,而是漂漂亮亮的再创造傅雷:翻译如临画, 如伯乐相马,'重神似, 不重形似',得其精而忘其粗, 再其内而忘其外萧乾:翻译好象走钢丝,实在艰难……郭沫若:创作是处女, 翻译是媒婆。
---------黄忠廉.翻译本质论〔M〕.武汉:华中师范大学出版社,2000.14 -15 .茅盾:文学的翻译是用另一种语言,把原作的艺术意境传达出来,使读者在读译文的时候能够像读原作一样得到启发、感动和美的感受”。
(1954 年, 茅盾在当年全国文学翻译工作会议上所做的《为发展文学翻译事业和提高翻译译质量而奋斗》所作的报告)------矛盾.为发展文学翻译事业和提高翻译质量而奋斗[A] .罗新璋.翻译论集[C] , 北京:商务印书馆, 1984.朱维之:翻译是一种艺术……这是一种难度较大的艺术工作, 不但要把原著的字句翻译出来, 更主要的是要把它的思想、精神传达出来, 还要把作者的特殊风格表露出来.------翻译通讯编辑部.翻译研究论文集:1949 -1983[C]. 北京:外语教学与研究出版社,1984.许渊冲:翻译的艺术就是通过原文的形式(或表层),理解原文的内容(或深层),再用译文的形式,把原文的内容再现出来。
Html 标签大全: Html Hypertext Markup Language 超文本标记语言 <a></a>超文本链接 <a href="URL"></a>创建超文本链接 ,其中的 url 为链接目标地址href:Hypertext Reference 的缩写。
意思是超文本引用<a>anchor 的缩写。
anchor ['æŋkə ] 基本解释 n. 锚, 铁锚的。
URL全球资源定位器(Uniform Resource Locator) <h1align="center">this is a heading</h1> HTML 标题(Heading)是通过<h1> - <h6>等标签进行定义的 W3C 指出 h1-h6 标签可定义标题。
h1 定义最大的标题。
h6 定义最小的标题。
h 标签是成对出现 的,以<h>开始,以</h>结束 align="center"中间对齐align:排列、对齐、对准<p>this is a Paragraph</P>Paragraph----段落的意思<imgsrc="w3school.jpg" width="104" height="142" />img:image 的缩写,图像, src,source,资源 <br>标签是空标签(意味着它没有结束标签,因此这是错误的:<br></br>)。
有换行的作用Barter rabbet 的缩写 barter:交易,rabbet 槽 <body bgcolor=”yellow”> </body> breakBgcolor 中的 bg 是 background 的缩写 bgcolor 意为:背景颜色<table border="1"> </table>table:表格, border:['bɔ :də ]边缘、边沿、边界表格边框的设置从这里开始是按照字母排序开始的,可以对照文本 HTML 属性(按字母排序)/tags/index.asp<!- ->定义注释 <! DOCTYPE>定义文档类型的缩写文档类型 doctype:document type <abbr>定义缩写 abbr : abbreviation,[ə ,bri:vi'eiʃ ə n]缩写,省略; <acronym>定义只取首字母的缩写 acronym:['ækrə nim],首母缩略字 <address>定义文档作者或拥有者的联系信息 address:地址根据例题解释标签<html> <body> <p>请点击图像上的星球,把它们放大。
Translation EquivalenceDespite the fact that the world is becoming a global village, translation remains a major way for languages and cultures to interact and influence each other. And name translation, especially government name translation, occupies a quite significant place in international exchange.It is generally accepted that translation, not as a separate entity, blooms into flower under such circumstances like culture, societal functions, politics and power relations. Nowadays, the filed of translation studies is immersed with abundantly diversified translation standards, with no exception that some of them are presented by renowned figures and are rather authoritative. In the translation practice, however, how should we select the so-called translation standards to serve as our guidelines in the translation process and how should we adopt the translation standards to evaluate a translation product?In the macro - context of flourish of linguistic theories, theorists in the translation circle, keep to the golden law of the principle of equivalence. The theory of Translation Equivalence is the central issue in western translation theories. And the presentation of this theory gives great impetus to the development and improvement of translation theory. It’s not difficult for us to discover that it is the theory of Translation Equivalence that serves as guidelines in government name translation in China. Name translation, as defined, is the replacement of the name in the source language by an equivalent name or other words in the target language. Translating Chinese government names into English, similarly, is replacing the Chinese government name with an equivalent in English.Metaphorically speaking, translation is often described as a moving trajectory going from A to B along a path or a container to carry something across from A to B. This view is commonly held by both translation practitioners and theorists in the West. In this view, they do not expect that this trajectory or something will change its identity as it moves or as it is carried. In China, to translate is also understood by many people normally as“ to translatethe whole text sentence by sentence and paragraph by paragraph, without any omission, addition, or other changes. In both views, the source text and the target text must be“the same”. This helps explain the etymological source for the term “translation equivalence”. It is in essence a word which describes the relationship between the ST and the TT.Equivalence means the state or fact or property of being equivalent. It is widely used in several scientific fields such as chemistry and mathematics. Therefore, it comes to have a strong scientific meaning that is rather absolute and concise. Influenced by this, translation equivalence also comes to have an absolute denotation though it was first applied in translation study as a general word. From a linguistic point of view, it can be divided into three sub-types, i.e., formal equivalence, semantic equivalence, and pragmatic equivalence. In actual translation, it frequently happens that they can not be obtained at the same time, thus forming a kind of relative translation equivalence in terms of quality. In terms of quantity, sometimes the ST and TT are not equivalent too. Absolute translation equivalence both in quality and quantity, even though obtainable, is limited to a few cases.The following is a brief discussion of translation equivalence study conducted by three influential western scholars, Eugene Nida, Andrew Chesterman and Peter Newmark.It’s expected that their studies can instruct GNT study in China and provide translators with insightful methods.Eugene NidaEugene A. Nida’s definition of translation is : “Translation consists in reproducing in the receptor language the closest natural equivalent of the source language message , first in terms of meaning and secondly in terms of style.” It’s a replacement of textual material in one language〔SL〕by equivalent textual material in another language〔TL〕. The translator must strive for equivalence rather than identity. In a sense, this is just another way of emphasizing the reproducing of the message rather than the conservation ofthe form of the utterance. The message in the receptor language should match as closely as possible the different elements in the source language to reproduce as literally and meaningfully as possible the form and content of the original. Translation equivalence is an empirical phenomenon discovered by comparing SL and TL texts and it’s a useful operational concept like the term “unit of translation”.Nida argues that there are two different types of equivalence, namely formal equivalence and dynamic equivalence. Formal correspondence focuses attention on the message itself, in both form and content, whereas dynamic equivalence is based upon “the principle of equivalent effect”.Formal correspondence consists of a TL item which represents the closest equivalent of a ST word or phrase. Nida and Taber make it clear that there are not always formal equivalents between language pairs. Therefore, formal equivalents should be used wherever possible if the translation aims at achieving formal rather than dynamic equivalence. The use of formal equivalents might at times have serious implications in the TT since the translation will not be easily understood by the target readership. According to Nida and Taber, formal correspondence distorts the grammatical and stylistic patterns of the receptor language, and hence distorts the message, so as to cause the receptor to misunderstand or to labor unduly hard.Dynamic equivalence is based on what Nida calls “the principle of equivalent effect”where the relationship between receptor and message should be substantially the same as that which existed between the original receptors and the message. The message has to be modified to the receptor’s linguistic needs and cultural expectation and aims at complete naturalness of expression. Naturalness is a key requirement for Nida. He defines the goal of dynamic equivalence as seeking the closest natural equivalent to the SL message. This receptor-oriented approach considers adaptations of grammar, of lexicon and of cultural references to be essential in order to achieve naturalness; the TL should not show interference from the SL, andthe‘foreignness’of the ST setting is minimized.Nida is in favour of the application of dynamic equivalence, as a more effective translation procedure. Thus, the product of the translation process, that is the text in the TL, must have the same impact on the different readers it was addressing. Only in Nida and Taber's edition is it clearly stated that dynamic equivalence in translation is far more than mere correct communication of information.Andrew ChestermanAs Andrew Chesterman points out in his recent book Memes of Translation, equivalence is one of the five supermemes of translation theory, standing shoulder to shoulder with source-target, untranslatability, free-vs-literal, All-writing-is-translating in importance. Pragmatically speaking, obser ved Chesterman, “the only true examples of equivalence (i.e., absolute equivalence) are those in which an ST item X is invariably translated into a given TL as Y, and vice versa. Typical examples would be words denoting numbers (with the exception of contexts in which they have culture-bound connotations, such as “magic” or “unlucky”), certain technical terms (oxygen, molecule) and the like. From this point of view, the only true test of equivalence would be invariable back-translation. This, of course, is unlikely to occur except in the case of a small set of lexical items, or perhaps simple isolated syntactic structure”.Peter NewmarkDeparting from Nida’s receptor-oriented line, Newmark argues that the success of equivalent effect is“illusory”and that th e conflict of loyalties and the gap between emphasis on source and target language will always remain as the overriding problem in translation theory and practice. He suggests narrowing the gap by replacing the old terms with those of semantic and communicative translation. The former attempts to render,as closely as thesemantic and syntactic structures of the second language allow, the exact contextual meaning of the original, while the latter“attempts to produce on its readers an effect as close as possible to that obtained on the readers of the original.” Newmark’s description of communicative translation resembles Nida’s dynamic equivalence in the effect it is trying to create on the TT reader, while semantic translation has similarities to Nida’s forma l equivalence. Meanwhile, Newmark points out that only by combining both semantic and communicative translation, can we achieve the goal of keeping the ‘spirit’ of the original. Semantic translation requires the translator retain the aesthetic value of the original, trying his best to keep the linguistic feature and characteristic style of the author. According to semantic translation, the translator should always retain the semantic and syntactic structures of the original. Deletion and abridgement lead to distortion of the author’s intention and his writing style.。
N3 Rules Processing and HTML Translation for the Semantic webChun Yip LeungDigital Media Systems LaboratoryHP Laboratories BristolHPL-2003-199October 2nd , 2003*E-mail: chun.leung@N3,forward chained rules, RDF translation, semantic web The semantic web is an emerging technology that could totally change how web works. It is based on the Resource Description Framework (RDF) which defines graphs to represent links between data. RDF/XML is the common format to store RDF graphs while N3 is another instant to represent RDF and provides powerful function like rules representation.* Internal Accession Date Only Approved for External Publication © Copyright Hewlett-Packard Company 2003N3R u l e s P r o c e s s i n g a n dH T M L T r a n s l a t i o n f o r t h eS e m a n t i c w e bAuthor: Chun Yip Leung (chun.leung@)Keyword: N3; Forward Chained Rules; RDF Translation; Semantic WebAbstractThe semantic web is an emerging technology that could totally change how web works. It is based on the Resource Description Framework (RDF) [0] which defines graphs to represent link s between data. RDF/XML is the common format to store RDF graphs while N3 is another i n stant to represent RDF and provides powerful function like rules representation.In this report we will discuss how to connect N3 rules to the Jena2’s rule processing system and also use the new system to solve the visual representation problem o n browsing RDF.AcknowledgementsThis report and the project I have been working on within my six-month placement in Hewlett-Packard Labs Bristol gave my invaluable experience and I would like to say thank you to the Jena development team, especially Andy Seaborne, Chris Dollin and Dave Reynolds who gave me many advice throughout.1 IntroductionIn the current web, machines cannot understand the meaning of the links. [1]Figure 1 - The current webWeb browsers use HTTP protocol to access data served by different servers. Documents and resources are linked by hyperlinks and Hypertext is transmitted to present data overweb browsers. When the World Wide Web was designed, the assumption was a person will read the page, not machines. This makes it very hard for information management and processing, especially across different documents.The Semantic Web makes a simple extension to the current web by using binary relationships to capture the meaning between link s and data. [2] That makes it possible to represent machine processable information and lead to automation, integration and reuse of data across various applications. [3]The computer industry has agreed and uses XML standards to give a syntactic structure for describing data. However, XML can be used in many different ways to describe the same data, this makes it too open and arbitrary to support the type of widespread and ad hoc data integration envisaged for the Semantic Web. [4] Therefore a standard syntax - Resource Description Framework (RDF) was introduced.RDF defines a graph model to provide a consistent, standardised way of describing and querying internet resources, from text pages and graphics to audio files and video clips. It gives semantic interoperability, and provides the base layer for building a Semantic Web.[4]2 Problem“The Semantic Web is a vision: the idea of having data on the Web defined and linked in such a way that it can be used by machines not just for display purposes."[6]2.1 Display information represented by RDF in web browsersIn the semantic web, RDF is the base for defining meaning, or relationships, between data. The most common way to store RDF data is to use RDF/XML; however XML syntax is not very good at the visual presentation of information to human beings; when we see XML files written according to the RDF specifications, we know how to interpret them. But that does not mean we could see the meaning straight away.RDF/XML may be much harder to read than this:Therefore, a better mean s of visual presentation would be necessary towards the success of semantic web. The most common way to make visual presentation over the Internet isthe hypertext. It would be a good idea if it is able to use HTML on displaying the information modelled by RDF, in particular RDF/XML, on web browsers.One of the examples is us ing web server to serve FOAF (Friend of a Friend) data stored in RDF over the internet. And throughout this report, I will illustrate how this actually could be done.Moreover, we normally do not want t o display all the information stored within the RDF but only part of the information. For example, we have a collection of FOAF RDF about placement students working in Hewlett-Packard Labs but we only want to display FOAF data on a particular person, say a bout “Johnny”. And within Johnny’s data, we might only want a certain bit being displayed.The principle is same as report generation in general I.T. industry but our data source is any data modelled in RDF. This could be done in XSLT up to a point if data is stored in XML format, but the XML’s tree structure and centric design make it not so effective. This happened because for the same graph, we could have different RDF/XML representation, as RDF focused on representing semantic, that means there are inf inity ways to store the same semantic within the RDF/XML documents, that means we have to obtain the data within the semantic level.The good thing about RDF is that there is a graph represented by it. The logical meaning, or semantic will not be affected on the representation method and therefore the translation should not be effected if the RDF data is provided in RDF/XML, N3, N-triples or in different type of Jena model.2.2 Customizable systemWhen the data was presented over web browsers, it would also be great if th e layout is not limited but any customizable layout.The primary aim is d ifferent types of template could be easily created and the system could generate the HTML output according to the template so we could have whatever needed.The further aim would be minimize the learning curve on how the configuration could be done. The system developer might need to understand the semantic web technology deeply and programming on declarative rules are required on serving different RDF data based on different schema, but the learning curve of the system administrator should be much shorter in order to configure the system.The HTML template is based in normal HTML but with embedded tags, known as taglibs, and normal web developer or website administrator sho uld be able pick up the technique on template writing in a very short time and create web pages to present RDF data.3 Background3.1 Semantic Web TechnologiesSemantic Web technologies are based on a global naming scheme (URIs), a standardsyntax for describing data (RDF), standard means of describing the properties of that data (rdf-schema) and standard means of describing relationships between data items(ontologies). [5]Figure 2 - The Layer CakeThe principles are:• Everything Identifiable is on SW by URI (Universal Resource Identifiers).• Some properties allow unambiguous identification• Allow effective combination of the independent work of diverse communities.• Support the ability to add new information without insisting that the old be modified.• Provide communities the ability to resolve ambiguities and clarify inconsistencies. • Use descriptive conventions that can expand as human understanding expands.3.1.1 RDF/XMLRDF provides a consistent, standardized way of describing and querying internetresources and it provides the base layer for building a Semantic Web.For instance, telnet(janet_bruten, 3128700) represents the fact that the person objectJanet Bruten has the telnet number 312-8700. For example, if we have the followinggraphs representing relationships: [4]Figure 3 - A simple directed graphThis means:The standard way to record these relationships is via RDF/XML:3.1.2 Notation 3 - N3 [7]N3 is based on RDF standards and equivalent to RDF /XML syntax, but have extra features like rules and formula. N3 is not designed as an alternative to RDF's XML syntax but a language designed for a human -readable and scribblable language. [10]It is easier and simpl e r than the RDF/XML approach. In N3, information is also a collection of statements; each with a subject, verb and object - and nothing else. In a statement, everything is identified by URI. And every statement is ended with a period. For example:is a valid N3 statement. However, Object can be literal to represent different kind of knowledge, we could also have:Another N3 syntax used for saving space is the comma and s e micolon. The comma means the following object has the same subject and predicate, and semicolon means another predicate for same subject. For example,This shows the use of comma and semicolon. By u sing the basic N3 syntax, f or the above Janet Bruten’s example; we could represent the data in N3 format:Sometimes there are things involved in a statement don't actually have any identifier you want to give them - you know one exists but you only want to give the properties. They are blank nodes, and we might represent this by square brackets with the properties inside.That means <#johnny > has <#child> which one is <#age> 4, and one <#age> “3”. Beside N3, there is also another format, called N -triples, for representing RDF data in plain text format. It was designed to be a fixed subset of N3 and N-Triple is the same as N3 until now. So what make N3 so different from normal RDF and powerful?3.1.3 N3 rules and FormulaIn N3, we hav e rules. A simple rule might say something like (in some central heating vocabulary) "If the thermostat temperature is high, then the heating system power is zero", orThe curly brackets here enclose a set of statements. We ca ll it a formula. All formulae are enclosed by the curly brackets. Apart from the fact that the subject and object of the statement are formulae, the thermo example shown above is just a single statement.The “=>” used here is a special predicate, mean s “implies ”. This is used to links formulae. It is actually the short hand of the URI log:implies, or: /2000/10/swap/log#implies .When two formulas linked with log:implies, it is a rule. Therefore all rules are just a different kind of statements.Formulas take us out of the things we can represent using the current RDF/XML; these Rules are not part of standard RDF syntax.As stated above, we could see formula as a collection of statements, for examples: is another instant of valid N3 rules. In fact, a formula could be more than just a collection of statements. We could have variable within a formula. Variable is start with a “?”. Examples or variables are:The rule says, if x is subclass of a, and if a is subclass of b then x is subclass of b.3.2 FOAFFOAF allows the expression of personal information and relationships, by using FOAF vocabularies it is possible to share information about different persons.Here is a very basic document desc ribing a person:This brief example introduces the basics of FOAF. It basically says, "there is a foaf:Person with a foaf:name property of “Chun Leung” and a foaf:mbox_sha1sum property of 1234567890; this person stands in a foaf:homepage relationship to a thing called /~cyl00 and a foaf:img relationship to a thing called /~cyl00/photo/chun.jpg.The full descriptions of all FOAF vocabulariescould be found in/foaf/0.1/. 3.3 Current Jena2 rules system implementationThere are two different type of rules system; forward chained and backward chained. Backward chaining systems are goal-directed, query will run against the data and the rule engine will either prove the statement as true or false, or finds the facts that satisfy the constraints. For example, Prolog is backward chaining.Forward chaining rules systems are data -directed. Rules will run against the current data and new facts will be found and inserted into the dataset if the preconditions have been satisfied. The new rules will also be fired until no new fact have been found. [8]For customizing the output to the selected data, some form of querying is needed. And the intention is to use N3 rules with a fixed set of vocabularies to create the necessary model. Therefore a forward chaining rule processing engine is needed for HTML translation..Jena2 has a build-in rules system w ith forward chain reasoner, backward chaining reasoner, RETE reasoner and hybrid reasoner. However it only runs on its own language, not N3 rules.3.4 Related WorkCurrently, there are a few RDF rule processor and visualization tools available on theweb.3.4.1 CWMCWM is a general-purpose data processor for the semantic web, somewhat like sed, awk,etc. for text files or XSLT for XML. It is a forward chaining reasoner which can be usedfor querying, checking, transforming and filtering information. Its core language is RDF, extended to include rules, and it uses RDF/XML or RDF/N3 (see Notation3 Primer)serializations as required.CWM is written in python; it is part of SWAP, a Semantic Web Application Platform.And there is another backward chained engine call Euler which is interoperable withCWM at the language level.Official web site: /2000/10/swap/doc/cwm.html3.4.2 IsaVizThe most common graphical visualization for RDF is IsaViz. It is a visual environment written by W3C using Jena, for browsing and a uthoring RDF models represented as graphs. It features:• a 2.5D user interface allowing smooth zooming and navigation in the graph• creation and editing of graphs by drawing ellipses, boxes and arcs• RDF/XML, Notation 3 and N-Triple import• RDF/XML, Notation 3 and N-Triple export, but also SVG and PNG exportFigure 4 - IsaVizThe current version is 2.0, and since then IsaViz can render RDF graphs using GSS (Graph Stylesheets), a stylesheet language derived from CSS and SVG for styling RDF models represented as node-link diagrams.Official web site: /2001/11/IsaViz/3.4.3 Brown SauceBrownSauce is a generic RDF browser. It was written by Damian Steer whilst employed at HP Labs Bristol. BrownSauce is free software, released under a BSD style licence.Figure 5 - BrownSauceOfficial web site: /3.4.4 RDF Template language [9]RDF Templates work in a similar fashion to XSLT. It will take RDF graphs and translate it into XML according to the stylesheets. The problem the RDF Template (RDFT) dedicated to solve is exactly the same as our problem. We will discuss RDFT in details later.4 Solution4.1 Overview of the design – the JRPJ systemThe Jena Rule Processing in Java (JRPJ) system consists of two main components; the rules stor e/execution engine and the HTML generator.The system takes in set of rules and collection of RDF data model. The system will use the forward chaining rules engine to process all the data with the given rules.Then user could get the result or if the user use s the specific de fined set of N3 rules and by feeding the result from the rules engine into the HTML generator, in combination of the HTML template; the system could translate the given RDF data into HTML. Here is a more detailed diagram on the system design:T he N3 parser is used to read the N3 rules. By connecting the parser to the rule store,rules and data could be retrieved for execution engine.After the data and rules being read , the execution engine, which extends the Jena’s build -in forward chain reasoner, will process the rules using the data from the Jena model sit on the other end. There could be more than one Jena models but the Jena API already provided an easy way to deal with this with a U nion Model. So we could always treat many graphs as one graph.The execution engine will return a resulting graph which contains all the statements of the result of execution. This graph could be passed to other system, or most importantly, the HTML generator.The HTML generator will read in the HTML template file, and using the information from the resulting RDF graph to generate the HTML. The HTML could be printed out to the system’s standard output, or a java servlet could be used to server the HTML over a servlet enabled web server.4.2 Graph and rules handlingWe know that N3 is just a different, extended version of RDF, therefore the best and simplest way to hold N3 statements is to extend the current Jena’s mechanism of holding graph – which is the Graph interface and the GraphMem , the memory implementation. The main difference of N3 to normal RDF is N3 have formulas. So a new type of node – Node_Formula is added into the Jena’s Node hierarchy. The Node_formula had an enclosed graph to store the collection of statements within this formula and the details will be described in the following section.4.2.1 JRPJ Rule Store Although N3 formulas are just another kind of RDF statements, unfortunately, it is not possible to use Jena model to store the rules directly . However, the similarity makes it possible to extend the Jena’s Graph interface to store N3 statement and this will be the JRPJ rule store.As mentioned before, we will use the GraphMem implementation provided in Jena. It is because normally we will run a small set of rules against a large set of data. So using GraphMem should provide a balance on speed on memory usage.The main task is to implement a new Node type; the Node_Formula , which had an enclosed graph to store the collection of s tatements within this formula.The Node_formula will extends the Jena ’s Node class and provide an enclosed graph for4.2.2 N3 Parser and formula han dlingJena2 has a build-in N3 parser to read normal N3. A new parser handler has been written to handle N3 and its formulas because N3 is not complete to RDF.The new N3RulesReader will be a subclass of the N3Parser . The major change is the used of a newParserHandler . The new parser handler could deal with formula and feed the parsed N3 statements into the JRPJ rule store. The parser will read the N3 rules file and the handler will construct back all the statement and a stack will be used the obtain all t he statements enclosed in formula. Node_formula contain an enclosed graph for the enclosed statement, a new graph will be constructed and put into the Node_formula .Stack was used to handle formula. When the parser saw the start of formula, i.e. a ‘{‘, it will put the token into the stack. Then the following statements will be put into the stack as well until the end of formula, ‘}’ reach. Then all statements in the stack will be dumped into the Node_forumla4.2.3 Connecting and interfacing to Jena ’s Forward Rules SystemThe current version of Jena2 has a simple reasoner that I could reuse the codes and probably extends its functionality. This reasoner does run on use the standard N3 rules but the idea behind is the same so I could extend it and do a little translation on N3 t o use this.The JRFRule extends the FRuleEngine which implements the FRuleEngineI interface RETEEngine could also be used if needed but we use the FRuleEngine as start.To connect the reasoner with the N3 rule store, what have been done is make the rule store as an implementation of the List interface as well. The main idea behind is the Jena’s ForwardChainReasoner expect a List of Rule as argument, and therefore the easiest way is to make the rule store compatible with what the reasoner expected.The following code illustrates how we could translate a N3 statement with Node_formula into Rule easily: And by translating all statements in N3 into the expected Rule , the in-built reasoner could be used for this system.4.3 HTML TranslationIt is the time to move onto the HTML translation. The Rule Processing Unit mentioned above will take a collection of RDF d ata and user defined N3 Rules for execution, resulting a new set of RDF in Jena model.The idea of the HTML translation is to use a template language. The template language consists of a well defined set of N3 rules and a HTML templating syntax. When the rules run against the data, we have a well structured model and using the HTML Template to transform the data into HTML.Moreover, beside HTML generate, it is possible to generate XM L but the system is primary designed for HTML generation, so extensions might be needed on the current system to handle a wider set of template language.4.3.1 Template Language – The HTML templateHere is an example of HTML template we used for displaying FOAF data.All variables are of the form <?JRPJ URI >. And the URI will be used by the HTML generator to match the result from the rules. For example, for the variable <?JRPJ :name/>, the HTML generator will replace this variable with the result of executing the rules about tmp:name. However the “/” is very important, it separate out single variables from multi-line variables.For example, when the HTML system see the following:. That means there would be more than one nick name and the system will repeat the content enclosed within the tag.4.3.2 Template Language – Syntax of N3 rulesIn this section we will discuss the details of the special operators. The prefix used is tmp: </2003/jrpj/htmlTemplate#>. For example, tmp:head is the short hand of /2003/jrpj/htmlTemplate#head .tmp:head Indicates all information will go into head section of a HTML document. The object in the triple indicates which tag will be used to put that information.tmp:body Indicates all information will go into the body of the HTML target. The Object will be the location where this will go.In order for the system to work, you have to specify the head and body, like this:Which means we have a document type tmp:template and it has both a head and body. tmp:title indicates information goes into <title> tag , for e xample:Means this document has a title of “FOAF data” tmp:link indicates information goes into <link> tag, for example:tmp:meta indicates information goes into <meta> tag , for example:The most common operation on the body are: tmp:variable, which indicate the system should replace the variable in the html template , tmp:location tell the system where the content goes to and tmp:content tell the system what is the valueSo, using the above three URI together, we could have:Which means the body have a variable named tmp:line1, and if the system found this variable, it will be replaced by the string “<br>”.So, for example, if we the system sees “<?JRPJ :line1/>” in the HTML template, the output will be “<br>”.tmp:tag and tmp:value are used to support any unsupported tags and XML generation, you could also specify the tag name used using tmp:tag and tmp:value to specify attributes of the tag. For example, if we have the following N3 rules:That means if we have the surname on the FOAF data, then create a font tag with arguments size=12 and color=red, with content value the value of variable y, and replace the tmp:surname variable on the HTML template.The output of the above rule would therefore be:<font size=12 color=red>content extracted from the RDF</font>tmp:a, C reate HTML <a> tag, for example:would create<a href=”url extracted”>homepage</a>tmp:img will create <img> tag for images.tmp:list for multi-valued properties, we might use tmp:list to print it out.. It will just print each value out line by line. However, it is not same as the RDF list.For examples if we have multi-valued properties, then we could use list to handle it.4.3.3 Template Language – Tables RDF to HTML translationTables are more complicated as it has multiple values on multi-rows with orders. So I think one of the best way is rules programmer must define/declare any tables they will be using before the rules that put data into the table.Declaration of tables:The idea is basically the same as before. However, we introduced two new operations, tmp:hasTable and tmp:hasColumns into the our HTML generation system.tmp:hasTable tell the system that the programmer is declaring a table here, and tmp:hasColumns define the columns of this table. To define the columns, RDF list is used, which everything is surround ed by ( ) and in items are separated by space.By using the RDF list, we could make define the order of the column of the table and the system could take care of the ordering when we actually fill in the data using the N3 rules. Using the same style as before, everything inside columns list are blank node. (i.e. [ ]) Within these node, we use tmp:name to define the name of this cell and tmp:content to define the text of the header. As usual, tmp:tag and tmp:value could still be used to create tags.The advantage of using list is everything could be in a defined order of the columns. And tmp:orderBy could be used to define the sorting of rows using which column in this table.We use tmp:hasRow to indicate some data will be a row in this table, then use tmp:hasCell to tell which data will go into which cell.To put data into the table, we could use something like:Or, in our FOAF example:The usage of tmp:location and tmp:content are the same, but the location here means the location within the table, in stead of normal variable in the document.4.3.4 The translationAfter discussing the language itself, the rest it how the translation actually be done. The system simply iterate t h rough the given model, search for know properties and use it to create the HTML trmplate.and it is the same for tables, but before that, tables must be created using table declaration. Then the data will be filled into the table.5 Analysis/Review5.1 PrototypeTwo prototypes had been built to demonstrate this system;they are the command line and the servlet version for HTML generation.5.1.1 Command lineThe command line version is to test out the N3 parsi ng and rules processing ability. The basic usage is:-N3: The RDF data file is in N3 format.-HTML: Enable HTML processingThe system will depend on the arguments passed in and set up the environment. Then will parse the rules, execute the rules against the data using the engine and print the result.After testing, t his prototype successfully parses any common N3 Rules and could execute against the data if HTML is not enabled. And the result will be printed to the standard output.5.1.2 ServletA general servlet had also been developed for serving RDF over web server. All subclass implementation must implement the following functions:These two functions tell the system how to f ind the HTML Template and the RDF data from the given arguments. Normally the HTML template is located at fixed location, for example:Programmer could just return a new HtmlParser without looking at the arguments fed into the system. And for the getJrpj methods, it could be as simple as looking up the files in a specificed location, for example:After the programmers have defined the necessary methods, the following code was used to serve the data.Here are some screen shots for the demo program: (Please see Appendix A for full data used in the demo)This HTML page simply provides a text box to input the name of person you want to view:For this example, we want to read the FOAF’s data about “johnny”. And the following was part of the RDF data we want to display:。