Presentation is loading. Please wait.

Presentation is loading. Please wait.

The Semantic Web – introduction to the basic technology Week 2 - XML Lee McCluskey.

Similar presentations


Presentation on theme: "The Semantic Web – introduction to the basic technology Week 2 - XML Lee McCluskey."— Presentation transcript:

1 The Semantic Web – introduction to the basic technology Week 2 - XML Lee McCluskey

2 Artform Research Group Recap n The Semantic Web is the Vision (not a current reality) of having an internet with resources that are machine understandable or accessible to automated processes - machines should do much more than present the information visually or do human-consumable IR. n Central idea – we agree on a way of SPECIFYING vocabularies rather than agreeing on a particular vocabularies/languages. Then in communication, processes only need to point to the language (vocabulary) they are using. This is much more flexible than a common language. n XML is like a “machine code” in the SW. n Processes on the SW will need to perform reasoning to fully exploit the SW to do Knowledge Acquisition etc.

3 Artform Research Group WWW - A tool for people to access information - Interface to certain (online) databases, and to businesses - Human interface to some services (info retrieval, weather, train timetables etc) The WWW is successful largely through the use of layers of internationally accepted standards (TCP/IP,html) and now the fact that it is - Ubiquitous - Organic + Distributed - Dynamic + Unbounded

4 Artform Research Group WWW - a standard - ‘first generation’ - hand written html pages - ‘second generation’ - dynamic web - pages created by programs to display the results of a process, or the output of a query of an accessed database. Web pages used as an interface to networked processes (services) as well as for general information display.

5 Artform Research Group WWW + Much R&D has been directed at writing programs/services that utilise HTML web info EG the University of California’s travel assistant - a web service that uses other web services (weather, timetables, hotel) to make travel plans in response to a high level directive “I need to be in X on days Y using budget Z” BUT: this is very hard because of the web’s unstructured data.. Eg ISI’s travel assistant has to use a learning program to induce web page ‘wrappers’ before it can reliably extract data.

6 Artform Research Group WWW html example Lee McCluskey McCluskey, Thomas Leo BSc (Maths), MSc (Maths), PhD (Computer Science), MBCS, C.Eng Professor of Software Technology School of Computing and Engineering, University of Huddersfield, Huddersfield, West Yorkshire, HD1 3DH, United Kingdom. email: t.l.mccluskey followed by @hud.ac.uk telephone (direct): (+44) (0) 1484 472247 telephone (internal): 2247 telephone (messages): (+44) (0) 1484 472150 fax: (+44) (0) 1484 421106 room number: CW2/09

7 Artform Research Group Metadata and XML n We can start to giving ‘meaning’ to info on the web using META-DATA eg using tags around data to describe its content. n In XML - eXtensible Mark-up Language - tags are not fixed - one can invent new tags to structure the information in a web page. n XML is considered to be the basis for all semantic web languages - the “machine code” of the new generation web

8 Artform Research Group Rough Hierarchy of Languages in the Semantic Web OWL.. Ontology language DAML.. gives logic RDFS.. gives classes RDF.. gives tuples XML.. gives content

9 Artform Research Group XML Overview n XML is a subset of SGML (standard general mark- up language) which was written originally for electronic documents and publications n XML has the advantages of HTML – it is platform- independent and a standardised language see http://www.w3.org/TR/REC-xml/http://www.w3.org/TR/REC-xml/ But HTML has a FIXED set of tags, and holds no MEANING about the data in its document.

10 Artform Research Group Rough syntax of XML = list of element n XML structures information using TAGS in a composite fashion eg …… n Info between tags is called an “element”

11 Artform Research Group XML n XML allows the content to be structured so that it is easy for a machine to extract meaningful data from an XML page. It is a meta-language – a language used in the description of other languages. n It can be used to structure data in a database, or as a communication language n It can be formatted using a style sheet language called XSL (like CSS for HTML)

12 Artform Research Group Example fred sue xml example This is the message n All tags have a start and end n Tags must be correctly nested as a tree syntax n Tags can have attributes

13 Artform Research Group Example - better fred sue 30 9 2004 xml example this is the message

14 Artform Research Group Elements.. Logically every element has four key pieces: n A name n The attributes of the element n The namespaces in scope on the element n The content of the element The content can be text, comments, more tagged info or Processing Information eg This is meta info about the document

15 Artform Research Group DTD’s n XML is self describing – it uses a DTD (Document Type Definition) to formally describe the structure of its contents n An XML doc is well-formed if its syntax is ok according to the XML standard. It is VALID if additionally it conforms to its DTD n DTD’s are formed so that we can share our document structures with other parties. Knowing our DTD, they can write programs to process our XML documents.

16 Artform Research Group Example with DTD <!DOCTYPE note [ <!ELEMENT to (#PCDATA ]> fred sue xml example this is the message

17 Artform Research Group DTD are like grammars..

18 Artform Research Group DOMs “.. The promise of the Internet is very much tied to interoperability and the value proposition of e-business depends on the ability to truly collaborate with partners and customers in a meaningful and efficient way..” http://www.4infinitesolutions.com/course%20XML%20DTDs_S chema_DOM.htm

19 Artform Research Group DOMs n Document Object Models (DOMs) give an (abstract) program interface for constructing, querying accessing, and manipulating XML documents. n Concrete DOMs define methods and properties (instantiated for each programming language) which can be used to access/change XML documents from programs

20 Artform Research Group The Uniform Resource Identifier (URI) !!! A “URI” is fundamental to the SW – it ‘defines a unique resource’ – a string that uniquely defines something. Often (but not always) URI points to a webpage or an XML document. In XML, element type names (tags) and attribute names may be qualified with a URI – so that the name can be understood globally.

21 Artform Research Group The Uniform Resource Identifier (URI) Example: you need to refer to an ELEMENT annotated by in the document.. http://scom.hud.uk/scomtlm/namespaces/example You would set up a “namespace” in your XML document say tlm = http://scom.hud.uk/scomtlm/namespaces/example Then in your document you would use tlm:email To denote that this tag is the same as the one in http://scom.hud.uk/scomtlm/namespaces/example

22 Artform Research Group Namespaces - xmlns examples … You can also define a default namespace:

23 Artform Research Group exercises Read through some XML tutorials from relevant sites on the web eg n http://www.ddj.com/documents/s=2803/nam1012432263/ n http://www.ddj.com/documents/s=2799/nam1012432259/ http://www.ddj.com/documents/s=2799/nam1012432259/ n http://www.xmlfiles.com/xml/ http://www.xmlfiles.com/xml/ n http://www.dcs.napier.ac.uk/~andrew/xml/ (this has some nice tutorial questions and answers!) http://www.dcs.napier.ac.uk/~andrew/xml/ Try the following exercises: 1. 1. Write a small XML Bibliography, and then write a DTD for it. 2. 2. Write a small XML Address book, and then write a DTD for it. 3. 3. Cut and paste an XSL style-sheet from one of the example websites and try to use it to present your XML files. For the Week ahead: Continue to read through the tutorials, and write down some notes on the meaning and different roles of DTD, XSL, DOM and all the other jargon you come across!


Download ppt "The Semantic Web – introduction to the basic technology Week 2 - XML Lee McCluskey."

Similar presentations


Ads by Google