AW: aside: mentioning multiple types of a thing in RDF/XML vs RDFa

+1 on this one. 
 
When additional classes come at almost no cost, it's easy to assign a
custom subclass for the sake of precision and use in custom
applications, and the widely understood superclass as well. I think
that's a good practice, don't relying on client side reasoning (which is
spare, as Ross stated). May be this practice could overcome some
hesitance in coining subclasses (or subproperties, where whitespace
separated lists in RDFa work too).
 
Cheers, Joachim


________________________________

	Von: public-lld-request@w3.org
[mailto:public-lld-request@w3.org] Im Auftrag von Dan Brickley
	Gesendet: Montag, 1. November 2010 17:48
	An: Antoine Isaac
	Cc: public-lld
	Betreff: aside: mentioning multiple types of a thing in RDF/XML
vs RDFa
	
	

		Well, I was in fact going to advice subclassing to Jeff.


	I think the rise of RDFa may have some bearing on design choices
here. It makes it much easier to mention several types for something,
with minimal syntactic overhead.
	
	
	So in theory RDF is defined as an abstract standard, and its
notations are irrelevant to modelling habits. In practice, these levels
of abstraction are connected.

	Here's what it would look like in RDF/XML to mention a 2nd type
for a person,

	1. with one type mentioned:

	<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:foaf="http://xmlns.com/foaf/0.1/">
	<foaf:Person rdf:about="#fred">
	 <foaf:name>Fred Flintstone</foaf:name>
	</foaf:Person>
	</rdf:RDF>
	  

	2. Adding in a second type property: 

	(pretty ugly and long...)

	<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:foaf="http://xmlns.com/foaf/0.1/">
	<foaf:Person rdf:about="#fred">

	 <rdf:type
rdf:resource="http://example.com/vocab2#BiblioPerson"/>

	 <foaf:name>Fred Flintstone</foaf:name>
	</foaf:Person>
	</rdf:RDF>
	  

	3. Using a little-known syntax shortcut in RDF/XML (type=
attribute)

	(a bit prettier, but in XML you're only allowed one of these
type attributes)

	<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:foaf="http://xmlns.com/foaf/0.1/">
	<foaf:Person rdf:about="#fred"
rdf:type="http://example.com/vocab2#BiblioPerson">
	 <foaf:name>Fred Flintstone</foaf:name>
	</foaf:Person>
	</rdf:RDF>


	Let's compare this with an RDFa 1.0 HTML page:

	4. 
	<html>
	<head><title>a page about Fred</title></head>
	<body>
	<div xmlns:foaf="http://xmlns.com/foaf/0.1/"
xmlns:vocab2="http://example.com/vocab2#"
	about="#fred" typeof="foaf:Person vocab2:BiblioPerson" >
	<span property="foaf:name">Fred Flintstone</span>
	</div>
	</body>
	</html>

	...from which we can parse 4 triples:

	rapper -i rdfa fred.html 
	rapper: Parsing URI file:///Users/danbri/working/rdfa/fred.html
with parser rdfa
	rapper: Serializing with serializer ntriples
	<file:///Users/danbri/working/rdfa/fred.html#fred>
<http://www.w3.org/1999/02/22-rdf-syntax-ns#type>
<http://xmlns.com/foaf/0.1/Person> .
	<file:///Users/danbri/working/rdfa/fred.html#fred>
<http://www.w3.org/1999/02/22-rdf-syntax-ns#type>
<http://example.com/vocab2#BiblioPerson> .
	<file:///Users/danbri/working/rdfa/fred.html#fred>
<http://xmlns.com/foaf/0.1/name> "Fred Flintstone" .
	rapper: Parsing returned 3 triples


	Note the ease of mentioning extra types:

	 typeof="foaf:Person vocab2:BiblioPerson"

	...that's a space separated list. We could have types from
Dbpedia, wordnet, freebase, marc relators perhaps ... each requires a
declared namespace to be in scope, and then you just add it to the list.
And apparently RDFa 1.1 has more shortcut idioms in store.

	My point being that RDF as deployed to date has tended to
mention only a single type per thing described. That made choosing that
type a more weighty act. If (*if*) RDFa gets more traction as a
preferred syntax, we could see a rise in multi-typed descriptions...

	</aside>

	cheers,

	Dan

Received on Tuesday, 2 November 2010 08:53:21 UTC