To begin attempting to apply a context to our data I chose to take a sample of our stadium data. The current state of a stadium JSON object is as follows:
{ "Capacity": "30000", "Tenant": "Troy Trojans", "Type": "Football", "Stadium": "Veterans Memorial Stadium", "Location": { ... (google geocoder results) }, "Year opened": "1950" } In order to apply a context to this instance, I can do the following: { "@context" : { "Stadium": "http://schema.org/name", "capacity": "http://schema.org/additionalProperty", "Type": "http://schema.org/brand", "Tenant": "http://schema.org/additionalProperty", "Location": "http://schema.org/address", "Year opened": "http://schema.org/foundingDate", }, "Capacity": "30000", "Tenant": "Troy Trojans", "Type": "Football", "Stadium": "Veterans Memorial Stadium", "Location": { ... (google geocoder results) }, "Year opened": "1950" } To test if the context I provided was valid, I can use JSON-LD's playground site. There are still more properties to be added to make it more useful, but I feel this approach is unrealistic due to how time consuming it will be. This method will need to be applied to every instance, causing a lot of overhead. Also, If I decide to add or change the context, I will need to do so for every instance. This issue is similar to css styling. styles can be embedded into html, added to the header of the document, or it can be linked from an external css file. The latter approach is generally a best practice, because maintenance becomes simpler and quicker. A JSON-LD also has a similar approach to deal with this issue. A .jsonld context file can be created, then an instance can link to the file to apply the context. This approach reduces overhead, and allows for simpler maintenance. I was able to refine the context and create a jsonld context file: { "@context": { "name": "http://schema.org/name", "geo": "http://schema.org/geo", "address": "https://schema.org/address", "latitude": { "@id": "http://schema.org/latitude", "@type": "xsd:float" }, "longitude": { "@id": "http://schema.org/longitude", "@type": "xsd:float" }, "brand": "https://schema.org/brand", "foundingDate": { "@id": "https://schema.org/foundingDate", "@type": "xsd:int" }, "teams": "https://schema.org/additionalProperty", "capacity": { "@id": "https://schema.org/additionalProperty", "@type": "xsd:int" }, "xsd": "http://www.w3.org/2001/XMLSchema#" } } The issue was is figuring out where to host the file, so I can link to it. I decided to store it in our github repo. The most recent stadium context file can be found here. Now that the context file is hosted, I can re-write our instances as followed: { "name": "Veterans Memorial Stadium", "teams": "Troy Trojans", "foundingDate": "1950", "@context": "https://raw.githubusercontent.com/slopez15/ASU-CREU2016/master/JSON-Data/stadiums_context.jsonld", "brand": "Football", "address": "Veterans Memorial Stadium, Veterans Dr, Coffeyville, KS 67337, USA", "@type": "https://schema.org/StadiumOrArena", "geo": { "latitude": 37.0706651, "@type": "GeoCoordinates", "longitude": -95.6415231 }, "capacity": "30000" }
25 Comments
9/5/2022 07:13:58 am
Really informative article, I had the opportunity to learn a lot, thank you. https://freecodezilla.net/wp-all-export-pro/
Reply
9/11/2022 04:23:45 pm
Really informative article, I had the opportunity to learn a lot, thank you. https://kurma.website/
Reply
9/12/2022 04:40:51 am
Really informative article, I had the opportunity to learn a lot, thank you. https://odemebozdurma.com/
Reply
9/14/2022 07:08:59 pm
Really informative article, I had the opportunity to learn a lot, thank you. https://bit.ly/site-kurma
Reply
9/30/2022 07:29:47 am
It's great to have this type of content. Good luck with your spirit. Thank you. https://bit.ly/site-kurma
Reply
10/4/2022 10:51:23 pm
I think this post is useful for people. It has been very useful for me. Looking forward to the next one, thank you. https://escortnova.com/escort-ilanlari/kars-escort/
Reply
10/5/2022 02:04:46 am
It was a post that I found very successful. Good luck to you. https://escortnova.com/escort-ilanlari/ordu-escort/altinordu-escort/
Reply
10/5/2022 10:14:05 pm
I follow your posts closely. I can find it thanks to your reliable share. Thank you. https://escortnova.com/escort-ilanlari/istanbul-escort/sancaktepe-escort/
Reply
10/8/2022 03:51:10 am
Thoughtful and real content is shared. Thank you for these shares. https://escortnova.com/escort-ilanlari/istanbul-escort/kagithane-escort/
Reply
11/24/2022 03:26:43 am
Hemen Göz At evde para kazanmaya basla: https://sites.google.com/view/evden-ek-is/
Reply
12/11/2022 07:18:55 pm
Uygun fiyatlardan takipçi satın al: https://takipcialdim.com/
Reply
1/8/2023 03:24:38 pm
100 tl deneme bonusu veren siteleri öğrenmek istiyorsan tıkla.
Reply
6/30/2023 04:07:50 pm
En iyi hakkari ilan sitesi burada. https://hakkari.escorthun.com/
Reply
Leave a Reply. |
CategoriesArchives
May 2016
|