- From: Tor Skjøtskift <tor.skjotskift@amedia.no>
- Date: Fri, 5 Dec 2014 09:36:17 +0000
- To: "public-linked-json@w3.org" <public-linked-json@w3.org>
I have an exisiting api returning json and would like the elements to schema.org<http://schema.org> vocabularies.
The json response would be a NewsArticle, but with some different vocabularies embedded.
I cannot rename the keys in the json response but need to point them to their schema.org<http://schema.org> terms
JSON from the api:
main type is http://schema.org/NewsArticle
{
"_id: 1416981240975,
«instagramHashtag" : "#tag", // http://schema.org/keywords
"factBox" : "..<html>…", // http://schema.org/articleBody and type http://schema.org/Article
"isPremium" : true, // http://schema.org/requiresSubscription and type http://schema.org/MediaObject
"vignette" : "…. ", // http://schema.org/articleSection
"overline" : "…", // http://schema.org/alternativeHeadline
"byline" : "…", // http://schema.org/author (in the examples on schema.org<http://schema.org> this is a string, but in the schema is says it should be one of Person or Organization. How do I do this property?)
"body" : " … <html> … ", // http://schema.org/articleBody
"leadtext" : "… <html> … ", http://schema.org/description (schema.org<http://schema.org> doesn’t have a good term for lead text
"title" : " … ", http://schema.org/name
}
My take on this would be:
{
"@context" : {
"schema" : "http://schema.org",
"_id" : "@id",
"instagramHashtag" : "schema:keywords",
"factBox" : {
"@id" : "http://schema.org/Article#articleBody",
"@type" : "rdf:HTML"
},
"isPremium" : "http://schema.org/MediaObject#requiresSubscription",
"vignette" : "schema:articleSection",
"overline" : "schema:alternativeHeadline",
"byline" : "schema:author",
"body" : {
"@id" : "http://schema.org/Article#articleBody",
"@type" : "rdf:HTML"
},
"leadText" : {
"@id" : "schema:description",
"@type" : "rdf:HTML"
},
"title" : "schema:name"
}
"@type" : "NewsArticle",
"_id" : 1416981240975,
"instagramHashtag" : "",
"factBox" : " ",
"isPremium" : true,
"vignette" : "",
"overline" : "",
"byline" : "",
"body" : "",
"leadtext" : "",
"title" : "",
}
Is this the correct way to do this?
Is there a better way of specifying additional vocabularies. This way of doing it requires that we split the strings on '#' to create itemtype and itemprops in html.
Received on Friday, 5 December 2014 09:36:39 UTC