Knowledge Management Semantic Web and Social Networking Unit #2 Semantic Web Technologies Dr. Bhavani Thuraisingham The University of Texas at Dallas April 2010OutlineThe XML LanguageXML ElementsXML AttributesWell-Formed XML DocumentsThe Tree Model of XML Documents: An ExampleThe Tree Model of XML Documents: An Example (2)DTD: Element Type DefinitionXML SchemaData TypesA Data Type ExampleXML Schema: The Email ExampleNamespacesAn ExampleAddressing and Querying XML Documents: XPATHXSL Transformations (XSLT)SummaryDrawbacks of XMLBasic Ideas of RDFResourcesPropertiesStatementsStatements as TriplesRDF Statements in XMLReificationThe rdf:resource AttributeContainer ElementsExample for a BagExample for AlternativeRDF CollectionsBasic Ideas of RDF SchemaClasses and their InstancesInheritance in Class HierarchiesProperty HierarchiesRDF Schema in RDFCore ClassesCore PropertiesSemantics based on Inference RulesSPARQL RDF Query LanguageSlide 41Requirements for Ontology LanguagesReasoning About Knowledge in Ontology LanguagesReasoning Support for OWLSome Limitations of the Expressive Power of RDF SchemaThree Species of OWLOWLowl:OntologyClassesSlide 50An African Wildlife Ontology – PropertiesAn African Wildlife Ontology – Plants and TreesAn African Wildlife Ontology – BranchesAn African Wildlife Ontology – LeavesAn African Wildlife Ontology – CarnivoresAn African Wildlife Ontology – GiraffesSlide 57Semantic Web Rules LanguageNon-monotonic RulesThe Potential Buyer Carlos RequirementsFormalization of Carlos’s Requirements – RulesRepresentation of Available ApartmentsDetermining Acceptable ApartmentsSummaryKnowledge ManagementSemantic Web and Social NetworkingUnit #2 Semantic Web TechnologiesDr. Bhavani Thuraisingham The University of Texas at DallasApril 2010OutlineXMLRDFOWLRULESReference: G. Antoniou and F. vanHarmelen, A Semantic Web Primer, MIT Press, 2004 (second edition, 2008)3The XML LanguageAn XML document consists of a prologa number of elementsan optional epilogThe prolog consists of an XML declaration and an optional reference to external structuring documents<?xml version="1.0" encoding="UTF-16"?><!DOCTYPE book SYSTEM "book.dtd">XML4XML ElementsContent may be text, or other elements, or nothing <lecturer><name>David Billington</name><phone> +61 − 7 − 3875 507 </phone></lecturer>If there is no content, then the element is called empty; it is abbreviated as follows:<lecturer/> for <lecturer></lecturer>5XML AttributesAn empty element is not necessarily meaningless–It may have some properties in terms of attributesAn attribute is a name-value pair inside the opening tag of an element<lecturer name="David Billington" phone="+61 − 7 − 3875 507"/>6Well-Formed XML DocumentsSyntactically correct documentsSome syntactic rules:–Only one outermost element (called root element)–Each element contains an opening and a corresponding closing tag–Tags may not overlap<author><name>Lee Hong</author></name>–Attributes within an element have unique names–Element and tag names must be permissibleAn XML document is valid if –it is well-formed–respects the structuring information it usesThere are two ways of defining the structure of XML documents: –DTDs (the older and more restricted way)–XML Schema (offers extended possibilities)–7The Tree Model of XML Documents: An Example<email><head><from name="Michael Maher" address="[email protected]"/><to name="Grigoris Antoniou"address="[email protected]"/><subject>Where is your draft?</subject></head><body>Grigoris, where is the draft of the paper you promised me last week?</body></email>8The Tree Model of XML Documents: An Example (2)9DTD: Element Type Definition<lecturer><name>David Billington</name><phone> +61 − 7 − 3875 507 </phone></lecturer>DTD for above element (and all lecturer elements):<!ELEMENT lecturer (name,phone)><!ELEMENT name (#PCDATA)><!ELEMENT phone (#PCDATA)>The element types lecturer, name, and phone may be used in the documentA lecturer element contains a name element and a phone element, in that order (sequence)A name element and a phone element may have any content In DTDs, #PCDATA is the only atomic type for elements10XML SchemaSignificantly richer language for defining the structure of XML documentsTts syntax is based on XML itself–not necessary to write separate toolsReuse and refinement of schemas–Expand or delete already existent schemasSophisticated set of data types, compared to DTDs (which only supports strings)An XML schema is an element with an opening tag like<schema "http://www.w3.org/2000/10/XMLSchema"version="1.0">Structure of schema elements–Element and attribute types using data types11Data TypesThere is a variety of built-in data types –Numerical data types: integer, Short etc. –String types: string, ID, IDREF, CDATA etc.–Date and time data types: time, Month etc.There are also user-defined data types –simple data types, which cannot use elements or attributes–complex data types, which can use theseComplex data types are defined from already existing data types by defining some attributes (if any) and using:–sequence, a sequence of existing data type elements (order is important)–all, a collection of elements that must appear (order is not important)–choice, a collection of elements, of which one will be chosen12A Data Type Example<complexType name="lecturerType"><sequence><element name="firstname" type="string"minOccurs="0“ maxOccurs="unbounded"/><element name="lastname" type="string"/></sequence><attribute name="title" type="string" use="optional"/></complexType>13XML Schema: The Email Example<element name="email" type="emailType"/><complexType name="emailType"><sequence><element name="head" type="headType"/><element name="body" type="bodyType"/></sequence></complexType>14NamespacesAn XML document may use more than one DTD or schema Since each structuring document was developed independently, name clashes may appearThe solution is to use a different prefix for each DTD or schema –prefix:name15An Example<vu:instructors xmlns:vu="http://www.vu.com/empDTD"xmlns:gu="http://www.gu.au/empDTD"xmlns:uky="http://www.uky.edu/empDTD"><uky:faculty uky:title="assistant professor"uky:name="John Smith"uky:department="Computer Science"/><gu:academicStaff gu:title="lecturer"gu:name="Mate Jones"gu:school="Information
View Full Document