Using Schema.org Review with copyrightHolder? - microdata

I'm trying to implement correct properties of Schema.org, in video game reviews. It's not hard to understand the basics http://schema.org/Review, but some properties are a bit confuse (to me).
For example, a review about "Gran Turismo", of "Sony PlayStation", released in "1996", is correct to use properties of "Creative Work", this way:
<meta itemprop="copyrightHolder" content="Sony" />
<meta itemprop="copyrightYear" content="1996" />
Or do this is it related to the review itself, so I should use the review's author name and publication date? If yes, what's the right properties to those info (if needed)?

When reviewing a video game, there are two CreativeWorks (resp. more specific types) involved:
the video game
the review
The properties copyrightYear and copyrightHolder refer to the nearest parent CreativeWork. You have to make sure not to mix them: it’s all about the correct nesting.
<div itemscope itemtype="http://schema.org/CreativeWork">
<!-- this is *your* CreativeWork, i.e., the review -->
<div itemprop="itemReviewed" itemscope itemtype="http://schema.org/CreativeWork">
<!-- this is *not your* CreativeWork, i.e., the video game -->
</div>
<!-- this is, again, *your* CreativeWork -->
</div>
(Note that I’ve used the general CreativeWork type in this example; you should of course use more specific types if available, e.g., http://schema.org/Review for the review).

Daniel, you should use the review schema as your primary schema, then nest the others such as creative work within it. The review schema should include the item, the author's name, date of the review, and of course the actual review body and rating markups. But it really is not necessary to use the copyright item properties. You can simply leave those tags out if you wish.

Related

Select first <p> tag can anyone tell what is xpath of below code?

<div class="main-banner"><img alt="Health and Safety In Care" height="291px" width="650px" class="img-responsive" height="291px" Width="650px" src="images/Care Safety.jpg" /></div>
<p>It is a legal requirement that those in the care sector must have sufficient health and safety training to ensure the safety of both staff and patients.</p>
<p>The below range of health and safety courses specialise in handling different equipment and scenarios often encountered in the care sector. Our courses boast accreditation from the CIEH and HABC, and are designed to fulfil recommendations made by the CQC.</p>
select <p> tag for xpath after below <div> tag that contain
main-banner class.
<div class="main-banner"><img alt="Health and Safety In Care" height="291px" width="650px" class="img-responsive" height="291px" Width="650px" src="images/Care Safety.jpg" /></div>
<p>It is a legal requirement that those in the care sector must have sufficient health and safety training to ensure the safety of both staff and patients.</p>
<p>The below range of health and safety courses specialise in handling different equipment and scenarios often encountered in the care sector. Our courses boast accreditation from the CIEH and HABC, and are designed to fulfil recommendations made by the CQC.</p></div>
To select the 1st <p> node right after the <div> node with class="main-banner":
(//div[#class="main-banner"]/following-sibling::p)[1]
----------
In case if the crucial <div> node has multiple items within class attribute like class="cont baseline main-banner" use the following xpath expression:
(//div[contains(#class,"main-banner")]/following-sibling::p)[1]
xpath :
//div[#class="main-banner"]/following-sibling::p [1]

What is the correct high level schema.org microdata itemtype for a retail brand/company homepage?

I'd like to hear which schema.org itemtype others would recommend using or have used in the case of completing a retail brand's company homepage microdata. Take for example TOMS's shoes:
Example #1 - Using /Corporation as the high-level itemtype one can include a lot of great /Organization microdata, but nothing about the retail store.
<html itemscope='itemscope' itemtype="http://schema.org/Website>
<head></head>
<body itemscope='itemscope' itemtype="http://schema.org/Corporation>
various microdata here probably including Product microdata
</body>
</html>
NOTE: the only schema.org property specific to /Corporation is tickerSymbol & TOMS doesn't have one.
Example #2 - This code would work if TOMS started their own channel of physical retail stores & each location had it's own homepage. However, for TOMS's.com, although accurate schematically & more descriptive at the face, this is incorrect microdata markup for TOMS.com, because /ShoeStore derives from /LocalBusiness - which must represent a physical place.
<html itemscope='itemscope' itemtype='http://schema.org/Website'>
<head></head>
<body itemscope='itemscope' itemtype='http://schema.org/ShoeStore'>
a whole bunch of jabber here
</body>
</html>
NOTE: Since TOMS is virtual & thus can't be a /Store this means you lose really cool properties like 'currenciesAccepted', 'paymentAccepted' & 'priceRange'.
Is this just a 'sit and wait' situation until more schemas are approved for 'virtual places' or is there a validation-passing way to get the best of both worlds?
Assuming you're looking at this more or less from an SEO point of view, remember that the major search engines are currently making only very limited use of microdata, and the schemas you're talking about (Corporation and Shoe Store) are not, to my knowledge, used for anything (yet). So, to an extent, I think the whole thing is largely hypothetical for now.
However, I think it's important to remember that you could use very different microdata depending on the page function. You're asking about the homepage, for which it could be completely valid to add only enough microdata to describe the name and category of the entity concerned. Detailed product data would appear on product pages, more detailed organisational data on the about or contact page, etc. In other words, use the schema that best allows you to encapsulate the main purpose of the page.
Incidentally, they've recently added GoodRelations vocabulary to Schema.org, so the scope for describing products and other business-related data just grew considerably.

expression engine orderby issue

Hi I’m trying to order entries by a field called surname but it just doesn’t seem to be working. changing orderby and sort to anything gives the same results - latest entry last in list.
Any ideas what I could be doing wrong?
{exp:query sql="SELECT member_id FROM exp_members WHERE group_id = '5'"}
{exp:member:custom_profile_data member_id="{member_id}" orderby="surname" sort="asc"}
<li><img src="{photo_url}" width="138" height="103" alt="{screen_name}" />
<h3 class="name">{firstname} {surname}</h3></li>
{/exp:member:custom_profile_data}
{/exp:query}
To save yourself some energy you might want to think about using Freemember from Exp-resso on your site. https://github.com/expressodev/freemember
This module has super simple syntax to do what you are wanting and might add some additional features to make your ExpressionEngine development easier.
I'll start by pointing out that if you have a lot of members, this nested query could really bog down your server. It would be much more efficient to use the Query module to get all of your member data in one go, then interate through it without the nested custom_profile_data tag. You'd have to account for variables that get manipulated beforehand using custom_profile_data (like image URLs), but it would be worth the effort in performance gains.
Regardless:
The custom_profile_data tag only queries a single member, so orderby and sort won't make any difference. Your sorting needs to take place during your exp:query tag.
{exp:query sql="SELECT m.member_id FROM exp_members m, exp_member_data d WHERE m.group_id = '5' AND d.member_id = m.member_id ORDER BY d.m_field_id_X ASC"}
{exp:member:custom_profile_data member_id="{member_id}"}
<li><img src="{photo_url}" width="138" height="103" alt="{screen_name}" />
<h3 class="name">{firstname} {surname}</h3>
</li>
{/exp:member:custom_profile_data}
{/exp:query}
Replace m_field_id_X with the actual m_field_id of your surname custom member field (which can be found by looking at exp_member_fields in Tools → Data → SQL Manager).

Project references with microdata

I have a site where I need to list my projects from before. They are websites with name, URL, description, list of used technologies, and an image gallery.
I was searching for a schema for it on schema.org, but I was not able to find a fitting one. What itemscopes should I use?
There is no good fit for what you need in the current available Schemas on http://schema.org.
What I'd do:
Use http://schema.org/WebPage for your webpage definition, along with parts of http://schema.org/WebPageElement as needed.
Use http://schema.org/Person for defining yourself
Lastly for each project, I'd use what's already there for the parent Creative Work schema (http://schema.org/CreativeWork) since there is no sub-schema under it that fits for you. I'd then just define attributes and values for about, datePublished, author, headline, keywords. Also define editor, video, awards and publisher if appropriate.

How do I fill in a specific field in Webrat when several share the same name and id?

I'm just getting started with Cucumber and Webrat, and am adding feature specifications to an existing Rails application. One page in the app has multiple forms on it, representing different ways to build a new Character object. Here's a simplified example:
<form id="adopt_character_form">
....
<input type="text" name="character[name]" id="character_name">
...
</form>
<form id="spawn_character_form">
....
<input type="text" name="character[name]" id="character_name">
...
</form>
As you can see, there are (at least) two fields that have the same name and id on the page, though they are in different forms, and I can't find a way in the Webrat rdoc or source code to specify a particular one.
I know that I could change the name or id on one of them, but I would have to deviate from the Rails naming conventions to do so, which I'd really rather not. I could also put the forms on different pages, but it would take more modification to the work flow than I want to do. I could also try to merge them in to a single form that was more modular and dynamic, but having to make structural changes to the UI just to support a given testing framework seems a little questionable and might not always be feasible, plus I would have to require javascript.
Is there any way to specify one of these fields in Webrat, or should I just give up and try Cucumber on a different project?
You can use webrats within method
For example in a cucumber steps file
#my_steps
Then /^I update character name with "([^\"]*)"$/ do |updated_character|
within '#adopt_character_form'
fill_in "character[name]", :with => updated_character
end
end
Hope that helps
Considering having multiple elements with the same ID is an explicit violation of HTML validity, I think you've already deviated from the path of Rails conventions. Recent versions of Rails generally make an effort to keep things standards-conformant. IIRC it's pretty straightforward to call the form helpers in such a way that the IDs are differentiated. If nothing else you can just supply an explicit ID with each call. For the purpose of Rails conventions the name field is the only one that matters, since that's the one Rails will have to map back to a field name on a model.

Resources