SOSwiftVocabulary
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
CocoaPods
pod 'SOSwiftVocabulary', '~> 1.6'
Swift Package Manager
.package(url: "https://github.com/richardpiazza/SOSwiftVocabulary", .upToNextMinor(from: "1.6.0"))
Significant Differences
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.
Float
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.
Has/Is
Many of the classes use a has/is prefix on non-boolan variable names. This vocabulary removes these prefixes.
Pluralization
Classes with singular names of clearly arrays of types has been plurarlized for clarity and consistency.