Presentation is loading. Please wait.

Presentation is loading. Please wait.

Jan Pettersen Nytun, UIA, page 1 Knowledge Representation Part IV The Semantics Web Starting with XML Jan Pettersen Nytun, UiA.

Similar presentations


Presentation on theme: "Jan Pettersen Nytun, UIA, page 1 Knowledge Representation Part IV The Semantics Web Starting with XML Jan Pettersen Nytun, UiA."— Presentation transcript:

1 Jan Pettersen Nytun, UIA, page 1 Knowledge Representation Part IV The Semantics Web Starting with XML Jan Pettersen Nytun, UiA

2 S O P The Semantic Web A W3C recommendation. Common data formats. Allow specification of data about data - which again allows automatic reasoning. Globally unique ids by using the addressing mechanism of the web. Jan Pettersen Nytun, UIA, page 2

3 S O P Jan Pettersen Nytun, UIA, page 3 Some of the W3C hold Specifications – HTML – OWL – RDF – SOAP – SPARQL – SVG – XHTML – XML – XPath – …

4 S O P Jan Pettersen Nytun, UIA, page 4 The Semantic Web Language Stack Hierarchy of languages, where each layer exploits and uses capabilities of the layers below. / XML Schema

5 S O P About Semantic Web Languages Can use XML syntax – E.g., XML Schema can define an element type (~ class) with help of XML syntax. One language may constrain a lower level language – E.g., XML Schema limits XML. One language may extend a lower level language – E.g., RDF Schema (RDFS) extends XML Schema with a richer vocabulary. Jan Pettersen Nytun, UIA, page 5

6 S O P Jan Pettersen Nytun, UIA, page 6 EXtensible Markup Language (XML) / XML Schema

7 XML Jan Pettersen Nytun, UIA, page 7 XML is a general format while html is meant for human readable web pages! XML has no fixed tag vocabulary – hence, users can define their own custom element and attribute names. It has some keywords, e.g., xmlns.

8 S O P Jan Pettersen Nytun, UIA, page 8 XML Syntax in Well-formed Documents The document must have exactly one root element. The following is a well- formed XML document: This is a journal. The basic syntax for one element is: content The following is also correct syntax: start-tagend-tagcontent

9 S O P Jan Pettersen Nytun, UIA, page 9 XML Syntax Continues… The root element can be preceded by an optional XML declaration. E.g., There may be elements inside elements, but XML requires that elements be properly nested, i.e., no overlap. Example: May be a little overweight Lack of iron. A slight attack of shopomania? Attribute Start-tag and end-tag of element medicalsystem

10 S O P xmlns - XML Namespace Gives unique names to elements and attributes. Gives unique names to elements and attributes. xmlns can be used to solve name conflicts inside one xml page, e.g., “table” may be a furniture or a data structure. Jan Pettersen Nytun, UIA, page 10

11 S O P Namespace Examples An xml name space is often a web address. The address may go to a none existing web page - only the URI (URL) addressing mechanism is used. [1]: …. African Coffee Table 80 120 Jan Pettersen Nytun, UIA, page 11

12 S O P Jan Pettersen Nytun, UIA, page 12 XML - UML May be a little bit fat? Lack of iron. A slight attack of shopomania? JournalJournalRecord name:String SSN:String description:String :Journal:JournalRecord name=“Ola” SSN=“1” description=“May be a little bit fat?” :Journal:JournalRecord name=“Kari” SSN=“2” description=“Lack of iron.” :JournalRecord description=“A slight attack of shopomania?” Medical System UML Model Data 1 *

13 What is meant with the following statement: “XML is Syntax”? Syntax: … What is meant with the following statement: “XML is Syntax”? Syntax: …the rules about how words are arranged and connected to make phrases and sentences… Jan Pettersen Nytun, UIA, page 13

14 S O P XML “is Syntax” The custom tags may indicate the meaning of the document's content, e.g.,, and - this can make XML documents at least partly self-describing (to humans). But what is meant by a tag, e.g.,, is not given (the term “musician” is used but not explained). Jan Pettersen Nytun, UIA, page 14

15 S O P Jan Pettersen Nytun, UIA, page 15 From Wikipedia: XML is a generic framework for storing text or any data whose structure can be represented as a tree. May be a little overweight Lack of iron. A slight attack of shopomania? Node child * root 1 DirectedTree 0..1 edge topRoot Why a tree?

16 Jan Pettersen Nytun, UIA, page 16 May be a little overweight Lack of iron. A slight attack of shopomania? medicalsystem journal journalrecord name “Ola Norman" id “1" name “Kari Norman" id “2" “May be a little overweight " “Lack of iron." “A slight attack of shopomania?" Where did the start- and end-tags go? What about the order of things?

17 S O P Node name : String Attribute Element value : String * 0..1 container Building blocks for defining an XML document (Using UML) Attribute Element Text (A bit simplified) textContent : String content Is this an instance model?

18 Example (simplified): XML document (= instance of some XML schema)): … ….. An XML Schema functioning as model Jan Pettersen Nytun, UIA, page 18

19 S O P URI [1] A URI (a Uniform Resource Identifier) is used to uniquely identify a resource. A URI is a string that refers to a resource, such as a web page, a person, or a corporation. In some cases it is just an (empty) web address. Jan Pettersen Nytun, UIA, page 19

20 S O P Uniform Resource Locator (URL) … a URL is a subset of URI that specifies where an identified resource is available and the mechanism for retrieving it… … often incorrectly used as a synonym for URI… Jan Pettersen Nytun, UiA, Ontologies, page 20 From Wikipedia:

21 S O P URI/URL [1] Often URIs use the syntax of web addresses since they are unique. A "#" in a URI denotes an individual that is referred to in a web page. For example, http://cs.ubc.ca/ ∼ poole/foaf.rdf#david denotes the individual david referred to in http://cs.ubc.ca/ ∼ poole/foaf.rdf. http://cs.ubc.ca/ ∼ poole/foaf.rdf Jan Pettersen Nytun, UIA, page 21

22 S O P References Jan Pettersen Nytun, UIA, page 22 [1] Book: David Poole and Alan Mackworth, Artificial Intelligence: Foundations of Computational Agents, Cambridge University Press, 2010, http://artint.info/http://artint.info/


Download ppt "Jan Pettersen Nytun, UIA, page 1 Knowledge Representation Part IV The Semantics Web Starting with XML Jan Pettersen Nytun, UiA."

Similar presentations


Ads by Google