We are trying to integrate TrainReservation schemas in our emails, like what we did for FlightReservation before. I've tried sending a test email to myself (using google scripts) along with the following schema:
<script type="application/ld+json">
[
{
"#context": "http://schema.org",
"#type": "TrainReservation",
"reservationNumber": "175091993",
"reservationStatus": "http://schema.org/ReservationConfirmed",
"cancelReservationUrl": "https://test.com/cancel?id=AB3XY2",
"underName": {
"#type": "Person",
"name": "Test Test"
},
"reservationFor": {
"#type": "TrainTrip",
"departureStation": {
"#type": "TrainStation",
"name": "Foo"
},
"departureTime": "2021-09-21T15:15:00+04:30",
"arrivalStation": {
"#type": "TrainStation",
"name": "Bar"
},
"arrivalTime": "2021-09-21T19:55:00+04:30",
"trainNumber": "282"
},
"reservedTicket": {
"#type": "Ticket",
"underName": "Test Test",
"ticketNumber": "175091993",
"additionalTicketText": "Some text"
}
}
]
</script>
The schema is successfully tested using the markup tester. However, in the received email, I do not see any special thing, unlike FlightReservation markups that show the itinerary data at the top of the email, adds it to the calendar automatically and has action buttons for cancellation and modification.
So I'm wondering, am I doing something wrong, or is this just the normal behavior? What features do I have to expect from TrainReservation markups for the receivers of emails? (and also please answer that for BusReservation markups as well)
Appreciate this question is almost a year old, but it appeared when I Googled "TrainReservation" and "Schema" and didn't have any answers. Somebody asked it 6 years ago here, and it looks like as of August 2022 the TrainReservation type is not supported in Google Schema - you can find a list of supported schema types here, which currently only includes:
Events
Flights
Hotels
Restaurants
They haven't included car hire, but that does also seem to work in my experience.
I suppose all we can do is wait for Google to eventually implement TrainReservation and BusReservation as types. Very frustrating!
Related
I'm working on a multiple-language website and I'm preparing Schema.org markups using JSON-LD. Important detail: this website uses subdirectories for languages. Let's consider 2 languages:
English: https://www.example.com/
French: https://www.example.com/fr/
I want to put Corporation and WebSite things on all localized HP. Everything goes fine but for #id, url and inLanguage properties: I don't quite know what I should fill.
For Corporation, I think I got it right: I'm going to use on all pages default url and base my #id on it:
{
"#context": "http://schema.org",
"#type": "Corporation",
"#id": "https://www.example.com/#organization",
"name": "Example",
"url": "https://www.example.com/",
...
But what would be the best move for WebSite properties, on my French HP?
Technically speaking, /fr/ subfolder is part of the example.com/ domain. But then, #id, inLanguage and url are not telling my website is also available for French-speakers.
{
"#context": "http://schema.org",
"#type": "WebSite",
"#id": "https://www.example.com/#website", // should this be "https://www.example.com/fr/#website" ?
"name": "Example",
"url": "https://www.example.com/", // should this be "https://www.example.com/fr/" ?
"inLanguage": "en", // should this be "fr" ?
...
I searched a lot about this and found nothing on this particular matter.
Does anyone have any experience on this?
You have two different (albeit translated) websites. It shouldn’t matter that they share the same domain/hostname.
Each website should get its own WebSite item, with its own #id, url, and inLanguage values, while they would refer to the same Corporation item.
{
"#context": "http://schema.org",
"#type": "WebSite",
"#id": "https://www.example.com/#website",
"url": "https://www.example.com/",
"inLanguage": "en",
"publisher": {"#id": "https://www.example.com/#organization"}
}
{
"#context": "http://schema.org",
"#type": "WebSite",
"#id": "https://www.example.com/fr/#website",
"url": "https://www.example.com/fr/",
"inLanguage": "fr",
"publisher": {"#id": "https://www.example.com/#organization"}
}
If the websites are primarily translations, you could use workTranslation/translationOfWork to link the WebSite items.
"workTranslation": {"#id": "https://www.example.com/fr/#website"}
"translationOfWork": {"#id": "https://www.example.com/#website"}
(This is a good case to see why the WebSite items should have different #id values, because otherwise you couldn’t refer to their translations like that. Using the url value instead of the #id value wouldn’t be a good idea, because this URI typically represents the homepage, not the whole website.)
I am trying to create some JSON-LD structured data for a list of products on an ecom-site but I am getting an error when using Google's Structured Data Testing Tool.
So far, I have this:
{
"#context": "http://schema.org",
"#type": "OfferCatalog",
"name": "Fresh Fruit",
"itemListElement": [
{
"#type": "ListItem",
"position": 1,
"item":
{
"#type": "Offer",
"price": "1.20",
"priceCurrency": "GBP",
"availability": "http://schema.org/InStock",
"url": "http://example.com/green-apples/",
"itemOffered": {
"#type": "Product",
"name": "Green Apples",
"url": "http://example.com/green-apples/"
}
}
}
]
}
Mostly it validates, but the Google tool throws the following error:
All values provided for url must point to the same page.
The error highlights line 11 ("#type": "Offer",).
The URL fields seem to be clashing with the #context declaration, because if I change the context to either a non-url string or http://example.com, it validates (although, this obviously causes its own issues). (This has been shown to be a red-herring, in the comments below)
What am I missing here? It feels like something blindingly obvious.
I think it is connected with pushing of accelerated mobile pages and its structured data.
Please check my thoughts here: All values provided for URL must point to the same page. My guess was about the problem in Google’s SDTT
So, to fix the problem with your structure data, please use the correct version of ItemList (there are Separately and Combined marked up ItemLists, please check here):
If your items are on the same page, please use the version with items
inside, the Combined one.
Otherwise, if you point to different pages inside and your items are
not on one page, please DON’T put item element with type and other
description inside, the Separately marked up one.
Now it's 2018.
Answer by Yash Pal above is close, but not quite right.
This is not an error from Google validator tools.
The error is valid and you need to fix it.
You use the "Single Page" approach ( there are two approaches "Summary page" and "Single page" )
For "Single Page" approach, you need each URL to be exactly same, and each of them should have "an anchor".
The Google developer doc clearly mentioned it.
I wrote the explanation details there
If your page contains some links to another page, then you should use "Summary Page" approach and it had different data structure ( much simpler one, I think )
I think the issues occurs when we mix two list types i.e Summary page + multiple full details pages and A single, all-in-one-page list.
Google stated on page - https://developers.google.com/search/docs/guides/mark-up-listings
If this is a summary page, the ListItem should include only the type,
position, and url properties.
If this is an all-in-one-page list, the ListItem should include all the additional schema.org properties for the data type that it describes (for example, Recipe or Course objects).
But Google should consider eCommerce category's product listing where people display numbers of product with more than 3 properties on summery page and these are obvious for eCommerce, like price and image are 2 important item on product listing page except the 3 listed above.
So we need to raise this issue with Google to address the concern.
No, it is NOT an error in Google's SDTT,
I have helped many people fix their structured data, including dynamic arrays. Read the instructions. Google clearly states "All values for the URL must point to the same page". Think about it, Google is trying to tell you something.
That something means this "Hey you are using a different item list from the example we provided, your item list has more than two item".
The solution:
Use anchors! Voila!
Please use this example snippet and you cannot go wrong. And another tip; use the Fetch Url option from SDTT:
<script type="application/ld+json">
/*structerd data markup compiled by http://www.iwanross.co.za */
{
"#context": "http://schema.org",
"#type": "ItemList",
"itemListElement": [
{
"#type": "ListItem",
"position": 1,
"item": {
"#type": "Recipe",
"url": "https://www.smokingchimney.com/#beetroot",
"name": "Beetroot Side Salad for the braai",
"image": "http://www.smokingchimney.com/recipe-pages/images/1x1/Beetroot-Salad-
for-the-Braai-800x451.jpg",
"author": {
"#type": "Person",
"name": "Marna Ross"
},
"datePublished": "2018-10-05"
}
},
{
"#type": "ListItem",
"position": 2,
"item": {
"#type": "Recipe",
"url": "https://www.smokingchimney.com/#carrot",
"name": "Carrot Cake",
"image": "http://www.smokingchimney.com/recipe-pages/images/16x9/carrot-cake-
recipe-picture-1024x576.jpg",
"author": {
"#type": "Person",
"name": "Marna Ross"
},
"datePublished": "2018-10-05"
}
},
{
"#type": "ListItem",
"position": 3,
"item": {
"#type" : "Recipe",
"url":"https://www.smokingchimney.com/#overnight",
"name": "Overnight Steak Marinade",
"image": "http://www.smokingchimney.com/recipe-pages/images/1x1/Overnight-steak-
marinade-700x465.png",
"author": {
"#type": "Person",
"name": "Marna Ross"
},
"datePublished": "2009-10-05"
}
}
]
}
</script>
It is surely an error in the validator. I checked with the examples google provided: https://developers.google.com/search/docs/guides/mark-up-listings .
If you click on the 2nd example you will see that it has the same error.
The error is shown even if you use 1 item:
{
"#context": "http://schema.org",
"#type": "ItemList",
"itemListElement": [
{
"#type": "ListItem",
"position": 1,
"item": {
"#type": "Recipe",
"url": "http://example.com/desserts/pies/#apple-pie",
"name": "Apple Pie",
"image": "https://example.com/300px-Apple_pie.jpg",
"author": {
"#type": "Person",
"name": "Carol Smith"
},
"datePublished": "2009-11-05"
}
}
]
}
you don't need to anchor every URL, you can add parameters to the URL as well ?i=1
like:
https://website.com/d/link?i=1
https://website.com/d/link?i=2
....
Use type OfferCatalog instead of ItemList. https://schema.org/OfferCatalog
Reading through the Google email markup documentation (https://developers.google.com/gmail/markup/overview) I found not information on how it is possible to deeplink into a native application.
Since an email contains LD+JSON and contains the URL, why can't the schema not support a native deep-link into the Android or iOS app?
I would have thought that this is the most obvious use-case where one-click actionable content makes sense.
If you look at the JSON-LD example for EntryPoint on Schema.org you'll notice that it allows android-app:// and other types of deep links which is a very explicit way of providing deep links for each platform:
<script type="application/ld+json">
{
"#context": "http://schema.org",
"#type": "Restaurant",
"name": "Tartine Bakery",
"potentialAction": {
"#type": "ViewAction",
"target": [
"http://www.urbanspoon.com/r/6/92204",
{
"#type": "EntryPoint",
"urlTemplate": "http://api.urbanspoon.com/r/6/92204",
"contentType": "application/json+ld"
},
"android-app://com.urbanspoon/http/www.urbanspoon.com/r/6/92204",
{
"#type": "EntryPoint",
"urlTemplate": "urbanspoon://r/6/92204",
"application": {
"#type": "SoftwareApplication",
"#id": "284708449",
"name": "Urbanspoon iPhone & iPad App",
"operatingSystem": "iOS"
}
},
{
"#type": "EntryPoint",
"urlTemplate": "urbanspoon://r/6/92204",
"application": {
"#type": "SoftwareApplication",
"#id": "5b23b738-bb64-4829-9296-5bcb59bb0d2d",
"name": "Windows Phone App",
"operatingSystem": "Windows Phone 8"
}
}
]
}
}
</script>
Eventually, once deep linking is baked into all of Google's products, these mappings could be crawled from your webpage and the correct links automatically applied regardless of whether you're view a Highlight in Gmail on Chrome or one of the native mobile apps.
I'm testing actions with the Apps Script tutorial (with emails sent to myself), but currently only Go-To actions show up. This is the code I use to generate a Confirm Action, am I doing something wrong?
<script type="application/ld+json">{
"#context": "http://schema.org",
"#type": "EmailMessage",
"description": "Retry fax sending",
"action": {
"#type": "ConfirmAction",
"name": "Retry",
"handler": {
"#type": "HttpActionHandler",
"url": "http://example.com/do/ba98262b-6eb9-4314-a01a-8ff3076821e3"
"method": "POST"
}
}
}
BTW, is there any place in which we can check the status of roll-out of Gmail Actions? For instance, my Google Apps account does not show any action, while my "standard" Gmail account does.
You are simply missing a comma after the handler.url property, this is the correct markup:
<script type="application/ld+json">
{
"#context": "http://schema.org",
"#type": "EmailMessage",
"description": "Retry fax sending",
"action": {
"#type": "ConfirmAction",
"name": "Retry",
"handler": {
"#type": "HttpActionHandler",
"url": "http://example.com/do/ba98262b-6eb9-4314-a01a-8ff3076821e3",
"method": "POST"
}
}
}
</script>
You can use the Schema Validator tool to check your markup for syntax errors like this: https://developers.google.com/gmail/schemas/testing-your-schema
Go-To and One-Click actions are launched, while Review and RSVP are not yet. Please track the Release Notes page to get all updates.
For what concerns Google Apps accounts, please note that domain admins decide which track they want to be part of and that controls when they get the new features.
I have my project name, but not the numeric Project Id. The latter is needed to use HTML Direct Links.I'm using JIRA 5.0.1
How do I get the numeric Project Id for a given project name?
I've searched the Project Administration area, several other places, the documentation, Google, etc but still can't find a way to get that value.
Thanks.
This solution does not require admin rights:
Navigate to https://jira.YOURDOMAIN.TLD/rest/api/2/project/YOURPROJECTNAME and read the id in the JSON response:
{
"self":"https://jira.YOURDOMAIN.TLD/rest/api/2/project/YOURPROJECTNAME",
"id":"12345", ☜ Project Id
"key":"YOURPROJECTNAME",
"description":..
:
}
Navigate to https://jira.YOURDOMAIN.TLD/rest/api/2/project to get a JSON list of projects.
Bonus: here's a one-liner in Groovy to get the ID:
groovy -e "println new groovy.json.JsonSlurper().parseText("https://jira.YOURDOMAIN.TLD/rest/api/2/project/YOURPROJECTNAME".toURL().text)?.id ?: 'not found'"
A java.io.FileNotFoundException probably means that your JIRA server requires authentication.
Here's a one-liner to list all the visible projects and their ID:
groovy -e "new groovy.json.JsonSlurper().parseText('https://jira.YOURDOMAIN.TLD/rest/api/2/project'.toURL().text)?.each{println it.key+' = '+it.id}"
The easiest way is to do it from the web browser:
Go to the Administration page.
Select the Project from the menu.
Hover over 'Edit Project' link and check the link href (in the status bar).
It should be something like http://servername:8080/secure/project/EditProject!default.jspa?pid=10040
Where pid is the id you are looking for.
For Jira 6.x:
place the cursor on EDIT Project button and
look at the url being redirected at bottom left of the screen
This solution doesn't require admin rights and shows you all of the projects the current user can view.
https://example.com/rest/api/2/project
Responses found here.
https://docs.atlassian.com/jira/REST/latest/#d2e4972
returns a json array.
[
{
"self": "http://www.example.com/jira/rest/api/2/project/EX",
"id": "10000",
"key": "EX",
"name": "Example",
"avatarUrls": {
"24x24": "http://www.example.com/jira/secure/projectavatar?size=small&pid=10000",
"16x16": "http://www.example.com/jira/secure/projectavatar?size=xsmall&pid=10000",
"32x32": "http://www.example.com/jira/secure/projectavatar?size=medium&pid=10000",
"48x48": "http://www.example.com/jira/secure/projectavatar?size=large&pid=10000"
},
"projectCategory": {
"self": "http://www.example.com/jira/rest/api/2/projectCategory/10000",
"id": "10000",
"name": "FIRST",
"description": "First Project Category"
}
},
{
"self": "http://www.example.com/jira/rest/api/2/project/ABC",
"id": "10001",
"key": "ABC",
"name": "Alphabetical",
"avatarUrls": {
"24x24": "http://www.example.com/jira/secure/projectavatar?size=small&pid=10001",
"16x16": "http://www.example.com/jira/secure/projectavatar?size=xsmall&pid=10001",
"32x32": "http://www.example.com/jira/secure/projectavatar?size=medium&pid=10001",
"48x48": "http://www.example.com/jira/secure/projectavatar?size=large&pid=10001"
},
"projectCategory": {
"self": "http://www.example.com/jira/rest/api/2/projectCategory/10000",
"id": "10000",
"name": "FIRST",
"description": "First Project Category"
}
}
]
Exporting a ticket in XML reveals the project ID for me. I am not admin, so can't access the admin page. The rest/json trick didn't work for me, either. The XML of an issue has the following,
<project id="1234" key="test">TEST Project</project>