Databases Reference
In-Depth Information
Figure 4.5:
Wikipedia page including info box on right.
PREFIX dbprop: <http://dbpedia.org/property/>
PREFIX db: <http://dbpedia.org/resource/>
SELECT ?who ?work ?genre
WHERE {
db:Tokyo_Mew_Mew dbprop:illustrator ?who .
?work dbpprop:author ?who .
OPTIONAL { ?work dbpprop:genre ?genre } .
}
Early HTML had been derived from SGML and so, for example, close tags were not required where
they could be inferred from the structure, for example, in “
<
ul
><
li
>
one
<
li
>
two
<
/ul
>
,” a parser
knows that the first
<
li
>
tag encloses “one” as
<
li
>
elements cannot be nested, effectively yield-
ing “
<
ul
><
li
>
one
<
/li
><
li
>
two
<
/li
><
/ul
>
,” not “
<
ul
><
li
>
one
<
li
>
two
<
/li
><
/li
><
/ul
>
.”
This is fine for a well-known structure such as HTML, but it means that new tags cannot easily be
added. In contrast, XML enforces strict nesting, so a parser does not need to know the kind of data
to be able to parse the hierarchical structure. A DTD can be associated with an XML document;
however, this can be used optionally for validation and is not essential for parsing.