- From: Niklas Lindström <lindstream@gmail.com>
- Date: Fri, 14 Aug 2015 11:14:09 +0200
- To: Thad Guidry <thadguidry@gmail.com>
- Cc: Alex M <tech.guy415@gmail.com>, Dan Brickley <danbri@google.com>, "schema.org Mailing List" <public-schemaorg@w3.org>, W3C Web Schemas Task Force <public-vocabs@w3.org>
- Message-ID: <CADjV5jf7Ly-=XnJWZz3dYY8NMjBNXovBNkfzioLXb2be0xLOBg@mail.gmail.com>
How about native JSON-LD lists (i.e. RDF collections) over ItemList
whenever possible? That'd turn the above example into:
{
"@context": "http://schema.org",
"@type": "TravelAction",
"fromLocation": "USA",
"toLocation": "Costa Rica",
"name": "Travel from USA to Costa Rica",
"instrument": {
"@list": [
{"name": "A Valid Passport"},
{"name": "Pre-paid airline or bus ticket to exit Costa Rica"},
{"name": "$100.00US dollars per every 30 calendar days you plan
to stay in Costa Rica"}
]
},
"distance": "2000 miles"
}
(For properties where the value is always expected to be a @list (and not a
@set), the term can be defined in the @context, like: "instrument":
{"@container": "@list"}, to omit the wrapping {"@list": [...]} construct.)
(Also, in RDFa 1.1, the @inlist attribute is available for the same
purpose.)
Cheers,
Niklas
On Fri, Aug 14, 2015 at 12:12 AM, Thad Guidry <thadguidry@gmail.com> wrote:
> Yikes!
>
> DanBri - Can we make this easier in the future somehow for folks ?
>
> Thad
> +ThadGuidry <https://www.google.com/+ThadGuidry>
>
> On Thu, Aug 13, 2015 at 3:10 PM, Alex M <tech.guy415@gmail.com> wrote:
>
>> I wish plural would be easier ... well, it may not be what you expect,
>> but this validates:
>>
>> <script type="application/ld+json">
>> {
>> "@context":"http://schema.org",
>> "@type":"TravelAction",
>> "fromLocation": "USA",
>> "toLocation": "Costa Rica",
>> "name": "Travel from USA to Costa Rica",
>> "instrument": {
>> "@type": "ItemList",
>> "numberOfItems": 3,
>> "itemListElement": [
>> {
>> "@type": "ListItem",
>> "position": 1,
>> "item": {
>> "name": "A Valid Passport"
>> }
>> },
>> {
>> "@type": "ListItem",
>> "position": 2,
>> "item": {
>> "name": "Pre-paid airline or bus ticket to exit Costa Rica"
>> }
>> },
>> {
>> "@type": "ListItem",
>> "position": 3,
>> "item": {
>> "name": "$100.00US dollars per every 30 calendar days you plan
>> to stay in Costa Rica"
>> }
>> }
>> ]},
>> "distance":"2000 miles"
>> }
>> }
>> </script>
>>
>> On Thu, Aug 13, 2015 at 12:26 PM, Thad Guidry <thadguidry@gmail.com>
>> wrote:
>>
>>> oh boy... ok...your thinking much later...
>>> Let's start simple and work outwards and upwards from there....
>>>
>>> <script type="application/ld+json">
>>> {
>>> "@context":"http://schema.org",
>>> "@type":"TravelAction",
>>> "fromLocation": "USA",
>>> "toLocation": "Costa Rica",
>>> "name": "Travel from USA to Costa Rica",
>>> "instrument": {"name": "A Valid Passport"},
>>> "distance":"2000 miles"
>>> }
>>> </script>
>>>
>>>
>>> Thad
>>> +ThadGuidry <https://www.google.com/+ThadGuidry>
>>>
>>> On Thu, Aug 13, 2015 at 9:44 AM, Alex M <tech.guy415@gmail.com> wrote:
>>>
>>>> Here is my first attempt to do it on a JSON TD style, but very simple
>>>> and basic. I am getting three errors and perhaps it is that I do not quite
>>>> understand how to extend one schema to the other. Any help is welcome. I
>>>> get three errors.
>>>>
>>>> <script type="application/ld+json">
>>>> {
>>>> "@context":"http://schema.org",
>>>> "@type":"TravelAction",
>>>> "fromLocation": "USA",
>>>> "toLocation": "Costa Rica",
>>>>
>>>> #ERROR //Thing is not a known valid target type for the name property.
>>>> You can see here that THING has NAME http://schema.org/Thing
>>>>
>>>> "name": {
>>>> "@type":"Thing",
>>>> #ERROR//The property about is not recognized by Google for an object of
>>>> type Thing.
>>>> YOu can see here that THING has ABOUT http://schema.org/Thing
>>>> "about":"Costa Rica Required Entry and Transit Documents"
>>>> },
>>>> #ERROR //The property itemListElement is not recognized by Google
>>>> for an object of type TravelAction.
>>>> This should be from THING so it is probably my syntax.
>>>>
>>>> "itemListElement":
>>>> [
>>>> {
>>>> "@type": "ListItem",
>>>> "position": 1,
>>>> "item":
>>>> {
>>>> "name": "A Valid Passport"
>>>> },
>>>> "@type": "ListItem",
>>>> "position": 2,
>>>> "item":
>>>> {
>>>> "name": "Pre-paid airline or bus ticket to exit Costa Rica"
>>>> },
>>>> "@type": "ListItem",
>>>> "position": 3,
>>>> "item":
>>>> {
>>>> "name": "$100.00US dollars per every 30 calendar days you plan to
>>>> stay in Costa Rica"
>>>> }
>>>> }
>>>> ]
>>>> }
>>>>
>>>> </script>
>>>>
>>>> On Wed, Aug 12, 2015 at 3:59 PM, Thad Guidry <thadguidry@gmail.com>
>>>> wrote:
>>>>
>>>>> Ooops typo ! this is better :
>>>>> http://www.w3.org/TR/json-ld/#embedding-json-ld-in-html-documents
>>>>>
>>>>> Thad
>>>>> +ThadGuidry <https://www.google.com/+ThadGuidry>
>>>>>
>>>>> On Wed, Aug 12, 2015 at 4:58 PM, Thad Guidry <thadguidry@gmail.com>
>>>>> wrote:
>>>>>
>>>>>> The answer is easy ! Just spend 3 hours reading the full official
>>>>>> documentation thus far !
>>>>>>
>>>>>> Or skip directly to the answers your looking for provided by me:
>>>>>>
>>>>>> http://www.w3.org/TR/json-ld/#interpreting-json-as-json-ld
>>>>>>
>>>>>> http://www.w3.org/TR/json-ld/#embedding-json-ld-in-htmls-documents
>>>>>>
>>>>>> As well as visiting the awesomeness that is:
>>>>>> http://json-ld.org/learn.html
>>>>>>
>>>>>>
>>>>>> Thad
>>>>>> +ThadGuidry <https://www.google.com/+ThadGuidry>
>>>>>>
>>>>>> On Wed, Aug 12, 2015 at 4:25 PM, Alex M <tech.guy415@gmail.com>
>>>>>> wrote:
>>>>>>
>>>>>>> Is the script placed inside the <head> tag or before the </body>?
>>>>>>>
>>>>>>> On Wed, Aug 12, 2015 at 3:21 PM, Thad Guidry <thadguidry@gmail.com>
>>>>>>> wrote:
>>>>>>>
>>>>>>>> JSON_LD is a preference (whenever you can accomplish that.) :)
>>>>>>>>
>>>>>>>> Thad
>>>>>>>> +ThadGuidry <https://www.google.com/+ThadGuidry>
>>>>>>>>
>>>>>>>> On Wed, Aug 12, 2015 at 4:20 PM, Alex M <tech.guy415@gmail.com>
>>>>>>>> wrote:
>>>>>>>>
>>>>>>>>> Is it better to do this on the HTML mark up or on JSON-LD? Does
>>>>>>>>> it fulfill the same purpose or for search engines is better the HTML markup?
>>>>>>>>>
>>>>>>>>>
>>>>>>>
>>>>>>
>>>>>
>>>>
>>>
>>
>
Received on Friday, 14 August 2015 09:15:08 UTC