The Schema.org structured data vocabulary defined as a series of swift protocols.
Schema.org is a collaborative, community activity with a mission to create, maintain, and promote schemas for structured data on the Internet, on web pages, in email messages, and beyond. This library implements some of the core vocabulary as a series of Swift protocols.
This work is based on the 3.4 version of the Schema.org vocabulary.
How to Use
pod 'SOSwiftVocabulary', '~> 1.6'
Swift Package Manager
.package(url: "https://github.com/richardpiazza/SOSwiftVocabulary", .upToNextMinor(from: "1.6.0"))
Although this body of work trys to adhere as closly as possibile to the defined vocabulary, some changes are required to make the API feel swifty.
Schema.org uses 'Float' as it's floating-point decimal type. 'Double' is the standard floating-point type in Swift, so double replaces all instances of float.
Many of the classes use a has/is prefix on non-boolan variable names. This vocabulary removes these prefixes.
Classes with singular names of clearly arrays of types has been plurarlized for clarity and consistency.