W3C home > Mailing lists > Public > public-linked-json@w3.org > December 2014

Re: Using multiple vocabularies and aliasing properties

From: Nicholas Bollweg <nick.bollweg@gmail.com>
Date: Fri, 5 Dec 2014 08:10:02 -0500
Message-ID: <CACejjWykL-6FrXaUJNX9MbL2hhYGOrueeCKvtvcx=CZirVC9+Q@mail.gmail.com>
To: Tor Skjøtskift <tor.skjotskift@amedia.no>
Cc: "public-linked-json@w3.org" <public-linked-json@w3.org>
it looks like you are on the right track... here's a link to your document,
gently persuaded into some LD on the playground:

http://preview.tinyurl.com/naqfdtz

it can be really helpful to look at the expanded/compacted view of the
document. especially with the expanded view, this is how an
outsider/robot/search engine would see your data.... which i assume is
important to your use case!

the only things i really had to get it to load were:

   - _id to a string, which is part of the spec
   - schema.org is a flat hierechy (i think). the # you were wondering
   about are not the actual URIs of the properties... on schema.org, click
   on those values, and they'll take you to the "canonical" page for that item.

as to your questions:

   -
>
>    this is a string, but in the schema is says it should be one of Person
>    or Organization. How do I do this property?)

   - whenever it says that, for JSON-LD you can read it as "@id or nested
      node"
         - in this case, it could be
         "http://yourapp.com/users/<username>"
         or
         {"email": "tor.skjotskift@amedia.no", name: "Tor Skjøtskift"}
      -
>
>    doesn’t have a good term for lead text

   - yeah. to make it worse, if you look at how body and factbox get
      compacted, they get packed into the same term.

hopefully that helps!

On Fri, Dec 5, 2014 at 4:36 AM, Tor Skjøtskift <tor.skjotskift@amedia.no>
wrote:

> 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 13:10:30 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 16:18:43 UTC