简体   繁体   中英

Schema.org ontology as json

Background

I'm trying to develop aa programmatic way to either allow or disallow you from pairing some webpage data to a given schema property.

In order to do that, I'd need to be able to say the following:

Data "xyz" is the value of Thing.Article.name

However, in schema.org, some namespaces would actually belong to multple types, so the json object representing schema.org would need to have an extra field in each object that would tell us what it belongs to.

The question:

is there already a json version of schema.org out there somewhere?

If not,

then how should the json be structured?

No, no official JSON version of schema.org now. But some attempts have been undertaken. Eg by Google for GMail Actions stuff. They use JSON-LD:

<script type="application/ld+json">
{
  "@context": "http://schema.org",
  "@type": "Event",
  "name": "John's Birthday Party",
  ... information about the event ...
  "action": {
    "@type": "RsvpAction",
    "url": "http://events-organizer.com/rsvp?eventId=123",
  }
}
</script>

Details are available here . Hope this helps.

Kristian is right, JSON-LD is just a data representation of schema.org.

The JSON Schema-representation would be " JSON Schema " .

This project generates JSON Schemas from the schema.org Ontology : https://github.com/geraintluff/schema-org-gen

Unfortunately schema.org has a special data model which schema.rdfs.org maps. Please note that (due to an error with schema.rdfs.org I reported already) it is missing some metadata.
I made a gist including the missing comments which you could use as a source for the project mentioned above, see https://github.com/mhausenblas/schema-org-rdf/issues/58

@Kristian - FYI:
I am currently working on how to transform OWL Ontologies to JSON Schema, see https://github.com/redaktor/owl2jsonschema.js

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM