Reputation: 21830
Background
I'm trying to develop a a 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?
Upvotes: 1
Views: 2009
Reputation: 4618
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
Upvotes: 2
Reputation: 1906
No, no official JSON version of schema.org now. But some attempts have been undertaken. E.g. 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.
Upvotes: 1