I'm just entering the semantic world and I can't understand some things. I'm trying to figure out how to check what kind of element is an HTML element based on the Microdata tags on it. I'm working from a Firefox extension, so I have no limitations about requests and the low privileges stuff. I just need to figure it out what is the element about and display an alert in a user comprehensible language (no MusicRecording
for example) by knowing the kind of defined "thing" in the schema. Consider this microdata example:
<div itemscope itemtype="http://schema.org/MusicRecording">
<span itemprop="byArtist" itemscope itemtype="http://schema.org/MusicGroup">
British rock band
<span itemprop="name">Queen</span>
</span>
for their
<span itemprop="inAlbum" itemscope itemtype="http://schema.org/MusicAlbum">
<span itemprop="dateCreated">1977</span> album
<span itemprop="name">News of the World</span>
</span>
<div>
By reading the itemtype I need to be able to retrieve the name of the thing (something like "Music Recording"), but not analyzing the string; in a "right way", by querying something and asking for that. The thing is, I can't found a REST api or something like that for obtaining the name, and I need to do it with pure javascript.
So... Any clue/idea? (besides asking the DOM of such URL)