hat is the proper structure for Parcel Delivery schema if your delivery contains multiple tracking numbers? - schema.org

It is possible for our orders to contain multiple SKU's as well as multiple tracking numbers per SKU on an order.
I have been referencing https://developers.google.com/gmail/markup/reference/parcel-delivery. We are also using the JSON-LD format.
{
"#context":"http://schema.org",
"#type":"ParcelDelivery",
"deliveryAddress":{
"#type":"PostalAddress",
"name":"John Frank",
"streetAddress":"24 Willie Mays Plaza",
"addressLocality":"San Francisco",
"addressRegion":"CA",
"addressCountry":"US",
"postalCode":"94107"
},
"originAddress":{
"#type":"PostalAddress",
"name":"John Frank",
"streetAddress":"25 Willie Mays Plaza",
"addressLocality":"San Francisco",
"addressRegion":"CA",
"addressCountry":"US",
"postalCode":"94107"
},
"expectedArrivalFrom":"2013-03-10T12:00:00-08:00",
"expectedArrivalUntil":"2013-03-12T12:00:00-08:00",
"carrier":{
"#type":"Organization",
"name":"FedEx",
"url":"http://fedex.com/"
},
"itemShipped":{
"#type":"Product",
"name":"iPod Mini",
"url":"http://apple.com/ipad32gb",
"image":"http://apple.com/images/ipad32gb.jpg",
"sku":"B00DR0PDNE",
"description":"iPod Mini 32Gb White",
"brand":{
"#type":"Brand",
"name":"Apple"
},
"color":"white"
},
"trackingNumber":"3453291231",
"trackingUrl":"http://fedex.com/track/3453291231",
"potentialAction":{
"#type":"TrackAction",
"target":"http://fedex.com/track/3453291231"
},
"hasDeliveryMethod":"http://schema.org/ParcelService",
"partOfOrder":{
"#type":"Order",
"orderNumber":"176057",
"merchant":{
"#type":"Organization",
"name":"Bob Dole",
"sameAs":"http://www.freebase.com/m/0fhkx"
},
"orderStatus":"http://schema.org/OrderInTransit"
}
}
I checked previous questions on SO and can not seem to find an answer on google or in their official documentation or schema.org. Any advice would be greatly appreciated. Cheers.

Please correct me if I am wrong but after some research I am quite certain you just need to replicate the same json snippet for each parcel in the order. This is how it would work if you were not using JSON-LD so it makes sense it would work the same way. Cheers.

Related

Multiple response in action on google dialogflow

How can i get multiple response on action on google console using dialogflow ?
i simulated on Action on google console but only two responses are showing on it
where as third response are not showing
here is my json response
{
"source": "webhook",
"data": {
"google": {
"is_ssml": true,
"permissions_request": null,
"expect_user_response": true
}
},
"messages": [
{
"type": 0,
"speech": "peter Got around 28 marks in maths. which is ranked 1 among 3 candidate in class 1"
},
{
"textToSpeech": "peter Got around 28 marks in maths. which is ranked 1 among 3 candidate in class 1",
"platform": "google",
"displayText": "peter Got around 28 marks in maths. which is ranked 1 among 3 candidate in class 1",
"type": "simple_response"
},
{
"textToSpeech": "Working",
"platform": "google",
"displayText": "Working",
"type": "simple_response"
},
{
"textToSpeech": "Working 2",
"platform": "google",
"displayText": "Working 2",
"type": "simple_response"
}
]
}
Here is my console output
any help regarding this is much appreciated
Thank you
Regards Saif
Only two simple responses will be accepted as a response. If you want more content you will need to consolidate your text into one of the two responses.
As you can see on the AoG Responses docs, it is specified as a requirement :
At most 2 chat bubbles per turn
So your third bubble won't display, as intended by Google.
As suggested in the previous answer from Nick, you need to consolidate your text and wrap everything in your 2 bubbles. In a simple response, you can line break by adding a \n where needed.
In a Basic Card however, you can access a limited subset of markdown, as stated in the docs link I provided, like that :
New line with a double space
**bold**
*italics*
Rich responses have the following requirements and optional properties that you can configure:
Supported on surfaces with the actions.capability.SCREEN_OUTPUT
capability.
The first item in a rich response must be a simple response.
At most two simple responses.
At most one basic card or StructuredResponse.
At most 8 suggestion chips. (you can add more than 8 also but you will get a warning not an error.)
Suggestion chips are not allowed in a FinalResponse
Linking out to the web from smart displays is currently not
supported.

How do I use the Loopback where filter correctly on REST-API

Hi there I seem to miss some information about Loopback where clause or syntax. My problem is, that I receive an empty array if I try to get a list of matching model instances, does no difference if in loopback api explorer or trhough http api request.
My "subject" model:
[
{
"user": "string",
"semester": "string",
"subject_name": "string",
"subject_relevance": 1,
"subject_details": 0,
"id": "string"
}
]
One Instance of Subjects:
{
"user": "59eef907cc199c1cf8f99296",
"semester": "59eef6f8ebf12e1a37ee898b",
"subject_name": "Mathematik",
"subject_relevance": "1",
"subject_details": "",
"id": "59eef96aebf12e1a37ee898f"
}
My Loopback API Explorer filter:
{"where" : {"semester" : "59eef6f8ebf12e1a37ee898b"}}
My http request:
http://localhost:3000/api/subjects?filter[where][semester]=59eef6f8ebf12e1a37ee898b
The result I receive:
[]
If I try to search for this:
{"where" : {"subject_name" : "Mathematik"}}
or in browser:
http://localhost:3000/api/subjects?filter[where][subject_name]=Mathematik
I reveive the instance correctly or as expected. So I went thrugh the documentation and I strugle to find some hints or solutions to my problem. Can someone help me out or suggest me something to get the right instance back? Do I miss something? Has it to do that these are ID-fields or what is it?
Thanks for any help in advance!!
There are 2 ways to get your records based on where clause
one is by using 'findOne' method
get request
http://localhost:3000/api/subjects/findOne?filter[where][semester]=59eef6f8ebf12e1a37ee898b
Other one is using normal get request
http://localhost:3000/api/subjects?filter={"where":{"semester":"59eef6f8ebf12e1a37ee898b"}}
I am using loopback 4 and I had faced the same issue.
Here is the issue in loopback git
Solution is the add this setting in your #model decorator
#model({settings: {"strict":false, "strictObjectIDCoercion": true}})

Can I access ReimburseCharge objects in the IPP QBO v3 API?

I queried an Invoice that contains a billable expense charge. The response includes (and I'm showing just the relevant portions of it):
....
"Line": [
{
"LineNum": 1,
"DescriptionLineDetail": {
"ServiceDate": "2015-11-15"
},
"Id": "3",
"DetailType": "DescriptionOnly",
"Description": "Test Billable Transaction 1"
},
{
"LineNum": 2,
"DescriptionLineDetail": {
"ServiceDate": "2015-11-15"
},
"Id": "4",
"DetailType": "DescriptionOnly",
"Description": "Test Billable Expense Transaction 3"
},
{
"DetailType": "SubTotalLineDetail",
"Amount": 8.01,
"SubTotalLineDetail": {}
}
],
"LinkedTxn": [
{
"TxnId": "1938",
"TxnType": "ReimburseCharge"
},
{
"TxnId": "1932",
"TxnType": "ReimburseCharge"
}
],
...
I tried querying the API for ReimburseCharge and got only errors back. Is this business object on the roadmap?
On a related note, I observe that a billable line (at least in Purchase objects) can have its BillableStatus attribute set to "HasBeenBilled" with an Update call. It cannot be set back to "Billable" without first setting it to "NotBillable", but this does seem to work more than once so that it's not a one-way effect. If the line has actually been billed though, I get a validation fault when I try to change the BillableStatus from "HasBeenBilled" to "NotBillable", which I suppose makes sense.
Here's what's decidedly problematic though: I cannot use the API to either link a billable expense to an invoice or figure out where an already-linked expense is invoiced. Also, I cannot see the amount of the individual lines contained in these "DescriptionOnly" lines, so all I get is the total. Does Intuit have plans to change this and, if so, when?
This decision for supporting Reimb Charge is still pending.
Regarding DescriptionOnly- This was meant to support only total and sub totals.
So, if you have to use lines then you should use SalesItemLineDetail

Difficulty using `populate` with `groupBy` and `sum` with Waterline query in Sails.js

I have run into a strange problem with the groupBy and sum methods when used with populate. I have a set of associated models: User, Source (books, etc), Recommendation, and Discipline (i.e. academic discipline).
I attempted the following waterline query:
Recommendation.find({
where: {discipline: '5559ea07dfa9bd0499f9f799'},
groupBy: ['source'], sum: ['rating']
}).exec(console.log);
This worked well, returning:
[
{
"source": "5571e72ab50f0c3c49fe19f6",
"rating": 4
},
{
"source": "5571b88c51861950360fac1c",
"rating": 12
}
]
I then tried it with populate on the source because I wanted to have the full source data linked to the each recommendation. So I tried:
Recommendation.find({
where: {discipline: '5559ea07dfa9bd0499f9f799'},
groupBy: ['source'], sum: ['rating']
}).populate('source').exec(console.log);
This yielded something strange:
[
{
"source": {
"type": "book",
"identifiers": [
{
"type": "ISBN_10",
"identifier": "1400823226"
},
{
"type": "ISBN_13",
"identifier": "9781400823222"
}
],
"title": "Patterns for America",
"subtitle": "Modernism and the Concept of Culture",
"publisher": "Princeton University Press",
"year": 1999,
"language": "en",
"categories": [
"Literary Criticism"
],
"abstract": "In recent decades, historians and social theorists have given much thought to the concept of \"culture,\" its origins in Western thought, and its usefulness for social analysis. In this book, Susan Hegeman focuses on the term's history in the United States in the first half of the twentieth century. She shows how, during this period, the term \"culture\" changed from being a technical term associated primarily with anthropology into a term of popular usage. She shows the connections between this movement of \"culture\" into the mainstream and the emergence of a distinctive \"American culture,\" with its own patterns, values, and beliefs. Hegeman points to the significant similarities between the conceptions of culture produced by anthropologists Franz Boas, Edward Sapir, Ruth Benedict, and Margaret Mead, and a diversity of other intellectuals, including Randolph Bourne, Van Wyck Brooks, Waldo Frank, and Dwight Macdonald. Hegeman reveals how relativist anthropological ideas of human culture--which stressed the distance between modern centers and \"primitive\" peripheries--came into alliance with the evaluating judgments of artists and critics. This anthropological conception provided a spatial awareness that helped develop the notion of a specifically American \"culture.\" She also shows the connections between this new view of \"culture\" and the artistic work of the period by, among others, Sherwood Anderson, Jean Toomer, Thomas Hart Benton, Nathanael West, and James Agee and depicts in a new way the richness and complexity of the modernist milieu in the United States.",
"imageLinks": {
"smallThumbnail": "http://bks3.books.google.de/books/content?id=OwYWU2H3me4C&printsec=frontcover&img=1&zoom=5&edge=curl&source=gbs_api",
"thumbnail": "http://bks3.books.google.de/books/content?id=OwYWU2H3me4C&printsec=frontcover&img=1&zoom=1&edge=curl&source=gbs_api"
},
"createdAt": "2015-06-05T14:56:12.714Z",
"updatedAt": "2015-06-05T14:56:12.724Z",
"id": "5571b88c51861950360fac1c"
},
"rating": 4
},
{
"source": {
"_bsontype": "ObjectID",
"id": "Uq¸Q\u0019P6\u000f¬\u001c"
},
"rating": 12
}
]
As you can see rather than replacing the source id with the full source properties, it added the source as an object in the returned array, and then added another object with a new source id reference, and the summed rating amount. Strangely, it also attached just one of the rating values to the source object it appended to the results.
Is this what should be happening. I can't follow the logic and it feels a bit buggy. In any case, what I would like is to have the source within each returned row, alongside the summed total. Can anyone explain what's going on here, and if I made an error perhaps?

How to Separate the Profile Details

I try to read education details from face book using JSON in IPhone.
I read all education details from Face book successfully.
But i get the whole details. I want to separate the school, college {PG and UG}. But the node having same name like school. and also the data wil be read first one school, and then read one college, then again read one school and read one college like that. somebody fill one school more than one college. somebody wil fill more than one school and one college, somebody wont fill school or college. some id having same number of schools and college. some id having different number of schools and college. So how to I identify the schools and college details separately. Please if anybody having any idea please share with me.
MY Doubt is how to identify the schools, and college and then print schools and college separately...
My sample output as follows..
"education":
[
{
"school":
{
"id":110402725649312,
"name":"10th class"
},
"year":
{
"id":102356633142124,
"name":"2001"
}
},
{
"school":
{
"id":111983532181734,
"name":"Bsc Maths"
},
"year":
{
"id":146950445337693,
"name":"2006"
},
},
{
"school":
{
"id":115980035092981,
"name":"+2"
},
"year":
{
"id":114786038555902,
"name":"2003"
}
},
{
"school":
{
"id":130814456944277,
"name":"mca"
},
"year":
{
"id":115598488468394,
"name":"2010"
},
}
}]
Thanks to all...
I don't know how to retrieve a school ID from Facebook based on the id field you're getting there, but I'm sure there's a way to traverse their Social Graph structure to find it.
The advice I have for you is: Use the json-framework to convert that into a native NSArray containing NSDictionaries. Then walking that data becomes a ton easier.