itemprop refering to an outer itemscope - microdata

I have an itemscope for an event containing a table with attendees.
I would like to be able at the same time to have the table as itemscope itemtype="[...]Table" and the rows of the table as itemprop="attendee" referring to the outer itemscope itemtype="[...]Event". Something like:
itemscope itemtype=Event
itemprop something about Event
itemprop another thing about Event
itemscope itemtype=Table
itemprop=attendee referring to the Event, not the Table
...
However if I use what I have written above the attendee property will refer to the Table scope. Is there a way around this?

I think you could probably do that with itemref. That allows you to refer back to a previously specified bit of microdata using an id on the relevant element. Specification here: http://www.w3.org/TR/2011/WD-microdata-20110405/#attr-itemref

Related

Oracle Apex 5 custom report

in my application I have a form based on a report with the list of Dishes. I want to change apperance of the report so that it doesn't look like a table, but more like a list. I don't want to have a heading. I would expect something similar to the amazon list after you submit your search:
http://www.amazon.com/s/ref=nb_sb_noss_2?url=search-alias%3Daps&field-keywords=oracle+apex
Is it possibe to achieve it without creating a plugin? How would you approach this?
You can do this by creating a new bespoke report template for the report.
Go to Shared Components, Templates and create a new report template. Select "Named Column (row template)" as the template type.
After creating it, edit it and change the "Row template 1" property which initially looks like this:
<tr><td>#1#</td><td>#2#</td><td>#3#</td><td>#4#</td><td>#5#</td></tr>
Replace that with the HTML for each report row, for example:
<li>
<div class="picture">
<img src="#DISH_PICTURE#">
</div>
<div class="description">
<h2>#DISH_TITLE#</h2>
<p>#DISH_DETAILS#</p>
</div>
</li>
The words between #'s are column names from your report query (this template is bespoke for this particular report). So your query might be:
select dish_picture, dish_title, dish_details
from dishes
order by dish_seq;
Use the "Before Rows" and "After Rows" properties to define the HTML before and after the rows, for example <ul class="dishList"> and </ul>.
You can then apply styling using CSS in files or in the page attributes (for example).

Can I use multiple itemtypes in one itemscope for Schema.org? [duplicate]

This question already has answers here:
Correct way to use multiple itemtypes in Microdata
(2 answers)
Closed 4 years ago.
I am wondering if I can use multiple itemtypes inside one item scope. For example I have this at the moment:
<body id="home" itemscope itemtype="http://schema.org/WebPage">
<div class="wrapper" itemscope itemtype="http://schema.org/ProfessionalService">
<p itemprop from professional service></p>
<p itemprop from web page></p>
</div>
</body>
When I do a structured data test within Google's Web developer tools it only picks up items within the professional service schema and every itemprop that is related to the webpage schema is ignored and not recognised as part of the professional service. I understand about nesting them and why it's happening.
Can I have a multiple itemtype within an item scope? Such as:
<div class="wrapper" itemscope itemtype="http://schema.org/ProfessionalService http://schema.org/WebPage">
<p itemprop from professional service></p>
<p itemprop from web page></p>
</div>
Yes, you can use several item types in one itemtype attribute, as long as they are from the same vocabulary. See Microdata: itemtype:
The itemtype attribute, if specified, must have a value that is an unordered set of unique space-separated tokens that are case-sensitive, each of which is a valid URL that is an absolute URL, and all of which are defined to use the same vocabulary.
But note that then all properties (itemprop values) need to be defined for all the specified item types. So you cannot say that a particular property should belong only to a particular item type.
So you’d still have the same problem. In your case, you should either use correct nesting, or you might use the itemref attribute to add properties to the corresponding items that are scattered on the page.
FWIW, the schema.org vocabulary also defines the additionalType property. This can also be used to specify additional item types from other vocabularies. But this doesn’t allow you to use the properties from the additional item type.

Microdata markup with properties on multiple pages

I'm creating a web page and currently I'm adding Microdata markup to the code. I’m using schema.org’s MusicGroup.
I have an index.html page from where I'd like to take the name and the image properties for this band:
<div class="container" itemscope itemtype="http://schema.org/MusicGroup">
...
<img itemprop="image" src="img/logo.png" alt="logo" />
<p>We are <span itemprop="name">NAME OF THE BAND</span>.</p>
...
</div>
However on the about_us.html page there is a short description which I'd also like to use:
<div class="container" itemscope itemtype="http://schema.org/MusicGroup">
...
<p itemprop="description">A description of the band.</p>
...
</div>
When I use the code like this, search enginges (understandably) treat them as two different MusicGroups:
MusicGroup 1:
Image: .../img/logo.png
Name: NAME OF THE BAND
MusicGroup 2:
Description: A description of the band.
How can I link these properties into one item?
Microdata’s name-value pairs are per webpage, not per website.
So on a website about a music group, it can be expected that each page contains an "own" MusicGroup item, which is, however, actually always about the same music group. But from the Microdata or schema.org perspective, these different items would not be semantically connected that way (consumers might guess this however, e.g. by comparing property values).
Microdata’s itemid attribute could be used to uniquely identify each item. But it is required that the used vocabulary supports "global identifiers for items" (itemid is used for some types on schema.org (e.g., in the example for MedicalScholarlyArticle), but it’s not clear to me if it’s really supported as required by Microdata for other types, like MusicGroup).
So in your case, you could:
leave it as it is
duplicate the information, so that each item has all relevant content (possibly using meta/link elements)
move all information on one page (possibly using itemref)
(if it should be allowed for general use with schema.org) use itemid to state that several items are actually about the same thing

Can I nest itemprop if it read semantically?

I'm working on a product page on a eComm solution and I'm using Schema.org for the first time. I have a product name and inside of that is the brand and model. Is this acceptable?
<h2 itemprop="name">
<span itemprop="brand">Brand Name</span>
<span itemprop="model">######</span>
</h2>
I can't see anywhere in the Microdata spec that explicitly allows this but it looks like the Google parser accepts it.
The algorithm for finding the value of a property defines (in the last step, which applies in your example):
The value is the element's textContent.
(i.e., the text content of the element and its child elements)
So according to this, the value of name should be "Brand Name ######".
The algorithm for finding the properties of an item contains this step:
If current does not have an itemscope attribute, then: add all the child elements of current to pending.
So the child elements of an element containing itemprop are checked for itemprop attributes, too.

Google Spreadsheet importxml timestamp

I been trying for over 2 hours to import timestamp from zap2it.com link to my google spreasheet.
Here is link I am trying to importxml from.
http://affiliate.zap2it.com/tvlistings/ZCGrid.do?zipcode=78238&lineupId=DISH641:-
Here is what I am tryign to import
Here is what I tried so far
=importxml("http://affiliate.zap2it.com/tvlistings/ZCGrid.do?aid=dish&pkg=8388608&fromProvider=true&zipcode=78238&x=52&y=18"&B1,"//body//div[3]/div/div/div[3]/div/div")
EDIT
I was able to improve and get better results
//body//div[3]/div/div/div[1]//*
but it shows timestamp from all over the page. not exactly what I need.
[The first complication is that the data stream returned from dereferencing that URI is not actually XML; it has several thousand well-formedness errors (unescaped ampersands in URIs, unescaped ampersands and less-than signs in scripts, some embedded HTML, some miscellaneous errors). Since you're not reporting problems from that, however, I'll assume that somewhere between the server and your XPath expression someone is doing some tidying.]
I think you'll get better results if you use the id and class attributes that are extensively used in the document. The material you want looks like this in the source (you can use any browser-based debugging tool to find it; I used the 'Web Inspector' in Safari); I have indented to make the structure more visible, and fixed some well-formedness errors in one of the a elements (missing whitespace between attribute-value pairs).
<div class="zc-tn" id="zc-tn-top">
<div class="zc-tn-i">
<a href="ZCGrid.do?fromTimeInMillis=1355781600000"
class="zc-tn-l"
title="Move the grid three hours earlier"></a>
<div class="zc-tn-c">
<span class="zc-tn-z"
title="Central Standard Time">CST</span>
<div class="zc-tn-t">7:00 PM</div>
<div class="zc-tn-t">7:30 PM</div>
<div class="zc-tn-t">8:00 PM</div>
<div class="zc-tn-t">8:30 PM</div>
<div class="zc-tn-t">9:00 PM</div>
<div class="zc-tn-t">9:30 PM</div>
</div>
<a href="ZCGrid.do?fromTimeInMillis=1355803200000"
class="zc-tn-r"
title="Advance the grid three hours"></a>
</div>
</div>
A simple search verifies that the value zc-tn-top is indeed unique as an ID value in the document. Given that, a simple XPath expression to retrieve all the elements whose display is circled in your image is (assuming xhtml is bound to the XHTML namespace):
//xhtml:div[#id='zc-tn-top']//xhtml:div[#class='zc-tn-t']
It looks from your question as if your XPath evaluator is namespace-challenged or namespace-oblivious, so you may need to write this as
//div[#id='zc-tn-top']//div[#class='zc-tn-t']

Resources