Hierarchická data

XML (eXtensible Markup Language):

XML z Konceptualniho modelu

XML Namespace

Pasted image 20240822102304.png

XML Schema (XSD)

XML je validnije validovan na XML Schema
<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
           xmlns:vc="http://www.w3.org/2007/XMLSchema-versioning"
           elementFormDefault="qualified" attributeFormDefault="unqualified"
           vc:minVersion="1.1">
    <xs:complexType name="TypeAddress">
        <!-- specification of content -->
        <xs:sequence>
            <xs:element name="Street" type="xs:string"/>
            <xs:element name="Number" type="xs:integer"/>
            <xs:element name="City" type="xs:string"/>
        </xs:sequence>
        <!-- specification of attributes -->
        <xs:attribute name="Country" type="xs:string" default="CZ"/>
    </xs:complexType>
    <xs:element name="Address" type="TypeAddress"/>
</xs:schema>

Ekvivalentne

<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
           xmlns:vc="http://www.w3.org/2007/XMLSchema-versioning"
           elementFormDefault="qualified" attributeFormDefault="unqualified"
           vc:minVersion="1.1">
    <xs:element name="Address">
	    <xs:complexType>
	        <!-- specification of content -->
	        <xs:sequence>
	            <xs:element name="Street" type="xs:string"/>
	            <xs:element name="Number" type="xs:integer"/>
	            <xs:element name="City" type="xs:string"/>
	        </xs:sequence>
	        <!-- specification of attributes -->
	        <xs:attribute name="Country" type="xs:string" default="CZ"/>
	    </xs:complexType>
    </xs:element>
</xs:schema>

Pasted image 20240822102736.png

XLST (eXtensible Stylesheet Language Transformations)

XPath

Nejdrive pokud, chceme zformulovat XLST musime umet XPATH.

Filtrovani

Pasted image 20240822105856.png

XSLT

JSON (JavaScript Object Notation)

JSON Schema

JSON a RDF: JSON-LD

JSON-LD (JSON for Linking Data):

{
  "@context": {
    "name": "http://schema.org/name",
    "homepage": { "@id": "http://schema.org/url", "@type": "@id" }
  },
  "@graph": [
    {
      "@id": "http://example.com/person/123",
      "name": "Jane Doe",
      "homepage": "http://janedoe.com"
    },
    {
      "@id": "http://example.com/person/456",
      "name": "John Smith",
      "homepage": "http://johnsmith.com"
    },
    {
      "@id": "http://example.com/person/789",
      "name": "Alice Johnson",
      "homepage": "http://alicejohnson.com"
    }
  ]
}