These forums are currently read-only due to receiving more spam than actual discussion. Sorry.

It is currently Sat Dec 02, 2017 4:20 pm Advanced search

Microdata implementation

Here you can discuss things related to HTML and the Web in general that do not fit in to other categories.

Microdata implementation

Postby timvanoostrom » Fri Nov 13, 2009 2:22 pm

Hello,
I am developing an experimental CMS which has every 'thing' structured with a semantic html annotation language, microformats are not an option so it came down to RDFa.
But i found out about html5 microdata yesterday and that looks really promising to me. I made a few use-cases and have a few questions which i hope somebody can enlighten me about.
--------------------------------------------------------------------------------------------------
Consider this case :
Code: Select all
<div itemscope itemtype="http://www.example.org/vocabulary/Catalog">
   <h4 itemprop="http://www.example.org/vocabulary/Title">Catalog Title</h4>
</div>

I came up with the following triples :
Code: Select all
<item> <itemtype> http://www.example.org/vocabulary/Catalog
<item> <itemprop> Title : Catalog Title

_or_
Code: Select all
<item> <itemtype> http://www.example.org/vocabulary/Catalog
<item> <itemprop:Title> Catalog Title

_or_
Code: Select all
<item::itemtype:http://www.example.org/vocabulary/Catalog> <itemprop:Title> Catalog title

- Which one is it ?
--------------------------------------------------------------------------------------------------
- Can vocabularies be in html5 documents itself ?
- How would one reference a Property or Itemtype when they are not described in rdf/owl vocabularies ?

I came up with something like this :
Code: Select all
http://www.example.org/items/ has html5 document <div itemscope itemtype="http://www.example.org/vocabulary/An-item" id="item-a">Original item</div>
http:/www.another.example.org/things/ has html5 document <div itemscope itemtype="http://www.example.org/vocabulary/An-item" itemid="http://www.example.org/items/#item-a">(Reference to) Original item</div>

- Do you think/is this is a solid/valid way to describe `items` in html5 documents ?
timvanoostrom
<h5>
 
Posts: 10
Joined: Fri Nov 13, 2009 2:14 pm

Postby timvanoostrom » Fri Nov 13, 2009 2:27 pm

O, i forgot one triple :

Code: Select all
<item> <itemtype> http://www.example.org/vocabulary/Catalog
<item> <Title> Catalog Title


which seems valid but the structure of the `itemtype` att is not like the `itemprop` att
timvanoostrom
<h5>
 
Posts: 10
Joined: Fri Nov 13, 2009 2:14 pm

Postby timvanoostrom » Fri Nov 13, 2009 2:58 pm

Ok answering my own questions here, according to : http://www.whatwg.org/specs/web-apps/cu ... examples-1, the `turtle` would be
Code: Select all
<> a Catalog;
   Title "Catalog title";
timvanoostrom
<h5>
 
Posts: 10
Joined: Fri Nov 13, 2009 2:14 pm

Postby zcorpan » Sat Nov 14, 2009 9:16 am

You can see what the JSON and RDF output is using http://james.html5.org/microdata/

HTH,
zcorpan
<article>
 
Posts: 807
Joined: Tue Feb 06, 2007 8:29 pm
Location: Sweden

Postby timvanoostrom » Sun Nov 15, 2009 6:28 pm

Ok, found out a lot today about Microdata notation and i really like it opposed to RDFa notation it is more apparant for me.

Consider this example :
Code: Select all
<div id="exampleA" itemscope itemtype="http://www.example.org/vocabulary/Example" itemid="http://forums.whatwg.org/viewtopic.php?t=4165#exampleA">
   <div itemprop="http://dublincore.org/2008/01/14/dcelements.rdf#Subject" itemscope itemtype="http://xmlns.com/foaf/0.1/page" itemid="http://forums.whatwg.org/viewtopic.php?t=4165" >
      <span itemprop="http://xmlns.com/foaf/0.1/topic">Microdata implementation</span>
      <span itemprop="http://dublincore.org/2008/01/14/dcelements.rdf#Creator">timvanoostrom</span>
   </div>
</div>

@prefix _3: <http://xmlns.com/foaf/0.1/>.
@prefix _4: <http://dublincore.org/2008/01/14/dcelements.rdf#>.
@prefix _5: <http://forums.whatwg.org/viewtopic.php?t=4165#>.
@prefix _6: <http://www.example.org/vocabulary/>.
@prefix _7: <http://www.w3.org/1999/xhtml/microdata#>.
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>.

<None> _7:item _5:exampleA.

<http://forums.whatwg.org/viewtopic.php?t=4165> a _3:page;
     _4:Creator "timvanoostrom";
     _3:topic "Microdata implementation".

_5:exampleA a _6:Example;
     _4:Subject <http://forums.whatwg.org/viewtopic.php?t=4165>.




How could i do the following in RDFa ?
Code: Select all
<div itemprop="http://dublincore.org/2008/01/14/dcelements.rdf#Subject" itemscope itemtype="http://xmlns.com/foaf/0.1/page" itemid="http://forums.whatwg.org/viewtopic.php?t=4165" >

Making the Object of Predicate a Subject...
I tried :
Code: Select all
      <div xmlns:vb="http://example.org/vocabulary/"
          xmlns:dc="http://dublincore.org/2008/01/14/dcelements.rdf#"
          xmlns:foaf="http://xmlns.com/foaf/0.1/" typeof="vb:Example" about="http://forums.whatwg.org/viewtopic.php?t=4165#example">
         <div property="dc:Subject" typeof="foaf:page" about="http://forums.whatwg.org/viewtopic.php?t=4165" >
            <span property="foaf:topic">Microdata implementation</span>
         </div>
      </div>


But the RDFa parsers (http://www.w3.org/2007/08/pyRdfa/ and http://localhost/arc/) completely ignore the fact that Object of predicate dc:Subject is foaf:page which is also a Subject.
timvanoostrom
<h5>
 
Posts: 10
Joined: Fri Nov 13, 2009 2:14 pm


Return to General Discussion

Who is online

Users browsing this forum: No registered users and 1 guest